Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Sharybin <sergey.vfx@gmail.com>2012-03-05 22:54:57 +0400
committerSergey Sharybin <sergey.vfx@gmail.com>2012-03-05 22:54:57 +0400
commit1ae27144f665efeed0b9cd0f07fbe50a25b494d4 (patch)
treed196a1d82ecc8574d8f365d827a9559ca838ac25 /source/blender/imbuf
parenta5eadf14e03809f5b54803f97a4545c9719232ea (diff)
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.
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp35
1 files changed, 9 insertions, 26 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index ad729b34d31..e076dcfa286 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -234,34 +234,17 @@ static int imb_save_openexr_half(struct ImBuf *ibuf, const char *name, int flags
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;
}
}
}