New Forum | Previous | Next | (P-PDF) Developers
Topic: 4 bit Indexed CalRGB
Conf: (P-PDF) Developers, Msg: 91663
Date: 7/8/2003 11:13 PM
Hi PDF Gurus,
I'm in a process of converting the image into BMP format and able to do the conversions of some Color Spaces(DeviceRGB,GrayScale,CMYK,....) without much hassle.Now I start looking into Indexed color space.I suppose the indexed color space(CalRGB) is a flavour of Windows BMP format(Correct me if not).I'm able to convert the 8 BitsPerComponent Indexed CalRGB image into BMP very easily.
Currently I struck with 4 BitsPerComponent image.What I'm planning in case of 4 bit is to just insert the color look up table value into the bmiColors of bitmap data.
And also the image data stream need to be WordAligned in case of BMP.Row-by-Row I'm creating the word aligned buffer.The output buffer size for BMP is calculating using the Width Byte formula ie (((Bits) + 31) / 32 * 4).
Here is the area I need the help.What should be the input buffer size .I'm taking the input buffer size as
((Width + 1) >> 1) ,since data is something roughly on the order of Width/2..I think this is not correct.I'm not getting the output correctly .
I like to get clarified on this.What about the Byte boundaries issue when the size of width is odd in PDF?.Another is what would be the bits per pixel value in case of 4 bitspercomponents?