diff options
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/Makefile | 3 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 5 | ||||
-rw-r--r-- | source/blender/imbuf/IMB_imbuf_types.h | 4 | ||||
-rw-r--r-- | source/blender/imbuf/SConscript | 4 | ||||
-rw-r--r-- | source/blender/imbuf/intern/IMB_openexr.h | 46 | ||||
-rw-r--r-- | source/blender/imbuf/intern/Makefile | 5 | ||||
-rw-r--r-- | source/blender/imbuf/intern/openexr.cpp | 397 | ||||
-rw-r--r-- | source/blender/imbuf/intern/readimage.c | 9 | ||||
-rw-r--r-- | source/blender/imbuf/intern/writeimage.c | 8 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 1 | ||||
-rw-r--r-- | source/blender/src/Makefile | 4 | ||||
-rw-r--r-- | source/blender/src/buttons_scene.c | 9 | ||||
-rw-r--r-- | source/blender/src/toets.c | 13 | ||||
-rw-r--r-- | source/blender/src/writeimage.c | 5 |
14 files changed, 0 insertions, 513 deletions
diff --git a/source/blender/blenkernel/intern/Makefile b/source/blender/blenkernel/intern/Makefile index 0b8c0a03217..c91ba45048c 100644 --- a/source/blender/blenkernel/intern/Makefile +++ b/source/blender/blenkernel/intern/Makefile @@ -78,6 +78,3 @@ ifeq ($(WITH_FREETYPE2), true) CPPFLAGS += -I$(NAN_FREETYPE)/include/freetype2 endif -ifeq ($(WITH_OPENEXR), true) - CPPFLAGS += -DWITH_OPENEXR -endif diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index e4752220737..d8c455c9c48 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -193,11 +193,6 @@ void makepicstring(char *string, int frame) else if(G.scene->r.imtype==R_PNG) { extension= ".png"; } -#ifdef WITH_OPENEXR - else if(G.scene->r.imtype==R_OPENEXR) { - extension= ".exr"; - } -#endif else if(G.scene->r.imtype==R_TARGA) { extension= ".tga"; } diff --git a/source/blender/imbuf/IMB_imbuf_types.h b/source/blender/imbuf/IMB_imbuf_types.h index e0a1d42aa1a..a257e475e4e 100644 --- a/source/blender/imbuf/IMB_imbuf_types.h +++ b/source/blender/imbuf/IMB_imbuf_types.h @@ -152,9 +152,6 @@ typedef enum { #ifdef WITH_IMAGEMAGICK #define IMAGEMAGICK (1 << 23) #endif -#ifdef WITH_OPENEXR -#define OPENEXR (1 << 22) -#endif #define RAWTGA (TGA | 1) @@ -191,7 +188,6 @@ typedef enum { #define IS_hamx(x) (x->ftype == AN_hamx) #define IS_tga(x) (x->ftype & TGA) #define IS_png(x) (x->ftype & PNG) -#define IS_openexr(x) (x->ftype & OPENEXR) #define IS_bmp(x) (x->ftype & BMP) #define IMAGIC 0732 diff --git a/source/blender/imbuf/SConscript b/source/blender/imbuf/SConscript index 199e872e49b..11d7cfb2b30 100644 --- a/source/blender/imbuf/SConscript +++ b/source/blender/imbuf/SConscript @@ -33,9 +33,6 @@ source_files = ['intern/allocimbuf.c', 'intern/util.c', 'intern/writeimage.c'] -if user_options_dict['USE_OPENEXR'] == 1: - source_files.append('intern/openexr.cpp') - imbuf_env.Append (CPPPATH = ['.', '../makesdna', '#/intern/guardedalloc', @@ -46,7 +43,6 @@ imbuf_env.Append (CPPPATH = ['.', imbuf_env.Append (CPPPATH = user_options_dict['JPEG_INCLUDE']) imbuf_env.Append (CPPPATH = user_options_dict['PNG_INCLUDE']) -imbuf_env.Append (CPPPATH = user_options_dict['OPENEXR_INCLUDE']) imbuf_env.Append (CPPPATH = user_options_dict['Z_INCLUDE']) imbuf_env.Append (CPPPATH = extra_includes) imbuf_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/blender_imbuf', source=source_files) diff --git a/source/blender/imbuf/intern/IMB_openexr.h b/source/blender/imbuf/intern/IMB_openexr.h deleted file mode 100644 index edf8b144bde..00000000000 --- a/source/blender/imbuf/intern/IMB_openexr.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - */ -/** - * \file IMB_openexr.h - * \ingroup imbuf - * \brief Function declarations for openexr.cc - */ - -#ifndef IMB_OPENEXR_H -#define IMB_OPENEXR_H - -struct ImBuf; - -int imb_is_a_openexr(void *buf); - -struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags); -short imb_save_openexr(struct ImBuf * ibuf, char *name, int flags); -#endif diff --git a/source/blender/imbuf/intern/Makefile b/source/blender/imbuf/intern/Makefile index 15062044716..ed79b67af99 100644 --- a/source/blender/imbuf/intern/Makefile +++ b/source/blender/imbuf/intern/Makefile @@ -63,8 +63,3 @@ ifeq ($(WITH_QUICKTIME), true) CPPFLAGS += -DWITH_QUICKTIME endif -ifeq ($(WITH_OPENEXR), true) - CPPFLAGS += -DWITH_OPENEXR - CPPFLAGS += -I$(NAN_OPENEXR)/include/OpenEXR -endif - diff --git a/source/blender/imbuf/intern/openexr.cpp b/source/blender/imbuf/intern/openexr.cpp deleted file mode 100644 index 44b198d4403..00000000000 --- a/source/blender/imbuf/intern/openexr.cpp +++ /dev/null @@ -1,397 +0,0 @@ -/** - * - * ***** BEGIN GPL/BL DUAL LICENSE BLOCK ***** - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. The Blender - * Foundation also sells licenses for use in proprietary software under - * the Blender License. See http://www.blender.org/BL/ for information - * about this. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software Foundation, - * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Copyright by Gernot Ziegler <gz@lysator.liu.se>. - * All rights reserved. - * - * The Original Code is: all of this file. - * - * Contributor(s): none yet. - * - * ***** END GPL/BL DUAL LICENSE BLOCK ***** - * - */ - -#ifdef WITH_OPENEXR - -#include <stdlib.h> -#include <stdio.h> -#include <string> - -#include <iostream> - -#include <half.h> -#include <ImfVersion.h> -#include <ImathBox.h> -#include <ImfArray.h> -#include <ImfIO.h> -#include <ImfChannelList.h> -#include <ImfPixelType.h> -#include <ImfInputFile.h> -#include <ImfOutputFile.h> - -using namespace Imf; -using namespace Imath; - -extern "C" -{ -#ifdef WIN32 -#include "BLI_winstuff.h" -#endif -#include "BLI_blenlib.h" - -#include "imbuf.h" -#include "imbuf_patch.h" - -#include "IMB_imbuf_types.h" -#include "IMB_imbuf.h" - -#include "IMB_allocimbuf.h" -#include "IMB_cmap.h" -} - - -int imb_is_a_openexr(void *mem) -{ - return Imf::isImfMagic ((const char *)mem); -} - - -class Mem_IStream: public IStream -{ - public: - - Mem_IStream (unsigned char *exrbuf, int exrsize): - IStream("dummy"), _exrpos (0), _exrsize(exrsize) { _exrbuf = exrbuf; } - - virtual bool read (char c[], int n); - virtual Int64 tellg (); - virtual void seekg (Int64 pos); - virtual void clear (); -//virtual ~Mem_IStream() {}; // unused - - private: - - Int64 _exrpos; - Int64 _exrsize; - unsigned char *_exrbuf; -}; - -bool Mem_IStream::read (char c[], int n) -{ - if (n + _exrpos <= _exrsize) - { - memcpy(c, (void *)(&_exrbuf[_exrpos]), n); - _exrpos += n; - return true; - } - else - return false; -} - - -Int64 Mem_IStream::tellg () -{ - return _exrpos; -} - - -void Mem_IStream::seekg (Int64 pos) -{ - _exrpos = pos; -} - - -void Mem_IStream::clear () -{ -} - - -struct _RGBAZ -{ - half r; - half g; - half b; - half a; - half z; -}; - -typedef struct _RGBAZ RGBAZ; - -extern "C" -{ - short imb_save_openexr(struct ImBuf *ibuf, char *name, int flags) - { - int width = ibuf->x; - int height = ibuf->y; - int i; - - // summarize - int write_zbuf = (flags & IB_zbuf) && ibuf->zbuf != 0; - - printf("OpenEXR-save: Saving %s image of %d x %d\n", - write_zbuf ? "RGBAZ" : "RGBA", width, height); - - try - { - Header header (width, height); - 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 (write_zbuf) - header.channels().insert ("Z", Channel (HALF)); - - FrameBuffer frameBuffer; - OutputFile *file; - - if (flags & IB_mem) - { - printf("OpenEXR-save: Create EXR in memory CURRENTLY NOT SUPPORTED !\n"); - imb_addencodedbufferImBuf(ibuf); - ibuf->encodedsize = 0; - return(0); - } - else - { - printf("OpenEXR-save: Creating output file %s\n", name); - file = new OutputFile(name, header); - } - - RGBAZ *pixels = new RGBAZ[height * width]; - - int bytesperpixel = (ibuf->depth + 7) >> 3; - if ((bytesperpixel > 4) || (bytesperpixel == 2)) - { - printf("OpenEXR-save: unsupported bytes per pixel: %d\n", bytesperpixel); - return (0); - } - - frameBuffer.insert ("R", - Slice (HALF, - (char *) &pixels[0].r, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - frameBuffer.insert ("G", - Slice (HALF, - (char *) &pixels[0].g, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - frameBuffer.insert ("B", - Slice (HALF, - (char *) &pixels[0].b, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - frameBuffer.insert ("A", - Slice (HALF, - (char *) &pixels[0].a, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - if (write_zbuf) - frameBuffer.insert ("Z", - Slice (HALF, - (char *) &pixels[0].z, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - if (!ibuf->rect_float) - { - printf("OpenEXR-save: Converting Blender 8/8/8/8 pixels to OpenEXR format\n"); - - RGBAZ *to = pixels; - unsigned char *from = (unsigned char *) ibuf->rect; - - for (i = ibuf->x * ibuf->y; i > 0; i--) - { - to->r = (float)(from[0])/255.0; - to->g = (float)(from[1])/255.0; - to->b = (float)(from[2])/255.0; - to->a = (float)(from[3])/255.0; - to++; from += 4; - } - } - else - { - printf("OpenEXR-save: Converting Blender FLOAT pixels to OpenEXR format\n"); - - RGBAZ *to = pixels; - float *from = ibuf->rect_float; - - for (i = ibuf->x * ibuf->y; i > 0; i--) - { - to->r = from[0]; - to->g = from[1]; - to->b = from[2]; - to->a = from[3]; - to++; from += 4; - } - } - - if (write_zbuf) - { - RGBAZ *to = pixels; - int *fromz = ibuf->zbuf; - - for (int i = ibuf->x * ibuf->y; i > 0; i--) - { - to->z = (0.5+((float)(*fromz/65536)/65536.0)); - to++; fromz ++; - } - } - - printf("OpenEXR-save: Writing OpenEXR file of height %d.\n", height); - - file->setFrameBuffer (frameBuffer); - file->writePixels (height); - delete file; - } - catch (const std::exception &exc) - { - printf("OpenEXR-save: ERROR: %s\n", exc.what()); - if (ibuf) IMB_freeImBuf(ibuf); - - return (0); - } - - return (1); - printf("OpenEXR-save: Done.\n"); - } - - struct ImBuf *imb_load_openexr(unsigned char *mem, int size, int flags) - { - struct ImBuf *ibuf = 0; - - printf("OpenEXR-load: testing input, size is %d\n", size); - if (imb_is_a_openexr(mem) == 0) return(0); - - InputFile *file = NULL; - - try - { - printf("OpenEXR-load: Creating InputFile from mem source\n"); - Mem_IStream membuf(mem, size); - file = new InputFile(membuf); - - Box2i dw = file->header().dataWindow(); - int width = dw.max.x - dw.min.x + 1; - int height = dw.max.y - dw.min.y + 1; - - printf("OpenEXR-load: image data window %d %d %d %d\n", - dw.min.x, dw.min.y, dw.max.x, dw.max.y); - - const ChannelList &channels = file->header().channels(); - - for (ChannelList::ConstIterator i = channels.begin(); i != channels.end(); ++i) - { - const Channel &channel = i.channel(); - printf("OpenEXR-load: Found channel %s of type %d\n", i.name(), channel.type); - if (channel.type != 1) - { - printf("OpenEXR-load: Can only process HALF input !!\n"); - return(NULL); - } - } - - RGBAZ *pixels = new RGBAZ[height * width]; - - FrameBuffer frameBuffer; - - frameBuffer.insert ("R", - Slice (HALF, - (char *) &pixels[0].r, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - frameBuffer.insert ("G", - Slice (HALF, - (char *) &pixels[0].g, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - frameBuffer.insert ("B", - Slice (HALF, - (char *) &pixels[0].b, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - - frameBuffer.insert ("A", - Slice (HALF, - (char *) &pixels[0].a, - sizeof (pixels[0]) * 1, - sizeof (pixels[0]) * width)); - -// FIXME ? Would be able to read Z data or other channels here ! - - printf("OpenEXR-load: Reading pixel data\n"); - file->setFrameBuffer (frameBuffer); - file->readPixels (dw.min.y, dw.max.y); - - printf("OpenEXR-load: Converting to Blender ibuf\n"); - - int bytesperpixel = 4; // since OpenEXR fills in unknown channels - ibuf = IMB_allocImBuf(width, height, 8 * bytesperpixel, 0, 0); - - if (ibuf) - { - ibuf->ftype = PNG; - imb_addrectImBuf(ibuf); - - if (!(flags & IB_test)) - { - unsigned char *to = (unsigned char *) ibuf->rect; - RGBAZ *from = pixels; - RGBAZ prescale; - - for (int i = ibuf->x * ibuf->y; i > 0; i--) - { - to[0] = (unsigned char)(((float)from->r > 1.0) ? 1.0 : (float)from->r) * 255; - to[1] = (unsigned char)(((float)from->g > 1.0) ? 1.0 : (float)from->g) * 255; - to[2] = (unsigned char)(((float)from->b > 1.0) ? 1.0 : (float)from->b) * 255; - to[3] = (unsigned char)(((float)from->a > 1.0) ? 1.0 : (float)from->a) * 255; - to += 4; from++; - } - } - - } - else - printf("Couldn't allocate memory for PNG image\n"); - - printf("OpenEXR-load: Done\n"); - - return(ibuf); - } - catch (const std::exception &exc) - { - std::cerr << exc.what() << std::endl; - if (ibuf) IMB_freeImBuf(ibuf); - - return (0); - } - - } - -} // export "C" - -#endif // #ifdef WITH_OPENEXR diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c index 9d40ef602f8..15a9c259e65 100644 --- a/source/blender/imbuf/intern/readimage.c +++ b/source/blender/imbuf/intern/readimage.c @@ -48,10 +48,6 @@ #include "IMB_bmp.h" #include "BKE_global.h" -#ifdef WITH_OPENEXR -#include "IMB_openexr.h" -#endif - #ifdef WITH_QUICKTIME #if defined(_WIN32) || defined (__APPLE__) #include "quicktime_import.h" @@ -142,11 +138,6 @@ ImBuf *IMB_ibImageFromMemory(int *mem, int size, int flags) { ibuf = imb_loadtarga((uchar *)mem, flags); if (ibuf) return(ibuf); -#ifdef WITH_OPENEXR - ibuf = imb_load_openexr((uchar *)mem, size, flags); - if (ibuf) return(ibuf); -#endif - #ifdef WITH_QUICKTIME #if defined(_WIN32) || defined (__APPLE__) if(G.have_quicktime) { diff --git a/source/blender/imbuf/intern/writeimage.c b/source/blender/imbuf/intern/writeimage.c index 925eaca3e87..150ab8aac26 100644 --- a/source/blender/imbuf/intern/writeimage.c +++ b/source/blender/imbuf/intern/writeimage.c @@ -50,9 +50,6 @@ #include "IMB_amiga.h" #include "IMB_png.h" #include "IMB_bmp.h" -#ifdef WITH_OPENEXR -#include "IMB_openexr.h" -#endif #include "IMB_iff.h" #include "IMB_bitplanes.h" @@ -73,11 +70,6 @@ short IMB_saveiff(struct ImBuf *ibuf,char *naam,int flags) if (IS_png(ibuf)) { return imb_savepng(ibuf,naam,flags); } -#ifdef WITH_OPENEXR - if (IS_openexr(ibuf)) { - return imb_save_openexr(ibuf,naam,flags); - } -#endif if (IS_bmp(ibuf)) { return imb_savebmp(ibuf,naam,flags); } diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index aae1465df0d..54b93a9dfbd 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -340,7 +340,6 @@ typedef struct Scene { #define R_AVICODEC 18 #define R_QUICKTIME 19 #define R_BMP 20 -#define R_OPENEXR 21 /* **************** RENDER ********************* */ /* mode flag is same as for renderdata */ diff --git a/source/blender/src/Makefile b/source/blender/src/Makefile index 7755c8cf707..210ed7d7320 100644 --- a/source/blender/src/Makefile +++ b/source/blender/src/Makefile @@ -111,10 +111,6 @@ ifeq ($(WITH_QUICKTIME),true) CPPFLAGS += -DWITH_QUICKTIME endif -ifeq ($(WITH_OPENEXR),true) - CPPFLAGS += -DWITH_OPENEXR -endif - ifeq ($(INTERNATIONAL), true) CPPFLAGS += -DINTERNATIONAL endif diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c index 8702f320c6c..56ef9aa412d 100644 --- a/source/blender/src/buttons_scene.c +++ b/source/blender/src/buttons_scene.c @@ -954,9 +954,6 @@ static char *imagetype_pup(void) #endif strcat(formatstring, "|%s %%x%d"); // add space for PNG -#ifdef WITH_OPENEXR - strcat(formatstring, "|%s %%x%d"); // add space for OpenEXR -#endif strcat(formatstring, "|%s %%x%d"); // add space for BMP #ifdef _WIN32 @@ -981,9 +978,6 @@ static char *imagetype_pup(void) "Targa", R_TARGA, "Targa Raw", R_RAWTGA, "PNG", R_PNG, -#ifdef WITH_OPENEXR - "OpenEXR", R_OPENEXR, -#endif "BMP", R_BMP, "Jpeg", R_JPEG90, "HamX", R_HAMX, @@ -1002,9 +996,6 @@ static char *imagetype_pup(void) "Targa", R_TARGA, "Targa Raw", R_RAWTGA, "PNG", R_PNG, -#ifdef WITH_OPENEXR - "OpenEXR", R_OPENEXR, -#endif "BMP", R_BMP, "Jpeg", R_JPEG90, "HamX", R_HAMX, diff --git a/source/blender/src/toets.c b/source/blender/src/toets.c index 752f4359365..0aac38c58cf 100644 --- a/source/blender/src/toets.c +++ b/source/blender/src/toets.c @@ -192,17 +192,6 @@ void schrijfplaatje(char *name) else if(R.r.imtype==R_PNG) { ibuf->ftype= PNG; } -#ifdef WITH_OPENEXR - else if(R.r.imtype==R_OPENEXR) { - ibuf->ftype= OPENEXR; - if (ibuf->zbuf == 0) { - if (R.rectz) { - ibuf->zbuf = (int *)R.rectz; - } - else printf("Write OPENEXR: no zbuf !\n"); - } - } -#endif else if(R.r.imtype==R_BMP) { ibuf->ftype= BMP; } @@ -482,8 +471,6 @@ int save_image_filesel_str(char *str) switch(G.scene->r.imtype) { case R_PNG: strcpy(str, "Save PNG"); return 1; - case R_OPENEXR: - strcpy(str, "Save OPENEXR"); return 1; case R_BMP: strcpy(str, "Save BMP"); return 1; case R_TARGA: diff --git a/source/blender/src/writeimage.c b/source/blender/src/writeimage.c index d16247a70b2..0c0b716d211 100644 --- a/source/blender/src/writeimage.c +++ b/source/blender/src/writeimage.c @@ -57,11 +57,6 @@ int BIF_write_ibuf(ImBuf *ibuf, char *name) else if ((G.scene->r.imtype==R_BMP)) { ibuf->ftype= BMP; } -#ifdef WITH_OPENEXR - else if ((G.scene->r.imtype==R_OPENEXR)) { - ibuf->ftype= OPENEXR; - } -#endif else if ((G.scene->r.imtype==R_TARGA) || (G.scene->r.imtype==R_PNG)) { // fall back to Targa if PNG writing is not supported ibuf->ftype= TGA; |