Reader:
DDS has a bunch of different compression formats, all of then
supported by GPU hardware decode. BUT, theres also uncompressed format
as well... you can store up to 4 channels of 32bit float uncompressed.
So, in theory, if the DDS stores uncompressed data, you could read it
to an ImagePrimitive....
So, I'm not sure... I suppose makes more sense to return an
IECoreGL::Texture by default, but would be also interesting to be able
to convert IECoreGL::Texture to ImagePrimitive after reading, if
necessary... in this case, a Conversor could take care of
uncompressing the data on the fly, if necessary...
What about derive IECoreGL::Texture to a IECoreGL:DDSTexture class,
and then I could add a toImagePrimitive method ?
Using this DDSTexture class approach would also be interesting to do
DDS compression on the fly straight from an ImagePrimitive buffer
without having to rely on dds files. I think this can be really
usefull, specially in film to "squeeze" more EXR textures into GPU
memory!
Writer:
My idea was exact that... derive from IECore::Writer and take an
ImagePrimitive as input.
My plan:
I think I'll start with an DDSTexture backend class that will provide
all the functionality to IECoreGL::DDSTexture, Reader and Writer.
what do you think?