Good question.  Here's the situation as I understand it:

An image file can potentially hold multiple images (for example, some image 
file formats support multiple subimages, or MIPmaps, or both).

An ImageBuf can hold just one image.  For example, one MIPmap level of one 
subimage of a file.  When you ask an ImageBuf to load from a file, you must 
specify which subimage and MIPmap level (defaulting to the highest-resolution 
MIP level of the first subimage in the file).

All ImageBufAlgo image processing functions apply to ImageBufs, i.e., single 
images.  Some IBA functions take an ROI to specifies a rectangular region of 
pixels in the ImageBuf to apply the operation.

oiiotool is set up so that it can (but doesn't have to) work on all subimages 
or MIP levels of the named images.  Local to oiiotool (but not exposed 
publicly) is a class called ImageRec, which is just a container of ImageBufs 
for all the subimages and MIPmap levels in a file.  

When you invoke oiiotool with the "-a" flag ('all'), it tries to apply the 
given operations to all subimages and MIP levels (by default, it just does its 
thing with the top MIPlevel of the first subimage).  Some operations make sense 
to use -a (like if you are using oiiotool --info to list info on all the 
subimges, etc.), but many (perhaps most) think you'll want to do with oiiotool 
don't make a lot of sense to apply that way.  Usually, you'd want to do your 
image processing on the top level of a MIPmap only, then re-maketx the results, 
rather than try to do operations on each level.

I don't think any oiiotool command line options allow you to specify ROIs, 
though it might be handy for some things in the future.  But I think ROI's are 
among the things that make no sense for MIPmaps or multiple subimges, since a 
ROI inherently specifies a rectangle in a single image.

So just don't worry about the interaction of ROIs and MIPmaps or multi-image 
files.  

If you have the oiio-images project checked out (needed for the testsuite), the 
grid.tx file is a MIPmap file.  I'm not sure we have an easy example of a 
multi-image but not MIPmapped file at the moment; very few formats support this 
(although the new OpenEXR 2.0 will; I'm working on support for this now).

        -- lg



On Jul 21, 2012, at 6:12 PM, Stefan Stavrev wrote:

> At this point, the ROI structure specifies a region in an ImageBuf
> on which to apply an image processing operation.
> 
> Most operations in oiiotool are applied to all subimages and 
> all mip-levels. But I am not sure now of the interplay between
> ROI and ImageRec.
> 
> By the way, where can I find such an image that contains
> more subimages and mip-levels, for testing?


--
Larry Gritz
[email protected]


_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to