Ha!  Just a few days ago  sent this pull request:  
https://github.com/OpenImageIO/oiio/pull/401
After nobody reviewing for a couple days, I decided that it was totally safe 
and committed it.

As it turns out, it exposes writeable access to an IB's spec via a new 
IB::specmod() method.  Use with extreme caution!  It's safe to alter the offset 
and add new attributes and such, but if you change 'format' or 'xwidth' or 
anything else that affects the kind or size of buffer it has stored, you're 
going to regret it.

        -- lg


On Jul 15, 2012, at 9:06 PM, Chris Foster wrote:

> On Mon, Jul 16, 2012 at 1:00 PM, Stefan Stavrev <[email protected]> 
> wrote:
>> How do I offset an ImagaBuf? I have input image A
>> and I want to modify the x and y in it's spec.
>> I can't use reset, because that clears everything
>> including pixels data. So, I just need to offset the image
>> and keep everything else the same.
> 
>> I need this so I can test the Porter-Duff operations
>> with images that don't fully overlap.
> 
> 
> I don't suppose ImageBuf::set_full will do what you want?  That
> modifies m_spec.full_x etc.
> 
> If it's m_spec.x you want to modify, there doesn't seem to be a way to
> do it from ImageBuf.  I'm not sure whether there's a fundamental
> reason for this or it's just an oversight in the current API (cc OIIO
> dev: hopefully someone else will throw some light).
> 
> ~Chris

--
Larry Gritz
[email protected]


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

Reply via email to