[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [44654] trunk/blender/source/blender/imbuf /intern/openexr/openexr_api.cpp: Fix for OpenEXR half float save function resulting in dark images saved
Campbell Barton
ideasman42 at gmail.com
Mon Mar 5 22:32:29 CET 2012
The reason support for saving non-linear Imbufs was added is because
float sequencer buffers were not linear (internally AFAIK they are
still not - this is needed for sequencer float blending which differs
with linear buffers),
However I tested this change and it works ok - sequencer must become
linear before its passed to OpenEXR save now.
Just a note incase this issue crops up again.
On Tue, Mar 6, 2012 at 5:55 AM, Sergey Sharybin <sergey.vfx at gmail.com> wrote:
> Revision: 44654
> http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=44654
> Author: nazgul
> Date: 2012-03-05 18:54:57 +0000 (Mon, 05 Mar 2012)
> Log Message:
> -----------
> Fix for OpenEXR half float save function resulting in dark images saved
>
> Float buffers of ImBuf are always supposed to be linear space a,d ImBuf's
> profile means how byte array was constructed from float buffer.
>
> Modified Paths:
> --------------
> trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
>
> Modified: trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
> ===================================================================
> --- trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp 2012-03-05 18:05:06 UTC (rev 44653)
> +++ trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp 2012-03-05 18:54:57 UTC (rev 44654)
> @@ -234,34 +234,17 @@
> if(ibuf->rect_float) {
> float *from;
>
> - if(ibuf->profile == IB_PROFILE_LINEAR_RGB) {
> - for (int i = ibuf->y-1; i >= 0; i--)
> - {
> - from= ibuf->rect_float + channels*i*width;
> + for (int i = ibuf->y-1; i >= 0; i--)
> + {
> + from= ibuf->rect_float + channels*i*width;
>
> - for (int j = ibuf->x; j > 0; j--)
> - {
> - to->r = from[0];
> - to->g = from[1];
> - to->b = from[2];
> - to->a = (channels >= 4)? from[3]: 1.0f;
> - to++; from += 4;
> - }
> - }
> - }
> - else {
> - for (int i = ibuf->y-1; i >= 0; i--)
> + for (int j = ibuf->x; j > 0; j--)
> {
> - from= ibuf->rect_float + channels*i*width;
> -
> - for (int j = ibuf->x; j > 0; j--)
> - {
> - to->r = srgb_to_linearrgb(from[0]);
> - to->g = srgb_to_linearrgb(from[1]);
> - to->b = srgb_to_linearrgb(from[2]);
> - to->a = (channels >= 4)? from[3]: 1.0f;
> - to++; from += 4;
> - }
> + to->r = from[0];
> + to->g = from[1];
> + to->b = from[2];
> + to->a = (channels >= 4)? from[3]: 1.0f;
> + to++; from += 4;
> }
> }
> }
>
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs
--
- Campbell
More information about the Bf-committers
mailing list