Skip to content

Commit

Permalink
Marking ready for a 2.1.0 release.
Browse files Browse the repository at this point in the history
Merge branch 'develop'

Conflicts:
	IlmBase/bootstrap
	OpenEXR/bootstrap
	PyIlmBase/bootstrap
  • Loading branch information
pstanczyk committed Nov 25, 2013
2 parents 34f5447 + e9093ef commit ecf35bd
Show file tree
Hide file tree
Showing 264 changed files with 5,980 additions and 3,610 deletions.
41 changes: 34 additions & 7 deletions Contrib/DtexToExr/DtexToExr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ void ConvertDtexFile( const std::string& i_fileName,

// Create the windows.
Imath::Box2i dataWindow( Imath::V2i( 0, 0 ),
Imath::V2i( outWidth, outHeight ) );
Imath::V2i( outWidth-1, outHeight-1 ) );
Imath::Box2i displayWindow = dataWindow;

// Create the header.
Expand All @@ -250,13 +250,13 @@ void ConvertDtexFile( const std::string& i_fileName,
NP[4], NP[5], NP[6], NP[7],
NP[8], NP[9], NP[10], NP[11],
NP[12], NP[13], NP[14], NP[15] );
header.insert( "NP", Imf::M44fAttribute( NPm ) );
addWorldToNDC( header, NPm );

Imath::M44f Nlm( Nl[0], Nl[1], Nl[2], Nl[3],
Nl[4], Nl[5], Nl[6], Nl[7],
Nl[8], Nl[9], Nl[10], Nl[11],
Nl[12], Nl[13], Nl[14], Nl[15] );
header.insert( "Nl", Imf::M44fAttribute( Nlm ) );
addWorldToCamera( header, Nlm );

// Add channels to the header.

