public LibRawBitmapDataStream(libraw_data_t data)
        {
            this.data = data;
            this.bitmapSize = (this.data.sizes.flip & 4) != 4
                            ? new Size(data.sizes.width, data.sizes.height)
                            : new Size(data.sizes.height, data.sizes.width);

            var unpaddedRowSize = (this.bitmapSize.Width * this.BitsPerPixel / 8);
            this.rowPadding = 4 - (unpaddedRowSize % 4);
            if (this.rowPadding == 4)
                this.rowPadding = 0;

            this.imageDataSize = data.sizes.height * this.RowSize;
        }
示例#2
0
        public static void Histogram(libraw_data_t data)
        {
            var t_white = 0x995; // this was actually a 0x2000, 0x995 is just a temp value suitable for ARW
            int c;

            //var perc = (int)(data.sizes.width * data.sizes.height * 0.01);
            //if (?.fuji_width) perc /= 2;

            //if (!(([email protected] & ~2) || [email protected]_auto_bright))
            //    for (t_white = c = 0; c < P1.colors; c++) {
            //        int val;
            //        int total;
            //        for (val = 0x2000, total = 0; --val > 32; )
            //            if ((total += libraw_internal_data.output_data.histogram[c][val]) > perc) break;
            //        if (t_white < val) t_white = val;
            //    }

            GammaCurve(
                data.color.curve,
                [email protected][0],
                [email protected][1],
                (t_white << 3) / [email protected]
            );
        }