|
Converting a Gimp .h-file to BITMAP * |
H
Member #1,673
November 2001
|
I'm working on a project that needs to operate without the use of extern data. Therefore I thought it might be useful to use the function in the GIMP (GNU Image Manipulation Program) to save an image as a C header file. /* Call this macro repeatedly. After each use, the pixel data can be extracted */ #define HEADER_PIXEL(data,pixel) {\ static char header_data_cmap[256][3] = { //..... static char header_data[] = {
This doesn't work of course. The variable called data in the GIMP macro is supposed to point to a two-dimensional array. But the only two-dimensional array is header_data_cmap, and it can't point to that? |
Thomas Fjellstrom
Member #476
June 2000
|
Just point it to header_data. the macro is already using header_data_cmap, header_data_cmap[(unsigned char) data[0] ][0] I think it wants a one dimentional array. -- |
Bob
Free Market Evangelist
September 2000
|
What's wrong with dat2c? -- |
H
Member #1,673
November 2001
|
Yes, you're right. I missed one of the square brackets there, it should be a one-dimensional array. But then I can't understand why it isn't working. It is pointing to header_data, but I just get weird colors. [edit] |
|