Quantcast
Channel: Adobe Community : Popular Discussions - Photoshop Plugin and Companion App SDK
Viewing all articles
Browse latest Browse all 54282

Need precise description of tile data received after advanceState()

$
0
0

I am working on my first filter. It isn't running yet, so the code I use to get a tile of data from Photoshop (modified slightly from the Dissolve sample) is just a guess:

 

            SetInRect(inRect);
        SetOutRect(inRect);
        if (filterRecord->haveMask) SetMaskRect(inRect);
        filterRecord->outLoPlane = filterRecord->inLoPlane = 0;
        filterRecord->outHiPlane = filterRecord->inHiPlane = filterRecord->planes - 1;

        int result = filterRecord->advanceState();


where inRect is the tile rectangle.

 

As far as I can tell, the tile data arrives in filterRecord->outData. How is the data arranged for the various image modes? I've highlighted my major questions by using bold below.

 

My best guess is that the data is interleaved:

 

     pixel1 data, pixel2 data, ...

 

Within each set of pixel data, we have:

 

     color channels, then ...?

 

So here is where the confusion begins. My best guess for RGB is:

 

     R, G, B, alpha, inverted alpha, mask, inverted mask

 

Is this correct (given the LoPlane and HiPlane I used)? If not, what is the correct data received and order?

 

I would be happy with:

 

     R, G, B, alpha, mask

 

Is there any way to get just this data? This is not critical.

 

For the other modes, I'm guessing RGB would be substituted by G (for Grayscale), CMYK, HSL, HSB and LAB, with the channels in the order listed. Correct?

 

For 8-bit modes, the values range from 0..255. How is the "H" in HSL and HSB handled since it normally goes from 0..359?

 

In 16-bit modes, values range from 0..32768, at least for RGB. What are the ranges for the other modes?

 

For 32-bit mode, I'm guessing that the values range from 0.0..1.0. Correct?

 

Are the alpha and mask layers always 8-bit, regardless of the color data size?

 

Finally, I'm assuming that the alpha layer controls transparency but the mask layer tells me how strongly to apply my filter effect. A mask value of 0 would leave the pixel unchanged. Is this right?

 

Do I have to handle masking on my own or will Photoshop automatically handle masking?

 

Answers to the bolded questions should allow me to process the tile contents correctly. Feel free to link to a resource that answers the question. I've gone through most of the SDK documentation and examples and have not found that to be a good way to resolve these questions.

 

Thanks for your help!


Viewing all articles
Browse latest Browse all 54282

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>