Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Migration from Photon to GF: (4 Items)
   
Migration from Photon to GF  
Hi,

Application is responsible for displaying data (8-bits/pixel graymap). Data is received from Ethernet interface and 
displayed when image is complete (all frames were already gathered).

Under Photon as solution I use PhCreateImage() and  PgDrawPhImage() functions. 
BTW Is there any other way in order to achive a better performane in Photon ?
 
It's time to move to GF.

In the "Working with Images" chapter there is a following code:
    palette.ncolors = 256;
    palette.colors = (img_color_t*)g8pal;
but compiler says that g8pal is undefined. How can I use this ?
Should I generate array of colors itself (in similar way that was done under Photon,  PgSetPalette()) ?

What function should I use under GF as equivalent ?
I found the gf_draw_image() but this function doesn't support GF_FORMAT_PAL8...

Regards,
Jacek
Re: Migration from Photon to GF  
I am having the same problem, I can't find 'g8pal'. It looks like it should be a pointer to a palette of type 
'img_color_t' which is just an integer. So what should the g8pal palette look like. I am new to QNX and GF graphics and 
am finding it hard to get things working as a lot of info is missing from QNX examples.
Re: Migration from Photon to GF  
I have changed pixel_format in the display.conf file from "rgb565" onto "pal8" value.
Now the gf_draw_blit2() works while with "rgb565" screen is dark all the time.

Picture is visible but colors are not correct.
I wonder how to generate 8-bits gray palette under GF ?
Re: Migration from Photon to GF  
I have successfully generated 8-bits gray palette as follows:

gf_palette_t palette;
gf_color_t     g8pal[256];
...

for (i = 0; i < 256; i++) {
	g8pal[i] = (0xff << 24) | ((i & 0xff) << 16) | ((i & 0xff) << 8) | (i & 0xff);
}

palette.ncolors = 256;
palette.colors = (gf_color_t*)g8pal;

It works fine with rgb565 format for io-display.