Hello,

I've sent an email about this before but I think my reply got lost somewhere. 
Anyway, I am trying to crop a multi-image Exr file.

I have managed to write out the multi-image like this (because 
out->supports("appendsubimage") returns false)

out->open (filename.toStdString(), orig_fb_count, specs);

// Write the individual subimages
unsigned int xoffset = 0;
for (int s = 0;  s < orig_fb_count;  s++) {
    if (s > 0) { // Not needed for the first, which is already open
        out->open (filename.toStdString(), specs[s], 
ImageOutput::AppendSubimage);
    }
    out->write_image (TypeDesc::BASETYPE(specs[s].format.basetype), scratch + 
xoffset);
    xoffset += specs[s].image_bytes();
}

Here the scratch is a scratch file buffer storing all the aovs contiguously, 
and the arrap of specs stores the spec for each one. This is working great, but 
I want to add an autocrop feature.

I can calculate the ROI (or BBox) for the overall image, but I am not sure how 
to crop the images.

The original code I inherited uses ImageBufAlgo::crop, and then ImageBuf::write 
to save the file. I am not sure how to write out the result from the crop to a 
multi-image EXR

out->open (filename.toStdString(), orig_fb_count, specs);


What's the correct method to crop the image and write it out as a multi-image 
EXR?

SVEN STEINBAUER
Senior R&D Engineer
T +44 20 7287 4041
SUPPORTING WORLD PRIDE MONTH 2020
THE MILL 11-14 WINDMILL STREET, LONDON, W1T 2JG
FOLLOW @MILLCHANNEL | FACEBOOK | LINKEDIN | INSTAGRAM|THEMILL.COM
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to