Hey

I'm fairly new to this amazing lib. Just trying to wrap my head around it.

I've opened one of exr files that has multiple layers, I did some edits to few of them and now I'd like tow rite them out again in to file. Either current one, or new one...

I've started with docs examples & started tweaking it...

int channels =6;// RGBA + 1 RGB channel int xres =640,yres =480;

std::vector<float> pixelsOut(xres *yres *channels);

for (auto x =1000;x <xres *yres *channels -1000; ++x) {
    pixelsOut[x] = (char)rand();
}
std::unique_ptr<OIIO::ImageOutput> out =OIIO::ImageOutput::create(filenamex);
if (!out)
    return;
OIIO::ImageSpec spec(xres,yres,channels,OIIO::TypeDesc::FLOAT);
spec.channelnames = {"R","G","B","LALA","LOLOL", "LILI"};
spec.channelformats = {OIIO::TypeDesc::FLOAT,
                        OIIO::TypeDesc::FLOAT,
                        OIIO::TypeDesc::FLOAT,
                        OIIO::TypeDesc::FLOAT,
                        OIIO::TypeDesc::FLOAT,
                        OIIO::TypeDesc::FLOAT,

                        };
out->open(filenamex,spec);
out->write_image(OIIO::TypeDesc::FLOAT,pixelsOut.data());
out->close();


Nowt this will write a nice file for me... but I'd like to understand... if I have 100 channels.... and I might be reading channel from 1 file/ closing it /writing it/etc... How can I eee... add a channel to existing file?

Regards
Dariusz


--
DARIUSZ MAKOWSKi
CGI-Photographer
07 590 530 854
dari...@dariuszmakowski.com
www.dariuszmakowski.com


--
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus
_______________________________________________
Oiio-dev mailing list
Oiio-dev@lists.openimageio.org
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to