kal wrote:
oc but I meant without adding a header. a way to handle raw data would be nice.
Does anyone know of an existing image format good for storing raw data, without requiring as much moving around of data as my TGA suggestion currently would?
We could invent a new image format
The only required header info would be the pixel format (RGBA, BGR, RGB16F, etc) and the width and height (and depth for 3d images?). This header-data could be written as a footer if it makes things easier...
Then we'd just need to extend Horde's image loader to check for this new raw format.
Code:
struct RawGLPixels
{
int pixelFormat;
int width, height, depth;
}
...
byte *buf;
size_t size = width*height*4;
buf = malloc( size + sizeof(RawGLPixels) );
GeneratePixelData( buf, width, height );
RawGLPixels& footer = *(RawGLPixels*)(buf + size);
footer.pixelFormat = RGBA;
footer.width = width;
footer.height = height;
footer.depth = 0;
...
pass buf to Horde