Expand Down Expand Up @@ -399,8 +399,8 @@ void PrintUsage( const std::string& i_cmd, std::ostream& ostr )
<< "\n\t\t (multiply RGB data by Alpha, "
<< "implying that source data is unpremultiplied)"
<< std::endl << std::endl
<< "\t --sideways "
<< "\n\t\t (transpose width & height of image)"
<< "\t --sideways [true|false]"
<< "\n\t\t (rotate image 90 deg clockwise)"
<< std::endl << std::endl
<< "\t --compressionError <float> (DEFAULT: 0.0f) "
<< "\n\t\t (compress dtex data before converting to deep exr)"
Expand Down Expand Up @@ -450,7 +450,7 @@ void ParseArguments( int argc, char* argv[],
o_params.sideways = false;
o_params.discardZeroAlphaSamples = true;
o_params.doDeepBack = true;
o_params.doRGB = true;
o_params.doRGB = false;
o_params.compressionError = 0.0f;

// Eat up the args!
Expand Down Expand Up @@ -511,7 +511,34 @@ void ParseArguments( int argc, char* argv[],
}
else if ( arg == "--sideways" )
{
o_params.sideways = true;
if ( argi <= argc-1 )
{
std::cout << argv[argi+1] << std::endl;
if ( strcmp(argv[argi+1], "true") == 0 )
{
o_params.sideways = true;
++argi;
}
else if ( strcmp(argv[argi+1], "false") == 0 )
{
o_params.sideways = false;
++argi;
}
else if ( argv[argi+1][0] == '-' )
{
// found another arg. sideways has no parameter, which means sideways is on.
o_params.sideways = true;
}
else
{
// sideways must be followed by "true", "false", another arg, or nothing.
PXDU_THROW( "Invalid parameter for --sideways: " << argv[argi+1] );
}
}
else
{
o_params.sideways = true;
}
}
else if ( arg == "--compressionError" )
{
Expand Down
2 changes: 1 addition & 1 deletion Contrib/DtexToExr/PxBaseDeepHelper.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ void BaseDeepHelper<RGBA_T,DERIVED,SPAN>::processDeepBox

DeepOutRow<RGBA_T> outRow( width, m_params.doDeepBack, m_params.doRGB );

for ( int y = i_box.min.y; y <= i_box.max.y; ++y )
for ( int y = i_box.max.y; y >= i_box.min.y; --y )
{
outRow.clear();

Expand Down
3 changes: 3 additions & 0 deletions Contrib/DtexToExr/PxDeepUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,11 @@
#include <half.h>
#include <math.h>
#include <float.h>
#include <cmath>
#include <sys/types.h>

using std::isfinite;

namespace PxDeep {

//-*****************************************************************************
Expand Down
91 changes: 73 additions & 18 deletions IlmBase/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,24 @@
# [email protected]
CMAKE_MINIMUM_REQUIRED(VERSION 2.8)

PROJECT ( ILMBase )
PROJECT ( ilmbase )

ENABLE_TESTING()

SET(CPACK_PACKAGE_VERSION_MAJOR "2")
SET(CPACK_PACKAGE_VERSION_MINOR "1")
SET(CPACK_PACKAGE_VERSION_PATCH "0")
SET(CPACK_SOURCE_GENERATOR "TGZ")
set(CPACK_SOURCE_PACKAGE_FILE_NAME
"${CMAKE_PROJECT_NAME}-${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}"
)
set(CPACK_SOURCE_IGNORE_FILES
"/.git*;/.cvs*;${CPACK_SOURCE_IGNORE_FILES}")
INCLUDE ( CPack )


# Allow the developer to select if Dynamic or Static libraries are built
OPTION (BUILD_SHARED_LIBS "Build Shared Libraries" ON)

IF ( NOT WIN32)
ADD_DEFINITIONS ( -pthread )
Expand Down Expand Up @@ -59,6 +76,16 @@ MACRO(GET_TARGET_PROPERTY_WITH_DEFAULT _variable _target _property _default_valu
INSTALL( FILES ${_laname} DESTINATION ${CMAKE_INSTALL_PREFIX}${_install_DIR})
ENDMACRO(CREATE_LIBTOOL_FILE)

SET (LIB_TYPE STATIC)
IF (BUILD_SHARED_LIBS)
# User wants to build Dynamic Libraries, so change the LIB_TYPE variable to CMake keyword 'SHARED'
SET (LIB_TYPE SHARED)
IF (WIN32)
ADD_DEFINITIONS(-DOPENEXR_DLL)
ENDIF ()
ENDIF (BUILD_SHARED_LIBS)


ADD_SUBDIRECTORY ( Half )
ADD_SUBDIRECTORY ( Iex )
ADD_SUBDIRECTORY ( IexMath )
Expand All @@ -70,36 +97,65 @@ IF (WIN32)
DESTINATION ${CMAKE_SOURCE_DIR}/config
)
ELSE ()
FILE ( WRITE ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define HAVE_PTHREAD 1\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define HAVE_POSIX_SEMAPHORES 1\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_VERSION_STRING \"2.0.0\"\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_PACKAGE_STRING \"IlmBase 2.0.0\"\n" )
IF (APPLE)
FILE ( WRITE ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define HAVE_PTHREAD 1\n" )
ELSE ()
FILE ( WRITE ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define HAVE_PTHREAD 1\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_HAVE_LARGE_STACK 1\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define HAVE_POSIX_SEMAPHORES 1\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_HAVE_CONTROL_REGISTER_SUPPORT 1\n")
ENDIF ()
ENDIF ()

FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_INTERNAL_NAMESPACE_CUSTOM 1\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define IMATH_INTERNAL_NAMESPACE Imath_${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define IEX_INTERNAL_NAMESPACE Iex_${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMTHREAD_INTERNAL_NAMESPACE IlmThread_${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define IMATH_NAMESPACE Imath\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define IEX_NAMESPACE Iex\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMTHREAD_NAMESPACE IlmThread\n")
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_VERSION_STRING \"${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\"\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_PACKAGE_STRING \"IlmBase ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}\"\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_VERSION_MAJOR ${CPACK_PACKAGE_VERSION_MAJOR}\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_VERSION_MINOR ${CPACK_PACKAGE_VERSION_MINOR}\n" )
FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "#define ILMBASE_VERSION_PATCH ${CPACK_PACKAGE_VERSION_PATCH}\n" )

FILE ( APPEND ${CMAKE_SOURCE_DIR}/config/IlmBaseConfig.h "
// Version as a single hex number, e.g. 0x01000300 == 1.0.3
#define ILMBASE_VERSION_HEX ((ILMBASE_VERSION_MAJOR << 24) | \\
(ILMBASE_VERSION_MINOR << 16) | \\
(ILMBASE_VERSION_PATCH << 8))
")


SET_TARGET_PROPERTIES ( Half
PROPERTIES
VERSION 10.0.0
SOVERSION 10
VERSION 11.0.0
SOVERSION 11
)
SET_TARGET_PROPERTIES ( Iex
PROPERTIES
VERSION 10.0.0
SOVERSION 10
VERSION 11.0.0
SOVERSION 11
OUTPUT_NAME "Iex-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}"
)
SET_TARGET_PROPERTIES ( Imath
PROPERTIES
VERSION 10.0.0
SOVERSION 10
VERSION 11.0.0
SOVERSION 11
OUTPUT_NAME "Imath-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}"
)
SET_TARGET_PROPERTIES ( IlmThread
PROPERTIES
VERSION 10.0.0
SOVERSION 10
VERSION 11.0.0
SOVERSION 11
OUTPUT_NAME "IlmThread-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}"
)
SET_TARGET_PROPERTIES ( IexMath
PROPERTIES
VERSION 10.0.0
SOVERSION 10
VERSION 11.0.0
SOVERSION 11
OUTPUT_NAME "IexMath-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR}"
)

IF ( NOT WIN32 )
Expand Down Expand Up @@ -133,9 +189,8 @@ OpenEXR_includedir=\${prefix}/include/OpenEXR
Name: IlmBase
Description: Base math and exception libraries
Version: 1.1.0
Libs: -L\${libdir} -lImath -lIexMath -lHalf -lIex -lIlmThread -pthread
Cflags: -pthread -I\${OpenEXR_includedir}
Version: ${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}
Libs: -L\${libdir} -lImath-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR} -lIexMath-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR} -lHalf -lIex-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR} -lIlmThread-${CPACK_PACKAGE_VERSION_MAJOR}_${CPACK_PACKAGE_VERSION_MINOR} -pthreadCflags: -pthread -I\${OpenEXR_includedir}
")

INSTALL ( FILES
Expand Down
4 changes: 4 additions & 0 deletions IlmBase/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
Version 2.x.x
* Bumped version to track OpenEXR
(Piotr Stanczyk)

Version 2.0.1
* Bumped version to track OpenEXR
(Piotr Stanczyk)
Expand Down
7 changes: 6 additions & 1 deletion IlmBase/Half/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,11 @@ SET_SOURCE_FILES_PROPERTIES(
${CMAKE_CURRENT_SOURCE_DIR}/toFloat.h
)

ADD_LIBRARY ( Half STATIC
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DHALF_EXPORTS)
ENDIF()

ADD_LIBRARY ( Half ${LIB_TYPE}
half.cpp
)

Expand All @@ -48,6 +52,7 @@ INSTALL ( TARGETS
INSTALL ( FILES
half.h
halfFunction.h
halfExport.h
halfLimits.h
DESTINATION
include/OpenEXR
Expand Down
32 changes: 10 additions & 22 deletions IlmBase/Half/halfExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,16 @@
// This copyright notice does not imply publication.
//

#if defined(PLATFORM_WINDOWS)
# if defined(PLATFORM_BUILD_STATIC)
# define PLATFORM_EXPORT_DEFINITION
# define PLATFORM_IMPORT_DEFINITION
# else
# define PLATFORM_EXPORT_DEFINITION __declspec(dllexport)
# define PLATFORM_IMPORT_DEFINITION __declspec(dllimport)
# endif
#else // linux/macos
# if defined(PLATFORM_VISIBILITY_AVAILABLE)
# define PLATFORM_EXPORT_DEFINITION __attribute__((visibility("default")))
# define PLATFORM_IMPORT_DEFINITION
# else
# define PLATFORM_EXPORT_DEFINITION
# define PLATFORM_IMPORT_DEFINITION
# endif
#endif

#if defined(HALF_EXPORTS) // create library
# define HALF_EXPORT PLATFORM_EXPORT_DEFINITION
#else // use library
# define HALF_EXPORT PLATFORM_IMPORT_DEFINITION
#if defined(OPENEXR_DLL)
#if defined(HALF_EXPORTS)
#define HALF_EXPORT __declspec(dllexport)
#else
#define HALF_EXPORT __declspec(dllimport)
#endif
#define HALF_EXPORT_CONST
#else
#define HALF_EXPORT
#define HALF_EXPORT_CONST const
#endif

#endif // #ifndef HALFEXPORT_H
Expand Down
7 changes: 6 additions & 1 deletion IlmBase/Iex/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# [email protected]

ADD_LIBRARY ( Iex STATIC
IF(BUILD_SHARED_LIBS)
ADD_DEFINITIONS(-DIEX_EXPORTS)
ENDIF()

ADD_LIBRARY ( Iex ${LIB_TYPE}
IexBaseExc.cpp
IexThrowErrnoExc.cpp
)


INSTALL ( TARGETS
Iex
DESTINATION
Expand Down
6 changes: 5 additions & 1 deletion IlmBase/Iex/IexBaseExc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
#include <windows.h>
#endif

#include <stdlib.h>

IEX_INTERNAL_NAMESPACE_SOURCE_ENTER


Expand Down Expand Up @@ -141,12 +143,14 @@ void
iex_debugTrap()
{
if (0 != getenv("IEXDEBUGTHROW"))
DebugBreak();
::DebugBreak();
}
#else
void
iex_debugTrap()
{
// how to in Linux?
if (0 != ::getenv("IEXDEBUGTHROW"))
__builtin_trap();
}
#endif
33 changes: 10 additions & 23 deletions IlmBase/Iex/IexExport.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,29 +35,16 @@
//
///////////////////////////////////////////////////////////////////////////


#if defined(PLATFORM_WINDOWS)
# if defined(PLATFORM_BUILD_STATIC)
# define IEX_EXPORT_DEFINITION
# define IEX_IMPORT_DEFINITION
# else
# define IEX_EXPORT_DEFINITION __declspec(dllexport)
# define IEX_IMPORT_DEFINITION __declspec(dllimport)
# endif
#else // linux/macos
# if defined(PLATFORM_VISIBILITY_AVAILABLE)
# define IEX_EXPORT_DEFINITION __attribute__((visibility("default")))
# define IEX_IMPORT_DEFINITION
# else
# define IEX_EXPORT_DEFINITION
# define IEX_IMPORT_DEFINITION
# endif
#endif

#if defined(IEX_EXPORTS) // create library
# define IEX_EXPORT IEX_EXPORT_DEFINITION
#else // use library
# define IEX_EXPORT IEX_IMPORT_DEFINITION
#if defined(OPENEXR_DLL)
#if defined(IEX_EXPORTS)
#define IEX_EXPORT __declspec(dllexport)
#else
#define IEX_EXPORT __declspec(dllimport)
#endif
#define IEX_EXPORT_CONST
#else
#define IEX_EXPORT
#define IEX_EXPORT_CONST const
#endif

#endif // #ifndef IEXEXPORT_H
Expand Down
Loading

0 comments on commit ecf35bd

Please sign in to comment.