?????????? ????????? - ??????????????? - /home/agenciai/public_html/cd38d8/OpenEXR.zip
???????
PK �!�[��� � OpenEXRConfig.cmakenu �[��� ####### Expanded from @PACKAGE_INIT@ by configure_package_config_file() ####### ####### Any changes to this file will be overwritten by the next CMake run #### ####### The input file was OpenEXRConfig.cmake.in ######## get_filename_component(PACKAGE_PREFIX_DIR "${CMAKE_CURRENT_LIST_DIR}/../../../" ABSOLUTE) # Use original install prefix when loaded through a "/usr move" # cross-prefix symbolic link such as /lib -> /usr/lib. get_filename_component(_realCurr "${CMAKE_CURRENT_LIST_DIR}" REALPATH) get_filename_component(_realOrig "/usr/lib64/cmake/OpenEXR" REALPATH) if(_realCurr STREQUAL _realOrig) set(PACKAGE_PREFIX_DIR "/usr") endif() unset(_realOrig) unset(_realCurr) macro(set_and_check _var _file) set(${_var} "${_file}") if(NOT EXISTS "${_file}") message(FATAL_ERROR "File or directory ${_file} referenced by variable ${_var} does not exist !") endif() endmacro() macro(check_required_components _NAME) foreach(comp ${${_NAME}_FIND_COMPONENTS}) if(NOT ${_NAME}_${comp}_FOUND) if(${_NAME}_FIND_REQUIRED_${comp}) set(${_NAME}_FOUND FALSE) endif() endif() endforeach() endmacro() #################################################################################### include(CMakeFindDependencyMacro) if (ON) find_dependency(Threads REQUIRED) endif() find_dependency(ZLIB REQUIRED) find_dependency(Imath REQUIRED) include("${CMAKE_CURRENT_LIST_DIR}/OpenEXRTargets.cmake") check_required_components("OpenEXR") PK �!�[f� c� � OpenEXRTargets.cmakenu �[��� # Generated by CMake if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.8) message(FATAL_ERROR "CMake >= 2.8.0 required") endif() if(CMAKE_VERSION VERSION_LESS "2.8.3") message(FATAL_ERROR "CMake >= 2.8.3 required") endif() cmake_policy(PUSH) cmake_policy(VERSION 2.8.3...3.24) #---------------------------------------------------------------- # Generated CMake target import file. #---------------------------------------------------------------- # Commands may need to know the format version. set(CMAKE_IMPORT_FILE_VERSION 1) # Protect against multiple inclusion, which would fail when already imported targets are added once more. set(_cmake_targets_defined "") set(_cmake_targets_not_defined "") set(_cmake_expected_targets "") foreach(_cmake_expected_target IN ITEMS OpenEXR::OpenEXRConfig OpenEXR::IexConfig OpenEXR::IlmThreadConfig OpenEXR::Iex OpenEXR::IlmThread OpenEXR::OpenEXRCore OpenEXR::OpenEXR OpenEXR::OpenEXRUtil) list(APPEND _cmake_expected_targets "${_cmake_expected_target}") if(TARGET "${_cmake_expected_target}") list(APPEND _cmake_targets_defined "${_cmake_expected_target}") else() list(APPEND _cmake_targets_not_defined "${_cmake_expected_target}") endif() endforeach() unset(_cmake_expected_target) if(_cmake_targets_defined STREQUAL _cmake_expected_targets) unset(_cmake_targets_defined) unset(_cmake_targets_not_defined) unset(_cmake_expected_targets) unset(CMAKE_IMPORT_FILE_VERSION) cmake_policy(POP) return() endif() if(NOT _cmake_targets_defined STREQUAL "") string(REPLACE ";" ", " _cmake_targets_defined_text "${_cmake_targets_defined}") string(REPLACE ";" ", " _cmake_targets_not_defined_text "${_cmake_targets_not_defined}") message(FATAL_ERROR "Some (but not all) targets in this export set were already defined.\nTargets Defined: ${_cmake_targets_defined_text}\nTargets not yet defined: ${_cmake_targets_not_defined_text}\n") endif() unset(_cmake_targets_defined) unset(_cmake_targets_not_defined) unset(_cmake_expected_targets) # Compute the installation prefix relative to this file. get_filename_component(_IMPORT_PREFIX "${CMAKE_CURRENT_LIST_FILE}" PATH) # Use original install prefix when loaded through a # cross-prefix symbolic link such as /lib -> /usr/lib. get_filename_component(_realCurr "${_IMPORT_PREFIX}" REALPATH) get_filename_component(_realOrig "/usr/lib64/cmake/OpenEXR" REALPATH) if(_realCurr STREQUAL _realOrig) set(_IMPORT_PREFIX "/usr/lib64/cmake/OpenEXR") endif() unset(_realOrig) unset(_realCurr) get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) get_filename_component(_IMPORT_PREFIX "${_IMPORT_PREFIX}" PATH) if(_IMPORT_PREFIX STREQUAL "/") set(_IMPORT_PREFIX "") endif() # Create imported target OpenEXR::OpenEXRConfig add_library(OpenEXR::OpenEXRConfig INTERFACE IMPORTED) set_target_properties(OpenEXR::OpenEXRConfig PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/OpenEXR" ) # Create imported target OpenEXR::IexConfig add_library(OpenEXR::IexConfig INTERFACE IMPORTED) set_target_properties(OpenEXR::IexConfig PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/OpenEXR" ) # Create imported target OpenEXR::IlmThreadConfig add_library(OpenEXR::IlmThreadConfig INTERFACE IMPORTED) set_target_properties(OpenEXR::IlmThreadConfig PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include;${_IMPORT_PREFIX}/include/OpenEXR" ) # Create imported target OpenEXR::Iex add_library(OpenEXR::Iex SHARED IMPORTED) set_target_properties(OpenEXR::Iex PROPERTIES INTERFACE_COMPILE_FEATURES "cxx_std_11" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;OpenEXR::IlmThreadConfig" ) # Create imported target OpenEXR::IlmThread add_library(OpenEXR::IlmThread SHARED IMPORTED) set_target_properties(OpenEXR::IlmThread PROPERTIES INTERFACE_COMPILE_FEATURES "cxx_std_11" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;OpenEXR::IlmThreadConfig;OpenEXR::Iex;Threads::Threads" ) # Create imported target OpenEXR::OpenEXRCore add_library(OpenEXR::OpenEXRCore SHARED IMPORTED) set_target_properties(OpenEXR::OpenEXRCore PROPERTIES INTERFACE_COMPILE_FEATURES "cxx_std_11" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;ZLIB::ZLIB" ) # Create imported target OpenEXR::OpenEXR add_library(OpenEXR::OpenEXR SHARED IMPORTED) set_target_properties(OpenEXR::OpenEXR PROPERTIES INTERFACE_COMPILE_FEATURES "cxx_std_11" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;Imath::Imath;OpenEXR::IlmThreadConfig;OpenEXR::Iex;OpenEXR::IlmThread;ZLIB::ZLIB" ) # Create imported target OpenEXR::OpenEXRUtil add_library(OpenEXR::OpenEXRUtil SHARED IMPORTED) set_target_properties(OpenEXR::OpenEXRUtil PROPERTIES INTERFACE_COMPILE_FEATURES "cxx_std_11" INTERFACE_INCLUDE_DIRECTORIES "${_IMPORT_PREFIX}/include" INTERFACE_LINK_LIBRARIES "OpenEXR::IlmThreadConfig;OpenEXR::OpenEXR" ) if(CMAKE_VERSION VERSION_LESS 3.0.0) message(FATAL_ERROR "This file relies on consumers using CMake 3.0.0 or greater.") endif() # Load information for each installed configuration. file(GLOB _cmake_config_files "${CMAKE_CURRENT_LIST_DIR}/OpenEXRTargets-*.cmake") foreach(_cmake_config_file IN LISTS _cmake_config_files) include("${_cmake_config_file}") endforeach() unset(_cmake_config_file) unset(_cmake_config_files) # Cleanup temporary variables. set(_IMPORT_PREFIX) # Loop over all imported files and verify that they actually exist foreach(_cmake_target IN LISTS _cmake_import_check_targets) foreach(_cmake_file IN LISTS "_cmake_import_check_files_for_${_cmake_target}") if(NOT EXISTS "${_cmake_file}") message(FATAL_ERROR "The imported target \"${_cmake_target}\" references the file \"${_cmake_file}\" but this file does not exist. Possible reasons include: * The file was deleted, renamed, or moved to another location. * An install or uninstall procedure did not complete successfully. * The installation package was faulty and contained \"${CMAKE_CURRENT_LIST_FILE}\" but not all the files it references. ") endif() endforeach() unset(_cmake_file) unset("_cmake_import_check_files_for_${_cmake_target}") endforeach() unset(_cmake_target) unset(_cmake_import_check_targets) # This file does not depend on other imported targets which have # been exported from the same project but in a separate export set. # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) cmake_policy(POP) PK �!�[C�@�� � OpenEXRTargets-release.cmakenu �[��� #---------------------------------------------------------------- # Generated CMake target import file for configuration "Release". #---------------------------------------------------------------- # Commands may need to know the format version. set(CMAKE_IMPORT_FILE_VERSION 1) # Import target "OpenEXR::Iex" for configuration "Release" set_property(TARGET OpenEXR::Iex APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(OpenEXR::Iex PROPERTIES IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib64/libIex-3_1.so.30.1.0" IMPORTED_SONAME_RELEASE "libIex-3_1.so.30" ) list(APPEND _cmake_import_check_targets OpenEXR::Iex ) list(APPEND _cmake_import_check_files_for_OpenEXR::Iex "${_IMPORT_PREFIX}/lib64/libIex-3_1.so.30.1.0" ) # Import target "OpenEXR::IlmThread" for configuration "Release" set_property(TARGET OpenEXR::IlmThread APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(OpenEXR::IlmThread PROPERTIES IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib64/libIlmThread-3_1.so.30.1.0" IMPORTED_SONAME_RELEASE "libIlmThread-3_1.so.30" ) list(APPEND _cmake_import_check_targets OpenEXR::IlmThread ) list(APPEND _cmake_import_check_files_for_OpenEXR::IlmThread "${_IMPORT_PREFIX}/lib64/libIlmThread-3_1.so.30.1.0" ) # Import target "OpenEXR::OpenEXRCore" for configuration "Release" set_property(TARGET OpenEXR::OpenEXRCore APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(OpenEXR::OpenEXRCore PROPERTIES IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib64/libOpenEXRCore-3_1.so.30.1.0" IMPORTED_SONAME_RELEASE "libOpenEXRCore-3_1.so.30" ) list(APPEND _cmake_import_check_targets OpenEXR::OpenEXRCore ) list(APPEND _cmake_import_check_files_for_OpenEXR::OpenEXRCore "${_IMPORT_PREFIX}/lib64/libOpenEXRCore-3_1.so.30.1.0" ) # Import target "OpenEXR::OpenEXR" for configuration "Release" set_property(TARGET OpenEXR::OpenEXR APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(OpenEXR::OpenEXR PROPERTIES IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib64/libOpenEXR-3_1.so.30.1.0" IMPORTED_SONAME_RELEASE "libOpenEXR-3_1.so.30" ) list(APPEND _cmake_import_check_targets OpenEXR::OpenEXR ) list(APPEND _cmake_import_check_files_for_OpenEXR::OpenEXR "${_IMPORT_PREFIX}/lib64/libOpenEXR-3_1.so.30.1.0" ) # Import target "OpenEXR::OpenEXRUtil" for configuration "Release" set_property(TARGET OpenEXR::OpenEXRUtil APPEND PROPERTY IMPORTED_CONFIGURATIONS RELEASE) set_target_properties(OpenEXR::OpenEXRUtil PROPERTIES IMPORTED_LOCATION_RELEASE "${_IMPORT_PREFIX}/lib64/libOpenEXRUtil-3_1.so.30.1.0" IMPORTED_SONAME_RELEASE "libOpenEXRUtil-3_1.so.30" ) list(APPEND _cmake_import_check_targets OpenEXR::OpenEXRUtil ) list(APPEND _cmake_import_check_files_for_OpenEXR::OpenEXRUtil "${_IMPORT_PREFIX}/lib64/libOpenEXRUtil-3_1.so.30.1.0" ) # Commands beyond this point should not need to know the version. set(CMAKE_IMPORT_FILE_VERSION) PK �!�[��)�� � OpenEXRConfigVersion.cmakenu �[��� # This is a basic version file for the Config-mode of find_package(). # It is used by write_basic_package_version_file() as input file for configure_file() # to create a version-file which can be installed along a config.cmake file. # # The created file sets PACKAGE_VERSION_EXACT if the current version string and # the requested version string are exactly the same and it sets # PACKAGE_VERSION_COMPATIBLE if the current version is >= requested version, # but only if the requested major version is the same as the current one. # The variable CVF_VERSION must be set before calling configure_file(). set(PACKAGE_VERSION "3.1.1") if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION) set(PACKAGE_VERSION_COMPATIBLE FALSE) else() if("3.1.1" MATCHES "^([0-9]+)\\.") set(CVF_VERSION_MAJOR "${CMAKE_MATCH_1}") if(NOT CVF_VERSION_MAJOR VERSION_EQUAL 0) string(REGEX REPLACE "^0+" "" CVF_VERSION_MAJOR "${CVF_VERSION_MAJOR}") endif() else() set(CVF_VERSION_MAJOR "3.1.1") endif() if(PACKAGE_FIND_VERSION_RANGE) # both endpoints of the range must have the expected major version math (EXPR CVF_VERSION_MAJOR_NEXT "${CVF_VERSION_MAJOR} + 1") if (NOT PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX_MAJOR STREQUAL CVF_VERSION_MAJOR) OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND NOT PACKAGE_FIND_VERSION_MAX VERSION_LESS_EQUAL CVF_VERSION_MAJOR_NEXT))) set(PACKAGE_VERSION_COMPATIBLE FALSE) elseif(PACKAGE_FIND_VERSION_MIN_MAJOR STREQUAL CVF_VERSION_MAJOR AND ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS_EQUAL PACKAGE_FIND_VERSION_MAX) OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MAX))) set(PACKAGE_VERSION_COMPATIBLE TRUE) else() set(PACKAGE_VERSION_COMPATIBLE FALSE) endif() else() if(PACKAGE_FIND_VERSION_MAJOR STREQUAL CVF_VERSION_MAJOR) set(PACKAGE_VERSION_COMPATIBLE TRUE) else() set(PACKAGE_VERSION_COMPATIBLE FALSE) endif() if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION) set(PACKAGE_VERSION_EXACT TRUE) endif() endif() endif() # if the installed or the using project don't have CMAKE_SIZEOF_VOID_P set, ignore it: if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "" OR "8" STREQUAL "") return() endif() # check that the installed version has the same 32/64bit-ness as the one which is currently searching: if(NOT CMAKE_SIZEOF_VOID_P STREQUAL "8") math(EXPR installedBits "8 * 8") set(PACKAGE_VERSION "${PACKAGE_VERSION} (${installedBits}bit)") set(PACKAGE_VERSION_UNSUITABLE TRUE) endif() PK rM�[�L��Z Z ImfExport.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMFEXPORT_H #define INCLUDED_IMFEXPORT_H #include "OpenEXRConfig.h" /// \addtogroup ExportMacros /// @{ // are we making a DLL under windows (might be msvc or mingw or others) #if defined(OPENEXR_DLL) // when building as a DLL for windows, typical dllexport / import case // where we need to switch depending on whether we are compiling // internally or not # if defined(OPENEXR_EXPORTS) # define IMF_EXPORT __declspec(dllexport) // mingw needs the export when the extern is defined # if defined(__MINGW32__) # define IMF_EXPORT_EXTERN_TEMPLATE IMF_EXPORT # define IMF_EXPORT_TEMPLATE_INSTANCE // for mingw windows, we need to cause this to export the // typeinfo tables (but you don't need to have the // complementary import, because might be a local template too!) # define IMF_EXPORT_TEMPLATE_TYPE IMF_EXPORT # else // for normal msvc, need to export the actual instantiation in // the cpp code, and none of the others # define IMF_EXPORT_EXTERN_TEMPLATE # define IMF_EXPORT_TEMPLATE_INSTANCE IMF_EXPORT # define IMF_EXPORT_TEMPLATE_TYPE # endif # else // OPENEXR_EXPORTS # define IMF_EXPORT __declspec(dllimport) # define IMF_EXPORT_EXTERN_TEMPLATE IMF_EXPORT # define IMF_EXPORT_TEMPLATE_INSTANCE # define IMF_EXPORT_TEMPLATE_TYPE # endif // DLLs don't support these types of visibility controls, just leave them as empty # define IMF_EXPORT_TYPE # define IMF_EXPORT_ENUM # define IMF_HIDDEN #else // not an OPENEXR_DLL // just pass these through from the top level config # define IMF_EXPORT OPENEXR_EXPORT # define IMF_HIDDEN OPENEXR_HIDDEN # define IMF_EXPORT_ENUM OPENEXR_EXPORT_ENUM # define IMF_EXPORT_TYPE OPENEXR_EXPORT_TYPE # define IMF_EXPORT_TEMPLATE_TYPE OPENEXR_EXPORT_TEMPLATE_TYPE # define IMF_EXPORT_EXTERN_TEMPLATE OPENEXR_EXPORT_EXTERN_TEMPLATE # define IMF_EXPORT_TEMPLATE_INSTANCE OPENEXR_EXPORT_TEMPLATE_INSTANCE #endif // OPENEXR_DLL /// @} #endif // INCLUDED_IMFEXPORT_H PK rM�[�"�n[) [) ImfSampleCountChannel.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_SAMPLE_COUNT_CHANNEL_H #define INCLUDED_IMF_SAMPLE_COUNT_CHANNEL_H //---------------------------------------------------------------------------- // // class SampleCountChannel // // For an explanation of images, levels and channels, // see the comments in header file Image.h. // //---------------------------------------------------------------------------- #include "ImfUtilExport.h" #include "ImfImageChannel.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER class DeepImageLevel; // // Sample count channel for a deep image level: // // Each deep image level has a number of samples channel. For each // pixel location (x,y) within the data window of the level, the sample // count channel stores a single integer, n(x,y). A deep channel, c, // in the level as the sample count channel stores n(x,y) samples at // location (x,y) if // // x % c.xSampling() == 0 and y % c.ySampling() == 0. // // The deep channel stores no samples at location (x,y) if // // x % c.xSampling() != 0 or y % c.ySampling() != 0, // class IMFUTIL_EXPORT_TYPE SampleCountChannel : public ImageChannel { public: // // The OpenEXR pixel type of this channel (HALF, FLOAT or UINT). // IMFUTIL_EXPORT virtual PixelType pixelType () const; // // Construct an OpenEXR frame buffer slice for this channel. // This function is needed reading an image from an OpenEXR // file and for saving an image in an OpenEXR file. // IMFUTIL_EXPORT Slice slice () const; // // Access to the image level to which this channel belongs. // IMFUTIL_EXPORT DeepImageLevel & deepLevel (); IMFUTIL_EXPORT const DeepImageLevel & deepLevel () const; // // Access to n(x,y), without bounds checking. Accessing a location // outside the data window of the image level results in undefined // behavior. // IMFUTIL_EXPORT const unsigned int & operator () (int x, int y) const; // // Access to n(x,y), with bounds checking. Accessing a location outside // the data window of the image level throws an Iex::ArgExc exception. // IMFUTIL_EXPORT const unsigned int & at (int x, int y) const; // // Faster access to n(x,y) for all pixels in a single horizontal row of // the channel. Rows are numbered from 0 to pixelsPerColumn()-1, and // each row contains pixelsPerRow() values. // Access is not bounds checked; accessing out of bounds rows or pixels // results in undefined behavior. // IMFUTIL_EXPORT const unsigned int * row (int r) const; // // Change the sample counts in one or more pixels: // // set(x,y,m) sets n(x,y) to m. // // set(r,m) sets n(x,y) for all pixels in row r according to the // values in array m. The array must contain pixelsPerRow() // entries, and the row number must be in the range from 0 // to pixelsPerColumn()-1. // // clear() sets n(x,y) to 0 for all pixels within the data window // of the level. // // If the sample count for a pixel is increased, then new samples are // appended at the end of the sample list of each deep channel. The // new samples are initialized to zero. If the sample count in a pixel // is decreased, then sample list of each deep channel is truncated by // discarding samples at the end of the list. // // Access is bounds-checked; attempting to set the number of samples of // a pixel outside the data window throws an Iex::ArgExc exception. // // Memory allocation for the sample lists is not particularly clever; // repeatedly increasing and decreasing the number of samples in the // pixels of a level is likely to result in serious memory fragmentation. // // Setting the number of samples for one or more pixels may cause the // program to run out of memory. If this happens, the image is resized // to zero by zero pixels and an exception is thrown. Note that the // resizing operation deletes this sample count channel and the image // level to which it belongs. // IMFUTIL_EXPORT void set(int x, int y, unsigned int newNumSamples); IMFUTIL_EXPORT void set(int r, unsigned int newNumSamples[]); IMFUTIL_EXPORT void clear(); // // OpenEXR file reading support / make sample counts editable: // // beginEdit() frees all memory that has been allocated for samples // in the deep channels, and returns a pointer to an // array of pixelsPerRow() by pixelsPerColumn() sample // counts in row-major order. // // After beginEdit() returns, application code is // free to change the values in the sample count array. // In particular, the application can fill the array by // reading the sample counts from an OpenEXR file. // // However, since memory for the samples in the deep // channels has been freed, attempting to access any // sample in a deep channel results in undefined // behavior, most likely a program crash. // // endEdit() allocates new memory for all samples in the deep // channels of the layer, according to the current // sample counts, and sets the samples to zero. // // Application code must take make sure that each call to beginEdit() // is followed by a corresponding endEdit() call, even if an // exception occurs while the sample counts are acessed. In order to // do that, application code may want to create a temporary Edit // object instead of calling beginEdit() and endEdit() directly. // // Setting the number of samples for all pixels in the image may // cause the program to run out of memory. If this happens, the image // is resized to zero by zero pixels and an exception is thrown. // Note that the resizing operation deletes this sample count channel // and the image level to which it belongs. // IMFUTIL_EXPORT unsigned int * beginEdit(); IMFUTIL_EXPORT void endEdit(); class Edit { public: // // Constructor calls level->beginEdit(), // destructor calls level->endEdit(). // IMFUTIL_EXPORT Edit (SampleCountChannel& level); IMFUTIL_EXPORT ~Edit (); Edit (const Edit& other) = delete; Edit& operator = (const Edit& other) = delete; Edit (Edit&& other) = delete; Edit& operator = (Edit&& other) = delete; // // Access to the writable sample count array. // IMFUTIL_EXPORT unsigned int * sampleCounts () const; private: SampleCountChannel & _channel; unsigned int * _sampleCounts; }; // // Functions that support the implementation of deep image channels. // IMFUTIL_EXPORT const unsigned int * numSamples () const; IMFUTIL_EXPORT const unsigned int * sampleListSizes () const; IMFUTIL_EXPORT const size_t * sampleListPositions () const; IMFUTIL_EXPORT size_t sampleBufferSize () const; private: friend class DeepImageLevel; // // The constructor and destructor are not public because // image channels exist only as parts of a deep image level. // SampleCountChannel (DeepImageLevel &level); virtual ~SampleCountChannel(); virtual void resize (); void resetBasePointer (); unsigned int * _numSamples; // Array of per-pixel sample counts unsigned int * _base; // Base pointer for faster access // to entries in _numSamples unsigned int * _sampleListSizes; // Array of allocated sizes of // per-pixel sample lists size_t * _sampleListPositions; // Array of positions of per-pixel // sample lists within sample list // buffer size_t _totalNumSamples; // Sum of all entries in the // _numSamples array size_t _totalSamplesOccupied; // Total number of samples within // sample list buffer that have // either been allocated for sample // lists or lost to fragmentation size_t _sampleBufferSize; // Size of the sample list buffer. }; //----------------------------------------------------------------------------- // Implementation of templates and inline functions //----------------------------------------------------------------------------- inline SampleCountChannel::Edit::Edit (SampleCountChannel &channel): _channel (channel), _sampleCounts (channel.beginEdit()) { // empty } inline SampleCountChannel::Edit::~Edit () { _channel.endEdit(); } inline unsigned int * SampleCountChannel::Edit::sampleCounts () const { return _sampleCounts; } inline const unsigned int * SampleCountChannel::numSamples () const { return _numSamples; } inline const unsigned int * SampleCountChannel::sampleListSizes () const { return _sampleListSizes; } inline const size_t * SampleCountChannel::sampleListPositions () const { return _sampleListPositions; } inline size_t SampleCountChannel::sampleBufferSize () const { return _sampleBufferSize; } inline const unsigned int & SampleCountChannel::operator () (int x, int y) const { return _base[y * pixelsPerRow() + x]; } inline const unsigned int & SampleCountChannel::at (int x, int y) const { boundsCheck (x, y); return _base[y * pixelsPerRow() + x]; } inline const unsigned int * SampleCountChannel::row (int n) const { return _base + n * pixelsPerRow(); } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[~��@ @ ImfLineOrderAttribute.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_LINE_ORDER_ATTRIBUTE_H #define INCLUDED_IMF_LINE_ORDER_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class LineOrderAttribute // //----------------------------------------------------------------------------- #include "ImfExport.h" #include "ImfNamespace.h" #include "ImfAttribute.h" #include "ImfLineOrder.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER using LineOrderAttribute = TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::LineOrder>; #ifndef COMPILING_IMF_LINE_ORDER_ATTRIBUTE extern template class IMF_EXPORT_EXTERN_TEMPLATE TypedAttribute<OPENEXR_IMF_INTERNAL_NAMESPACE::LineOrder>; #endif OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[If�o o ImfImageChannelRenaming.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_IMAGE_CHANNEL_RENAMING_H #define INCLUDED_IMF_IMAGE_CHANNEL_RENAMING_H //---------------------------------------------------------------------------- // // typedef RenamingMap, // helper functions for image channel renaming. // //---------------------------------------------------------------------------- #include "ImfNamespace.h" #include <string> #include <map> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER // // Given a map from old channel names to new channel names, // rename the channels in an image or image level. // This function assumes that the channel old-to-new-names // map has already been checked for collisions. // typedef std::map <std::string, std::string> RenamingMap; template <class ChannelMap> inline void renameChannelsInMap (const RenamingMap &oldToNewNames, ChannelMap &channels) { ChannelMap renamedChannels; for (typename ChannelMap::const_iterator i = channels.begin(); i != channels.end(); ++i) { RenamingMap::const_iterator j = oldToNewNames.find (i->first); std::string newName = (j == oldToNewNames.end())? i->first: j->second; renamedChannels[newName] = i->second; } channels = renamedChannels; } OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[ �qD� � ImfBoxAttribute.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_BOX_ATTRIBUTE_H #define INCLUDED_IMF_BOX_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class Box2iAttribute // class Box2fAttribute // //----------------------------------------------------------------------------- #include "ImfExport.h" #include "ImfNamespace.h" #include "ImfAttribute.h" #include <ImathBox.h> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER using Box2iAttribute = TypedAttribute<IMATH_NAMESPACE::Box2i>; using Box2fAttribute = TypedAttribute<IMATH_NAMESPACE::Box2f>; #ifndef COMPILING_IMF_BOX_ATTRIBUTE extern template class IMF_EXPORT_EXTERN_TEMPLATE TypedAttribute<IMATH_NAMESPACE::Box2i>; extern template class IMF_EXPORT_EXTERN_TEMPLATE TypedAttribute<IMATH_NAMESPACE::Box2f>; #endif OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[a�� � ImfDoubleAttribute.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_DOUBLE_ATTRIBUTE_H #define INCLUDED_IMF_DOUBLE_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class DoubleAttribute // //----------------------------------------------------------------------------- #include "ImfAttribute.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<double> DoubleAttribute; #ifndef COMPILING_IMF_DOUBLE_ATTRIBUTE extern template class IMF_EXPORT_EXTERN_TEMPLATE TypedAttribute<double>; #endif OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[�aD�� � ImfDeepScanLineOutputFile.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_DEEP_SCAN_LINE_OUTPUT_FILE_H #define INCLUDED_IMF_DEEP_SCAN_LINE_OUTPUT_FILE_H //----------------------------------------------------------------------------- // // class DeepScanLineOutputFile // //----------------------------------------------------------------------------- #include "ImfHeader.h" #include "ImfFrameBuffer.h" #include "ImfThreading.h" #include "ImfGenericOutputFile.h" #include "ImfNamespace.h" #include "ImfForward.h" #include "ImfExport.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER struct PreviewRgba; class DeepScanLineOutputFile : public GenericOutputFile { public: //----------------------------------------------------------- // Constructor -- opens the file and writes the file header. // The file header is also copied into the DeepScanLineOutputFile // object, and can later be accessed via the header() method. // Destroying this DeepScanLineOutputFile object automatically closes // the file. // // numThreads determines the number of threads that will be // used to write the file (see ImfThreading.h). //----------------------------------------------------------- IMF_EXPORT DeepScanLineOutputFile (const char fileName[], const Header &header, int numThreads = globalThreadCount()); //------------------------------------------------------------ // Constructor -- attaches the new DeepScanLineOutputFile object // to a file that has already been opened, and writes the file header. // The file header is also copied into the DeepScanLineOutputFile // object, and can later be accessed via the header() method. // Destroying this DeepScanLineOutputFile object does not automatically // close the file. // // numThreads determines the number of threads that will be // used to write the file (see ImfThreading.h). //------------------------------------------------------------ IMF_EXPORT DeepScanLineOutputFile (OPENEXR_IMF_INTERNAL_NAMESPACE::OStream &os, const Header &header, int numThreads = globalThreadCount()); //------------------------------------------------- // Destructor // // Destroying the DeepScanLineOutputFile object // before writing all scan lines within the data // window results in an incomplete file. //------------------------------------------------- IMF_EXPORT virtual ~DeepScanLineOutputFile (); //------------------------ // Access to the file name //------------------------ IMF_EXPORT const char * fileName () const; //-------------------------- // Access to the file header //-------------------------- IMF_EXPORT const Header & header () const; //------------------------------------------------------- // Set the current frame buffer -- copies the FrameBuffer // object into the OutputFile object. // // The current frame buffer is the source of the pixel // data written to the file. The current frame buffer // must be set at least once before writePixels() is // called. The current frame buffer can be changed // after each call to writePixels. //------------------------------------------------------- IMF_EXPORT void setFrameBuffer (const DeepFrameBuffer &frameBuffer); //----------------------------------- // Access to the current frame buffer //----------------------------------- IMF_EXPORT const DeepFrameBuffer & frameBuffer () const; //------------------------------------------------------------------- // Write pixel data: // // writePixels(n) retrieves the next n scan lines worth of data from // the current frame buffer, starting with the scan line indicated by // currentScanLine(), and stores the data in the output file, and // progressing in the direction indicated by header.lineOrder(). // // To produce a complete and correct file, exactly m scan lines must // be written, where m is equal to // header().dataWindow().max.y - header().dataWindow().min.y + 1. //------------------------------------------------------------------- IMF_EXPORT void writePixels (int numScanLines = 1); //------------------------------------------------------------------ // Access to the current scan line: // // currentScanLine() returns the y coordinate of the first scan line // that will be read from the current frame buffer during the next // call to writePixels(). // // If header.lineOrder() == INCREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().min.y. After writing each scan line, // the current scan line is incremented by 1. // // If header.lineOrder() == DECREASING_Y: // // The current scan line before the first call to writePixels() // is header().dataWindow().max.y. After writing each scan line, // the current scan line is decremented by 1. // //------------------------------------------------------------------ IMF_EXPORT int currentScanLine () const; //-------------------------------------------------------------- // Shortcut to copy all pixels from an InputFile into this file, // without uncompressing and then recompressing the pixel data. // This file's header must be compatible with the InputFile's // header: The two header's "dataWindow", "compression", // "lineOrder" and "channels" attributes must be the same. //-------------------------------------------------------------- IMF_EXPORT void copyPixels (DeepScanLineInputFile &in); // -------------------------------------------------------------- // Shortcut to copy pixels from a given part of a multipart file // -------------------------------------------------------------- IMF_EXPORT void copyPixels (DeepScanLineInputPart &in); //-------------------------------------------------------------- // Updating the preview image: // // updatePreviewImage() supplies a new set of pixels for the // preview image attribute in the file's header. If the header // does not contain a preview image, updatePreviewImage() throws // an IEX_NAMESPACE::LogicExc. // // Note: updatePreviewImage() is necessary because images are // often stored in a file incrementally, a few scan lines at a // time, while the image is being generated. Since the preview // image is an attribute in the file's header, it gets stored in // the file as soon as the file is opened, but we may not know // what the preview image should look like until we have written // the last scan line of the main image. // //-------------------------------------------------------------- IMF_EXPORT void updatePreviewImage (const PreviewRgba newPixels[]); struct Data; private: //------------------------------------------------------------ // Constructor -- attaches the OutputStreamMutex to the // given one from MultiPartOutputFile. Set the previewPosition // and lineOffsetsPosition which have been acquired from // the constructor of MultiPartOutputFile as well. //------------------------------------------------------------ DeepScanLineOutputFile (const OutputPartData* part); DeepScanLineOutputFile (const DeepScanLineOutputFile &) = delete; DeepScanLineOutputFile & operator = (const DeepScanLineOutputFile &) = delete; DeepScanLineOutputFile (DeepScanLineOutputFile &&) = delete; DeepScanLineOutputFile & operator = (DeepScanLineOutputFile &&) = delete; void initialize (const Header &header); void initializeLineBuffer(); Data * _data; friend class MultiPartOutputFile; }; OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[��z� � ImfIntAttribute.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_INT_ATTRIBUTE_H #define INCLUDED_IMF_INT_ATTRIBUTE_H //----------------------------------------------------------------------------- // // class IntAttribute // //----------------------------------------------------------------------------- #include "ImfExport.h" #include "ImfNamespace.h" #include "ImfAttribute.h" OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER typedef TypedAttribute<int> IntAttribute; #ifndef COMPILING_IMF_INT_ATTRIBUTE extern template class IMF_EXPORT_EXTERN_TEMPLATE TypedAttribute<int>; #endif OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #endif PK rM�[ � �: �: ImfXdr.hnu �[��� // // SPDX-License-Identifier: BSD-3-Clause // Copyright (c) Contributors to the OpenEXR Project. // #ifndef INCLUDED_IMF_XDR_H #define INCLUDED_IMF_XDR_H //---------------------------------------------------------------------------- // // Xdr -- routines to convert data between the machine's native // format and a machine-independent external data representation: // // write<R> (T &o, S v); converts a value, v, of type S // into a machine-independent // representation and stores the // result in an output buffer, o. // // read<R> (T &i, S &v); reads the machine-independent // representation of a value of type // S from input buffer i, converts // the value into the machine's native // representation, and stores the result // in v. // // size<S>(); returns the size, in bytes, of the // machine-independent representation // of an object of type S. // // The write() and read() routines are templates; data can be written // to and read from any output or input buffer type T for which a helper // class, R, exits. Class R must define a method to store a char array // in a T, and a method to read a char array from a T: // // struct R // { // static void // writeChars (T &o, const char c[/*n*/], int n) // { // ... // Write c[0], c[1] ... c[n-1] to output buffer o. // } // // static void // readChars (T &i, char c[/*n*/], int n) // { // ... // Read n characters from input buffer i // // and copy them to c[0], c[1] ... c[n-1]. // } // }; // // Example - writing to and reading from iostreams: // // struct CharStreamIO // { // static void // writeChars (ostream &os, const char c[], int n) // { // os.write (c, n); // } // // static void // readChars (istream &is, char c[], int n) // { // is.read (c, n); // } // }; // // ... // // Xdr::write<CharStreamIO> (os, 3); // Xdr::write<CharStreamIO> (os, 5.0); // //---------------------------------------------------------------------------- #include "ImfNamespace.h" #include "IexMathExc.h" #include <half.h> #include <limits.h> #include <cstdint> OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER namespace Xdr { //------------------------------- // Write data to an output stream //------------------------------- template <class S, class T> void write (T &out, bool v); template <class S, class T> void write (T &out, char v); template <class S, class T> void write (T &out, signed char v); template <class S, class T> void write (T &out, unsigned char v); template <class S, class T> void write (T &out, signed short v); template <class S, class T> void write (T &out, unsigned short v); template <class S, class T> void write (T &out, signed int v); template <class S, class T> void write (T &out, unsigned int v); template <class S, class T> void write (T &out, int64_t v); template <class S, class T> void write (T &out, uint64_t v); template <class S, class T> void write (T &out, float v); template <class S, class T> void write (T &out, double v); template <class S, class T> void write (T &out, half v); template <class S, class T> void write (T &out, const char v[/*n*/], int n); // fixed-size char array template <class S, class T> void write (T &out, const char v[]); // zero-terminated string //----------------------------------------- // Append padding bytes to an output stream //----------------------------------------- template <class S, class T> void pad (T &out, int n); // write n padding bytes //------------------------------- // Read data from an input stream //------------------------------- template <class S, class T> void read (T &in, bool &v); template <class S, class T> void read (T &in, char &v); template <class S, class T> void read (T &in, signed char &v); template <class S, class T> void read (T &in, unsigned char &v); template <class S, class T> void read (T &in, signed short &v); template <class S, class T> void read (T &in, unsigned short &v); template <class S, class T> void read (T &in, signed int &v); template <class S, class T> void read (T &in, unsigned int &v); template <class S, class T> void read (T &in, int64_t &v); template <class S, class T> void read (T &in, uint64_t &v); template <class S, class T> void read (T &in, float &v); template <class S, class T> void read (T &in, double &v); template <class S, class T> void read (T &in, half &v); template <class S, class T> void read (T &in, char v[/*n*/], int n); // fixed-size char array template <class S, class T> void read (T &in, int n, char v[/*n*/]); // zero-terminated string //------------------------------------------- // Skip over padding bytes in an input stream //------------------------------------------- template <class S, class T> void skip (T &in, int n); // skip n padding bytes //-------------------------------------- // Size of the machine-independent // representation of an object of type S //-------------------------------------- template <class S> int size (); //--------------- // Implementation //--------------- template <class S, class T> inline void writeSignedChars (T &out, const signed char c[], int n) { S::writeChars (out, (const char *) c, n); } template <class S, class T> inline void writeUnsignedChars (T &out, const unsigned char c[], int n) { S::writeChars (out, (const char *) c, n); } template <class S, class T> inline void readSignedChars (T &in, signed char c[], int n) { S::readChars (in, (char *) c, n); } template <class S, class T> inline void readUnsignedChars (T &in, unsigned char c[], int n) { S::readChars (in, (char *) c, n); } template <class S, class T> inline void write (T &out, bool v) { char c = !!v; S::writeChars (out, &c, 1); } template <class S, class T> inline void write (T &out, char v) { S::writeChars (out, &v, 1); } template <class S, class T> inline void write (T &out, signed char v) { writeSignedChars<S> (out, &v, 1); } template <class S, class T> inline void write (T &out, unsigned char v) { writeUnsignedChars<S> (out, &v, 1); } template <class S, class T> void write (T &out, signed short v) { signed char b[2]; b[0] = (signed char) (v); b[1] = (signed char) (v >> 8); writeSignedChars<S> (out, b, 2); } template <class S, class T> void write (T &out, unsigned short v) { unsigned char b[2]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); writeUnsignedChars<S> (out, b, 2); } template <class S, class T> void write (T &out, signed int v) { signed char b[4]; b[0] = (signed char) (v); b[1] = (signed char) (v >> 8); b[2] = (signed char) (v >> 16); b[3] = (signed char) (v >> 24); writeSignedChars<S> (out, b, 4); } template <class S, class T> void write (T &out, unsigned int v) { unsigned char b[4]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); b[2] = (unsigned char) (v >> 16); b[3] = (unsigned char) (v >> 24); writeUnsignedChars<S> (out, b, 4); } template <class S, class T> void write (T &out, int64_t v) { signed char b[8]; b[0] = (signed char) (v); b[1] = (signed char) (v >> 8); b[2] = (signed char) (v >> 16); b[3] = (signed char) (v >> 24); b[4] = (signed char) (v >> 32); b[5] = (signed char) (v >> 40); b[6] = (signed char) (v >> 48); b[7] = (signed char) (v >> 56); writeSignedChars<S> (out, b, 8); } template <class S, class T> void write (T &out, uint64_t v) { unsigned char b[8]; b[0] = (unsigned char) (v); b[1] = (unsigned char) (v >> 8); b[2] = (unsigned char) (v >> 16); b[3] = (unsigned char) (v >> 24); b[4] = (unsigned char) (v >> 32); b[5] = (unsigned char) (v >> 40); b[6] = (unsigned char) (v >> 48); b[7] = (unsigned char) (v >> 56); writeUnsignedChars<S> (out, b, 8); } template <class S, class T> void write (T &out, float v) { union {unsigned int i; float f;} u; u.f = v; unsigned char b[4]; b[0] = (unsigned char) (u.i); b[1] = (unsigned char) (u.i >> 8); b[2] = (unsigned char) (u.i >> 16); b[3] = (unsigned char) (u.i >> 24); writeUnsignedChars<S> (out, b, 4); } template <class S, class T> void write (T &out, double v) { union {uint64_t i; double d;} u; u.d = v; unsigned char b[8]; b[0] = (unsigned char) (u.i); b[1] = (unsigned char) (u.i >> 8); b[2] = (unsigned char) (u.i >> 16); b[3] = (unsigned char) (u.i >> 24); b[4] = (unsigned char) (u.i >> 32); b[5] = (unsigned char) (u.i >> 40); b[6] = (unsigned char) (u.i >> 48); b[7] = (unsigned char) (u.i >> 56); writeUnsignedChars<S> (out, b, 8); } template <class S, class T> inline void write (T &out, half v) { unsigned char b[2]; b[0] = (unsigned char) (v.bits()); b[1] = (unsigned char) (v.bits() >> 8); writeUnsignedChars<S> (out, b, 2); } template <class S, class T> inline void write (T &out, const char v[], int n) // fixed-size char array { S::writeChars (out, v, n); } template <class S, class T> void write (T &out, const char v[]) // zero-terminated string { while (*v) { S::writeChars (out, v, 1); ++v; } S::writeChars (out, v, 1); } template <class S, class T> void pad (T &out, int n) // add n padding bytes { for (int i = 0; i < n; i++) { const char c = 0; S::writeChars (out, &c, 1); } } template <class S, class T> inline void read (T &in, bool &v) { char c; S::readChars (in, &c, 1); v = !!c; } template <class S, class T> inline void read (T &in, char &v) { S::readChars (in, &v, 1); } template <class S, class T> inline void read (T &in, signed char &v) { readSignedChars<S> (in, &v, 1); } template <class S, class T> inline void read (T &in, unsigned char &v) { readUnsignedChars<S> (in, &v, 1); } template <class S, class T> void read (T &in, signed short &v) { signed char b[2]; readSignedChars<S> (in, b, 2); v = (static_cast <unsigned char> (b[0]) & 0x00ff) | (static_cast <unsigned char> (b[1]) << 8); } template <class S, class T> void read (T &in, unsigned short &v) { unsigned char b[2]; readUnsignedChars<S> (in, b, 2); v = (b[0] & 0x00ff) | (b[1] << 8); } template <class S, class T> void read (T &in, signed int &v) { signed char b[4]; readSignedChars<S> (in, b, 4); v = (static_cast <unsigned char> (b[0]) & 0x000000ff) | ((static_cast <unsigned char> (b[1]) << 8) & 0x0000ff00) | ((static_cast <unsigned char> (b[2]) << 16) & 0x00ff0000) | (static_cast <unsigned char> (b[3]) << 24); } template <class S, class T> void read (T &in, unsigned int &v) { unsigned char b[4]; readUnsignedChars<S> (in, b, 4); v = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); } template <class S, class T> void read (T &in, int64_t &v) { signed char b[8]; readSignedChars<S> (in, b, 8); v = (static_cast <int64_t> (b[0]) & 0x00000000000000ff) | ((static_cast <int64_t> (b[1]) << 8) & 0x000000000000ff00) | ((static_cast <int64_t> (b[2]) << 16) & 0x0000000000ff0000) | ((static_cast <int64_t> (b[3]) << 24) & 0x00000000ff000000) | ((static_cast <int64_t> (b[4]) << 32) & 0x000000ff00000000) | ((static_cast <int64_t> (b[5]) << 40) & 0x0000ff0000000000) | ((static_cast <int64_t> (b[6]) << 48) & 0x00ff000000000000) | (static_cast <int64_t> (b[7]) << 56); } template <class S, class T> void read (T &in, uint64_t &v) { unsigned char b[8]; readUnsignedChars<S> (in, b, 8); v = ((uint64_t) b[0] & 0x00000000000000ffLL) | (((uint64_t) b[1] << 8) & 0x000000000000ff00LL) | (((uint64_t) b[2] << 16) & 0x0000000000ff0000LL) | (((uint64_t) b[3] << 24) & 0x00000000ff000000LL) | (((uint64_t) b[4] << 32) & 0x000000ff00000000LL) | (((uint64_t) b[5] << 40) & 0x0000ff0000000000LL) | (((uint64_t) b[6] << 48) & 0x00ff000000000000LL) | ((uint64_t) b[7] << 56); } template <class S, class T> void read (T &in, float &v) { unsigned char b[4]; readUnsignedChars<S> (in, b, 4); union {unsigned int i; float f;} u; u.i = (b[0] & 0x000000ff) | ((b[1] << 8) & 0x0000ff00) | ((b[2] << 16) & 0x00ff0000) | (b[3] << 24); v = u.f; } template <class S, class T> void read (T &in, double &v) { unsigned char b[8]; readUnsignedChars<S> (in, b, 8); union {uint64_t i; double d;} u; u.i = ((uint64_t) b[0] & 0x00000000000000ffULL) | (((uint64_t) b[1] << 8) & 0x000000000000ff00ULL) | (((uint64_t) b[2] << 16) & 0x0000000000ff0000ULL) | (((uint64_t) b[3] << 24) & 0x00000000ff000000ULL) | (((uint64_t) b[4] << 32) & 0x000000ff00000000ULL) | (((uint64_t) b[5] << 40) & 0x0000ff0000000000ULL) | (((uint64_t) b[6] << 48) & 0x00ff000000000000ULL) | ((uint64_t) b[7] << 56); v = u.d; } template <class S, class T> inline void read (T &in, half &v) { unsigned char b[2]; readUnsignedChars<S> (in, b, 2); v.setBits ((b[0] & 0x00ff) | (b[1] << 8)); } template <class S, class T> inline void read (T &in, char v[], int n) // fixed-size char array { S::readChars (in, v, n); } template <class S, class T> void read (T &in, int n, char v[]) // zero-terminated string { while (n >= 0) { S::readChars (in, v, 1); if (*v == 0) break; --n; ++v; } } template <class S, class T> void skip (T &in, int n) // skip n padding bytes { char c[1024]; while (n >= (int) sizeof (c)) { if (!S::readChars (in, c, sizeof (c))) return; n -= sizeof (c); } if (n >= 1) S::readChars (in, c, n); } template <> inline int size <bool> () {return 1;} template <> inline int size <char> () {return 1;} template <> inline int size <signed char> () {return 1;} template <> inline int size <unsigned char> () {return 1;} template <> inline int size <signed short> () {return 2;} template <> inline int size <unsigned short> () {return 2;} template <> inline int size <signed int> () {return 4;} template <> inline int size <unsigned int> () {return 4;} template <> inline int size <signed long> () {return 8;} template <> inline int size <unsigned long> () {return 8;} template <> inline int size <unsigned long long> () {return 8;} template <> inline int size <float> () {return 4;} template <> inline int size <double> () {return 8;} template <> inline int size <half> () {return 2;} } // namespace Xdr OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT #if defined (OPENEXR_IMF_INTERNAL_NAMESPACE_AUTO_EXPOSE) namespace Imf{using namespace OPENEXR_IMF_INTERNAL_NAMESPACE;} #endif #endif PK rM�[z�xU�>