In the filter plug-in, void *inData in the struct FilterRecord is the pointer to the requested input image data. How to read and write it? In another word, how to translate it to unsigned char * data?
How to read and write the image data...
Use a cast, or assign to a pointer with your desired type.
For a large number of examples, see my source code at http://telegraphics.com.au/sw/
E.g., usage of inData in simple filters such as https://www.telegraphics.com.au/fisheye/browse/12bits/trunk/main.c?r=12#l248
You will also want to do this if you're accessing 16 bit data (unsigned short).
How to read and write the image data...
Thanks for you help.Could you explain it more particular?
Now my code is like this:
-------------------------------------------
FILE *fp;
fp=fopen(''C:\\h.bmp'',''w+r'');
fseek(fp, 55, SEEK_SET);
fwrite((unsigned char*)gStuff-%26gt;inData, 1, gStuff-%26gt;bigDocumentData-%26gt; wholeSize32.v * gStuff-%26gt;bigDocumentData-%26gt;wholeSize32.h * gStuff-%26gt;planes, fp);
fclose(fp);
-------------------------------------------
Why the image data saved is disordered?
Thanks.
Subscribe to:
Post Comments
(Atom)
No comments:
Post a Comment