Skip to content

Commit

Permalink
[feat] openexr writer
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Dukhovnikov <[email protected]>
  • Loading branch information
antond-weta committed Nov 16, 2023
1 parent 6bded10 commit 984c0cd
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion build_scripts/install_deps_linux.bash
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ set -ex
time sudo apt-get update

time sudo apt-get -q -f install -y \
libunwind-dev libimath-dev libopenexr-dev \
libunwind-dev \
libboost-dev libboost-filesystem-dev \
libboost-test-dev \
libraw-dev libceres-dev
4 changes: 2 additions & 2 deletions src/rawtoaces_util/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,8 @@ target_link_libraries ( ${RAWTOACESLIB}
${RAWTOACESIDTLIB}
INTERFACE
Eigen3::Eigen
Imath::Imath
Imath::ImathConfig
# Imath::Imath
# Imath::ImathConfig
)

if ( LIBRAW_CONFIG_FOUND )
Expand Down
32 changes: 28 additions & 4 deletions src/rawtoaces_util/acesrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
#include <rawtoaces/acesrender.h>
#include <rawtoaces/mathOps.h>

#include <Imath/half.h>
//#include <Imath/half.h>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
#include <boost/foreach.hpp>
Expand Down Expand Up @@ -1873,24 +1873,48 @@ void AcesRender::acesWrite( const char *name, float *aces, float ratio ) const
Imf::NO_COMPRESSION // compression
);

libraw_iparams_t *iparams = &_rawProcessor->imgdata.idata;
libraw_iparams_t *iparams = &_rawProcessor->imgdata.idata;
libraw_lensinfo_t *lens = &_rawProcessor->imgdata.lens;
libraw_imgother_t *other = &_rawProcessor->imgdata.other;

# if 0
Imf::addCameraMake( header, iparams->make );
Imf::addCameraModel( header, iparams->model );
Imf::addCameraLabel(
header, string( iparams->make ) + " " + iparams->model );

libraw_lensinfo_t *lens = &_rawProcessor->imgdata.lens;
Imf::addLensMake( header, lens->LensMake );
Imf::addLensModel( header, lens->Lens );
Imf::addLensSerialNumber( header, lens->LensSerial );

libraw_imgother_t *other = &_rawProcessor->imgdata.other;
Imf::addIsoSpeed( header, other->iso_speed );
Imf::addExpTime( header, other->shutter );
Imf::addAperture( header, other->aperture );
Imf::addEffectiveFocalLength( header, other->focal_len );
Imf::addComments( header, other->desc );
Imf::addOwner( header, other->artist );
# else
header.insert( "cameraMake", Imf::StringAttribute( iparams->make ) );
header.insert( "cameraModel", Imf::StringAttribute( iparams->model ) );
header.insert(
"cameraLabel",
Imf::StringAttribute(
string( iparams->make ) + " " + iparams->model ) );

header.insert( "lensMake", Imf::StringAttribute( lens->LensMake ) );
header.insert( "lensModel", Imf::StringAttribute( lens->Lens ) );
header.insert(
"lensSerialNumber", Imf::StringAttribute( lens->LensSerial ) );

header.insert( "isoSpeed", Imf::FloatAttribute( other->iso_speed ) );
header.insert( "expTime", Imf::FloatAttribute( other->shutter ) );
header.insert( "aperture", Imf::FloatAttribute( other->aperture ) );
header.insert(
"effectiveFocalLength", Imf::FloatAttribute( other->focal_len ) );
header.insert( "comments", Imf::StringAttribute( other->desc ) );
header.insert( "owner", Imf::StringAttribute( other->artist ) );
header.insert( "cameraMake", Imf::StringAttribute( iparams->make ) );
# endif

Imf::AcesOutputFile file( name, header );

Expand Down

0 comments on commit 984c0cd

Please sign in to comment.