From 67f1c590c13265d93d30075e7856391cd2c3fd25 Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Aug 28 2018 16:10:17 +0000 Subject: Disable deprecated option to use OpenEXR Half type as ColorReal --- diff --git a/synfig-core/configure.ac b/synfig-core/configure.ac index a8f72a1..ebb6510 100644 --- a/synfig-core/configure.ac +++ b/synfig-core/configure.ac @@ -83,16 +83,6 @@ AC_CHECK_LIB(c, dlopen, AC_SUBST(DYNAMIC_LD_LIBS) -AC_ARG_ENABLE(half, - AS_HELP_STRING(--enable-half, [use OpenEXR "half" type for color]),[ - use_openexr_half=$enableval -], -[ - use_openexr_half="no" -]) - - - AC_ARG_ENABLE(layer-profiling, AS_HELP_STRING(--enable-layer-profiling, [enable layer profiling]),[ use_layerprofiling=$enableval @@ -270,22 +260,13 @@ AC_ARG_WITH(openexr, ]) if test $with_openexr = "yes" ; then { PKG_CHECK_MODULES(OPENEXR, OpenEXR,[ - AC_DEFINE(HAVE_OPENEXR,[], [ Define if OpenEXR is available ] ) - AM_CONDITIONAL(WITH_OPENEXR,true) CONFIG_DEPS="$CONFIG_DEPS OpenEXR" ], [ with_openexr="no" ]) } ; fi -if test $with_openexr = "no" ; then { - AM_CONDITIONAL(WITH_OPENEXR,false) - use_openexr_half="no" -} ; fi -if test $use_openexr_half = yes ; then { - AC_MSG_RESULT([ ** Using OpenEXR Half.]) - CONFIG_CFLAGS="$CONFIG_CFLAGS -DUSE_HALF_TYPE" -} ; fi +AM_CONDITIONAL(WITH_OPENEXR, test $with_openexr = yes) # JPEG CHECK (commandline switch) ------------------------ @@ -664,7 +645,6 @@ OpenGL ---------------------------> $with_opengl OpenCL ---------------------------> $with_opencl libdv ----------------------------> $with_libdv OpenEXR --------------------------> $with_openexr -Using OpenEXR's \"half\" type ----> $use_openexr_half "'$'"CXX -----------------------------> '$CXX' "'$'"CXXFLAGS ------------------------> '$CXXFLAGS' diff --git a/synfig-core/src/modules/mod_openexr/mptr_openexr.cpp b/synfig-core/src/modules/mod_openexr/mptr_openexr.cpp index 8eed13d..083b46e 100644 --- a/synfig-core/src/modules/mod_openexr/mptr_openexr.cpp +++ b/synfig-core/src/modules/mod_openexr/mptr_openexr.cpp @@ -77,13 +77,6 @@ exr_mptr::get_frame(synfig::Surface &out_surface, const synfig::RendDesc &/*rend //int dx = in.dataWindow().min.x; //int dy = in.dataWindow().min.y; -#ifdef USE_HALF_TYPE - out_surface.set_wh(w,h); - in.setFrameBuffer (reinterpret_cast(out_surface[0]), 1, w); - - in.readPixels (in.dataWindow().min.y, in.dataWindow().max.y); - -#else etl::surface in_surface; in_surface.set_wh(w,h); in.setFrameBuffer (reinterpret_cast(in_surface[0]), 1, w); @@ -103,7 +96,6 @@ exr_mptr::get_frame(synfig::Surface &out_surface, const synfig::RendDesc &/*rend color.set_b(rgba.b); color.set_a(rgba.a); } -#endif } catch (const std::exception& e) { diff --git a/synfig-core/src/modules/mod_openexr/trgt_openexr.cpp b/synfig-core/src/modules/mod_openexr/trgt_openexr.cpp index 9f1ac69..343537e 100644 --- a/synfig-core/src/modules/mod_openexr/trgt_openexr.cpp +++ b/synfig-core/src/modules/mod_openexr/trgt_openexr.cpp @@ -67,11 +67,8 @@ exr_trgt::exr_trgt(const char *Filename, const synfig::TargetParam ¶ms): scanline(), filename(Filename), exr_file(NULL), - buffer(NULL) -#ifndef USE_HALF_TYPE - , + buffer(NULL), buffer_color(NULL) -#endif { // OpenEXR uses linear gamma gamma().set_gamma(1.0); @@ -80,13 +77,9 @@ exr_trgt::exr_trgt(const char *Filename, const synfig::TargetParam ¶ms): exr_trgt::~exr_trgt() { - if(exr_file) - delete exr_file; - + if(exr_file) delete exr_file; if(buffer) delete [] buffer; -#ifndef USE_HALF_TYPE if(buffer_color) delete [] buffer_color; -#endif } bool @@ -125,10 +118,8 @@ exr_trgt::start_frame(synfig::ProgressCallback *cb) if(cb)cb->task(filename); } exr_file=new Imf::RgbaOutputFile(frame_name.c_str(),w,h,Imf::WRITE_RGBA,desc.get_pixel_aspect()); -#ifndef USE_HALF_TYPE if(buffer_color) delete [] buffer_color; buffer_color=new Color[w]; -#endif //if(buffer) delete [] buffer; //buffer=new Imf::Rgba[w]; out_surface.set_wh(w,h); @@ -156,12 +147,7 @@ Color * exr_trgt::start_scanline(int i) { scanline=i; -#ifndef USE_HALF_TYPE return reinterpret_cast(buffer_color); -#else - return reinterpret_cast(out_surface[scanline]); -// return reinterpret_cast(buffer); -#endif } bool @@ -170,7 +156,6 @@ exr_trgt::end_scanline() if(!ready()) return false; -#ifndef USE_HALF_TYPE int i; for(i=0;isetFrameBuffer(buffer,1,desc.get_w()); //exr_file->writePixels(1); diff --git a/synfig-core/src/modules/mod_openexr/trgt_openexr.h b/synfig-core/src/modules/mod_openexr/trgt_openexr.h index 461cfda..745f597 100644 --- a/synfig-core/src/modules/mod_openexr/trgt_openexr.h +++ b/synfig-core/src/modules/mod_openexr/trgt_openexr.h @@ -54,9 +54,7 @@ private: Imf::RgbaOutputFile *exr_file; Imf::Rgba *buffer; etl::surface out_surface; -#ifndef USE_HALF_TYPE synfig::Color *buffer_color; -#endif bool ready(); synfig::String sequence_separator; diff --git a/synfig-core/src/synfig/color.h b/synfig-core/src/synfig/color.h index fa57481..cc8a79e 100644 --- a/synfig-core/src/synfig/color.h +++ b/synfig-core/src/synfig/color.h @@ -55,21 +55,9 @@ inline CairoColor::CairoColor(const CairoColorAccumulator& c) } -#ifdef USE_HALF_TYPE -#include - -namespace synfig { -inline Color::Color(const ColorAccumulator& c): - a_(c.a_), - r_(c.r_), - g_(c.g_), - b_(c.b_) { } -} -#else namespace synfig { typedef Color ColorAccumulator; } -#endif #include diff --git a/synfig-core/src/synfig/color/color.h b/synfig-core/src/synfig/color/color.h index 021204f..ce4e991 100644 --- a/synfig-core/src/synfig/color/color.h +++ b/synfig-core/src/synfig/color/color.h @@ -98,22 +98,6 @@ public: //! Convert from CairoColor to Color inline Color(const CairoColor& c); -#ifdef USE_HALF_TYPE - friend class ColorAccumulator; - //! Convert constructor - inline Color(const ColorAccumulator& c); -#endif - - //! Copy constructor - //Color(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); } - - /*const Color &operator=(const value_type &i) - { - r_ = g_ = b_ = a_ = i; - return *this; - }*/ - //Color& operator=(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); return *this; } - //! Returns the RED component const value_type& get_r()const { return r_; } @@ -345,23 +329,6 @@ public: //! a blending method is considered 'straight' if transparent pixels in the upper layer can affect the result of the blend static bool is_straight(BlendMethod x) { return BLEND_METHODS_STRAIGHT & (1 << x); } - -/*protected: - - value_type& operator[](const int i) - { - assert(i>=0); - assert(i<(signed)(sizeof(Color)/sizeof(value_type))); - return (&r_)[i]; - } - - const value_type& operator[](const int i)const - { - assert(i>=0); - assert(i<(signed)(sizeof(Color)/sizeof(value_type))); - return (&r_)[i]; - } -*/ }; // END of class Color } // synfig namespace diff --git a/synfig-core/src/synfig/color/color.hpp b/synfig-core/src/synfig/color/color.hpp index 6832b52..e210197 100644 --- a/synfig-core/src/synfig/color/color.hpp +++ b/synfig-core/src/synfig/color/color.hpp @@ -35,9 +35,6 @@ #include -#ifdef USE_HALF_TYPE -#include -#endif #ifdef USING_PCH # include "pch.h" #else @@ -166,23 +163,6 @@ Color::Color(const Color& c): b_(c.b_), a_(c.a_) { } -#ifdef USE_HALF_TYPE - friend class ColorAccumulator; - //! Convert constructor - Color(const ColorAccumulator& c); -#endif - - //! Copy constructor - //Color(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); } - - /*const Color &operator=(const value_type &i) - { - r_ = g_ = b_ = a_ = i; - return *this; - }*/ - //Color& operator=(const Color &c) { memcpy((void*)this, (const void*)&c, sizeof(Color)); return *this; } - - const String Color::get_hex()const { return String(real2hex(r_) + real2hex(g_) + real2hex(b_)); @@ -313,24 +293,6 @@ Color Color::YUV(const float& y, const float& s, const Angle& theta, const value { return Color().set_yuv(y,s,theta).set_a(a); } - -/*protected: - - value_type& operator[](const int i) - { - assert(i>=0); - assert(i<(signed)(sizeof(Color)/sizeof(value_type))); - return (&r_)[i]; - } - - const value_type& operator[](const int i)const - { - assert(i>=0); - assert(i<(signed)(sizeof(Color)/sizeof(value_type))); - return (&r_)[i]; - } -*/ - } // synfig namespace #endif // __SYNFIG_COLOR_COLOR_HPP diff --git a/synfig-core/src/synfig/color/common.h b/synfig-core/src/synfig/color/common.h index 4cfe415..1b39fac 100644 --- a/synfig-core/src/synfig/color/common.h +++ b/synfig-core/src/synfig/color/common.h @@ -36,10 +36,6 @@ #include #include -#ifdef USE_HALF_TYPE -#include -#endif - /* === M A C R O S ========================================================= */ #define use_colorspace_gamma() App::use_colorspace_gamma @@ -49,11 +45,7 @@ namespace synfig { -#ifdef USE_HALF_TYPE -typedef half ColorReal; -#else typedef float ColorReal; -#endif static const float EncodeYUV[3][3]= { diff --git a/synfig-core/src/synfig/node.cpp b/synfig-core/src/synfig/node.cpp index 0f084d4..5ba9ecc 100644 --- a/synfig-core/src/synfig/node.cpp +++ b/synfig-core/src/synfig/node.cpp @@ -35,7 +35,7 @@ #include "node.h" // #include "nodebase.h" // this defines a bunch of sigc::slots that are never used -#include +#include #endif @@ -78,7 +78,7 @@ using namespace synfig; /* === G L O B A L S ======================================================= */ -typedef std::unordered_map GlobalNodeMap; +typedef std::map GlobalNodeMap; //! A map to store all the GUIDs with a pointer to the Node. static GlobalNodeMap* global_node_map_; diff --git a/synfig-core/src/synfig/value.h b/synfig-core/src/synfig/value.h index 4148eeb..1e49932 100644 --- a/synfig-core/src/synfig/value.h +++ b/synfig-core/src/synfig/value.h @@ -35,10 +35,6 @@ #include #include "interpolation.h" -#ifdef USE_HALF_TYPE -#include -#endif - #include /* === M A C R O S ========================================================= */