Groups > Application developers > Photoshop SDK > Re: How to get image data from =?ISO-8859-1?Q?=91hidden=92?=




How to get image data from =?ISO-8859-1?Q?=91hidden=92?=
filter

How to get image data from =?ISO-8859-1?Q?=91hidden=92?= filter
Mon, 24 Mar 2008 23:38:30 -070
For example, we want to preview an image in automation plug-in. The code is like
this:
In Hidden filter project:

HERROR(sPSActionDescriptor->PutData(descriptor,
                              keyDatum,
                              gFilterRecord->planes * nWidth * nHeight,
                              gFilterRecord->inData));

...

In Automation project:

unsigned char *lpBits;

//lpBits = (unsigned char*)malloc(m_nWidth * m_nHeight);

hasKey = false;
 (void)sPSActionDescriptor->HasKey(result.get(), keyDatum, &hasKey);

if (hasKey)
{
    AFERROR(sPSActionDescriptor->GetData(result.get(), keyDatum, lpBits));
}
...

Alert program error!

Post Reply
Re: How to get image data from =?ISO-8859-1?Q?=91hidden=92?=
Sat, 5 Apr 2008 11:50:54 -0700
You need malloc the memory in your automation plug-in, give that pointer to your
filter plug-in, get the data in your filter and COPY it over to the pointer.
Then your code will work. In your current version the memory is no longer there
once your filter is unloaded from memory.

I had this example in earlier versions of the SDK but this way is not ideal.
Ideally you want to do all filtering operations in your filter plug-in because
you are going to have to do a lot of copy paste of pixel data which is going to
be expensive. Try to re-work your plug-in to keep the pixel get/set inside the
plug-in.

Post Reply
Re: How to get image data from =?ISO-8859-1?Q?=91hidden=92?=
Sun, 6 Apr 2008 01:24:13 -0700
Post Reply
about | contact