Hello!
I'm creating a format plugin based on the simpleformat example. When I load the layers using 8bits depth I have no problem, but when I try to load the layers with 16bits depth, the colors are just the double!!
Params with 8 bits:
gFormatRecord->depth = 8;
gFormatRecord->loPlane = 0;
gFormatRecord->hiPlane = 2;
gFormatRecord->colBytes = 3;
gFormatRecord->rowBytes = width * 3 * (depth / 8);
gFormatRecord->planeBytes = 1;
gFormatRecord->imgeMode = pluginModeRGBColor;
gFormatRecord->maxValue (not set)
Params with 16 bits
gFormatRecord->depth = 16;
gFormatRecord->loPlane = 0;
gFormatRecord->hiPlane = 2;
gFormatRecord->colBytes = 6;
gFormatRecord->rowBytes = width * 3 * (depth / 8);
gFormatRecord->planeBytes = 2;
gFormatRecord->imgeMode = pluginModeRGB48;
gFormatRecord->maxValue = 0x8000;
I load the image using its own SDK and I can load the layers indicating the depth desired (8, 16 and 32 bits). I made a simple program that loads the images and saves them to a tiff files, and there are no problems loading with any depth. So the buffers that I get in the plugin to give to Photoshop are correct.
I repeat, if I use the eyedropper, and pick over the same pixel in the layer loaded with my plugin, and in the image created with the format SDK, the color of the layer loaded with my PS plugin is exactly the double!!!
Any idea?
I attach an image comparing both images: the plugin result and the original image.