• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

New Here ,
Mar 26, 2008 Mar 26, 2008

Copy link to clipboard

Copied

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?
Thanks.
TOPICS
SDK

Views

704

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Explorer ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

>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.

Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

Thank Aandi Inston.
Could you tell me how to convert each pixel data to BMP files?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

>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.


Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

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

Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

On the other hand,
http://www.fortunecity.com/skyscraper/windows/364/bmpffrmt.html
includes vital information missing in the other reference. This is
more accessible and the section "The pixel data" is vital. However,
when it says "The first byte represents the red part, the second the
green and the third the blue part", this is simply wrong. Caveat
emptor.

Aandi Inston

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Mar 27, 2008 Mar 27, 2008

Copy link to clipboard

Copied

http://msdn2.microsoft.com/en-us/library/ms532311.aspx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 03, 2008 Apr 03, 2008

Copy link to clipboard

Copied

LATEST
Thank Aandi Inston and Toby Thain.
The problem is solved.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines