Can I iterate over each layer in a Photoshop document and get its image data through the C++ SDK of an "Automation"-style plugin? -- No. Automation plugins cannot get at pixels. They need help from other plugin types. The Outbout plugin (Export plugin type) can get at pixels. The *magic* is the plugin tells Photoshop "call me here" via the PiPL properties. For Outbound that is PluginMain in Outbound.cpp. In ExportRecordPtr, a nice big struct with all kinds of stuff, is a ReadImageDocumentDesc. ReadImageDocumentDesc is also a nice big struct, we like struct's (notice that Photoshop was invented in 1990, and has an amazing backwards compatibility story, long live C!) ReadLayerDesc and guess what...another struct, for all the layers in the document. I had an example, AutomationFilter + Hidden that would pass the pixel data back to an automation plugin. I changed that to have the AutomationFilter give commands to the Hidden filter to keep things more isolated. The ChannelPort.8bf plugin that ships with Photoshop is a version of a *hidden* filter that does work for some automation features.
... View more