luca
Posts: 4
Joined: Tue Oct 01, 2013 12:13 pm
Location: Italy - MI

RAW image file format

Tue Oct 01, 2013 12:20 pm

Hello everybody.

I'm quite new to the Raspberry and OPenGLES (i had some littel OGL experience some years ago).

I'm trying to modify the /opt/vc examples and moving on from there, i cant' find how the RAW images used as textures (hello_traingle) should be generated. I've read somewhere (can't find it again) it's an uncompressed TGA, but saving as TGA and renaming doesn't work.

Any info or pointers welcome.

Thank you.

Luca

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: RAW image file format

Tue Oct 01, 2013 1:21 pm

These RAW images are simply the RGB values of the image saved as a file. There is no header just the RGB values of the images. The images are saved as rows, top row first. pixels from left to right. Each file is 49152 bytes long (128 x 128 x 3). I am sure there are lots of programs around that will create a raw image file. Hope that helps!

luca
Posts: 4
Joined: Tue Oct 01, 2013 12:13 pm
Location: Italy - MI

Re: RAW image file format

Tue Oct 01, 2013 1:49 pm

Thanks!
Looking after this info i found somebody who said to save as "C code" from gimp and then including, which seems over complicated, but looking for it i found a "RAW image data" option without an associated file extension in the GIMP select file type dropdown in the save as window :)
so now just rename the file to raw and load and it works. :-)

Thanks.

Return to “OpenGLES”