[Gimp-user] The structure of exported GIMP image



I try to put an image from GIMP into an embedded system using export. The c file created has a struct with width, height, bytes per pixel (bpp) and the data of the image. The total length is width*height*bbp+1.  The bpp in default to 4 by GIMP. I has tried but fail to find an explanation of how the data is arranged. Can someone point me a direction?

In the very low level of pixel by pixel write to the display controller, one usually repeat image pixel height lines, and each line would have width/8 bytes times the bpp. Thus a 48x32 image, would have 24 bytes for each line and there are 32 lines. I try this rule but the image does not seem come out right.

A 4-bytes bpp seems to indicated that the there are 4G (256*256*256*256) color but most embedded display can only do 64K color (256*256), I found a function by web search to convert 4 bytes to 2 bytes but not sure the formula would be correct?  Is there an authoritative answer to  this?

Any help is appreciated.

rgds,
kfl.



--
-----------------------------------------------------------------------------------------------------------
IT&C (HK) Ltd. www.itnc.com  Tel:+852 6913 0049
PENIT (China) Ltd. www.penit.com : Tel: +86 755 26811370
E-Mail: kflee2000 gmail COM
           KFLee ITNC COM
 
SKYPE: kflee2000  QQ:129929-6015
19A, Seascape Plaza, 18 Taizi Road, Shekou, Shenzhen, PROC.
**** ACW: Alternative Class of Webspace 另类网路空间 *****
www.itnc.com  - Hong Kong Based HQ
www.penit.com - Logistic Software Developer
www.jpfree.com - ACW for Japan
www.twfree.com - ACW for Taiwan
www.cnfree.com - ACW for China
www.asiafree.net    -  Free Business Card Site

---------------------------------------------------------------------------------------------


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]