You can convert between planar configurations (for formats that support the
distinction) on the command line with oiiotool:
oiiotool myinterleaved.tif --planarconfig separate -o myseparate.tif
oiiotool mycontiguous.tif --planarconfig contig -o myinterleaved.tif
If you're using the C++ interface, you don't have to actually "do" anything, no
shuffling of memory on your own, it's all handled in the output just by setting
that one attribute for the output configuration.
I'm not sure what you mean by "padding". Can you explain what you're trying to
achieve?
Full PDF documentation (a 400 page book!) can be found in the OIIO distribution
itself. Look for openimageio.pdf.
> On May 19, 2017, at 10:13 AM, Steve Huey <[email protected]> wrote:
>
> Hi,
>
> I’ve just started using OpenImageIO to load and save images which I’m apply
> some effects to with a a third party library. After processing, the third
> party library converts images to planar (separate) format, and adds some
> padding to each row.
>
> I’ve been converting them back to interleaved (contig) using some code I
> wrote before saving the images with OpenImageIO but noticed that some of the
> command line tools included with the OpenImageIO distribution support this
> conversion as well. If OpenImageIO can handle this conversion for me, I’d
> like to learn how.
>
> From looking at the source for some of these tools they just appear to set
> call the attribute method of the ImageSpec class with something like:
> spec.attribute(“planarconfig”, “contig”). Because of the row padding (I
> think) this approach isn’t working for me, and the output image is corrupted.
>
> Given this, I have two questions:
>
> 1. Does OpenImageIO support conversion from planar to interleaved with
> padding?
> 2. If so, can you please point me in the direction of the recommended
> functions / docs?
>
> Thanks,
> Steve Huey
>
> --
> // Steven Huey * Senior Software Engineer
> // [email protected] <mailto:[email protected]>
> // www.artandlogic.com <http://www.artandlogic.com/>
> // Art & Logic -- Coding the "impossible."™
>
>
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
--
Larry Gritz
[email protected]
_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org