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:
authorTon Roosendaal <ton@blender.org>2006-02-09 21:55:14 +0300
committerTon Roosendaal <ton@blender.org>2006-02-09 21:55:14 +0300
commit7eba7494013c32800a2451af661930efb304fa7c (patch)
tree93cf6c106dfaad8ec380178b96e34ae51db7d8a2 /source/blender/imbuf/intern/openexr
parent8ef768826672fbfaf1037d25b0bfaf50418cd9f1 (diff)
Made exr saving respect the 'RGB' or 'RGBA' setting in render output
panel. Saves a whopping 25% filesize!
Diffstat (limited to 'source/blender/imbuf/intern/openexr')
-rw-r--r--source/blender/imbuf/intern/openexr/openexr_api.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp
index b310f128d8e..5cf8005cb99 100644
--- a/source/blender/imbuf/intern/openexr/openexr_api.cpp
+++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp
@@ -178,7 +178,8 @@ static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
header.channels().insert ("R", Channel (HALF));
header.channels().insert ("G", Channel (HALF));
header.channels().insert ("B", Channel (HALF));
- header.channels().insert ("A", Channel (HALF));
+ if (ibuf->depth==32)
+ header.channels().insert ("A", Channel (HALF));
if (write_zbuf) // z we do as float always
header.channels().insert ("Z", Channel (FLOAT));
@@ -195,8 +196,8 @@ static short imb_save_openexr_half(struct ImBuf *ibuf, char *name, int flags)
frameBuffer.insert ("R", Slice (HALF, (char *) &pixels[0].r, xstride, ystride));
frameBuffer.insert ("G", Slice (HALF, (char *) &pixels[0].g, xstride, ystride));
frameBuffer.insert ("B", Slice (HALF, (char *) &pixels[0].b, xstride, ystride));
- frameBuffer.insert ("A", Slice (HALF, (char *) &pixels[0].a, xstride, ystride));
-
+ if (ibuf->depth==32)
+ frameBuffer.insert ("A", Slice (HALF, (char *) &pixels[0].a, xstride, ystride));
if (write_zbuf)
frameBuffer.insert ("Z", Slice (FLOAT, (char *) ibuf->zbuf_float + 4*(height-1)*width,
sizeof(float), sizeof(float) * -width));
@@ -268,7 +269,8 @@ static short imb_save_openexr_float(struct ImBuf *ibuf, char *name, int flags)
header.channels().insert ("R", Channel (FLOAT));
header.channels().insert ("G", Channel (FLOAT));
header.channels().insert ("B", Channel (FLOAT));
- header.channels().insert ("A", Channel (FLOAT));
+ if (ibuf->depth==32)
+ header.channels().insert ("A", Channel (FLOAT));
if (write_zbuf)
header.channels().insert ("Z", Channel (FLOAT));
@@ -281,8 +283,8 @@ static short imb_save_openexr_float(struct ImBuf *ibuf, char *name, int flags)
frameBuffer.insert ("R", Slice (FLOAT, (char *) first, xstride, ystride));
frameBuffer.insert ("G", Slice (FLOAT, (char *) (first+1), xstride, ystride));
frameBuffer.insert ("B", Slice (FLOAT, (char *) (first+2), xstride, ystride));
- frameBuffer.insert ("A", Slice (FLOAT, (char *) (first+3), xstride, ystride));
-
+ if (ibuf->depth==32)
+ frameBuffer.insert ("A", Slice (FLOAT, (char *) (first+3), xstride, ystride));
if (write_zbuf)
frameBuffer.insert ("Z", Slice (FLOAT, (char *) ibuf->zbuf_float + 4*(height-1)*width,
sizeof(float), sizeof(float) * -width));