Groups > Application developers > Photoshop SDK > The order of the ' void *inData ' in filter plug-in




The order of the ' void *inData ' in filter plug-in

The order of the ' void *inData ' in filter plug-in
Wed, 26 Mar 2008 19:04:50 -070
We want to get the image data in filter plug-in.
the code is like this:
-------------------------------------------
FILE *fp;
fp=fopen("C:\\h.bmp","w+r");
fseek(fp, 55, SEEK_SET);
fwrite((unsigned char*)gStuff->inData, 1, gStuff->bigDocumentData->
wholeSize32.v * gStuff->bigDocumentData->wholeSize32.h *
gStuff->planes, fp);
fclose(fp);

-------------------------------------------
Why the image data saved is disordered?
Post Reply
The order of the ' void *inData ' in filter plug-in
Thu, 27 Mar 2008 01:19:30 -070
>fp=fopen("C:\\h.bmp","w+r");
>Why the image data saved is disordered?

It's not. But BMP files have different rules and orders for pixel data
than the Photoshop data. Read the specification for both carefully,
you will need to convert each pixel and ALSO may need to do special
processing at the end of each scan line.

Post Reply
Re: The order of the ' void *inData ' in filter plug-in
Thu, 27 Mar 2008 03:27:24 -070
Thank Aandi Inston.
Post Reply
The order of the ' void *inData ' in filter plug-in
Thu, 27 Mar 2008 10:04:04 -070
>Could you tell me how to convert each pixel data to BMP files?

It should be obvious once you have studied both specifications. You
seem to be making assumptions that pixel data is universal, rather
than specific to each file format.


Post Reply
The order of the ' void *inData ' in filter plug-in
Thu, 27 Mar 2008 11:14:24 -070
Note that some sources on the web incorrectly state that the byte
order in a 24-bit BMP file is Red, Green, Blue; in fact it is Blue,
Green, Red.  This file seems accurate:
http://atlc.sourceforge.net/bmp.html

Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact