FreeBSD Bugzilla – Attachment 190976 Details for
Bug 226185
textproc/ripgrep: Update to version 0.8.1
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch-to-2.1.0
pfstools.patch (text/plain), 321.01 KB, created by
Yuri Victorovich
on 2018-02-24 22:54:01 UTC
(
hide
)
Description:
patch-to-2.1.0
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2018-02-24 22:54:01 UTC
Size:
321.01 KB
patch
obsolete
>Index: graphics/pfstools/Makefile >=================================================================== >--- graphics/pfstools/Makefile (revision 462869) >+++ graphics/pfstools/Makefile (working copy) >@@ -2,8 +2,7 @@ > # $FreeBSD$ > > PORTNAME= pfstools >-PORTVERSION= 1.8.5 >-PORTREVISION= 5 >+DISTVERSION= 2.1.0 > CATEGORIES= graphics > MASTER_SITES= SF > >@@ -11,59 +10,101 @@ > COMMENT= Tools for manipulating HDR images and video frames > > LICENSE= LGPL21 >+LICENSE_FILE= ${WRKSRC}/COPYING > >-RUN_DEPENDS+= bash:shells/bash >+BUILD_DEPENDS= bash:shells/bash >+RUN_DEPENDS= bash:shells/bash > >-PFS_BUILD= ${MACHINE_ARCH}-portbld-freebsd${OSREL} >-PLIST_SUB+= PFS_BASE=${PREFIX} >+CONFLICTS= pfstmo-1.* pfscalibration-1.* > >-USES= gmake libtool pathfix pkgconfig >-GNU_CONFIGURE= yes >-CONFIGURE_TARGET= ${PFS_BUILD} >-CONFIGURE_ARGS+= --disable-jpeghdr --disable-matlab \ >- --with-bash=${LOCALBASE}/bin/bash >-CPPFLAGS+= -I${LOCALBASE}/include >-LDFLAGS+= -L${LOCALBASE}/lib >+LDFLAGS+= -lthr >+ >+USES= cmake:outsource tar:tgz dos2unix perl5 jpeg >+USE_PERL5= run > USE_LDCONFIG= yes > >-OPTIONS_DEFINE= NETPBM OPENEXR TIFF QT IMAGEMAGICK GDAL OCTAVE OPENGL >-QT_DESC= Compile programs that use QT library >-GDAL_DESC= Compile programs that use GDAL library >+CMAKE_VERBOSE= yes >+CMAKE_ARGS+= -DBUILD_SHARED_LIBS=ON \ >+ -DWITH_MATLAB=OFF \ >+ -DBASH_EXECUTABLE:STRING=${LOCALBASE}/bin/bash >+ >+DOS2UNIX_GLOB= *.txt *.cmake \ >+ *.h *.c *.cpp \ >+ *.1 >+ >+MANCOMPRESSED= yes >+ >+OPTIONS_DEFINE= TIFF OPENEXR IMAGEMAGICK NETPBM \ >+ OCTAVE FFTW GSL \ >+ ALIGN GLVIEW VIEW \ >+ OPENMP >+OPTIONS_DEFAULT=TIFF FFTW GSL >+NO_OPTIONS_SORT=yes >+OPTIONS_SUB= yes > OCTAVE_DESC= Compile octave interface functions >+GSL_DESC= Use Gnu Scientific Libarary required for some TMOs >+ALIGN_DESC= Compile pfsalign, requires OpenCV and libexif >+VIEW_DESC= Compile pfsview, requires QT5 >+GLVIEW_DESC= Compile pfsglview, requires GLUT > >-OPTIONS_DEFAULT= TIFF >-OPTIONS_SUB= yes >+TIFF_CMAKE_ON= -DWITH_TIFF=ON >+TIFF_CMAKE_OFF= -DWITH_TIFF=OFF >+TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff > >-NETPBM_CONFIGURE_ENABLE= netpbm >-NETPBM_LIB_DEPENDS= libnetpbm.so:graphics/netpbm >+OPENEXR_CMAKE_ON= -DWITH_OpenEXR=ON >+OPENEXR_CMAKE_OFF= -DWITH_OpenEXR=OFF >+OPENEXR_LIB_DEPENDS= libIlmImf.so:graphics/OpenEXR > >-OPENEXR_CONFIGURE_ENABLE= openexr >-OPENEXR_CONFIGURE_ON= --with-exrdir=${LOCALBASE}/include/OpenEXR >-OPENEXR_LIB_DEPENDS= libIlmImf.so:graphics/OpenEXR >+IMAGEMAGICK_CMAKE_ON= -DWITH_ImageMagick=ON >+IMAGEMAGICK_CMAKE_OFF= -DWITH_ImageMagick=OFF >+IMAGEMAGICK_LIB_DEPENDS=libMagick++-6.so:graphics/ImageMagick > >-TIFF_CONFIGURE_ENABLE= tiff >-TIFF_LIB_DEPENDS= libtiff.so:graphics/tiff >+NETPBM_CMAKE_ON= -DWITH_NetPBM=ON >+NETPBM_CMAKE_OFF= -DWITH_NetPBM=OFF >+NETPBM_LIB_DEPENDS= libnetpbm.so:graphics/netpbm > >-QT_CONFIGURE_ENABLE= qt >-QT_USE= QT4=moc_build,corelib,gui >+OCTAVE_CMAKE_ON= -DWITH_Octave=ON >+OCTAVE_CMAKE_OFF= -DWITH_Octave=OFF >+OCTAVE_PATCH_DEPENDS= octave-config:math/octave >+OCTAVE_BUILD_DEPENDS= mkoctfile:math/octave >+OCTAVE_RUN_DEPENDS= octave:math/octave > >-IMAGEMAGICK_CONFIGURE_ENABLE= imagemagick >-IMAGEMAGICK_LIB_DEPENDS= libMagick++-6.so:graphics/ImageMagick >+FFTW_CMAKE_ON= -DWITH_FFTW=ON \ >+ -DFFTW_INCLUDE_DIRS=${LOCALBASE}/include >+FFTW_CMAKE_OFF= -DWITH_FFTW=OFF >+FFTW_LIB_DEPENDS= libfftw3.so:math/fftw3 \ >+ libfftw3f.so:math/fftw3-float > >-GDAL_CONFIGURE_ENABLE= gdal >-GDAL_LIB_DEPENDS= libgdal.so:graphics/gdal >+GSL_CMAKE_ON= -DWITH_GSL=ON >+GSL_CMAKE_OFF= -DWITH_GSL=OFF >+GSL_LIB_DEPENDS= libgsl.so:math/gsl > >-OPENGL_CONFIGURE_ENABLE= opengl >-OPENGL_USE= GL=glut >+ALIGN_CMAKE_ON= -DWITH_OpenCV=ON >+ALIGN_CMAKE_OFF= -DWITH_OpenCV=OFF >+ALIGN_LIB_DEPENDS= libopencv_nonfree.so:graphics/opencv \ >+ libexif.so:graphics/libexif > >-OCTAVE_CONFIGURE_ENABLE= octave >-OCTAVE_PATCH_DEPENDS= octave-config:math/octave >-OCTAVE_BUILD_DEPENDS= mkoctfile:math/octave >-OCTAVE_RUN_DEPENDS= octave:math/octave >-OCTAVE_USES= shebangfix >+GLVIEW_CMAKE_ON= -DWITH_pfsglview=ON \ >+ -DGLUT_INCLUDE_DIRS=${LOCALBASE}/include >+GLVIEW_CMAKE_OFF= -DWITH_pfsglview=OFF >+GLVIEW_USE= GL=glut > >+VIEW_CMAKE_ON= -DWITH_QT=ON >+VIEW_CMAKE_OFF= -DWITH_QT=OFF >+VIEW_USE= QT5=buildtools_build,qmake_build,widgets >+ >+OPENMP_USES= compiler:openmp >+ > .include <bsd.port.options.mk> > >+.if ${PORT_OPTIONS:MNETPBM} && !${PORT_OPTIONS:MTIFF} >+WARNING+= "NETPBM is unusable without TIFF" >+.endif >+ >+.if ${PORT_OPTIONS:MIMAGEMAGICK} && !${PORT_OPTIONS:MOPENMP} >+USES+= compiler:c++11-lib >+.endif >+ > .if ${PORT_OPTIONS:MOCTAVE} > OCTAVE_BASE?= ${LOCALBASE} > OCTAVE_VERSION!=${OCTAVE_BASE}/bin/octave-config -v 2>&1 || ${ECHO} "0" >@@ -73,11 +114,15 @@ > OCTAVE_BASE=${OCTAVE_BASE} \ > OCTAVE_SITE_M=${OCTAVE_SITE_M:S|^${OCTAVE_BASE}/||} \ > OCTAVE_SITE_OCT=${OCTAVE_SITE_OCT:S|^${OCTAVE_BASE}/||} >-SHEBANG_FILES= src/octave/* >-SHEBANG_LANG+= octave >+SHEBANG_FILES+= src/octave/pfs* >+SHEBANG_LANG+= octave >+octave_OLD_CMD?=/usr/bin/octave >+octave_CMD?= ${OCTAVE_BASE}/bin/octave-cli > .endif > >-post-install: >- ${STRIP_CMD} ${STAGEDIR}${PREFIX}/lib//libpfs-1.2.so.0.0.0 >+.include <bsd.port.pre.mk> > >-.include <bsd.port.mk> >+post-extract: >+ @${TAR} cfC - ${FILESDIR}/port . | ${TAR} xpfC - ${WRKSRC} >+ >+.include <bsd.port.post.mk> >Index: graphics/pfstools/distinfo >=================================================================== >--- graphics/pfstools/distinfo (revision 462869) >+++ graphics/pfstools/distinfo (working copy) >@@ -1,2 +1,3 @@ >-SHA256 (pfstools-1.8.5.tar.gz) = 2cf958d39ee3b65b034796b0abeea727590561936e295461de6365a750167306 >-SIZE (pfstools-1.8.5.tar.gz) = 846001 >+TIMESTAMP = 1515923190 >+SHA256 (pfstools-2.1.0.tgz) = 3dea4248e41bf433fe4760b0a11d138ad2d240f62db9e519bcb1d557c0593413 >+SIZE (pfstools-2.1.0.tgz) = 596136 >Index: graphics/pfstools/files/patch-CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-CMakeLists.txt (working copy) >@@ -0,0 +1,30 @@ >+--- CMakeLists.txt.orig 2018-02-24 22:34:23 UTC >++++ CMakeLists.txt >+@@ -29,7 +29,7 @@ set (pfstools_VERSION_MINOR ${CPACK_PACK >+ set (pfslib_version 1.2) >+ set(CMAKE_LEGACY_CYGWIN_WIN32 0) >+ >+-set (MAN_DIR "${CMAKE_INSTALL_PREFIX}/share/man/man1" CACHE PATH "The directory where the man pages are") >++set (MAN_DIR "${CMAKE_INSTALL_PREFIX}/man/man1" CACHE PATH "The directory where the man pages are") >+ >+ include( CheckCXXSourceCompiles ) >+ >+@@ -57,7 +57,7 @@ endif( HAS_BRANCH_PREDICTION ) >+ # ======== Find bash ======= >+ >+ # TODO: What if the check fails >+-find_program (BASH_EXECUTABLE bash) >++#find_program (BASH_EXECUTABLE bash) >+ message( "Using bash: ${BASH_EXECUTABLE}" ) >+ >+ # ======== Find perl ======= >+@@ -250,6 +250,9 @@ if( WITH_FFTW ) >+ else( NOT FFTW_FOUND ) >+ set( HAVE_FFTW3F 1 ) >+ set( HAVE_FFTW3 1 ) >++ if( NOT "${FFTW_INCLUDE_DIRS}" STREQUAL "" ) >++ include_directories ("${FFTW_INCLUDE_DIRS}") >++ endif( NOT "${FFTW_INCLUDE_DIRS}" STREQUAL "" ) >+ endif( NOT FFTW_FOUND ) >+ >+ else( WITH_FFTW ) > >Property changes on: graphics/pfstools/files/patch-CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-config.h.in >=================================================================== >--- graphics/pfstools/files/patch-config.h.in (revision 462869) >+++ graphics/pfstools/files/patch-config.h.in (nonexistent) >@@ -1,19 +0,0 @@ >---- config.h.in.orig 2011-10-27 08:40:42 UTC >-+++ config.h.in >-@@ -99,13 +99,13 @@ >- >- /* Output stream for debug messages. */ >- #ifdef DEBUG >--#define DEBUG_STR cerr >-+#define DEBUG_STR std::cerr >- #else >--#define DEBUG_STR if(1); else cerr >-+#define DEBUG_STR if(1); else std::cerr >- #endif >- /* Output stream for verbose messages */ >- #define VERBOSE_STR if(verbose) std::cerr << PROG_NAME << ": " >- >- >- /* On some systems iostream, string etc are in 'std' namespace */ >--using namespace std; >-+//using namespace std; > >Property changes on: graphics/pfstools/files/patch-config.h.in >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-configure >=================================================================== >--- graphics/pfstools/files/patch-configure (revision 462869) >+++ graphics/pfstools/files/patch-configure (nonexistent) >@@ -1,11 +0,0 @@ >---- configure.orig 2011-10-27 08:40:31 UTC >-+++ configure >-@@ -15411,7 +15411,7 @@ fi #end of PKG_CHECK_MODULES >- if test -z "$QTDIR"; then >- MOC="moc-qt4" >- else >-- MOC="$QTDIR/bin/moc" >-+ MOC="$QTDIR/bin/moc-qt4" >- fi >- >- # Check whether --with-moc was given. > >Property changes on: graphics/pfstools/files/patch-configure >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-exrio.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-exrio.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-exrio.cpp (nonexistent) >@@ -1,28 +0,0 @@ >---- src/fileformat/exrio.cpp.orig 2005-06-15 13:36:54 UTC >-+++ src/fileformat/exrio.cpp >-@@ -54,14 +54,14 @@ OpenEXRReader::OpenEXRReader( const char >- } >- >- DEBUG_STR << "OpenEXR file \"" << filename << "\" (" >-- << width << "x" << height << ")" << endl; >-+ << width << "x" << height << ")" << std::endl; >- } >- >- void OpenEXRReader::readImage( pfs::Array2D *R, pfs::Array2D *G, >- pfs::Array2D *B ) >- { >- assert(file!=NULL); >-- DEBUG_STR << "Reading OpenEXR file... " << endl; >-+ DEBUG_STR << "Reading OpenEXR file... " << std::endl; >- >- Imf::Rgba* tmp_img = new Imf::Rgba[width*height]; >- >-@@ -93,7 +93,7 @@ void OpenEXRReader::readImage( pfs::Arra >- OpenEXRReader::~OpenEXRReader() >- { >- delete file; >-- file==NULL; >-+ file=NULL; >- } >- >- OpenEXRWriter::OpenEXRWriter(const char* filename) > >Property changes on: graphics/pfstools/files/patch-src-fileformat-exrio.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-hdrtiffio.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-hdrtiffio.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-hdrtiffio.cpp (nonexistent) >@@ -1,96 +0,0 @@ >---- src/fileformat/hdrtiffio.cpp.orig 2011-10-27 08:39:07 UTC >-+++ src/fileformat/hdrtiffio.cpp >-@@ -66,7 +66,7 @@ HDRTiffReader::HDRTiffReader( const char >- } >- >- DEBUG_STR << "TIFF file \"" << filename << "\" (" >-- << width << "x" << height << ")" << endl; >-+ << width << "x" << height << ")" << std::endl; >- >- //--- image parameters >- if(!TIFFGetField(tif, TIFFTAG_COMPRESSION, &comp)) // compression type >-@@ -81,7 +81,7 @@ HDRTiffReader::HDRTiffReader( const char >- switch(phot) >- { >- case PHOTOMETRIC_LOGLUV: >-- DEBUG_STR << "Photometric data: LogLuv" << endl; >-+ DEBUG_STR << "Photometric data: LogLuv" << std::endl; >- if (comp != COMPRESSION_SGILOG && comp != COMPRESSION_SGILOG24) >- { >- TIFFClose(tif); >-@@ -96,7 +96,7 @@ HDRTiffReader::HDRTiffReader( const char >- relative_values=true; >- break; >- case PHOTOMETRIC_RGB: >-- DEBUG_STR << "Photometric data: RGB" << endl; >-+ DEBUG_STR << "Photometric data: RGB" << std::endl; >- // read extra samples (# of alpha channels) >- if (TIFFGetField( tif, TIFFTAG_EXTRASAMPLES, >- &extra_samples_per_pixel, &extra_sample_types )!=1) >-@@ -121,36 +121,36 @@ HDRTiffReader::HDRTiffReader( const char >- if( bps==8 ) >- { >- TypeOfData = BYTE; >-- DEBUG_STR << "8bit per channel" << endl; >-+ DEBUG_STR << "8bit per channel" << std::endl; >- strcpy(format_string,"linear 8bit RGB"); >- relative_values=false; //!! TODO: verify if 8bit is always gamma corrected >- } >- else if( bps==16 ) >- { >- TypeOfData = WORD; >-- DEBUG_STR << "16bit per channel" << endl; >-+ DEBUG_STR << "16bit per channel" << std::endl; >- strcpy(format_string,"linear 16bit RGB"); >- relative_values=true; //!! TODO: verify this case!! >- } >- else >- { >- TypeOfData = FLOAT; >-- DEBUG_STR << "32bit float per channel" << endl; >-+ DEBUG_STR << "32bit float per channel" << std::endl; >- strcpy(format_string,"linear 32bit float RGB"); >- relative_values=true; >- } >- break; >- case PHOTOMETRIC_MINISBLACK: // HDR video camera format (grayscale) >-- DEBUG_STR << "Photometric data: MINISBLACK (hdrv camera)" << endl; >-+ DEBUG_STR << "Photometric data: MINISBLACK (hdrv camera)" << std::endl; >- if (!TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &bps) || !bps==1) >- { >- TIFFClose(tif); >- throw pfs::Exception("TIFF: Unsupported samples per pixel for " >- "grayscale image"); >- } >-- if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bps) || !bps==16) >-+ if (!TIFFGetField(tif, TIFFTAG_BITSPERSAMPLE, &bps) || !(bps==16)) >- { >-- DEBUG_STR << "Detected bits per sample: " << bps << endl; >-+ DEBUG_STR << "Detected bits per sample: " << bps << std::endl; >- TIFFClose(tif); >- throw pfs::Exception("TIFF: unsupported bits per sample for " >- "grayscale image."); >-@@ -160,7 +160,7 @@ HDRTiffReader::HDRTiffReader( const char >- relative_values=true; >- break; >- default: >-- DEBUG_STR << "Unsupported photometric type: " << phot << endl; >-+ DEBUG_STR << "Unsupported photometric type: " << phot << std::endl; >- TIFFClose(tif); >- strcpy(format_string,"unknown"); >- relative_values=false; >-@@ -184,12 +184,12 @@ void HDRTiffReader::readImage( pfs::Arra >- //--- image length >- uint32 imagelength; >- TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &imagelength); >-- DEBUG_STR << "Image length: " << imagelength << endl; >-+ DEBUG_STR << "Image length: " << imagelength << std::endl; >- >- //--- image scanline size >- uint32 scanlinesize = TIFFScanlineSize(tif); >- buf.vp = _TIFFmalloc(scanlinesize); >--// DEBUG_STR << "Scanline size: " << scanlinesize << endl; >-+// DEBUG_STR << "Scanline size: " << scanlinesize << std::endl; >- >- >- //--- read scan lines > >Property changes on: graphics/pfstools/files/patch-src-fileformat-hdrtiffio.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-pfsinexr.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-pfsinexr.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-pfsinexr.cpp (nonexistent) >@@ -1,11 +0,0 @@ >---- src/fileformat/pfsinexr.cpp.orig 2008-01-01 13:01:21 UTC >-+++ src/fileformat/pfsinexr.cpp >-@@ -234,7 +234,7 @@ void readFrames( int argc, char* argv[] >- } >- >- file.setFrameBuffer( frameBuffer ); >-- file.readPixels( dw.min.y, dw.max.y ); >-+ file.readPixels( dtw.min.y, dtw.max.y ); >- >- VERBOSE_STR << "reading file (linear) '" << ff.fileName << "'" << std::endl; >- > >Property changes on: graphics/pfstools/files/patch-src-fileformat-pfsinexr.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-pfsinimgmagick.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-pfsinimgmagick.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-pfsinimgmagick.cpp (nonexistent) >@@ -1,19 +0,0 @@ >---- src/fileformat/pfsinimgmagick.cpp.orig 2008-10-03 19:07:34 UTC >-+++ src/fileformat/pfsinimgmagick.cpp >-@@ -108,6 +108,7 @@ void readFrames( int argc, char* argv[] >- if( ff.fh == NULL ) break; // No more frames >- it.closeFrameFile( ff ); >- >-+ Magick::InitializeMagick(*argv); >- VERBOSE_STR << "reading file '" << ff.fileName << "'" << std::endl; >- Magick::Image imImage( ff.fileName ); >- >-@@ -172,7 +173,7 @@ void readFrames( int argc, char* argv[] >- frame->getTags()->setString( "FILE_NAME", fileNameTag ); >- >- char strbuf[3]; >-- snprintf( strbuf, 3, "%d", imImage.depth() ); >-+ snprintf( strbuf, 3, "%lu", imImage.depth() ); >- frame->getTags()->setString("BITDEPTH", strbuf ); >- >- pfsio.writeFrame( frame, stdout ); > >Property changes on: graphics/pfstools/files/patch-src-fileformat-pfsinimgmagick.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-pfsinjpeghdr.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-pfsinjpeghdr.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-pfsinjpeghdr.cpp (nonexistent) >@@ -1,22 +0,0 @@ >---- src/fileformat/pfsinjpeghdr.cpp.orig 2005-11-04 08:54:27 UTC >-+++ src/fileformat/pfsinjpeghdr.cpp >-@@ -123,8 +123,8 @@ void readFrames( int argc, char* argv[] >- case JPEG_HEADER_HDR: // HDR image >- jpeghdr_start_decompress(&jhinf); >- frame = pfsio.createFrame( jhinf.cinfo.output_width, jhinf.cinfo.output_height ); >-- hdrscan = (JHSAMPLE *)malloc(jhinf.cinfo.output_width * jhinf.cinfo.output_height * >-- sizeof(JHSAMPLE)*3); >-+ hdrscan = >-+ new JHSAMPLE[jhinf.cinfo.output_width * jhinf.cinfo.output_height * 3]; >- // Important: test jhinf.output_scanline, not jhinf.cinfo >- int index ; >- index = 0; >-@@ -144,7 +144,7 @@ void readFrames( int argc, char* argv[] >- (Z->getRawData())[i] = hdrscan[3*i + 2]; >- } >- pfs::transformColorSpace( pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >-- free((void *)hdrscan); >-+ delete[] hdrscan; >- break; >- case JPEG_HEADER_OK: // LDR image >- case JPEG_SUSPENDED: > >Property changes on: graphics/pfstools/files/patch-src-fileformat-pfsinjpeghdr.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-pfsoutimgmagick.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-pfsoutimgmagick.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-pfsoutimgmagick.cpp (nonexistent) >@@ -1,10 +0,0 @@ >---- src/fileformat/pfsoutimgmagick.cpp.orig 2011-03-15 08:47:24 UTC >-+++ src/fileformat/pfsoutimgmagick.cpp >-@@ -190,6 +190,7 @@ void writeFrames( int argc, char* argv[] >- if( alpha != NULL ) >- imgBuffer[i++] = (unsigned short)(maxValue-clamp((*alpha)(pix),0.f,1.f)*maxValue); >- } >-+ Magick::InitializeMagick(*argv); >- Magick::Image imImage( frame->getWidth(), frame->getHeight(), >- (alpha == NULL ? "RGB" : "RGBA"), Magick::ShortPixel, imgBuffer ); >- imImage.quality( quality ); > >Property changes on: graphics/pfstools/files/patch-src-fileformat-pfsoutimgmagick.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-pfsoutjpeghdr.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-pfsoutjpeghdr.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-pfsoutjpeghdr.cpp (nonexistent) >@@ -1,40 +0,0 @@ >---- src/fileformat/pfsoutjpeghdr.cpp.orig 2005-11-04 08:54:27 UTC >-+++ src/fileformat/pfsoutjpeghdr.cpp >-@@ -69,8 +69,7 @@ void writeHDRJPEGGray( FILE *fh, int wid >- jhinf.correction = correction; >- jpeg_stdio_dest(&jhinf.cinfo, fh); >- >-- image = (JHSAMPLE *)malloc(width * height * >-- sizeof(JHSAMPLE)*3); >-+ image = new JHSAMPLE[width * height * 3]; >- >- for(int i=0;i<width * height;i++) >- { >-@@ -91,7 +90,7 @@ void writeHDRJPEGGray( FILE *fh, int wid >- // Or, assign jhinf.tmi 8-bit grayscale values in scanline order >- jpeghdr_do_compress(&jhinf); >- jpeghdr_destroy_compress(&jhinf); >-- fclose(fh); >-+ delete[] image; >- } >- >- void writeHDRJPEGRGB( FILE *fh, int width, int height, >-@@ -111,8 +110,7 @@ void writeHDRJPEGRGB( FILE *fh, int widt >- jhinf.beta = beta; >- jpeg_stdio_dest(&jhinf.cinfo, fh); >- >-- image = (JHSAMPLE *)malloc(width * height * >-- sizeof(JHSAMPLE)*3); >-+ image = new JHSAMPLE[width * height * 3]; >- >- for(int i=0;i<width * height;i++) >- { >-@@ -135,7 +133,7 @@ void writeHDRJPEGRGB( FILE *fh, int widt >- jpeghdr_do_compress(&jhinf); >- jpeghdr_destroy_compress(&jhinf); >- >-- free( image ); >-+ delete[] image; >- } >- >- void writeFrames( int argc, char* argv[] ) > >Property changes on: graphics/pfstools/files/patch-src-fileformat-pfsoutjpeghdr.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-pfsoutpfm.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-pfsoutpfm.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-pfsoutpfm.cpp (nonexistent) >@@ -1,20 +0,0 @@ >---- src/fileformat/pfsoutpfm.cpp.orig 2005-06-15 13:36:54 UTC >-+++ src/fileformat/pfsoutpfm.cpp >-@@ -74,7 +74,7 @@ void writePFMFileColor( FILE *fh, int wi >- } >- int written = fwrite( line, sizeof( float ), lineSize, fh ); >- if( written != lineSize ) >-- throw new pfs::Exception( "Unable to write data" ); >-+ throw pfs::Exception( "Unable to write data" ); >- } >- delete[] line; >- } >-@@ -94,7 +94,7 @@ void writePFMFileGrayscale( FILE *fh, in >- } >- int written = fwrite( line, sizeof( float ), lineSize, fh ); >- if( written != lineSize ) >-- throw new pfs::Exception( "Unable to write data" ); >-+ throw pfs::Exception( "Unable to write data" ); >- } >- delete[] line; >- } > >Property changes on: graphics/pfstools/files/patch-src-fileformat-pfsoutpfm.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-ppmio.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-ppmio.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-ppmio.cpp (nonexistent) >@@ -1,11 +0,0 @@ >---- src/fileformat/ppmio.cpp.orig 2009-05-25 19:24:49 UTC >-+++ src/fileformat/ppmio.cpp >-@@ -34,6 +34,8 @@ extern "C" { >- #include <math.h> >- #include <assert.h> >- >-+#define log2(x) ((float)log(x)/log(2)) >-+ >- struct PPMData >- { >- pixval maxPV; > >Property changes on: graphics/pfstools/files/patch-src-fileformat-ppmio.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-fileformat-rgbeio.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-fileformat-rgbeio.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-fileformat-rgbeio.cpp (nonexistent) >@@ -1,29 +0,0 @@ >---- src/fileformat/rgbeio.cpp.orig 2007-12-06 11:00:49 UTC >-+++ src/fileformat/rgbeio.cpp >-@@ -141,7 +141,7 @@ void rgb2rgbe( float r, float g, float b >- // Reading RGBE files >- void readRadianceHeader( FILE *file, int &width, int &height, float &exposure ) >- { >-- DEBUG_STR << "RGBE: reading header..." << endl; >-+ DEBUG_STR << "RGBE: reading header..." << std::endl; >- >- // read header information >- char head[255]; >-@@ -208,7 +208,7 @@ void readRadianceHeader( FILE *file, int >- height = height - width; >- } >- */ >-- DEBUG_STR << "RGBE: image size " << width << "x" << height << endl; >-+ DEBUG_STR << "RGBE: image size " << width << "x" << height << std::endl; >- } >- >- >-@@ -389,7 +389,7 @@ void writeRadiance( FILE *file, pfs::Arr >- int width = X->getCols(); >- int height = X->getRows(); >- >-- DEBUG_STR << "RGBE: writing image " << width << "x" << height << endl; >-+ DEBUG_STR << "RGBE: writing image " << width << "x" << height << std::endl; >- >- if( Y->getCols() != width || Y->getRows() != height || >- Z->getCols() != width || Z->getRows() != height ) > >Property changes on: graphics/pfstools/files/patch-src-fileformat-rgbeio.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-Makefile.am >=================================================================== >--- graphics/pfstools/files/patch-src-filter-Makefile.am (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-Makefile.am (nonexistent) >@@ -1,20 +0,0 @@ >---- src/filter/Makefile.am.orig 2009-05-30 06:59:10 UTC >-+++ src/filter/Makefile.am >-@@ -1,6 +1,7 @@ >- ### >- bin_PROGRAMS = pfsgamma pfsclamp pfstag pfssize pfsextractchannels pfspanoramic \ >-- pfsrotate pfsflip pfscut pfspad pfscat pfsabsolute pfsdisplayfunction >-+ pfsrotate pfsflip pfscut pfspad pfscat pfsabsolute pfsdisplayfunction \ >-+ pfswb >- >- man_MANS = pfsgamma.1 pfsclamp.1 pfstag.1 pfssize.1 pfsextractchannels.1 \ >- pfspanoramic.1 pfsrotate.1 pfsflip.1 pfscut.1 pfspad.1 pfscat.1 \ >-@@ -34,6 +35,8 @@ pfscat_SOURCES = pfscat.cpp >- >- pfsabsolute_SOURCES = pfsabsolute.cpp >- >-+pfswb_SOURCES = pfswb.cpp >-+ >- LIBS += ../pfs/libpfs-1.2.la >- INCLUDES = -I${srcdir}/../pfs >- > >Property changes on: graphics/pfstools/files/patch-src-filter-Makefile.am >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-Makefile.in >=================================================================== >--- graphics/pfstools/files/patch-src-filter-Makefile.in (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-Makefile.in (nonexistent) >@@ -1,58 +0,0 @@ >---- src/filter/Makefile.in.orig 2011-10-27 08:40:29 UTC >-+++ src/filter/Makefile.in >-@@ -38,7 +38,8 @@ bin_PROGRAMS = pfsgamma$(EXEEXT) pfsclam >- pfssize$(EXEEXT) pfsextractchannels$(EXEEXT) \ >- pfspanoramic$(EXEEXT) pfsrotate$(EXEEXT) pfsflip$(EXEEXT) \ >- pfscut$(EXEEXT) pfspad$(EXEEXT) pfscat$(EXEEXT) \ >-- pfsabsolute$(EXEEXT) pfsdisplayfunction$(EXEEXT) >-+ pfsabsolute$(EXEEXT) pfsdisplayfunction$(EXEEXT) \ >-+ pfswb$(EXEEXT) >- subdir = src/filter >- DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in >- ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 >-@@ -54,6 +55,9 @@ CONFIG_CLEAN_FILES = >- CONFIG_CLEAN_VPATH_FILES = >- am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" >- PROGRAMS = $(bin_PROGRAMS) >-+am_pfswb_OBJECTS = pfswb.$(OBJEXT) >-+pfswb_OBJECTS = $(am_pfswb_OBJECTS) >-+pfswb_LDADD = $(LDADD) >- am_pfsabsolute_OBJECTS = pfsabsolute.$(OBJEXT) >- pfsabsolute_OBJECTS = $(am_pfsabsolute_OBJECTS) >- pfsabsolute_LDADD = $(LDADD) >-@@ -120,13 +124,15 @@ SOURCES = $(pfsabsolute_SOURCES) $(pfsca >- $(pfscut_SOURCES) $(pfsdisplayfunction_SOURCES) \ >- $(pfsextractchannels_SOURCES) $(pfsflip_SOURCES) \ >- $(pfsgamma_SOURCES) $(pfspad_SOURCES) $(pfspanoramic_SOURCES) \ >-- $(pfsrotate_SOURCES) $(pfssize_SOURCES) $(pfstag_SOURCES) >-+ $(pfsrotate_SOURCES) $(pfssize_SOURCES) $(pfstag_SOURCES) \ >-+ $(pfswb_SOURCES) >- DIST_SOURCES = $(pfsabsolute_SOURCES) $(pfscat_SOURCES) \ >- $(pfsclamp_SOURCES) $(pfscut_SOURCES) \ >- $(pfsdisplayfunction_SOURCES) $(pfsextractchannels_SOURCES) \ >- $(pfsflip_SOURCES) $(pfsgamma_SOURCES) $(pfspad_SOURCES) \ >- $(pfspanoramic_SOURCES) $(pfsrotate_SOURCES) \ >-- $(pfssize_SOURCES) $(pfstag_SOURCES) >-+ $(pfssize_SOURCES) $(pfstag_SOURCES) \ >-+ $(pfswb_SOURCES) >- am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; >- am__vpath_adj = case $$p in \ >- $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ >-@@ -314,6 +320,7 @@ pfscut_SOURCES = pfscut.cpp >- pfspad_SOURCES = pfspad.cpp >- pfscat_SOURCES = pfscat.cpp >- pfsabsolute_SOURCES = pfsabsolute.cpp >-+pfswb_SOURCES = pfswb.cpp >- INCLUDES = -I${srcdir}/../pfs >- all: all-am >- >-@@ -392,6 +399,9 @@ clean-binPROGRAMS: >- list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ >- echo " rm -f" $$list; \ >- rm -f $$list >-+pfswb$(EXEEXT): $(pfswb_OBJECTS) $(pfswb_DEPENDENCIES) >-+ @rm -f pfswb$(EXEEXT) >-+ $(CXXLINK) $(pfswb_LDFLAGS) $(pfswb_OBJECTS) $(pfswb_LDADD) $(LIBS) >- pfsabsolute$(EXEEXT): $(pfsabsolute_OBJECTS) $(pfsabsolute_DEPENDENCIES) >- @rm -f pfsabsolute$(EXEEXT) >- $(CXXLINK) $(pfsabsolute_OBJECTS) $(pfsabsolute_LDADD) $(LIBS) > >Property changes on: graphics/pfstools/files/patch-src-filter-Makefile.in >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-pfscat.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-filter-pfscat.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-pfscat.cpp (nonexistent) >@@ -1,37 +0,0 @@ >---- src/filter/pfscat.cpp.orig 2008-01-01 13:01:21 UTC >-+++ src/filter/pfscat.cpp >-@@ -27,6 +27,7 @@ >- #include <pfs.h> >- #include <climits> >- #include <iostream> >-+#include <vector> >- #include <getopt.h> >- #include <fcntl.h> >- #include <stdlib.h> >-@@ -202,16 +203,12 @@ if (alignment==UNSP) throw pfs::Exceptio >- >- pfs::FrameFileIterator it ( argc, argv, "rb", NULL, NULL, optString, cmdLineOptions); >- int pipe_no = 0; >--pfs::FrameFile * ff; >--ff = (pfs::FrameFile *) malloc ((pipe_no+1) * sizeof(pfs::FrameFile)); >-- >-+std::vector<pfs::FrameFile> ff; >- while (1) { >-- ff[pipe_no] = it.getNextFrameFile(); >-+ ff.push_back(it.getNextFrameFile()); >- if (ff[pipe_no].fh == NULL) break; // no more files >- pipe_no++; >-- ff=(pfs::FrameFile *) realloc(ff, (pipe_no+1)*sizeof(pfs::FrameFile)); >- } >-- >- if(pipe_no == 0) { // no named pipes >- pipe_no = 1; >- pipes = false; >-@@ -408,7 +405,6 @@ if(!pipes) { >- } >- >- for (int i=0; i<pipe_no; i++) it.closeFrameFile(ff[i]); >--free(ff); >- } >- >- > >Property changes on: graphics/pfstools/files/patch-src-filter-pfscat.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-pfsclamp.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-filter-pfsclamp.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-pfsclamp.cpp (nonexistent) >@@ -1,13 +0,0 @@ >---- src/filter/pfsclamp.cpp.orig 2005-11-02 13:35:42 UTC >-+++ src/filter/pfsclamp.cpp >-@@ -151,8 +151,8 @@ void clampFrames( int argc, char* argv[] >- } >- else >- { >-- clampMin = (clampMin>1e-4) ? clampMin : 1e-4; >-- clampMax = (clampMax<1e8) ? clampMax : 1e8; >-+ clampMin = (clampMin>1e-20) ? clampMin : 1e-20; >-+ clampMax = (clampMax<1e+20) ? clampMax : 1e+20; >- if( clampMin >= clampMax ) >- throw pfs::Exception("incorrect clamping range"); >- } > >Property changes on: graphics/pfstools/files/patch-src-filter-pfsclamp.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-pfsextractchannels.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-filter-pfsextractchannels.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-pfsextractchannels.cpp (nonexistent) >@@ -1,11 +0,0 @@ >---- src/filter/pfsextractchannels.cpp.orig 2005-06-15 13:36:54 UTC >-+++ src/filter/pfsextractchannels.cpp >-@@ -46,7 +46,7 @@ void printHelp() >- "See man page for more information.\n" ); >- } >- >--static void errorCheck( bool condition, char *string ) >-+static void errorCheck( bool condition, char const *string ) >- { >- if( !condition ) { >- fprintf( stderr, PROG_NAME " error: %s\n", string ); > >Property changes on: graphics/pfstools/files/patch-src-filter-pfsextractchannels.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-pfspanoramic.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-filter-pfspanoramic.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-pfspanoramic.cpp (nonexistent) >@@ -1,38 +0,0 @@ >---- src/filter/pfspanoramic.cpp.orig 2010-02-18 11:27:03 UTC >-+++ src/filter/pfspanoramic.cpp >-@@ -93,7 +93,7 @@ class Vector3D >- } >- >- //TODO: optimize rotations by precomputing sines and cosines >-- Vector3D rotateX(double angle) >-+ void rotateX(double angle) >- { >- angle *= (M_PI / 180); >- >-@@ -107,7 +107,7 @@ class Vector3D >- z = z2; >- } >- >-- Vector3D rotateY(double angle) >-+ void rotateY(double angle) >- { >- angle *= (M_PI / 180); >- >-@@ -121,7 +121,7 @@ class Vector3D >- z = z2; >- } >- >-- Vector3D rotateZ(double angle) >-+ void rotateZ(double angle) >- { >- angle *= (M_PI / 180); >- >-@@ -195,7 +195,7 @@ class ProjectionFactory >- { >- char *opts; >- >-- if(opts = strchr(name, '/')) >-+ if ((opts = strchr(name, '/'))) >- { >- *opts++ = '\0'; >- } > >Property changes on: graphics/pfstools/files/patch-src-filter-pfspanoramic.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-pfstag.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-filter-pfstag.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-pfstag.cpp (nonexistent) >@@ -1,23 +0,0 @@ >---- src/filter/pfstag.cpp.orig 2005-06-15 13:36:54 UTC >-+++ src/filter/pfstag.cpp >-@@ -58,7 +58,7 @@ struct TagOperation >- string channel; >- }; >- >--typedef list<TagOperation> ListOfTags; >-+typedef std::list<TagOperation> ListOfTags; >- >- TagOperation parseTagOperation( const char *tag, bool remove ) >- { >-@@ -133,9 +133,9 @@ void setTagsOnFrames( int argc, char* ar >- for( it = setTags.begin(); it != setTags.end(); it++ ) { >- TagOperation &tagop = *it; >- if( tagop.remove ) >-- cerr << PROG_NAME ": remove tag '" << tagop.name << "'\n"; >-+ std::cerr << PROG_NAME ": remove tag '" << tagop.name << "'\n"; >- else >-- cerr << PROG_NAME ": set tag '" << tagop.name << "' to '" << tagop.value << "'\n"; >-+ std::cerr << PROG_NAME ": set tag '" << tagop.name << "' to '" << tagop.value << "'\n"; >- } >- >- } > >Property changes on: graphics/pfstools/files/patch-src-filter-pfstag.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-filter-pfswb.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-filter-pfswb.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-filter-pfswb.cpp (nonexistent) >@@ -1,302 +0,0 @@ >---- src/filter/pfswb.cpp.orig 2016-08-12 19:10:44 UTC >-+++ src/filter/pfswb.cpp >-@@ -0,0 +1,299 @@ >-+/** >-+ * @file pfswb.cpp >-+ * @brief Adjust white balance in RGB color space >-+ * >-+ * This file is a part of PFSTOOLS package. >-+ * ---------------------------------------------------------------------- >-+ * Copyright (C) 2008 Iouri V. Ivliev >-+ * >-+ * 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. >-+ * >-+ * 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 >-+ * ---------------------------------------------------------------------- >-+ * >-+ * @author Iouri V. Ivliev <ii@any.com.ru> >-+ * >-+ * $Id: $ >-+ */ >-+ >-+#include <config.h> >-+ >-+#include <exception> >-+#include <iostream> >-+#include <sys/limits.h> >-+#include <stdlib.h> >-+#include <getopt.h> >-+ >-+#include <pfs.h> >-+ >-+#define PROG_NAME "pfswb" >-+ >-+class QuietException >-+{ >-+}; >-+ >-+static void printHelp() >-+{ >-+ std::cerr << PROG_NAME " (" PACKAGE_STRING ") :\n" >-+ "\t[--red <val>] [--green <val>] [--blue <val>]\n" >-+ "\t[--auto] [--x <val>] [--y <val>] [--width <val>] [--height <val>]\n" >-+ "\t[--keep-lum]\n" >-+ "\t[--verbose] [--help]\n" >-+ "See man page for more information.\n"; >-+} >-+ >-+// verbose mode >-+static bool verbose = false; >-+ >-+// auto WB >-+static bool autowb = false; >-+// default gray box bounds >-+static int x = 0; >-+static int y = 0; >-+static int width = INT_MAX/2; >-+static int height = INT_MAX/2; >-+ >-+// keep original luminance >-+static bool keep = false; >-+ >-+// default WB multipliers >-+static float red = 1.f; >-+static float green = 1.f; >-+static float blue = 1.f; >-+ >-+static void multipliers( >-+ const pfs::Array2D &R, const pfs::Array2D &G, const pfs::Array2D &B, >-+ float &r, float &g, float &b) >-+{ >-+ r = red; >-+ g = green; >-+ b = blue; >-+ if (!autowb) return; >-+ // auto WB gray box >-+ int w = R.getCols(); >-+ int h = R.getRows(); >-+ if (x>=w || y>=h) >-+ throw pfs::Exception("gray box is out of frame bounds"); >-+ int x1 = width+x; >-+ if (x1>w) x1 = w; >-+ int y1 = height+y; >-+ if (y1>h) y1 = h; >-+ VERBOSE_STR >-+ << "auto WB gray box: " >-+ << (x1-x) << "x" << (y1-y) << "+" << x << "+" << y << std::endl; >-+ // auto WB multipliers >-+ double ar = 0.; >-+ double ag = 0.; >-+ double ab = 0.; >-+ for (int y0=y; y0<y1; ++y0) >-+ { >-+ for (int x0=x; x0<x1; ++x0) >-+ { >-+ ar += R(x0,y0); >-+ ag += G(x0,y0); >-+ ab += B(x0,y0); >-+ } >-+ } >-+ int n = (x1-x)*(y1-y); >-+ ar /= n; >-+ ag /= n; >-+ ab /= n; >-+ VERBOSE_STR << "average red value: " << ar << std::endl; >-+ VERBOSE_STR << "average green value: " << ag << std::endl; >-+ VERBOSE_STR << "average blue value: " << ab << std::endl; >-+ float a = (float)((ar+ag+ab)/3.); >-+ r *= a/ar; >-+ g *= a/ag; >-+ b *= a/ab; >-+} >-+ >-+static void pfswb() >-+{ >-+ pfs::DOMIO pfsio; >-+ VERBOSE_STR << "auto WB: " << (autowb ? "yes" : "no" ) << std::endl; >-+ VERBOSE_STR << "base red multiplier value: " << red << std::endl; >-+ VERBOSE_STR << "base green multiplier value: " << green << std::endl; >-+ VERBOSE_STR << "base blue multiplier value: " << blue << std::endl; >-+ VERBOSE_STR << "keep original luminance: " << (keep ? "yes" : "no" ) << std::endl; >-+ while (true) >-+ { >-+ // Read frame >-+ pfs::Frame *frame = pfsio.readFrame( stdin ); >-+ if (!frame) >-+ { >-+ break; // No more frames >-+ } >-+ // Get channels >-+ pfs::Channel *X, *Y, *Z; >-+ frame->getXYZChannels(X, Y, Z); >-+ if (!(Y && X && Z)) >-+ { >-+ throw pfs::Exception( "Missing X, Y, Z channels in the PFS stream" ); >-+ } >-+ int w = Y->getCols(); >-+ int h = Y->getRows(); >-+ int s = w*h; >-+ float min = 1e20, max = -1e20; >-+ for (int i=s; i--; ) >-+ { >-+ float const &l = (*Y)(i); >-+ if (min > l) min = l; >-+ if (max < l) max = l; >-+ } >-+ VERBOSE_STR << "luminance range of original frame: " << min << ":" << max << std::endl; >-+ // Convert from XYZ to RGB >-+ pfs::transformColorSpace(pfs::CS_XYZ, X, Y, Z, pfs::CS_RGB, X, Y, Z); >-+ // WB adjustment >-+ float r, g, b; >-+ multipliers(*X,*Y,*Z,r,g,b); >-+ VERBOSE_STR << "red multiplier value: " << r << std::endl; >-+ VERBOSE_STR << "green multiplier value: " << g << std::endl; >-+ VERBOSE_STR << "blue multiplier value: " << b << std::endl; >-+ for (int i=s; i--; ) >-+ { >-+ (*X)(i) *= r; >-+ (*Y)(i) *= g; >-+ (*Z)(i) *= b; >-+ } >-+ // Convert back to XYZ >-+ pfs::transformColorSpace(pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z); >-+ float amin = 1e20, amax = -1e20; >-+ for (int i=s; i--; ) >-+ { >-+ float const &l = (*Y)(i); >-+ if (amin > l) amin = l; >-+ if (amax < l) amax = l; >-+ } >-+ VERBOSE_STR << "luminance range of adjusted frame: " << amin << ":" << amax << std::endl; >-+ if (keep) >-+ { >-+ float k = (max-min)/(amax-amin); >-+ float nmin = 1e20, nmax = -1e20; >-+ for (int i=s; i--; ) >-+ { >-+ float const l = ((*Y)(i)-amin)*k+min; >-+ if (nmin > l) nmin = l; >-+ if (nmax < l) nmax = l; >-+ (*Y)(i) = l; >-+ (*X)(i) *= k; >-+ (*Z)(i) *= k; >-+ } >-+ VERBOSE_STR << "restored luminance range: " << nmin << ":" << nmax << std::endl; >-+ } >-+ // Write frame >-+ pfsio.writeFrame(frame, stdout); >-+ pfsio.freeFrame(frame); >-+ } >-+} >-+ >-+int main(int argc, char *const argv[]) >-+{ >-+ static const struct option cmdLineOptions[] = { >-+ { "help", no_argument, NULL, 'h' }, >-+ { "verbose", no_argument, NULL, 'v' }, >-+ { "auto", no_argument, NULL, 'A' }, >-+ { "x", required_argument, NULL, 'X' }, >-+ { "y", required_argument, NULL, 'Y' }, >-+ { "width", required_argument, NULL, 'W' }, >-+ { "height", required_argument, NULL, 'H' }, >-+ { "keep-lum", no_argument, NULL, 'k' }, >-+ { "red", required_argument, NULL, 'r' }, >-+ { "green", required_argument, NULL, 'g' }, >-+ { "blue", required_argument, NULL, 'b' }, >-+ { NULL, 0, NULL, 0 } >-+ }; >-+ >-+ try >-+ { >-+ int optionIndex = 0; >-+ while (true) >-+ { >-+ int c = getopt_long(argc, argv, "hvAX:Y:W:H:kr:g:b:", cmdLineOptions, &optionIndex); >-+ if (c == -1) >-+ { >-+ break; >-+ } >-+ switch (c) >-+ { >-+ case 'h': >-+ printHelp(); >-+ throw QuietException(); >-+ case 'v': >-+ verbose = true; >-+ break; >-+ case 'A': >-+ autowb = true; >-+ break; >-+ case 'X': >-+ x = (int)strtol(optarg, NULL, 10); >-+ if (x<=0) >-+ throw pfs::Exception("gray box x value out of range, should be >0"); >-+ break; >-+ case 'Y': >-+ y = (int)strtol(optarg, NULL, 10); >-+ if (y<=0) >-+ throw pfs::Exception("gray box y value out of range, should be >0"); >-+ break; >-+ case 'W': >-+ width = (int)strtol(optarg, NULL, 10); >-+ if (width<=0) >-+ throw pfs::Exception("gray box width value out of range, should be >0"); >-+ break; >-+ case 'H': >-+ height = (int)strtol(optarg, NULL, 10); >-+ if (height<=0) >-+ throw pfs::Exception("gray box height value out of range, should be >0"); >-+ break; >-+ case 'k': >-+ keep = true; >-+ break; >-+ case 'r': >-+ red = strtof(optarg, NULL); >-+ if (red<=0.0f) >-+ throw pfs::Exception("red multiplier value out of range, should be >0"); >-+ break; >-+ case 'g': >-+ green = strtof(optarg, NULL); >-+ if (green<=0.0f) >-+ throw pfs::Exception("green multiplier value out of range, should be >0"); >-+ break; >-+ case 'b': >-+ blue = strtof(optarg, NULL); >-+ if (blue<=0.0f) >-+ throw pfs::Exception("blue multiplier value out of range, should be >0"); >-+ break; >-+ case '?': >-+ throw QuietException(); >-+ case ':': >-+ throw QuietException(); >-+ } >-+ } >-+ >-+ pfswb(); >-+ } >-+ catch (std::exception ex) >-+ { >-+ std::cerr << PROG_NAME" std error: " << ex.what() << std::endl; >-+ return EXIT_FAILURE; >-+ } >-+ catch (pfs::Exception ex) >-+ { >-+ std::cerr << PROG_NAME" error: " << ex.getMessage() << std::endl; >-+ return EXIT_FAILURE; >-+ } >-+ catch (QuietException ex) >-+ { >-+ return EXIT_FAILURE; >-+ } >-+ return EXIT_SUCCESS; >-+} > >Property changes on: graphics/pfstools/files/patch-src-filter-pfswb.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-hdrhtml-hdrhtml.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-hdrhtml-hdrhtml.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-hdrhtml-hdrhtml.cpp (nonexistent) >@@ -1,192 +0,0 @@ >---- src/hdrhtml/hdrhtml.cpp.orig 2009-03-11 21:45:55 UTC >-+++ src/hdrhtml/hdrhtml.cpp >-@@ -27,6 +27,7 @@ >- >- #include "hdrhtml.h" >- >-+#include <limits> >- #include <algorithm> >- #include <math.h> >- #include <fstream> >-@@ -48,6 +49,8 @@ >- >- #include <config.h> >- >-+#define log2f(x) ((float)logf(x)/logf(2)) >-+ >- // ================================================ >- // Parameters controllig the web page >- // ================================================ >-@@ -94,8 +97,8 @@ public: >- >- if( min_val > max_val ) // missing min/max info >- { >-- min_val = numeric_limits<T>::max(); >-- max_val = numeric_limits<T>::min(); >-+ min_val = std::numeric_limits<T>::max(); >-+ max_val = std::numeric_limits<T>::min(); >- >- for( int k=0; k < d_size; k++ ) { >- if( data[k] > max_val ) max_val = data[k]; >-@@ -195,6 +198,7 @@ public: >- this->y_i = new float[lut_size]; >- own_y_i = true; >- memcpy(this->y_i, other.y_i, lut_size * sizeof(float)); >-+ return *this; >- } >- >- ~UniformArrayLUT() >-@@ -341,7 +345,7 @@ public: >- for( int k = 1; k < bin_n; k++ ) >- hist.n[k] += hist.n[k-1]; >- >--// cerr << "d_size: " << d_size << " hist.n: " << hist.n[bin_n-1] << "\n"; >-+// std::cerr << "d_size: " << d_size << " hist.n: " << hist.n[bin_n-1] << "\n"; >- assert( hist.n[bin_n-1] == d_size ); >- } >- >-@@ -361,7 +365,7 @@ public: >- // Text template file utils >- // ================================================ >- >--typedef void (*replace_callback)( ostream &out, void *user_data, const char *parameter ); >-+typedef void (*replace_callback)( std::ostream &out, void *user_data, const char *parameter ); >- >- class ReplacePattern >- { >-@@ -403,7 +407,7 @@ public: >- { >- } >- >-- virtual void write_replacement( ostream &out, const char *parameter = NULL ) >-+ virtual void write_replacement( std::ostream &out, const char *parameter = NULL ) >- { >- if( callback != NULL ) >- callback( out, user_data, parameter ); >-@@ -567,7 +571,7 @@ public: >- // Skip white spaces >- while( line_str[pos] == ' ' || line_str[pos] == '\t' ) pos++; >- int new_pos = line_str.find_first_of( ',', pos ); >-- int len; >-+ size_t len; >- if( new_pos == std::string::npos ) { >- if( k != columns-1 ) { >- std::string full_message( "Missing column data in the file: " ); >-@@ -576,16 +580,16 @@ public: >- } >- len = std::string::npos; >- } else >-- len = new_pos-pos; >-+ len = (size_t)(new_pos-pos); >- >- float value; >- if( len == 0 ) { >-- value = numeric_limits<float>::quiet_NaN(); >-+ value = std::numeric_limits<float>::quiet_NaN(); >- } else { >- std::string token = line_str.substr( pos, len ); >- const char *str_beg = token.c_str(); >- char *str_end; >--// cerr << "token: " << str_beg << "\n"; >-+// std::cerr << "token: " << str_beg << "\n"; >- value = strtof( str_beg, &str_end ); >- if( str_beg == str_end ) { >- std::ostringstream error_message; >-@@ -643,15 +647,15 @@ void HDRHTMLSet::add_image( int width, i >- basis_table.data[0][k] = log2f( basis_table.data[0][k] ); >- >- // Fix zero and negative values in the image, convert to log2 space, find min and max values >-- float img_min = numeric_limits<float>::max(); >-- float img_max = numeric_limits<float>::min(); >-+ float img_min = std::numeric_limits<float>::max(); >-+ float img_max = std::numeric_limits<float>::min(); >- { >- float *arrays[] = { R, G, B, Y }; >- int k; >- >- for( k = 0; k < 4; k++ ) { >- float *x = arrays[k]; >-- float min_val = numeric_limits<float>::max(), max_val = numeric_limits<float>::min(); >-+ float min_val = std::numeric_limits<float>::max(), max_val = std::numeric_limits<float>::min(); >- for( int i=0; i < pixels; i++ ) { >- if( x[i] < min_val && x[i] > 0) >- min_val = x[i]; >-@@ -741,7 +745,7 @@ void HDRHTMLSet::add_image( int width, i >- for( int k=1; k <= f8_stops+1; k++ ) { >- >- >-- float max_value = (float)numeric_limits<unsigned short>::max(); //(1<<16) -1; >-+ float max_value = (float)std::numeric_limits<unsigned short>::max(); //(1<<16) -1; >- >- float exp_multip = log2f(1/powf( 2, l_start + k*8 )); >- >-@@ -796,9 +800,9 @@ void HDRHTMLSet::add_image( int width, i >- >- } >- >--void print_image_objects( ostream &out, void *user_data, const char *parameter ); >--void print_cf_table( ostream &out, void *user_data, const char *parameter ); >--void print_image_htmlcode( ostream &out, void *user_data, const char *parameter ); >-+void print_image_objects( std::ostream &out, void *user_data, const char *parameter ); >-+void print_cf_table( std::ostream &out, void *user_data, const char *parameter ); >-+void print_image_htmlcode( std::ostream &out, void *user_data, const char *parameter ); >- >- void HDRHTMLSet::generate_webpage( const char *page_template, const char *image_template, >- const char *object_output, const char *html_output) >-@@ -852,11 +856,11 @@ void HDRHTMLSet::generate_webpage( const >- >- } >- >--void print_image_objects( ostream &out, void *user_data, const char *parameter ) >-+void print_image_objects( std::ostream &out, void *user_data, const char *parameter ) >- { >- HDRHTMLSet *hdrhtml_set = (HDRHTMLSet*)user_data; >- >-- list<HDRHTMLImage>::iterator it; >-+ std::list<HDRHTMLImage>::iterator it; >- for( it = hdrhtml_set->image_list.begin(); it != hdrhtml_set->image_list.end(); it++ ) { >- std::string obj_name( "hdr_" ); >- obj_name.append( it->base_name ); >-@@ -882,7 +886,7 @@ void print_image_objects( ostream &out, >- >- } >- >--void print_image_htmlcode( ostream &out, HDRHTMLSet *hdrhtml_set, const HDRHTMLImage &it ) >-+void print_image_htmlcode( std::ostream &out, HDRHTMLSet *hdrhtml_set, const HDRHTMLImage &it ) >- { >- std::string obj_name( "hdr_" ); >- obj_name.append( it.base_name ); >-@@ -907,13 +911,13 @@ void print_image_htmlcode( ostream &out, >- >- } >- >--void print_image_htmlcode( ostream &out, void *user_data, const char *parameter ) >-+void print_image_htmlcode( std::ostream &out, void *user_data, const char *parameter ) >- { >- HDRHTMLSet *hdrhtml_set = (HDRHTMLSet*)user_data; >- >- if( parameter != NULL ) { >- >-- list<HDRHTMLImage>::iterator it; >-+ std::list<HDRHTMLImage>::iterator it; >- for( it = hdrhtml_set->image_list.begin(); it != hdrhtml_set->image_list.end(); it++ ) { >- if( it->base_name.compare( parameter ) == 0 ) >- break; >-@@ -925,7 +929,7 @@ void print_image_htmlcode( ostream &out, >- >- } else { >- >-- list<HDRHTMLImage>::iterator it; >-+ std::list<HDRHTMLImage>::iterator it; >- for( it = hdrhtml_set->image_list.begin(); it != hdrhtml_set->image_list.end(); it++ ) { >- >- print_image_htmlcode( out, hdrhtml_set, *it ); >-@@ -935,7 +939,7 @@ void print_image_htmlcode( ostream &out, >- >- } >- >--void print_cf_table( ostream &out, void *user_data, const char *parameter ) >-+void print_cf_table( std::ostream &out, void *user_data, const char *parameter ) >- { >- CSVTable *cf = (CSVTable*)user_data; >- > >Property changes on: graphics/pfstools/files/patch-src-hdrhtml-hdrhtml.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-matlab-compatibility.h >=================================================================== >--- graphics/pfstools/files/patch-src-matlab-compatibility.h (revision 462869) >+++ graphics/pfstools/files/patch-src-matlab-compatibility.h (nonexistent) >@@ -1,10 +0,0 @@ >---- src/matlab/compatibility.h.orig 2007-03-01 14:10:57 UTC >-+++ src/matlab/compatibility.h >-@@ -59,6 +59,6 @@ >- >- #endif >- >--#define DEBUG_STR if(1); else cerr >-+#define DEBUG_STR if(1); else std::cerr >- >- #endif > >Property changes on: graphics/pfstools/files/patch-src-matlab-compatibility.h >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-octave-pfsclose.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-octave-pfsclose.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-octave-pfsclose.cpp (nonexistent) >@@ -1,14 +0,0 @@ >---- src/octave/pfsclose.cpp.orig 2016-02-12 17:10:27 UTC >-+++ src/octave/pfsclose.cpp >-@@ -53,9 +53,9 @@ DEFUN_DLD( pfsclose, args, , helpString >- return retval; >- } >- >-- Octave_map pfsStream = args(0).map_value(); >-+ octave_map pfsStream = args(0).map_value(); >- >-- Octave_map::const_iterator itFH = pfsStream.seek( "FH" ); >-+ octave_map::const_iterator itFH = pfsStream.seek( "FH" ); >- if( itFH == pfsStream.end() || >- !pfsStream.contents( itFH )(0).is_real_scalar() ) >- { > >Property changes on: graphics/pfstools/files/patch-src-octave-pfsclose.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-octave-pfsget.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-octave-pfsget.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-octave-pfsget.cpp (nonexistent) >@@ -1,58 +0,0 @@ >---- src/octave/pfsget.cpp.orig 2016-02-12 17:10:27 UTC >-+++ src/octave/pfsget.cpp >-@@ -52,9 +52,9 @@ DEFUN_DLD( pfsget, args, , helpString) >- return retval; >- } >- >-- Octave_map pfsStream = args(0).map_value(); >-+ octave_map pfsStream = args(0).map_value(); >- >-- Octave_map::const_iterator itFH = pfsStream.seek( "FH" ); >-+ octave_map::const_iterator itFH = pfsStream.seek( "FH" ); >- if( itFH == pfsStream.end() || >- !pfsStream.contents( itFH )(0).is_real_scalar() ) >- { >-@@ -63,7 +63,7 @@ DEFUN_DLD( pfsget, args, , helpString) >- } >- FILE *fh = (FILE*)((long)(pfsStream.contents( itFH )(0).double_value())); >- >-- Octave_map::const_iterator itMode = pfsStream.seek( "MODE" ); >-+ octave_map::const_iterator itMode = pfsStream.seek( "MODE" ); >- if( itMode == pfsStream.end() || !pfsStream.contents( itMode )(0).is_string() ) >- { >- error( SCRIPT_NAME ": MODE field missing in the structure or it has wrong type"); >-@@ -95,7 +95,7 @@ DEFUN_DLD( pfsget, args, , helpString) >- >- // Add channels as matrices to pfs stream struct >- { >-- Octave_map channels; >-+ octave_scalar_map channels; >- >- pfs::ChannelIteratorPtr cit( frame->getChannelIterator() ); >- while( cit->hasNext() ) { >-@@ -115,7 +115,7 @@ DEFUN_DLD( pfsget, args, , helpString) >- >- //Add tags >- { >-- Octave_map tags; >-+ octave_scalar_map tags; >- >- pfs::TagIteratorPtr it( frame->getTags()->getIterator() ); >- while( it->hasNext() ) { >-@@ -124,14 +124,14 @@ DEFUN_DLD( pfsget, args, , helpString) >- } >- pfsStream.assign( "tags", tags ); >- >-- Octave_map channelTagList; >-+ octave_scalar_map channelTagList; >- >- //Copy all channel tags >- pfs::ChannelIteratorPtr cit( frame->getChannelIterator() ); >- while( cit->hasNext() ) { >- pfs::Channel *ch = cit->getNext(); >- >-- Octave_map channelTags; >-+ octave_scalar_map channelTags; >- >- pfs::TagIteratorPtr tit( ch->getTags()->getIterator() ); >- while( tit->hasNext() ) { > >Property changes on: graphics/pfstools/files/patch-src-octave-pfsget.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-octave-pfsopen.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-octave-pfsopen.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-octave-pfsopen.cpp (nonexistent) >@@ -1,20 +0,0 @@ >---- src/octave/pfsopen.cpp.orig 2016-02-12 17:10:27 UTC >-+++ src/octave/pfsopen.cpp >-@@ -137,7 +137,7 @@ DEFUN_DLD( pfsopen, args, , helpString) >- } >- } >- >-- Octave_map pfsStream; >-+ octave_map pfsStream; >- pfsStream.assign( "FH", octave_value((double)((long)fh)) ); >- pfsStream.assign( "MODE", writeMode ? octave_value("W") : octave_value("R") ); >- pfsStream.assign( "EOF", octave_value(false) ); >-@@ -145,7 +145,7 @@ DEFUN_DLD( pfsopen, args, , helpString) >- if( writeMode ) { >- pfsStream.assign( "columns", octave_value(width) ); >- pfsStream.assign( "rows", octave_value(height) ); >-- Octave_map channels; >-+ octave_map channels; >- pfsStream.assign( "channels", octave_value(channels) ); >- } >- > >Property changes on: graphics/pfstools/files/patch-src-octave-pfsopen.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-octave-pfsput.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-octave-pfsput.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-octave-pfsput.cpp (nonexistent) >@@ -1,103 +0,0 @@ >---- src/octave/pfsput.cpp.orig 2016-02-12 17:10:27 UTC >-+++ src/octave/pfsput.cpp >-@@ -52,9 +52,9 @@ DEFUN_DLD( pfsput, args, , helpString) >- return retval; >- } >- >-- Octave_map pfsStream = args(0).map_value(); >-+ octave_map pfsStream = args(0).map_value(); >- >-- Octave_map::const_iterator itFH = pfsStream.seek( "FH" ); >-+ octave_map::const_iterator itFH = pfsStream.seek( "FH" ); >- if( itFH == pfsStream.end() || >- !pfsStream.contents( itFH )(0).is_real_scalar() ) >- { >-@@ -65,7 +65,7 @@ DEFUN_DLD( pfsput, args, , helpString) >- >- // Check mode >- { >-- Octave_map::const_iterator itMode = pfsStream.seek( "MODE" ); >-+ octave_map::const_iterator itMode = pfsStream.seek( "MODE" ); >- if( itMode == pfsStream.end() || !pfsStream.contents( itMode )(0).is_string() ) >- { >- error( SCRIPT_NAME ": MODE field missing in the structure or it has wrong type"); >-@@ -80,8 +80,8 @@ DEFUN_DLD( pfsput, args, , helpString) >- // Get width & height >- int width, height; >- { >-- Octave_map::const_iterator itCols = pfsStream.seek( "columns" ); >-- Octave_map::const_iterator itRows = pfsStream.seek( "rows" ); >-+ octave_map::const_iterator itCols = pfsStream.seek( "columns" ); >-+ octave_map::const_iterator itRows = pfsStream.seek( "rows" ); >- if( itCols == pfsStream.end() || itRows == pfsStream.end() || >- !pfsStream.contents( itCols )(0).is_real_scalar() || >- !pfsStream.contents( itRows )(0).is_real_scalar() ) >-@@ -94,9 +94,9 @@ DEFUN_DLD( pfsput, args, , helpString) >- } >- >- // Get channels >-- Octave_map channels; >-+ octave_map channels; >- { >-- Octave_map::const_iterator itChannels = pfsStream.seek( "channels" ); >-+ octave_map::const_iterator itChannels = pfsStream.seek( "channels" ); >- if( itChannels == pfsStream.end() || >- !pfsStream.contents( itChannels )(0).is_map() ) >- { >-@@ -111,7 +111,7 @@ DEFUN_DLD( pfsput, args, , helpString) >- pfs::Frame *frame = ctx.createFrame( width, height ); >- >- // For each channel in the 'channels' map >-- for( Octave_map::iterator itCh = channels.begin(); itCh != channels.end(); itCh++ ) { >-+ for( octave_map::iterator itCh = channels.begin(); itCh != channels.end(); itCh++ ) { >- std::string channelName = channels.key(itCh); >- >- if( !channels.contents( itCh )(0).is_real_matrix() ) { >-@@ -135,15 +135,15 @@ DEFUN_DLD( pfsput, args, , helpString) >- >- // Copy frame tags >- { >-- Octave_map::const_iterator itTags = pfsStream.seek( "tags" ); >-+ octave_map::const_iterator itTags = pfsStream.seek( "tags" ); >- if( itTags != pfsStream.end() ) { >- if( !pfsStream.contents( itTags )(0).is_map() ) >- { >- throw pfs::Exception( "'tags' field must be a structure" ); >- } >- >-- Octave_map tags = pfsStream.contents( itTags )(0).map_value(); >-- for( Octave_map::iterator itTag = tags.begin(); itTag != tags.end(); itTag++ ) { >-+ octave_map tags = pfsStream.contents( itTags )(0).map_value(); >-+ for( octave_map::iterator itTag = tags.begin(); itTag != tags.end(); itTag++ ) { >- std::string tagName = tags.key(itTag); >- >- if( !tags.contents( itTag )(0).is_string() ) >-@@ -156,14 +156,14 @@ DEFUN_DLD( pfsput, args, , helpString) >- >- // Copy channel tags >- { >-- Octave_map::const_iterator itChTags = pfsStream.seek( "channelTags" ); >-+ octave_map::const_iterator itChTags = pfsStream.seek( "channelTags" ); >- if( itChTags != pfsStream.end() ) { >- if( !pfsStream.contents( itChTags )(0).is_map() ) >- { >- throw pfs::Exception( "'channelTags' field must be a structure" ); >- } >-- Octave_map tagChannels = pfsStream.contents( itChTags )(0).map_value(); >-- for( Octave_map::iterator itCh = tagChannels.begin(); itCh != tagChannels.end(); itCh++ ) { >-+ octave_map tagChannels = pfsStream.contents( itChTags )(0).map_value(); >-+ for( octave_map::iterator itCh = tagChannels.begin(); itCh != tagChannels.end(); itCh++ ) { >- std::string channelName = tagChannels.key(itCh); >- if( !tagChannels.contents( itCh )(0).is_map() ) { >- throw pfs::Exception( "each channelTags file must be a structure" ); >-@@ -173,8 +173,8 @@ DEFUN_DLD( pfsput, args, , helpString) >- throw pfs::Exception( "can not set channel tag if channel is missing" ); >- } >- >-- Octave_map tags = tagChannels.contents( itCh )(0).map_value(); >-- for( Octave_map::iterator itTag = tags.begin(); itTag != tags.end(); itTag++ ) { >-+ octave_map tags = tagChannels.contents( itCh )(0).map_value(); >-+ for( octave_map::iterator itTag = tags.begin(); itTag != tags.end(); itTag++ ) { >- std::string tagName = tags.key(itTag); >- if( !tags.contents( itTag )(0).is_string() ) >- throw pfs::Exception( "all channel tags must be given as strings" ); > >Property changes on: graphics/pfstools/files/patch-src-octave-pfsput.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-pfs-pfs.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-pfs-pfs.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-pfs-pfs.cpp (nonexistent) >@@ -1,29 +0,0 @@ >---- src/pfs/pfs.cpp.orig 2010-07-14 09:44:27 UTC >-+++ src/pfs/pfs.cpp >-@@ -71,7 +71,7 @@ const char *PFSFILEID="PFS1\x0a"; >- // TagContainer implementation >- //------------------------------------------------------------------------------ >- >--typedef list<string> TagList; >-+typedef std::list<string> TagList; >- >- class TagIteratorImpl: public TagIterator >- { >-@@ -570,7 +570,7 @@ public: >- >- //Read channel IDs and tags >- // FrameImpl::ChannelID *channelID = new FrameImpl::ChannelID[channelCount]; >-- list<ChannelImpl*> orderedChannel; >-+ std::list<ChannelImpl*> orderedChannel; >- for( int i = 0; i < channelCount; i++ ) { >- char channelName[MAX_CHANNEL_NAME+1], *rs; >- rs = fgets( channelName, MAX_CHANNEL_NAME, inputStream ); >-@@ -592,7 +592,7 @@ public: >- >- >- //Read channels >-- list<ChannelImpl*>::iterator it; >-+ std::list<ChannelImpl*>::iterator it; >- for( it = orderedChannel.begin(); it != orderedChannel.end(); it++ ) { >- ChannelImpl *ch = *it; >- int size = frame->getWidth()*frame->getHeight(); > >Property changes on: graphics/pfstools/files/patch-src-pfs-pfs.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-pfs-pfs.h >=================================================================== >--- graphics/pfstools/files/patch-src-pfs-pfs.h (revision 462869) >+++ graphics/pfstools/files/patch-src-pfs-pfs.h (nonexistent) >@@ -1,54 +0,0 @@ >---- src/pfs/pfs.h.orig 2006-03-01 17:21:16 UTC >-+++ src/pfs/pfs.h >-@@ -115,6 +115,7 @@ namespace pfs >- class TagIterator >- { >- public: >-+ virtual ~TagIterator() {}; >- /** >- * Get next item on the list. >- * >-@@ -135,6 +136,7 @@ namespace pfs >- class TagContainer >- { >- public: >-+ virtual ~TagContainer() {}; >- /** >- * Get a string tag of the name tagName from the TagContainer. >- * @param tagName name of the tag to retrieve >-@@ -181,6 +183,7 @@ namespace pfs >- */ >- class Channel : public Array2D { >- public: >-+ virtual ~Channel() {}; >- /** >- * Gets width of the channel (in pixels). >- * This is a synonym for Array2D::getCols(). >-@@ -226,6 +229,7 @@ namespace pfs >- class ChannelIterator >- { >- public: >-+ virtual ~ChannelIterator() {}; >- /** >- * Get next item on the list. >- */ >-@@ -580,7 +584,9 @@ namespace pfs >- */ >- Exception( const char* const message ) >- { >-- strcpy( msg, message ); >-+ const size_t s = sizeof(msg)/sizeof(msg[0]) - 1; >-+ strncpy( msg, message, s ); >-+ msg[s] = '\0'; >- } >- >- ~Exception() {}; >-@@ -590,7 +596,7 @@ namespace pfs >- * >- * @return text description of the cause for the exception >- */ >-- const char* getMessage() >-+ const char* getMessage() const >- { >- return msg; >- } > >Property changes on: graphics/pfstools/files/patch-src-pfs-pfs.h >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-pfs-pfsutils.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-pfs-pfsutils.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-pfs-pfsutils.cpp (nonexistent) >@@ -1,11 +0,0 @@ >---- src/pfs/pfsutils.cpp.orig 2006-09-21 21:42:54 UTC >-+++ src/pfs/pfsutils.cpp >-@@ -81,7 +81,7 @@ class FrameFileIteratorImpl >- char fileName[1024]; >- FILE *stdinout; >- >-- typedef list<FilePattern> PatternList; >-+ typedef std::list<FilePattern> PatternList; >- >- PatternList patternList; >- PatternList::iterator currentPattern; > >Property changes on: graphics/pfstools/files/patch-src-pfs-pfsutils.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-pfsglview-picture_io.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-pfsglview-picture_io.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-pfsglview-picture_io.cpp (nonexistent) >@@ -1,29 +0,0 @@ >---- src/pfsglview/picture_io.cpp.orig 2006-11-20 12:13:13 UTC >-+++ src/pfsglview/picture_io.cpp >-@@ -87,7 +87,7 @@ void PictureIO::setFrame(pfs::Frame *fra >- return; >- >- // only XYZ channels are taken into consideration >-- if( channel != "XYZ" && channel != "X00" && channel != "0Y0" && channel != "00Z" ) { >-+ if (strcmp(channel,"XYZ") && strcmp(channel,"X00") && strcmp(channel,"0Y0") && strcmp(channel,"00Z")) { >- if(verbose) >- fprintf( stderr, "WARNING: wrong channel (PictureIO::setFrame())\n"); >- return; >-@@ -573,7 +573,7 @@ float PictureIO::getDynamicRange(void) { >- } >- std::sort(vec.begin(), vec.end()); >- >-- printf("size: %d\n", vec.size()); >-+ printf("size: %lu\n", vec.size()); >- >- val = vec[0]; >- std::vector<unsigned int> svec; >-@@ -589,7 +589,7 @@ float PictureIO::getDynamicRange(void) { >- >- float dr = svec[ svec.size()-1] / svec[0]; >- >-- printf("min:%ld max:%ld svec size: %d dr:%f\n", vec[0], vec[ vec.size()-1], svec.size(), log10(dr)); >-+ printf("min:%u max:%u svec size: %lu dr:%f\n", vec[0], vec[ vec.size()-1], svec.size(), log10(dr)); >- >- >- > >Property changes on: graphics/pfstools/files/patch-src-pfsglview-picture_io.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-pfsglview-picture_io.h >=================================================================== >--- graphics/pfstools/files/patch-src-pfsglview-picture_io.h (revision 462869) >+++ graphics/pfstools/files/patch-src-pfsglview-picture_io.h (nonexistent) >@@ -1,13 +0,0 @@ >---- src/pfsglview/picture_io.h.orig 2008-07-29 16:14:30 UTC >-+++ src/pfsglview/picture_io.h >-@@ -6,7 +6,9 @@ >- >- #define MAX_FRAMES_IN_MEMORY 10 >- >--class pfs::Frame; >-+namespace pfs { >-+class Frame; >-+}; >- enum LumMappingMethod { >- MAP_LINEAR, >- MAP_GAMMA1_4, > >Property changes on: graphics/pfstools/files/patch-src-pfsglview-picture_io.h >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src-pfsview-pfsview_widget.cpp >=================================================================== >--- graphics/pfstools/files/patch-src-pfsview-pfsview_widget.cpp (revision 462869) >+++ graphics/pfstools/files/patch-src-pfsview-pfsview_widget.cpp (nonexistent) >@@ -1,22 +0,0 @@ >---- src/pfsview/pfsview_widget.cpp.orig 2011-04-30 14:01:17 UTC >-+++ src/pfsview/pfsview_widget.cpp >-@@ -142,7 +142,7 @@ void PFSViewWidget::setFrame( pfs::Frame >- // Chose first available channel >- pfs::ChannelIterator *it = frame->getChannels(); >- if( !it->hasNext() ) // TODO: failover >-- throw new pfs::Exception( "No channels available!" ); >-+ throw pfs::Exception( "No channels available!" ); >- visibleChannel = it->getNext()->getName(); >- } else if( visibleChannel != COLOR_CHANNELS ) { >- // Get a new pointer, as the old frame object >-@@ -335,8 +335,8 @@ static void mapFrameToImage( pfs::Array2 >- assert( !color || (color && B != NULL) ); >- >- >-- float lutPixFloor[257*2]; >-- QRgb lutPixel[257*2]; >-+ float lutPixFloor[257*2+1]; >-+ QRgb lutPixel[257*2+1]; >- int lutSize; >- if( !color && ( negativeTreatment == NEGATIVE_GREEN_SCALE || >- negativeTreatment == NEGATIVE_ABSOLUTE ) ) { // Handle negative numbers > >Property changes on: graphics/pfstools/files/patch-src-pfsview-pfsview_widget.cpp >___________________________________________________________________ >Deleted: fbsd:nokeywords >## -1 +0,0 ## >-yes >\ No newline at end of property >Deleted: svn:eol-style >## -1 +0,0 ## >-native >\ No newline at end of property >Deleted: svn:mime-type >## -1 +0,0 ## >-text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_camera_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_CMakeLists.txt (working copy) >@@ -0,0 +1,11 @@ >+--- src/camera/CMakeLists.txt.orig 2018-01-19 06:59:44 UTC >++++ src/camera/CMakeLists.txt >+@@ -4,7 +4,7 @@ include_directories ("${PROJECT_BINARY_D >+ link_directories("${PROJECT_SOURCE_DIR}/src/pfs") >+ >+ set(TRG pfshdrcalibrate) >+-add_executable(${TRG} ${TRG}.cpp responses.cpp robertson02.cpp mitsunaga99.cpp mitsunaga99_numerical.cpp nrutil.cpp "${GETOPT_OBJECT}") >++add_executable(${TRG} ${TRG}.cpp responses.cpp robertson02.cpp robertson02old.cpp mitsunaga99.cpp mitsunaga99_numerical.cpp nrutil.cpp "${GETOPT_OBJECT}") >+ target_link_libraries(${TRG} pfs) >+ install (TARGETS ${TRG} DESTINATION bin) >+ install (FILES ${TRG}.1 DESTINATION ${MAN_DIR}) > >Property changes on: graphics/pfstools/files/patch-src_camera_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.1 >=================================================================== >--- graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.1 (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.1 (working copy) >@@ -0,0 +1,112 @@ >+--- src/camera/pfshdrcalibrate.1.orig 2018-01-19 06:59:44 UTC >++++ src/camera/pfshdrcalibrate.1 >+@@ -5,12 +5,14 @@ from a set of differently exposed images >+ >+ .SH SYNOPSIS >+ .B pfshdrcalibrate >+-[--response <type>] [--calibration <type>] >++[--response <type>] [--weights <type>] >++[--method <type>] [--no-calibration] >+ [--gauss <val>] >+ [--response-file <filename.m>] >+ [--save-response <filename.m>] >+ [--multiplier <val>] [--bpp <val>] >+-[--luminance] [--samples <val>] >++[--luminance] [--deghosting] >++[--samples <val>] >+ [--help] [--verbose] >+ >+ .SH DESCRIPTION >+@@ -38,13 +40,20 @@ automatic self-calibration. Predefined r >+ "gamma", "log". Default is "linear". This option can be used only with Robertson method. >+ >+ .TP >+---calibration <type>, -c <type> >++--weights <type>, -w <type> >++ >++Allows one to choose from predefined weighting finctions. Predefined >++weighting finctions are: "gauss" and "composite". Default is "composite". >++ >++.TP >++--method <type>, -c <type> >+ >+ Type of automatic self-calibration method used for recovery of the >+ response curve and/or type of method used for HDR merging. Accepted >+-types include: "robertson", "mitsunaga". "robertson" is the default >+-and recommended algorithm (see commends in the Bugs section >+-below). More infomation on the algorithms can be found in: >++types include: "robertson", "mitsunaga" and "robertson-old". >++"robertson" is the default and recommended algorithm (see commends >++in the Bugs section below). More infomation on the algorithms can >++be found in: >+ .IP >+ M.A. Robertson, S. Borman and R.L. Stevenson >+ .PD 0 >+@@ -63,6 +72,12 @@ Radiometric Self Calibration >+ .IP >+ In: Proc on IEEE Conf. on Computer Vision and Pattern Recognition (CVPR'99). Volume 1, p. 1374 >+ .PD >++ >++.TP >++--no-calibration, -C >++ >++Disable self-calibration. Only do HDR merging or save responce. >++ >+ .TP >+ --gauss <val>, -g <val> >+ >+@@ -80,16 +95,15 @@ response curve (see -c option). >+ --save-response <filename.m>, -s <filename.m> >+ >+ Saves the response curve calculated during automatic self-calibration >+-stage in a matlab format file. Can be later reused for set of images >+-captured with given camera. Also works fine for plotting with gnuplot. >++stage (or predefined curve when self-calibration disabled) in a matlab >++format file. Can be later reused for set of images captured with given >++camera. Also works fine for plotting with gnuplot. >+ >+ .TP >+ --multiplier <val>, -m <val> >+ >+ Input multiplier value. Can be used to manipulate the range of source >+-exposures. Default value for Robertson method is 256 since LDR images >+-are by default scaled to 0..1. This value is set to 1.0 for Mitsunaga >+-method. >++exposures. Default value is 1. >+ >+ .TP >+ --bpp <val>, -b <val> >+@@ -97,6 +111,13 @@ method. >+ Number of bits per pixel in input data from the camera. Default value >+ is 8. >+ >++Actually, the bpp parameter sets the number of levels used in the >++camera's response to 2**<val>. When a response curve is loaded from >++a file, this parameter has no effect. In this case, the number >++of input levels will be the same as the response curve levels. >++To change the number of levels in the response curve file, use the >++pfssmoothresp(1) command. >++ >+ .TP >+ --samples <val>, -p <val> >+ >+@@ -172,6 +193,7 @@ mitsunaga self-calibration method with 1 >+ .BR pfsindcraw (1) >+ .BR pfsabsolute (1) >+ .BR pfsglview (1) >++.BR pfssmoothresp (1) >+ .SH BUGS >+ Currently Mitsunaga and Nayar's method does not produce reliable >+ camera response curves. Robertson's method should be used instead. >+@@ -186,6 +208,11 @@ research purposes and getting accurate r >+ generating good looking images. The heuristics could hide the well >+ visible artifacts, but would also introduce error to the measurements. >+ .PP >++Sometimes Robertson's automatic self-calibration with "robertson" >++method cannot successfully comlete. Try to use "robertson-old" method >++\- the previous (stolen from pfscalibration 1.4) implementation >++of the Robertson02 algorithm. >++.PP >+ For any other issues please report bugs and comments on implementation >+ to the discussion group http://groups.google.com/group/pfstools >+ > >Property changes on: graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.1 >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.cpp (working copy) >@@ -0,0 +1,755 @@ >+--- src/camera/pfshdrcalibrate.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/camera/pfshdrcalibrate.cpp >+@@ -42,6 +42,7 @@ >+ >+ #include <responses.h> >+ #include <robertson02.h> >++#include <robertson02old.h> >+ #include <mitsunaga99.h> >+ >+ using namespace std; >+@@ -58,9 +59,12 @@ inline float max3( float a, float b, flo >+ inline float min3( float a, float b, float c ) >+ { >+ // ignore zero values >+- if( int(a)==0 ) a=1e8; >+- if( int(b)==0 ) b=1e8; >+- if( int(c)==0 ) c=1e8; >++ if (a <= std::numeric_limits<float>::epsilon()) >++ a = std::numeric_limits<float>::max(); >++ if (b <= std::numeric_limits<float>::epsilon()) >++ b = std::numeric_limits<float>::max(); >++ if (c <= std::numeric_limits<float>::epsilon()) >++ c = std::numeric_limits<float>::max(); >+ >+ float min = (a<b) ? a : b; >+ return (c<min) ? c : min; >+@@ -78,11 +82,12 @@ class QuietException >+ void printHelp() >+ { >+ fprintf( stderr, PROG_NAME ": \n" >+- "\t[--calibration <type>] [--luminance]\n" >+- "\t[--response <type>] [--response-file <filename.m>] \n" >+- "\t[--save-response <filename.m>] \n" >++ "\t[--method <type>] [--no-calibration]\n" >++ "\t[--response <type>] [--weights <type>]\n" >++ "\t[--response-file <filename.m>] [--save-response <filename.m>]\n" >+ "\t[--multiplier <val>] \n" >+ "\t[--bpp <val>] \n" >++ "\t[--luminance] [--deghosting]\n" >+ "\t[--verbose] [--help]\n" >+ "See man page for more information.\n" ); >+ } >+@@ -103,20 +108,22 @@ void pfshdrcalibrate( int argc, char* ar >+ enum TCalibration >+ { NONE, CALIBRATE } opt_calibration = CALIBRATE; >+ enum TResponse >+- { FROM_FILE, LINEAR, GAMMA, LOG10 } opt_response = LINEAR; >++ { FROM_FILE_RESP, LINEAR_RESP, GAMMA_RESP, LOG10_RESP } opt_response = LINEAR_RESP; >++ enum TWeight >++ { FROM_FILE_WEIGHT, GAUSS_WEIGHT, COMPOSITE_WEIGHT } opt_weight = COMPOSITE_WEIGHT; >+ enum TMethod >+- { ROBERTSON_METHOD, MITSUNAGA_METHOD } opt_method = ROBERTSON_METHOD; >++ { ROBERTSON_METHOD, MITSUNAGA_METHOD, ROBERTSON_OLD_METHOD } opt_method = ROBERTSON_METHOD; >+ >+ /* defaults */ >+- float input_multiplier = 1.0f; >++ float input_multiplier = -1.0f; >+ FILE *responseFile = NULL; >+ FILE *responseSaveFile = NULL; >+ int opt_bpp = 8; >+ bool opt_fillgaps = false; /* todo remove */ >+ bool opt_luminance = false; >+ float opt_gauss = 0.2; >+- int opt_maxresponse = -1; >+- int opt_minresponse = -1; >++ float opt_maxresponse = -1.0f; >++ float opt_minresponse = -1.0f; >+ unsigned long mitsunaga_sample_no = MITSUNAGA_SAMPLES_NO; >+ bool opt_deghosting = false; >+ >+@@ -128,10 +135,12 @@ void pfshdrcalibrate( int argc, char* ar >+ { "verbose", no_argument, NULL, 'v' }, >+ { "luminance", no_argument, NULL, 'Y' }, >+ { "method", required_argument, NULL, 'c' }, >++ { "no-calibrate", no_argument, NULL, 'C' }, >+ { "gauss", required_argument, NULL, 'g' }, >+ { "max-response", required_argument, NULL, 'A' }, >+ { "min-response", required_argument, NULL, 'S' }, >+ { "response", required_argument, NULL, 'r' }, >++ { "weights", required_argument, NULL, 'w' }, >+ { "response-file", required_argument, NULL, 'f' }, >+ { "save-response", required_argument, NULL, 's' }, >+ { "multiplier", required_argument, NULL, 'm' }, >+@@ -144,7 +153,7 @@ void pfshdrcalibrate( int argc, char* ar >+ int optionIndex = 0; >+ while( ( c = getopt_long( argc, >+ argv, >+- "hvYc:g:r:f:s:m:b:p:xd", >++ "hvYc:g:r:f:s:m:b:p:xdA:S:w:C", >+ cmdLineOptions, >+ &optionIndex) ) >+ != -1 ) >+@@ -172,27 +181,22 @@ void pfshdrcalibrate( int argc, char* ar >+ opt_fillgaps = true; >+ break; >+ >++ /* disable calibration, apply or save responce only */ >++ case 'C': >++ opt_calibration = NONE; >++ break; >++ >+ /* calibration method */ >+ case 'c': >+- if( strcmp( optarg, "mitsunaga" ) == 0 ) >+- { >+- opt_calibration = CALIBRATE; >+- opt_method = MITSUNAGA_METHOD; >+- } >+- else >+- if( strcmp( optarg, "robertson" ) == 0 ) >+- { >+- opt_calibration = CALIBRATE; >+- opt_method = ROBERTSON_METHOD; >+- } >+- else >+- if( strcmp( optarg, "none" ) == 0 ) >+- { >+- opt_calibration = NONE; >+- opt_method = ROBERTSON_METHOD; >+- } >+- else >+- throw pfs::Exception("unsupported automatic self-calibration method"); >++ if( strcmp( optarg, "mitsunaga" ) == 0 ) { >++ opt_method = MITSUNAGA_METHOD; >++ } else if( strcmp( optarg, "robertson" ) == 0 ) { >++ opt_method = ROBERTSON_METHOD; >++ } else if( strcmp( optarg, "robertson-old" ) == 0 ) { >++ opt_method = ROBERTSON_OLD_METHOD; >++ } else { >++ throw pfs::Exception("unsupported automatic self-calibration method"); >++ } >+ break; >+ >+ /* support of Gaussian weighting curve */ >+@@ -206,22 +210,32 @@ void pfshdrcalibrate( int argc, char* ar >+ /* predefined response curve */ >+ case 'r': >+ if( strcmp( optarg, "linear" ) == 0 ) { >+- opt_response = LINEAR; >++ opt_response = LINEAR_RESP; >+ } else if( strcmp( optarg, "gamma" ) == 0 ) { >+- opt_response = GAMMA; >++ opt_response = GAMMA_RESP; >+ } else if( strcmp( optarg, "log" ) == 0 ) { >+- opt_response = LOG10; >++ opt_response = LOG10_RESP; >+ } else { >+- throw pfs::Exception("unknown standard response (check the manpage or use default)"); >++ throw pfs::Exception("unknown standard response (check the manpage or use default)"); >++ } >++ break; >++ >++ /* predefined weighting function */ >++ case 'w': >++ if( strcmp( optarg, "gauss" ) == 0 ) { >++ opt_weight = GAUSS_WEIGHT; >++ } else if( strcmp( optarg, "composite" ) == 0 ) { >++ opt_weight = COMPOSITE_WEIGHT; >++ } else { >++ throw pfs::Exception("unknown standard weight (check the manpage or use default)"); >+ } >+- opt_calibration = NONE; >+ break; >+ >+ >+ /* response curve from file */ >+ case 'f': >+- opt_response = FROM_FILE; >+- opt_calibration = NONE; >++ opt_response = FROM_FILE_RESP; >++ opt_weight = FROM_FILE_WEIGHT; >+ responseFile = fopen(optarg, "r"); >+ if( !responseFile ) >+ throw pfs::Exception("could not open file with response curve"); >+@@ -257,15 +271,15 @@ void pfshdrcalibrate( int argc, char* ar >+ >+ >+ case 'A': // max response >+- opt_maxresponse = atoi(optarg); >+- if( opt_maxresponse<=opt_minresponse ) >+- throw pfs::Exception("max response should be higher than min response"); >++ opt_maxresponse = atof(optarg); >++ if( opt_maxresponse<0.0f || opt_maxresponse>1.0f ) >++ throw pfs::Exception("max response is out of range: 0..1"); >+ break; >+ >+ case 'S': // min response >+- opt_minresponse = atoi(optarg); >+- if( opt_minresponse<0 ) >+- throw pfs::Exception("min response should be >0"); >++ opt_minresponse = atof(optarg); >++ if( opt_minresponse<0.0f || opt_minresponse>1.0f ) >++ throw pfs::Exception("min response is out of range: 0..1"); >+ break; >+ >+ case 'd': >+@@ -293,39 +307,35 @@ void pfshdrcalibrate( int argc, char* ar >+ // input_multiplier = 255; >+ //Ivo end >+ >+- if( opt_method == ROBERTSON_METHOD ) >+- { >+- input_multiplier = float( 1 << opt_bpp ) - 1; >+- opt_gauss *= input_multiplier; >+- } >+- >+- >+- if( opt_method == MITSUNAGA_METHOD ) >++ if( input_multiplier == -1.0f ) >++ { >+ input_multiplier = 1.0f; >++ } >+ >+ >+ //--- verbose information and load initialization data >+- VERBOSE_STR << "Assuming " << opt_bpp << " Bits per pixel in the LDR images (use --bpp to change this)" << endl; >++ //VERBOSE_STR << "Assuming " << opt_bpp << " Bits per pixel in the LDR images (use --bpp to change this)" << endl; >+ >+- VERBOSE_STR << "calibrating channels: " >++ VERBOSE_STR << (opt_calibration == CALIBRATE ? "calibrating and " : "") >++ << "recovering channels: " >+ << (opt_luminance ? "LUMINANCE" : "RGB") << endl; >+ >+ switch( opt_response ) >+ { >+ >+- case FROM_FILE: >++ case FROM_FILE_RESP: >+ VERBOSE_STR << "response curve from file" << endl; >+ break; >+ >+- case LINEAR: >++ case LINEAR_RESP: >+ VERBOSE_STR << "initial response: linear" << endl; >+ break; >+ >+- case GAMMA: >++ case GAMMA_RESP: >+ VERBOSE_STR << "initial response: gamma" << endl; >+ break; >+ >+- case LOG10: >++ case LOG10_RESP: >+ VERBOSE_STR << "initial response: logarithmic" << endl; >+ break; >+ >+@@ -344,8 +354,8 @@ void pfshdrcalibrate( int argc, char* ar >+ >+ >+ // number of input levels >+- int M = (int) powf( 2.0f, opt_bpp ); >+- VERBOSE_STR << "number of input levels: " << M << endl; >++ int M = 1 << opt_bpp; >++ VERBOSE_STR << "input levels from bpp: " << M << " (" << opt_bpp << "bpp)" << endl; >+ VERBOSE_STR << "input multiplier: " << input_multiplier << endl; >+ >+ >+@@ -363,7 +373,7 @@ void pfshdrcalibrate( int argc, char* ar >+ int height = 0; >+ int size = 0; >+ >+- float minResponse = M; >++ float minResponse = 1.0f; >+ float maxResponse = 0.0f; >+ >+ // collected exposures >+@@ -451,15 +461,15 @@ void pfshdrcalibrate( int argc, char* ar >+ >+ for( int i=0 ; i < size ; i++ ) >+ { >+- (*eY.yi)( i ) = (*Y)( i ) * input_multiplier; >+- >+- float val = (*eY.yi)( i ); >+- >+- if( val>0.0f ) // discard zero values >++ float val = (*Y)( i ) * input_multiplier; >++ if (val < std::numeric_limits<float>::epsilon()) >++ val = std::numeric_limits<float>::epsilon(); >++ else // discard zero values >+ { >+ maxResponse = (maxResponse > val) ? maxResponse : val; >+ minResponse = (minResponse < val) ? minResponse : val; >+ } >++ (*eY.yi)( i ) = val; >+ } >+ >+ imgsY.push_back( eY ); >+@@ -489,21 +499,26 @@ void pfshdrcalibrate( int argc, char* ar >+ for( int i = 0 ; i < size ; i++ ) >+ { >+ >+- (*eR.yi)( i ) = (*X)( i ) * input_multiplier; >+- (*eG.yi)( i ) = (*Y)( i ) * input_multiplier; >+- (*eB.yi)( i ) = (*Z)( i ) * input_multiplier; >+- >+- float maxval = max3( (*eR.yi)( i ), >+- (*eG.yi)( i ), >+- (*eB.yi)( i ) ); >++ float r = (*X)( i ) * input_multiplier; >++ if (r < std::numeric_limits<float>::epsilon()) >++ r = std::numeric_limits<float>::epsilon(); >++ float g = (*Y)( i ) * input_multiplier; >++ if (g < std::numeric_limits<float>::epsilon()) >++ g = std::numeric_limits<float>::epsilon(); >++ float b = (*Z)( i ) * input_multiplier; >++ if (b < std::numeric_limits<float>::epsilon()) >++ b = std::numeric_limits<float>::epsilon(); >+ >+- float minval = min3( (*eR.yi)( i ), >+- (*eG.yi)( i ), >+- (*eB.yi)( i ) ); >++ float maxval = max3( r, g, b ); >++ float minval = min3( r, g, b ); >+ >+ maxResponse = (maxResponse > maxval) ? maxResponse : maxval; >+ minResponse = (minResponse < minval) ? minResponse : minval; >+ >++ (*eR.yi)( i ) = r; >++ (*eG.yi)( i ) = g; >++ (*eB.yi)( i ) = b; >++ >+ } >+ >+ // add to exposures list >+@@ -523,21 +538,27 @@ void pfshdrcalibrate( int argc, char* ar >+ >+ >+ // some more info on input frames >+- VERBOSE_STR << "registered values: min=" << (int) minResponse >+- << " max=" << (int) maxResponse << endl; >++ VERBOSE_STR << "registered camera response range: min=" << minResponse >++ << "; max=" << maxResponse << endl; >++ >++ if( minResponse < 0.0f ) >++ throw pfs::Exception( "input min value < 0 (wrong input?)" ); >++ if( maxResponse > 1.0f ) >++ throw pfs::Exception( "input max value > 1 (use input multiplier to adjust range)" ); >+ >+ if( opt_minresponse == -1 ) >+- opt_minresponse = (int) minResponse; >+- >++ opt_minresponse = minResponse; >+ if( opt_maxresponse == -1 ) >+- opt_maxresponse = (int) maxResponse; >++ opt_maxresponse = maxResponse; >++ if (opt_maxresponse<=opt_minresponse) >++ throw pfs::Exception("max response should be higher than min response"); >+ >+- if( opt_response != FROM_FILE ) >+- VERBOSE_STR << "camera response range: min=" << opt_minresponse >+- << " max=" << opt_maxresponse << endl; >+- >+- if( maxResponse >= M ) >+- throw pfs::Exception( "input value higher than defined number of input levels (adjust the number of bits per pixel)" ); >++ if( opt_response != FROM_FILE_RESP ) >++ VERBOSE_STR << "using camera response range: min=" << opt_minresponse >++ << "; max=" << opt_maxresponse << endl; >++ >++ int Mmin( (int) (M * (opt_minresponse + std::numeric_limits<float>::epsilon())) ); >++ int Mmax( (int) (M * (opt_maxresponse - std::numeric_limits<float>::epsilon())) ); >+ >+ /* ------------------------------------------------------------------------------------------------ */ >+ /* ---------------------------- preparation of images done ---------------------------------------- */ >+@@ -548,24 +569,35 @@ void pfshdrcalibrate( int argc, char* ar >+ /* ------------------------------------------------------------------------------------------------ */ >+ >+ // weighting function representing confidence in accuracy of acquisition >+- float* w = new float [ M ]; >++ int Mw(M); >++ float* w = new float [ Mw ]; >+ >+ if( w == NULL ) >+ throw pfs::Exception( "could not allocate memory for weighting function" ); >+ >+ /* 1.4: currently, weights are always Gaussian */ >+ /* Composite function works better for extreme cases */ >+- weightsComposite ( w, M, opt_minresponse, opt_maxresponse, opt_gauss ); >+- >+-// weightsGauss( w, M, opt_minresponse, opt_maxresponse, opt_gauss ); >++ switch (opt_weight) >++ { >++ case GAUSS_WEIGHT: >++ weightsGauss( w, Mw, Mmin, Mmax, opt_gauss ); >++ break; >++ default: //case COMPOSITE_WEIGHT: >++ weightsComposite ( w, Mw, Mmin, Mmax, opt_gauss ); >++ break; >++ } >+ >+ // camera response functions for each channel >+- float* Iy = new float [ M ]; >+- float* Ir = new float [ M ]; >+- float* Ig = new float [ M ]; >+- float* Ib = new float [ M ]; >++ int Mr(M); >++ float* Ir = new float [ Mr ]; >++ int Mg(M); >++ float* Ig = new float [ Mg ]; >++ int Mb(M); >++ float* Ib = new float [ Mb ]; >++ int &My(Mg); >++ float* &Iy(Ig); >+ >+- if( Iy == NULL || Ib == NULL || Ig == NULL || Ib == NULL ) >++ if( Ib == NULL || Ig == NULL || Ib == NULL ) >+ throw pfs::Exception( "could not allocate memory for camera responses" ); >+ >+ // initial responses >+@@ -573,65 +605,79 @@ void pfshdrcalibrate( int argc, char* ar >+ { >+ >+ /* ------ Response function from file ------ */ >+- case FROM_FILE: >++ case FROM_FILE_RESP: >+ >+ if( opt_luminance ) >+- { >++ { >+ >+- bool loadY_ok = responseLoad ( responseFile, Iy, M ); >+- bool loadW_ok = weightsLoad ( responseFile, w, M ); >+- fclose( responseFile ); >+- >+- if( !loadY_ok || !loadW_ok ) >+- throw pfs::Exception( "could not load response curve from file" ); >++ bool load_ok = responseLoad( responseFile, &Iy, &My ); >++ if (load_ok && opt_weight == FROM_FILE_WEIGHT) >++ load_ok = weightsLoad( responseFile, &w, &Mw ); >++ fclose( responseFile ); >+ >+- } >++ if( !load_ok ) >++ throw pfs::Exception( "could not load response curve from file" ); >+ >+- else >++ if (M != My) >++ VERBOSE_STR << "input levels from response: " << My << ", was " << M << endl; >++ >++ } >++ else >+ { >+ >+ // read camera response from file (and also weights) >+- bool loadR_ok = responseLoad ( responseFile, Ir, M ); >+- bool loadG_ok = responseLoad ( responseFile, Ig, M ); >+- bool loadB_ok = responseLoad ( responseFile, Ib, M ); >+- bool loadW_ok = weightsLoad ( responseFile, w, M ); >++ bool load_ok = responseLoad( responseFile, &Ir, &Mr ); >++ if (load_ok) >++ load_ok = responseLoad( responseFile, &Ig, &Mg ); >++ if (load_ok) >++ load_ok = responseLoad( responseFile, &Ib, &Mb ); >++ if (load_ok && opt_weight == FROM_FILE_WEIGHT) >++ load_ok = weightsLoad( responseFile, &w, &Mw ); >+ fclose( responseFile ); >+ >+- if( !loadR_ok || !loadG_ok || !loadB_ok || !loadW_ok ) >++ if( !load_ok ) >+ throw pfs::Exception( "could not load response curve from file" ); >++ >++ if (M != Mr || M != Mg || M != Mb) >++ VERBOSE_STR << "input levels from response: (" << Mr << "," << Mg << "," << Mb << "), was " << M << endl; >++ >+ } >+ >+- opt_calibration = NONE; >++ //if (M != Mw) >++ // weightsMinMax(w, Mw, Mmin, Mmax); >++ >+ break; >+ >+ /* ------ Response function linear ------ */ >+- case LINEAR: >+- responseLinear( Iy, M ); >+- responseLinear( Ir, M ); >+- responseLinear( Ig, M ); >+- responseLinear( Ib, M ); >++ case LINEAR_RESP: >++ //responseLinear( Iy, My ); >++ responseLinear( Ir, Mr ); >++ responseLinear( Ig, Mg ); >++ responseLinear( Ib, Mb ); >+ break; >+ >+ /* ------ Response function gamma ------ */ >+- case GAMMA: >+- responseGamma( Iy, M ); >+- responseGamma( Ir, M ); >+- responseGamma( Ig, M ); >+- responseGamma( Ib, M ); >++ case GAMMA_RESP: >++ //responseGamma( Iy, My ); >++ responseGamma( Ir, Mr ); >++ responseGamma( Ig, Mg ); >++ responseGamma( Ib, Mb ); >+ break; >+ >+ /* ------ Response function logarithmic ------ */ >+- case LOG10: >+- responseLog10( Iy, M ); >+- responseLog10( Ir, M ); >+- responseLog10( Ig, M ); >+- responseLog10( Ib, M ); >++ case LOG10_RESP: >++ //responseLog10( Iy, My ); >++ responseLog10( Ir, Mr ); >++ responseLog10( Ig, Mg ); >++ responseLog10( Ib, Mb ); >+ break; >+ >+ default: >+ throw pfs::Exception( "camera response not initialized" ); >+ break; >+- } >++ } >++ >++ weightsMinMax(w, Mw, Mmin, Mmax); >+ >+ >+ /* ------------------------------------------------------------------------------------------------ */ >+@@ -657,20 +703,20 @@ void pfshdrcalibrate( int argc, char* ar >+ if( opt_luminance ) >+ { >+ >+- int num = responseFillGaps( Iy, w, M ); >++ int num = responseFillGaps( Iy, My, w, My ); >+ >+- float perc = 100.0f * num / M; >++ float perc = 100.0f * num / My; >+ >+ VERBOSE_STR << "interpolated " << perc << "% of the Y response curve..." << endl; >+ } >+ else >+ { >+ >+- int numr = responseFillGaps ( Ir, w, M ); >+- int numg = responseFillGaps ( Ig, w, M ); >+- int numb = responseFillGaps ( Ib, w, M ); >++ int numr = responseFillGaps ( Ir, Mr, w, Mr ); >++ int numg = responseFillGaps ( Ig, Mg, w, Mg ); >++ int numb = responseFillGaps ( Ib, Mb, w, Mb ); >+ >+- float perc = 100.0f * ( numr + numb + numg) / ( 3 * M ); >++ float perc = 100.0f * ( numr + numb + numg) / ( Mr + Mg + Mb ); >+ >+ VERBOSE_STR << "interpolated " << perc << "% of the RGB response curve..." << endl; >+ } >+@@ -707,25 +753,34 @@ void pfshdrcalibrate( int argc, char* ar >+ >+ /* --------------------- Robertson Calibration --------------------- */ >+ case ROBERTSON_METHOD: >++ case ROBERTSON_OLD_METHOD: >+ >+- VERBOSE_STR << "automatic self-calibration method: robertson" << endl; >++ VERBOSE_STR << "automatic self-calibration method: robertson" << (opt_method == ROBERTSON_OLD_METHOD ? " (old)" : "") << endl; >+ >+ if( opt_luminance ) >+ { >+ VERBOSE_STR << "recovering Y channel..." << endl; >+- sp = robertson02_getResponse( Yj, imgsY, Iy, w, M); >++ sp = opt_method == ROBERTSON_OLD_METHOD >++ ? robertson02old_getResponse( Yj, imgsY, Iy, My, w, Mw) >++ : robertson02_getResponse( Yj, imgsY, Iy, My, w, Mw); >+ } >+ else >+ { >+ >+ VERBOSE_STR << "recovering R channel..." << endl; >+- sp = robertson02_getResponse( Xj, imgsR, Ir, w, M); >++ sp = opt_method == ROBERTSON_OLD_METHOD >++ ? robertson02old_getResponse( Xj, imgsR, Ir, Mr, w, Mw) >++ : robertson02_getResponse( Xj, imgsR, Ir, Mr, w, Mw); >+ >+ VERBOSE_STR << "recovering G channel..." << endl; >+- sp += robertson02_getResponse( Yj, imgsG, Ig, w, M); >++ sp += opt_method == ROBERTSON_OLD_METHOD >++ ? robertson02old_getResponse( Yj, imgsG, Ig, Mg, w, Mw) >++ : robertson02_getResponse( Yj, imgsG, Ig, Mg, w, Mw); >+ >+ VERBOSE_STR << "recovering B channel..." << endl; >+- sp += robertson02_getResponse( Zj, imgsB, Ib, w, M); >++ sp += opt_method == ROBERTSON_OLD_METHOD >++ ? robertson02old_getResponse( Zj, imgsB, Ib, Mb, w, Mw) >++ : robertson02_getResponse( Zj, imgsB, Ib, Mb, w, Mw); >+ >+ sp /= 3; >+ } >+@@ -742,12 +797,14 @@ void pfshdrcalibrate( int argc, char* ar >+ else >+ { >+ >++ if (Mw!=Mr || Mw!=Mg || Mw!=Mb) >++ throw pfs::Exception( "number of levels in functions (responce and weighting) must be the same for Mitsunaga & Nayar method"); >+ VERBOSE_STR << "Mitsunaga & Nayar ( " << mitsunaga_sample_no << " samples)" << endl; >+ >+ HDRCaptureMitsunaga* mits_calibration = new HDRCaptureMitsunaga(); >+ >+ mits_calibration -> capture ( imgsR, imgsG, imgsB, >+- M, 3, >++ Mw, 3, >+ Xj, Yj, Zj, >+ mitsunaga_sample_no, >+ Ir, Ig, Ib, >+@@ -783,36 +840,37 @@ void pfshdrcalibrate( int argc, char* ar >+ >+ /* --------------------- Robertson Apply Curve --------------------- */ >+ case ROBERTSON_METHOD: >++ case ROBERTSON_OLD_METHOD: >+ >+ if( opt_luminance ) >+ { >+ >+ VERBOSE_STR << "applying response to Y channel..." << endl; >+- sp = robertson02_applyResponse( Yj, imgsY, Iy, w, M); >++ sp = opt_method == ROBERTSON_OLD_METHOD >++ ? robertson02old_applyResponse( Yj, imgsY, Iy, My, w, Mw) >++ : robertson02_applyResponse( Yj, imgsY, Iy, My, w, Mw); >+ >+ } >+ else >+ { >+ >+- pfs::Array2D *RGB_out[3] = { Xj, Yj, Zj }; >+- const ExposureList *exposures[] = { &imgsR, &imgsG, &imgsB }; >+- const float *resp_curves[] = { Ir, Ig, Ib }; >++ if (opt_method == ROBERTSON_METHOD) { >++ pfs::Array2D *RGB_out[3] = { Xj, Yj, Zj }; >++ const ExposureList *exposures[] = { &imgsR, &imgsG, &imgsB }; >++ const float *resp_curves[] = { Ir, Ig, Ib }; >++ const int resp_curve_sizes[] = { Mr, Mg, Mb }; >+ >+- VERBOSE_STR << "applying response to RGB channels..." << endl; >+- sp = robertson02_applyResponseRGB( RGB_out, exposures, resp_curves, w, M, opt_deghosting ); >+- >+-/* >+- VERBOSE_STR << "applying response to R channel..." << endl; >+- sp = robertson02_applyResponse( Xj, imgsR, Ir, w, M); >+- >+- VERBOSE_STR << "applying response to G channel..." << endl; >+- sp += robertson02_applyResponse( Yj, imgsG, Ig, w, M); >+- >+- VERBOSE_STR << "applying response to B channel..." << endl; >+- sp += robertson02_applyResponse( Zj, imgsB, Ib, w, M); >+- >+- >+- sp /= 3;*/ >++ VERBOSE_STR << "applying response to RGB channels..." << endl; >++ sp = robertson02_applyResponseRGB( RGB_out, exposures, resp_curves, resp_curve_sizes, w, Mw, opt_deghosting ); >++ } else { >++ VERBOSE_STR << "applying response to R channel..." << endl; >++ sp = robertson02old_applyResponse( Xj, imgsR, Ir, Mr, w, Mw); >++ VERBOSE_STR << "applying response to G channel..." << endl; >++ sp += robertson02old_applyResponse( Yj, imgsG, Ig, Mg, w, Mw); >++ VERBOSE_STR << "applying response to B channel..." << endl; >++ sp += robertson02old_applyResponse( Zj, imgsB, Ib, Mb, w, Mw); >++ sp /= 3; >++ } >+ >+ if( sp > 0 ) >+ { >+@@ -830,17 +888,19 @@ void pfshdrcalibrate( int argc, char* ar >+ throw pfs::Exception( "recovering Y channel not implemented, use robertson calibration." ); >+ else >+ { >++ if (Mw!=Mr || Mw!=Mg || Mw!=Mb) >++ throw pfs::Exception( "number of levels in functions (responce and weighting) must be the same for Mitsunaga & Nayar method"); >+ HDRCaptureMitsunaga* mits_calibration = new HDRCaptureMitsunaga(); >+ >+ mits_calibration -> capture ( imgsR, imgsG, imgsB, >+- M, 3, >++ Mw, 3, >+ Xj, Yj, Zj, >+ mitsunaga_sample_no, >+ Ir, Ig, Ib, >+ w, 0 ); >+ >+ >+- // normalization >++ /*// normalization >+ VERBOSE_STR << "Normalization" << endl; >+ >+ float mmax = -1e30; >+@@ -859,7 +919,7 @@ void pfshdrcalibrate( int argc, char* ar >+ (*Xj)( j ) /= mmax; >+ (*Yj)( j ) /= mmax; >+ (*Zj)( j ) /= mmax; >+- } >++ }*/ >+ >+ } >+ break; >+@@ -883,16 +943,16 @@ void pfshdrcalibrate( int argc, char* ar >+ { >+ if( opt_luminance ) >+ { >+- responseSave( responseSaveFile, Iy, M, "IY" ); >+- weightsSave ( responseSaveFile, w, M, "W" ); >++ responseSave( responseSaveFile, Iy, My, M, "IY" ); >++ weightsSave ( responseSaveFile, w, Mw, M, "W" ); >+ fclose( responseSaveFile ); >+ } >+ else >+ { >+- responseSave( responseSaveFile, Ir, M, "IR" ); >+- responseSave( responseSaveFile, Ig, M, "IG" ); >+- responseSave( responseSaveFile, Ib, M, "IB" ); >+- weightsSave ( responseSaveFile, w, M, "W"); >++ responseSave( responseSaveFile, Ir, Mr, M, "IR" ); >++ responseSave( responseSaveFile, Ig, Mg, M, "IG" ); >++ responseSave( responseSaveFile, Ib, Mb, M, "IB" ); >++ weightsSave ( responseSaveFile, w, Mw, M, "W"); >+ fclose( responseSaveFile ); >+ } >+ } >+@@ -919,7 +979,7 @@ void pfshdrcalibrate( int argc, char* ar >+ // clean up memory >+ pfsio.freeFrame( frame ); >+ delete[] w; >+- delete[] Iy; >++ //delete[] Iy; >+ delete[] Ir; >+ delete[] Ig; >+ delete[] Ib; >+@@ -944,16 +1004,27 @@ int main( int argc, char* argv[] ) >+ pfshdrcalibrate( argc, argv ); >+ } >+ >+- catch( pfs::Exception ex ) >++ catch( std::exception const &ex ) >++ { >++ fprintf( stderr, PROG_NAME " error: %s\n", ex.what() ); >++ return EXIT_FAILURE; >++ } >++ >++ catch( pfs::Exception const &ex ) >+ { >+ fprintf( stderr, PROG_NAME " error: %s\n", ex.getMessage() ); >+ return EXIT_FAILURE; >+ } >+- >+- catch( QuietException ex ) >++ >++ catch( QuietException const &ex ) >+ { >+ return EXIT_FAILURE; >+ } >+- >++ >++ catch( ... ) >++ { >++ return EXIT_FAILURE; >++ } >++ >+ return EXIT_SUCCESS; >+ } > >Property changes on: graphics/pfstools/files/patch-src_camera_pfshdrcalibrate.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_responses.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_camera_responses.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_responses.cpp (working copy) >@@ -0,0 +1,378 @@ >+--- src/camera/responses.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/camera/responses.cpp >+@@ -27,10 +27,10 @@ >+ * $Id: responses.cpp,v 1.11 2011/02/25 13:45:14 ihrke Exp $ >+ */ >+ >+-#ifdef HAVE_CONFIG_H >+ #include <config.h> >+-#endif >+ >++#include <algorithm> >++#include <cmath> >+ #include <iostream> >+ #include <vector> >+ >+@@ -38,11 +38,17 @@ >+ #include <stdlib.h> >+ #include <math.h> >+ >++#include <pfs.h> >++ >+ #include <responses.h> >+ >+ #define MIN_WEIGHT 1e-3 >+ //#define MIN_WEIGHT 0.0f >+ >++#define PROG_NAME "responses" >++ >++extern bool verbose; /* verbose should be declared for each standalone code */ >++ >+ void dump_gnuplot( const char* filename, const float* array, int M ) >+ { >+ FILE* fp = fopen(filename, "w"); >+@@ -60,43 +66,47 @@ void dump_gnuplot( const char* filename, >+ dump_gnuplot(fn, array, M); >+ } >+ >++static float const minWeight(1e-3f); >+ >+-void weightsGauss( float* w, int M, int Mmin, int Mmax, float sigma ) >++void weightsGauss(float *w, int M, int Mmin, int Mmax, float sigma) >+ { >+- float mid = Mmin + ( Mmax - Mmin ) / 2.0f; >+- >+- std::cerr << "Mmin: " << Mmin << "mid: " << mid << "Mmax: " << Mmax << "M: " << M << std::endl; >+- >+- for( int m=0 ; m<M ; m++ ) >++ float step(-(Mmax-Mmin)/2.0f); >++ float const k(-sigma*40.0f/(step*step)); >++ float const mid(Mmin-step); >++ VERBOSE_STR >++ << "gauss: Mmin: " << Mmin >++ << "; Mmax: " << Mmax >++ << "; M: " << M >++ << "; mid: " << mid >++ << "; sigma: " << sigma >++ << "; k: " << k >++ << std::endl; >++ std::fill(w, w+Mmin, 0.0f); >++ std::fill(w+Mmax+1, w+M, 0.0f); >++ for (int m = Mmin; m <= Mmax; ++m, ++step) >++ { >++ w[m] = std::exp(k*step*step); >++ if (w[m] < minWeight) >+ { >+- // non-normalized Gaussian seems to have been used before (max=1 instead of int_-pi^pi = 1 ) >+- >+-#define SIGMA_CUT 2.0 >+- >+- float weight = exp( - (m - mid) * (m - mid) / ( 2 * sigma * sigma ) ); >+- //float weight = 1.0f / (sigma * sqrt ( 2.0 * M_PI )) * exp( - (m-mid)*(m-mid) / (2*sigma*sigma) ); >+- >+- /* robust Gaussian fixes saturation clipping problem */ >+- if ( fabs( m - mid ) < SIGMA_CUT * sigma ) >+- w[ m ] = weight; >+- else >+- { >+- w[m] = exp( - ( SIGMA_CUT * sigma )*( SIGMA_CUT * sigma ) / (2*sigma*sigma) ); >+- /* more efficient version below */ >+- // w [ m ] = exp ( - SIGMA_CUT * SIGMA_CUT / 2.0f ); >+- } >++ w[m] = 0.0f; >+ } >+- >++ //std::cerr << "m: " << m << "; step: " << step << "; w[m]: " << w[m] << std::endl; >++ } >+ } >+ >+- >+ void weightsComposite( float* w, int M, int Mmin, int Mmax, float sigma ) >+ { >+ float mid = Mmin + ( Mmax - Mmin ) / 2.0f; >+ float relative_dark_pos = 0.0; >+ >+ >+- std::cerr << "Mmin: " << Mmin << "mid: " << mid << "Mmax: " << Mmax << "M: " << M << std::endl; >++ VERBOSE_STR >++ << "composite: Mmin: " << Mmin >++ << "; Mmax: " << Mmax >++ << "; M: " << M >++ << "; mid: " << mid >++ << "; sigma: " << sigma >++ << std::endl; >+ >+ >+ for( int m=0 ; m<M ; m++ ) >+@@ -113,7 +123,7 @@ void weightsComposite( float* w, int M, >+ //float weight = 1.0f / (sigma * sqrt ( 2.0 * M_PI )) * exp( - (m-mid)*(m-mid) / (2*sigma*sigma) ); >+ >+ /* robust Gaussian fixes saturation clipping problem */ >+- if ( fabs( m - mid ) < SIGMA_CUT * sigma ) >++ if ( fabs( m - mid ) < SIGMA_CUT_WC * sigma ) >+ { >+ w [ m ] = weight; >+ } >+@@ -162,18 +172,22 @@ void weightsComposite( float* w, int M, >+ >+ void responseLinear( float* I, int M ) >+ { >+- for( int m=0 ; m<M ; m++ ) >+- I[m] = m / 255.0f; // range is not important, values are normalized later >++ float const scale(2.0f/(M-1)); >++ for( int m=0 ; m<M ; ++m ) >++ I[m] = scale * m; >+ } >+ >+ >+ void responseGamma( float* I, int M ) >+ { >+- float norm = M / 4.0f; >++ //float norm = M / 4.0f; >++ float const norm(2.0f/(M-1)); >++ static float const scale(1.0f / std::pow(0.5f, 2.2f)); >+ >+ // response curve decided empirically >+- for( int m=0 ; m<M ; m++ ) >+- I[m] = powf( m/norm, 1.7f ) + 1e-4; >++ for( int m=0 ; m<M ; ++m ) >++ //I[m] = powf( m/norm, 1.7f ) + 1e-4; >++ I[m] = scale * std::pow(m*norm, 2.2f); >+ } >+ >+ >+@@ -187,46 +201,49 @@ void responseLog10( float* I, int M ) >+ } >+ >+ >+-void responseSave( FILE* file, const float* I, int M, const char* name) >++void responseSave(FILE *file, float const *I, int Mr, int M, char const *name) >+ { >+ // response curve matrix header >+ fprintf(file, "# Camera response curve, channel %s\n", name); >+ fprintf(file, "# data layout: log10(response) | camera output | response\n"); >+ fprintf(file, "# name: %s\n", name); >+ fprintf(file, "# type: matrix\n"); >+- fprintf(file, "# rows: %d\n", M); >++ fprintf(file, "# rows: %d\n", Mr); >+ fprintf(file, "# columns: 3\n"); >+ >++ //float const factor(((float)Mr)/M); >+ // save response >+- for( int m=0 ; m<M ; m++ ) >+- if( I[m] > 0.0f ) >+- fprintf(file, " %e %4d %e\n", log10f(I[m]), m, I[m]); >+- else >+- fprintf(file, " %e %4d %e\n", -6.0f, m, I[m]); >+- >++ for (int m=0; m<Mr; ++m) >++ { >++ //int const i((int)(factor*m)); >++ fprintf(file, " %e %4d %e\n", log10f(I[m]>0.0f ? I[m] : -6.0f), m, I[m]); >++ } >+ fprintf(file, "\n"); >+ } >+ >+ >+-void weightsSave( FILE* file, const float* w, int M, const char* name) >++void weightsSave(FILE *file, float const *w, int Mw, int M, char const *name) >+ { >+ // weighting function matrix header >+ fprintf(file, "# Weighting function\n"); >+ fprintf(file, "# data layout: weight | camera output\n"); >+ fprintf(file, "# name: %s\n", name); >+ fprintf(file, "# type: matrix\n"); >+- fprintf(file, "# rows: %d\n", M); >++ fprintf(file, "# rows: %d\n", Mw); >+ fprintf(file, "# columns: 2\n"); >+ >++ //float const factor(((float)Mw)/M); >+ // save weights >+- for( int m=0 ; m<M ; m++ ) >++ for (int m=0; m<Mw; ++m) >++ { >++ //int const i((int)(factor*m)); >+ fprintf(file, " %e %4d\n", w[m], m); >+- >++ } >+ fprintf(file, "\n"); >+ } >+ >+ >+-bool responseLoad( FILE* file, float* I, int M) >++bool responseLoad(FILE *file, float *I[], int *M) >+ { >+ char line[1024]; >+ int m=0,c=0; >+@@ -235,37 +252,41 @@ bool responseLoad( FILE* file, float* I, >+ while( fgets(line, 1024, file) ) >+ if( sscanf(line, "# rows: %d\n", &m) == 1 ) >+ break; >+- if( m!=M ) >+- { >+- std::cerr << "response: number of input levels is different," >+- << " M=" << M << " m=" << m << std::endl; >+- return false; >+- } >+ while( fgets(line, 1024, file) ) >+ if( sscanf(line, "# columns: %d\n", &c) == 1 ) >+ break; >+- if( c!=3 ) >++ if( m==0 || c!=3 ) >+ return false; >++ if( m!=*M ) >++ { >++ //std::cerr << "response: number of input levels is different," >++ // << " M=" << *M << " m=" << m << std::endl; >++ //return false; >++ delete[] *I; >++ *I = new float[ *M = m ]; >++ } >+ >+ // read response >+ float ignore; >+- for( int i=0 ; i<M ; i++ ) >++ for( int i=0 ; i<*M ; ++i ) >+ { >+ float val; >+ if( fscanf(file, " %f %d %f\n", &ignore, &m, &val) !=3 ) >+ return false; >+- if( m<0 || m>M ) >++ if( m<0 || m>*M ) >++ { >+ std::cerr << "response: camera value out of range," >+ << " m=" << m << std::endl; >+- else >+- I[m] = val; >++ continue; >++ } >++ (*I)[m] = val; >+ } >+ >+ return true; >+ } >+ >+ >+-bool weightsLoad( FILE* file, float* w, int M) >++bool weightsLoad(FILE *file, float *w[], int *M) >+ { >+ char line[1024]; >+ int m=0,c=0; >+@@ -274,37 +295,49 @@ bool weightsLoad( FILE* file, float* w, >+ while( fgets(line, 1024, file) ) >+ if( sscanf(line, "# rows: %d\n", &m) == 1 ) >+ break; >+- if( m!=M ) >+- { >+- std::cerr << "response: number of input levels is different," >+- << " M=" << M << " m=" << m << std::endl; >+- return false; >+- } >+ while( fgets(line, 1024, file) ) >+ if( sscanf(line, "# columns: %d\n", &c) == 1 ) >+ break; >+- if( c!=2 ) >++ if( m==0 || c!=2 ) >+ return false; >++ if( m!=*M ) >++ { >++ //std::cerr << "weights: number of input levels is different," >++ // << " M=" << *M << " m=" << m << std::endl; >++ //return false; >++ delete[] *w; >++ *w = new float[ *M = m ]; >++ } >+ >+- // read response >+- for( int i=0 ; i<M ; i++ ) >+- if( fscanf(file, " %f %d\n", &(w[i]), &m) !=2 ) >++ // read weights >++ for( int i=0 ; i<*M ; i++ ) >++ { >++ float val; >++ if( fscanf(file, " %f %d\n", &val, &m) !=2 ) >+ return false; >++ if( m<0 || m>*M ) >++ { >++ std::cerr << "weights: camera value out of range," >++ << " m=" << m << std::endl; >++ continue; >++ } >++ (*w)[m] = val; >++ } >+ >+ return true; >+ } >+ >+-int responseFillGaps( float* I, float* w, int M ) >++int responseFillGaps(float *I, int Mr, float *w, int Mw ) >+ { >+ int m1=0; >+ int m2=0; >+ int filled_gaps = 0; >+ >+- while( m2<M ) >++ while( m2<Mr ) >+ { >+ // 1. find first non-zero >+ m1 = m2; // start from the last non-zero value >+- while( m1+1<M ) >++ while( m1+1<Mr ) >+ if( I[m1+1]==0.0f ) >+ break; >+ else >+@@ -312,7 +345,7 @@ int responseFillGaps( float* I, float* w >+ >+ // 2. find next non-zero >+ m2 = m1+1; // start from the last zero value >+- while( m2<M ) >++ while( m2<Mr ) >+ if( I[m2]!=0.0f ) >+ break; >+ else >+@@ -320,14 +353,16 @@ int responseFillGaps( float* I, float* w >+ >+ if( m2-m1>1 ) // there is someting to interpolate >+ { >++ float factor(((float)Mw)/Mr); >+ float delta= (I[m2]-I[m1]) / (m2-m1); >+ if( I[m2]<=0.0f ) >+ delta = (I[m1] - I[m1-1])/2.0f; // for some wierd data use gradient >+ >+ for( int m=m1+1 ; m<m2 ; m++ ) >+ { >+- I[m] = I[m-1]+delta; >+- w[m] = MIN_WEIGHT; // give very low confidence in the interpolated data >++ I[m] = I[m-1]+delta; >++ int wm = (int) ( m * factor ); >++ w[wm] = MIN_WEIGHT; // give very low confidence in the interpolated data >+ filled_gaps++; >+ } >+ } >+@@ -335,3 +370,26 @@ int responseFillGaps( float* I, float* w >+ >+ return filled_gaps; >+ } >++ >++void weightsMinMax(float *w, int M, int &Mmin, int &Mmax) >++{ >++ for (Mmin=0; Mmin<M && w[Mmin]<std::numeric_limits<float>::epsilon(); ++Mmin) >++ { >++ w[Mmin] = 0.0f; >++ } >++ for (Mmax=M; --Mmax>=0 && w[Mmax]<std::numeric_limits<float>::epsilon(); ) >++ { >++ w[Mmax] = 0.0f; >++ } >++ if (Mmin >= Mmax) >++ { >++ throw pfs::Exception("wrong weighting function"); >++ } >++ float const mid(Mmin+(Mmax-Mmin)/2.0f); >++ VERBOSE_STR >++ << "min/max: Mmin: " << Mmin >++ << "; Mmax: " << Mmax >++ << "; M: " << M >++ << "; mid: " << mid >++ << std::endl; >++} > >Property changes on: graphics/pfstools/files/patch-src_camera_responses.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_responses.h >=================================================================== >--- graphics/pfstools/files/patch-src_camera_responses.h (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_responses.h (working copy) >@@ -0,0 +1,57 @@ >+--- src/camera/responses.h.orig 2018-01-19 06:59:44 UTC >++++ src/camera/responses.h >+@@ -68,7 +68,7 @@ typedef std::vector<Exposure> ExposureLi >+ * @param Mmax maximum registered camera output level >+ * @param sigma sigma value for gaussian >+ */ >+-void weightsGauss( float* w, int M, int Mmin, int Mmax, float sigma ); >++void weightsGauss(float *w, int M, int Mmin, int Mmax, float sigma); >+ >+ /** >+ * @brief Composite weighting function - dark regions >+@@ -119,7 +119,7 @@ void responseLog10( float* I, int M ); >+ * @param M number of camera output levels >+ * @param name matrix name for use in Octave or Matlab >+ */ >+-void responseSave( FILE* file, const float* I, int M, const char* name); >++void responseSave(FILE *file, float const *I, int Mr, int M, char const *name); >+ >+ >+ /** >+@@ -130,7 +130,7 @@ void responseSave( FILE* file, const flo >+ * @param M number of camera output levels >+ * @param name matrix name for use in Octave or Matlab >+ */ >+-void weightsSave( FILE* file, const float* w, int M, const char* name); >++void weightsSave(FILE *file, float const *w, int Mw, int M, char const *name); >+ >+ >+ /** >+@@ -141,7 +141,7 @@ void weightsSave( FILE* file, const floa >+ * @param M number of camera output levels >+ * @return false means file has different output levels or is wrong for some other reason >+ */ >+-bool responseLoad( FILE* file, float* I, int M); >++bool responseLoad(FILE *file, float *I[], int *M); >+ >+ >+ /** >+@@ -152,7 +152,7 @@ bool responseLoad( FILE* file, float* I, >+ * @param M number of camera output levels >+ * @return false means file has different output levels or is wrong for some other reason >+ */ >+-bool weightsLoad( FILE* file, float* w, int M); >++bool weightsLoad(FILE *file, float *w[], int *M); >+ >+ >+ /** >+@@ -166,6 +166,8 @@ bool weightsLoad( FILE* file, float* w, >+ * @param M number of camera output levels >+ * @return number of filled values in the response curve >+ */ >+-int responseFillGaps( float* I, float* w, int M ); >++int responseFillGaps(float *I, int Mr, float *w, int Mw); >++ >++void weightsMinMax(float *w, int M, int &Mmin, int &Mmax); >+ >+ #endif > >Property changes on: graphics/pfstools/files/patch-src_camera_responses.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_robertson02.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_camera_robertson02.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_robertson02.cpp (working copy) >@@ -0,0 +1,341 @@ >+--- src/camera/robertson02.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/camera/robertson02.cpp >+@@ -79,10 +79,17 @@ float get_exposure_compensation( const E >+ int robertson02_applyResponseRGB( pfs::Array2D *rgb_out[], >+ const ExposureList *imgs[], >+ const float *resp_curve[], >++ const int resp_curve_size[], >+ const float *weights, >+- int M, >++ int Mw, >+ bool deghosting ) >+ { >++ float const rfactor[] = { >++ float(resp_curve_size[0]), >++ float(resp_curve_size[1]), >++ float(resp_curve_size[2]) >++ }; >++ float const wfactor(Mw); >+ // number of exposures >+ int N = imgs[0]->size(); >+ >+@@ -93,16 +100,16 @@ int robertson02_applyResponseRGB( pfs::A >+ // number of saturated pixels >+ int saturated_pixels = 0; >+ >+- float pw[M]; >+- for( int i = 0 ; i < M ; i++ ) { >++ float pw[Mw]; >++ for( int i = 0 ; i < Mw ; ++i ) { >+ pw[i] = weights[i]; >+ } >+- for( int i = 1; i < 10; i++ ) >+- pw[M-i] = 0; >++ for( int i = 1; i < 10; ++i ) >++ pw[Mw-i] = 0; >+ >+ float ew[N]; // Per-exposure weight to account for noise charactetistic >+ // For each exposure >+- for( int i = 0 ; i < N ; i++ ) { >++ for( int i = 0 ; i < N ; ++i ) { >+ const Exposure &ex = (*imgs[0])[i]; >+ >+ // TODO: Estimate read-out noise and use for exposure weighting >+@@ -121,7 +128,7 @@ int robertson02_applyResponseRGB( pfs::A >+ float w[3][N]; >+ bool saturated_exp[N]; >+ >+-// for( int i = 0; i < M; i++ ) >++// for( int i = 0; i < Mw; ++i ) >+ // cerr << "i = " << i << "; weight = " << weights[i] << endl; >+ >+ // For each pixel >+@@ -145,11 +152,13 @@ int robertson02_applyResponseRGB( pfs::A >+ const Exposure &ex = (*imgs[cc])[i]; >+ float ti = get_exposure_compensation( ex ); >+ >+- int m = (int) (*ex.yi)( j ); >+- X[i*3+cc] = resp_curve[cc][ m ] / ti; >+- w[cc][i] = weights [ m ] * ew[i]; >++ float v = (*ex.yi)( j ); >++ int rm = (int) ( (v - std::numeric_limits<float>::epsilon()) * rfactor[cc] ); >++ int wm = (int) ( (v - std::numeric_limits<float>::epsilon()) * wfactor ); >++ X[i*3+cc] = resp_curve[cc][ rm ] / ti; >++ w[cc][i] = weights [ wm ] * ew[i]; >+ >+- saturated_exp[i] |= ( m <= 1 || m >= M-2 ); >++ saturated_exp[i] |= ( v <= 1.0f/rfactor[cc]+std::numeric_limits<float>::epsilon() || v >= (1.0f-1.0f/rfactor[cc]-std::numeric_limits<float>::epsilon()) ); >+ >+ // cerr << X[i*3+cc] << ", "; >+ >+@@ -239,35 +248,37 @@ int robertson02_applyResponseRGB( pfs::A >+ continue; >+ >+ const Exposure &ex = (*imgs[cc])[i]; >+- int m = (int) (*ex.yi)( j ); >++ float v = (*ex.yi)( j ); >++ int rm = (int) ( (v - std::numeric_limits<float>::epsilon()) * rfactor[cc] ); >++ int wm = (int) ( (v - std::numeric_limits<float>::epsilon()) * wfactor ); >+ float ti = get_exposure_compensation( ex ); >+ >+ // Testing the noise-optimal approach >+ /* float iso2 = ex.iso*ex.iso; >+ float sigma_r2 = 0.00001; >+- float w = ex.exposure_time*ex.exposure_time*iso2/(iso2*ex.exposure_time*resp_curve[cc][m] + 2*sigma_r2); >+- sum += w * resp_curve[cc][ m ] / ti; >++ float w = ex.exposure_time*ex.exposure_time*iso2/(iso2*ex.exposure_time*resp_curve[cc][rm] + 2*sigma_r2); >++ sum += w * resp_curve[cc][ rm ] / ti; >+ div += w;*/ >+ >+-// float w = weights [ m ] * ew[i]; >+-// sum += w * resp_curve[cc][ m ] / ti; >++// float w = weights [ wm ] * ew[i]; >++// sum += w * resp_curve[cc][ rm ] / ti; >+ // div += w; >+ >+ // const float noise_level = 0.01; >+-// float var = (noise_level*noise_level)*resp_curve[cc][ m ]/(ti*ti); >++// float var = (noise_level*noise_level)*resp_curve[cc][ rm ]/(ti*ti); >+ >+ // float w = 1/var; >+-// float w = log(sqrt(resp_curve[cc][ m ] / ti / var))+3; >+-// float w = log(sqrt(m)); >+- float w = weights [ m ] * ew[i]; >++// float w = log(sqrt(resp_curve[cc][ rm ] / ti / var))+3; >++// float w = log(sqrt(v)); >++ float w = weights [ wm ] * ew[i]; >+ >+- sum += w * resp_curve[cc][ m ] / ti; >++ sum += w * resp_curve[cc][ rm ] / ti; >+ div += w; >+ >+- if( j < 10 && cc == 1 ) >+- std::cerr << "j = " << j << " ;i = " << i << " ;w = " << w << std::endl; >++ //if( j < 10 && cc == 1 ) >++ // std::cerr << "j = " << j << " ;i = " << i << " ;w = " << w << std::endl; >+ >+- div2 += weights [ m ]; >++ div2 += weights [ wm ]; >+ } >+ >+ /* float mean = sum / div; >+@@ -278,13 +289,15 @@ int robertson02_applyResponseRGB( pfs::A >+ for( int i = 0 ; i < N ; i++ ) >+ { >+ const Exposure &ex = (*imgs[cc])[i]; >+- int m = (int) (*ex.yi)( j ); >++ float v = (*ex.yi)( j ); >++ int rm = (int) ( (v - std::numeric_limits<float>::epsilon()) * rfactor[cc] ); >++ int wm = (int) ( (v - std::numeric_limits<float>::epsilon()) * wfactor ); >+ float ti = ex.ti; >+ >+- float ww = 1/(fabs(resp_curve[cc][ m ]/ti - mean) + 1e-7); >++ float ww = 1/(fabs(resp_curve[cc][ rm ]/ti - mean) + 1e-7); >+ >+- sum += weights [ m ] * ew[i] * resp_curve[cc][ m ] * ww / ti; >+- div += weights [ m ] * ew[i] * ww; >++ sum += weights [ wm ] * ew[i] * resp_curve[cc][ rm ] * ww / ti; >++ div += weights [ wm ] * ew[i] * ww; >+ }*/ >+ >+ if( div2 >= 0.0001f ) >+@@ -314,21 +327,21 @@ int robertson02_applyResponseRGB( pfs::A >+ >+ const Exposure &ex = (*imgs[cc])[0]; >+ // If pixel value > gray level, use the shortest exposure; >+- float short_long = ( (*ex.yi)(j) > M/2 ) ? 1.f : -1.f; >++ float short_long = ( (*ex.yi)(j) > 0.5f ) ? 1.f : -1.f; >+ >+ float best_ti = 1e10f * short_long; >+- int best_v = short_long == 1.f ? M-1 : 0; >++ int best_v = short_long == 1.f ? resp_curve_size[cc]-1 : 0; >+ for( int i = 0 ; i < N ; i++ ) >+ { >+ if( deghosting && skip_exp[i] ) >+ continue; >+ >+ const Exposure &ex = (*imgs[cc])[i]; >+- int m = (int) (*ex.yi)( j ); >++ //int m = (int) (*ex.yi)( j ); >+ float ti = get_exposure_compensation( ex );; >+ if( ti*short_long < best_ti*short_long ) { >+ best_ti = ti; >+- best_v = (int)(*ex.yi)(j); >++ best_v = (int) ( ((*ex.yi)(j) - std::numeric_limits<float>::epsilon()) * rfactor[cc] ); >+ } >+ } >+ (*rgb_out[cc])(j) = 1/best_ti * resp_curve[cc][best_v]; >+@@ -350,9 +363,12 @@ int robertson02_applyResponseRGB( pfs::A >+ int robertson02_applyResponse( pfs::Array2D *xj, >+ const ExposureList &imgs, >+ const float *rcurve, >++ int Mr, >+ const float *weights, >+- int M ) >++ int Mw ) >+ { >++ float const rfactor(Mr); >++ float const wfactor(Mw); >+ >+ // number of exposures >+ int N = imgs.size(); >+@@ -364,9 +380,9 @@ int robertson02_applyResponse( pfs::Arra >+ // number of saturated pixels >+ int saturated_pixels = 0; >+ >+-// cerr << "M = " << M << endl; >++// cerr << "Mw = " << Mw << endl; >+ // cerr << "W[0] = " << weights[0] << endl; >+-// cerr << "W[end] = " << weights[M-1] << endl; >++// cerr << "W[end] = " << weights[Mw-1] << endl; >+ >+ // all pixels >+ for( int j = 0; j < width * height; j++ ) >+@@ -377,11 +393,13 @@ int robertson02_applyResponse( pfs::Arra >+ >+ for( int i = 0 ; i < N ; i++ ) >+ { >+- int m = (int) (*imgs[ i ].yi)( j ); >++ float v = (*imgs[ i ].yi)( j ); >++ int rm = (int) ( (v - std::numeric_limits<float>::epsilon()) * rfactor ); >++ int wm = (int) ( (v - std::numeric_limits<float>::epsilon()) * wfactor ); >+ float ti = imgs[ i ].ti; >+ >+- sum += weights [ m ] / ti * rcurve [ m ]; >+- div += weights [ m ]; >++ sum += weights [ wm ] / ti * rcurve [ rm ]; >++ div += weights [ wm ]; >+ } >+ >+ >+@@ -398,7 +416,7 @@ int robertson02_applyResponse( pfs::Arra >+ /* >+ { >+ float best_ti = 1e10; >+- int best_v = M-1; >++ int best_v = Mr-1; >+ for( int i = 0 ; i < N ; i++ ) >+ { >+ int m = (int) (*imgs[ i ].yi)( j ); >+@@ -408,7 +426,7 @@ int robertson02_applyResponse( pfs::Arra >+ best_v = (int)(*imgs[i].yi)(j); >+ } >+ } >+- (*xj)( j ) = (M-1) / best_ti * rcurve [best_v]; >++ (*xj)( j ) = (Mr-1) / best_ti * rcurve [best_v]; >+ >+ }*/ >+ >+@@ -424,9 +442,12 @@ int robertson02_applyResponse( pfs::Arra >+ int robertson02_getResponse( pfs::Array2D *xj, >+ const ExposureList &imgs, >+ float *rcurve, >++ int Mr, >+ const float *weights, >+- int M ) >++ int Mw ) >+ { >++ float const rfactor(Mr); >++ //float const wfactor(Mw); >+ >+ // number of exposures >+ int N = imgs.size(); >+@@ -441,7 +462,7 @@ int robertson02_getResponse( pfs::Array2 >+ // indices >+ int i, j, m; >+ >+- float* rcurve_prev = new float[ M ]; // previous response >++ float* rcurve_prev = new float[ Mr ]; // previous response >+ >+ if( rcurve_prev == NULL ) >+ { >+@@ -451,19 +472,19 @@ int robertson02_getResponse( pfs::Array2 >+ >+ // 0. Initialization >+ >+- normalize_rcurve( rcurve, M ); >++ normalize_rcurve( rcurve, Mr ); >+ >+- for( m = 0 ; m < M ; m++ ) { >++ for( m = 0 ; m < Mr ; ++m ) { >+ // cerr << "m = " << m << " rc = " << rcurve [ m ] << endl; >+ rcurve_prev [ m ] = rcurve [ m ]; >+ } >+ >+- robertson02_applyResponse( xj, imgs, rcurve, weights, M ); >++ robertson02_applyResponse( xj, imgs, rcurve, Mr, weights, Mw ); >+ >+ // Optimization process >+ bool converged = false; >+- long *cardEm = new long [ M ]; >+- float *sum = new float[ M ]; >++ long *cardEm = new long [ Mr ]; >++ float *sum = new float[ Mr ]; >+ >+ if( sum == NULL || >+ cardEm == NULL ) >+@@ -479,12 +500,12 @@ int robertson02_getResponse( pfs::Array2 >+ { >+ >+ // Display response curve - for debugging purposes >+-/* for( m = 0 ; m < M ; m+=32 ) { >++/* for( m = 0 ; m < Mr ; m+=32 ) { >+ cerr << "m = " << m << " rc = " << rcurve [ m ] << endl; >+ }*/ >+ >+ // 1. Minimize with respect to rcurve >+- for( m = 0 ; m < M ; m++ ) >++ for( m = 0 ; m < Mr ; ++m ) >+ { >+ cardEm [ m ] = 0; >+ sum[ m ] = 0.0f; >+@@ -499,9 +520,9 @@ int robertson02_getResponse( pfs::Array2 >+ >+ for( j = 0 ; j < width * height ; j++ ) >+ { >+- m = (int) (*yi)( j ); >++ m = (int) ( ((*yi)( j ) - std::numeric_limits<float>::epsilon()) * rfactor ); >+ >+- if( m < M && m >= 0 ) >++ if( m < Mr && m >= 0 ) >+ { >+ sum[ m ] += ti * (*xj)( j ); >+ cardEm[ m ] ++; >+@@ -512,7 +533,7 @@ int robertson02_getResponse( pfs::Array2 >+ } >+ >+ >+- for( m = 0; m < M ; m++ ) >++ for( m = 0; m < Mr ; ++m ) >+ { >+ if( cardEm[ m ] != 0 ) >+ rcurve [ m ] = sum [ m ] / cardEm [ m ]; >+@@ -521,16 +542,16 @@ int robertson02_getResponse( pfs::Array2 >+ } >+ >+ // 2. Normalize rcurve >+- float middle_response = normalize_rcurve( rcurve, M ); >++ float middle_response = normalize_rcurve( rcurve, Mr ); >+ >+ // 3. Apply new response >+- saturated_pixels = robertson02_applyResponse( xj, imgs, rcurve, weights, M ); >++ saturated_pixels = robertson02_applyResponse( xj, imgs, rcurve, Mr, weights, Mw ); >+ >+ // 4. Check stopping condition >+ float delta = 0.0f; >+ int hits = 0; >+ >+- for( m = 0 ; m < M ; m++ ) >++ for( m = 0 ; m < Mr ; ++m ) >+ { >+ if( rcurve[ m ] != 0.0f ) >+ { >+@@ -548,7 +569,7 @@ int robertson02_getResponse( pfs::Array2 >+ >+ VERBOSE_STR << " #" << cur_it >+ << " delta=" << delta >+- << " (coverage: " << 100*hits/M << "%)\n"; >++ << " (coverage: " << 100*hits/Mr << "%)\n"; >+ >+ if( delta < MAX_DELTA ) >+ converged = true; > >Property changes on: graphics/pfstools/files/patch-src_camera_robertson02.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_camera_robertson02.h >=================================================================== >--- graphics/pfstools/files/patch-src_camera_robertson02.h (nonexistent) >+++ graphics/pfstools/files/patch-src_camera_robertson02.h (working copy) >@@ -0,0 +1,33 @@ >+--- src/camera/robertson02.h.orig 2018-01-19 06:59:44 UTC >++++ src/camera/robertson02.h >+@@ -44,8 +44,9 @@ >+ int robertson02_getResponse( pfs::Array2D* output, /* output image (gray scale) */ >+ const ExposureList &imgs, /* differrent exposures */ >+ float *rcurve, /* response curve */ >++ int Mr, /* number of values in rcurve */ >+ const float *weights, /* weights */ >+- int M /* number of values in rcurve/weights */ >++ int Mw /* number of values in weights */ >+ ); >+ >+ >+@@ -63,15 +64,17 @@ int robertson02_getResponse( pfs::Array2 >+ int robertson02_applyResponse( pfs::Array2D* xj, >+ const ExposureList &imgs, >+ const float* I, >++ int Mr, >+ const float* w, >+- int M ); >++ int Mw ); >+ >+ >+ int robertson02_applyResponseRGB( pfs::Array2D *rgb_out[], >+ const ExposureList *imgs[], >+ const float *resp_curve[], >++ const int resp_curve_size[], >+ const float *weights, >+- int M, >++ int Mw, >+ bool deghosting = false ); >+ >+ > >Property changes on: graphics/pfstools/files/patch-src_camera_robertson02.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_CMakeLists.txt (working copy) >@@ -0,0 +1,37 @@ >+--- src/fileformat/CMakeLists.txt.orig 2018-01-25 16:27:28 UTC >++++ src/fileformat/CMakeLists.txt >+@@ -81,18 +81,22 @@ if( OPENEXR_FOUND ) >+ endif( OPENEXR_FOUND ) >+ >+ if( ImageMagick_FOUND ) >++ execute_process(COMMAND ${ImageMagick_EXECUTABLE_DIR}/Magick++-config --cflags OUTPUT_VARIABLE ImageMagick_CFLAGS) >++ >+ include_directories(${ImageMagick_INCLUDE_DIRS}) >+ add_executable(pfsinimgmagick pfsinimgmagick.cpp "${GETOPT_OBJECT}") >+ target_link_libraries(pfsinimgmagick pfs ${ImageMagick_LIBRARIES}) >+ install (TARGETS pfsinimgmagick DESTINATION bin) >+ install (FILES pfsinimgmagick.1 DESTINATION ${MAN_DIR}) >+- set_target_properties(pfsinimgmagick PROPERTIES COMPILE_FLAGS "-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16") >++ #set_target_properties(pfsinimgmagick PROPERTIES COMPILE_FLAGS "-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16") >++ set_target_properties(pfsinimgmagick PROPERTIES COMPILE_FLAGS "${ImageMagick_CFLAGS}") >+ >+ add_executable(pfsoutimgmagick pfsoutimgmagick.cpp "${GETOPT_OBJECT}") >+ target_link_libraries(pfsoutimgmagick pfs ${ImageMagick_LIBRARIES}) >+ install (TARGETS pfsoutimgmagick DESTINATION bin) >+ install (FILES pfsoutimgmagick.1 DESTINATION ${MAN_DIR}) >+- set_target_properties(pfsoutimgmagick PROPERTIES COMPILE_FLAGS "-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16") >++ #set_target_properties(pfsoutimgmagick PROPERTIES COMPILE_FLAGS "-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16") >++ set_target_properties(pfsoutimgmagick PROPERTIES COMPILE_FLAGS "${ImageMagick_CFLAGS}") >+ >+ endif( ImageMagick_FOUND ) >+ >+@@ -128,4 +132,9 @@ if( TIFF_FOUND ) >+ >+ endif( TIFF_FOUND ) >+ >++if(OPENMP_FOUND) >++ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) >++ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}" ) >++endif(OPENMP_FOUND) >++ >+ > >Property changes on: graphics/pfstools/files/patch-src_fileformat_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_exrio.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_exrio.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_exrio.cpp (working copy) >@@ -0,0 +1,11 @@ >+--- src/fileformat/exrio.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/fileformat/exrio.cpp >+@@ -93,7 +93,7 @@ void OpenEXRReader::readImage( pfs::Arra >+ OpenEXRReader::~OpenEXRReader() >+ { >+ delete file; >+- file==NULL; >++ file=NULL; >+ } >+ >+ OpenEXRWriter::OpenEXRWriter(const char* filename) > >Property changes on: graphics/pfstools/files/patch-src_fileformat_exrio.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsinexr.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsinexr.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsinexr.cpp (working copy) >@@ -0,0 +1,11 @@ >+--- src/fileformat/pfsinexr.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/fileformat/pfsinexr.cpp >+@@ -235,7 +235,7 @@ void readFrames( int argc, char* argv[] >+ } >+ >+ file.setFrameBuffer( frameBuffer ); >+- file.readPixels( dw.min.y, dw.max.y ); >++ file.readPixels( dtw.min.y, dtw.max.y ); >+ >+ VERBOSE_STR << "reading file (linear) '" << ff.fileName << "'" << std::endl; >+ > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsinexr.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.1 >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.1 (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.1 (working copy) >@@ -0,0 +1,60 @@ >+--- src/fileformat/pfsinimgmagick.1.orig 2018-01-29 14:36:10 UTC >++++ src/fileformat/pfsinimgmagick.1 >+@@ -1,9 +1,10 @@ >+ .TH "pfsinimgmagick" 1 >+ .SH NAME >+-pfsinimgmagick \- Load images or frames using ImageMagick++ library >++pfsinimgmagick \- Load images or frames using Magick++ library >+ .SH SYNOPSIS >+ .B pfsinimgmagick >+-(<file> [--linear] [--absolute <max_lum>] [--frames <range>] [--skip-missing]) [<file>...] >++[--ignore-alpha] [--linear] [--absolute <max_lum>] >++<file> [<file> ...] [--frames <range>] [--skip-missing] [<file> ...] ... >+ >+ .SH DESCRIPTION >+ This command can load images or frames in the multitude of image >+@@ -25,7 +26,8 @@ the 'LUMINANCE' tag is set to 'RELATIVE' >+ be used to convert pixels to absolute luminance values. >+ .PP >+ This command handles properly 'alpha' channel (transparency) stored in >+-images. >++images. Use '--ignore-alpha' switch if you don't want to output an alpha >++channel. >+ .PP >+ Each file can contain a \%%d pattern, which is substituted with frame >+ numbers. The pattern has the same syntax as C >+@@ -62,22 +64,25 @@ frame in a sequence. This switch can be >+ animation where some of the frame has not been generated. >+ >+ .TP >++.B \--ignore-alpha, -A >++When input image contains alpha channel, don't store it in output frame. >++ >++.TP >+ .B \--linear, -l >+ Converts pixel values to linear luminance (XYZ), assuming the sRGB >+-color space for the input image. The maximum pixel value (255,255,255) >+-is mapped to Y=1. \fILUMINANCE\fR tag is set to RELATIVE. >++color space for the input image. The maximum pixel value (defined >++by ImageMagick builtin constant named as 'QuantumRange') is mapped >++to Y=1. \fILUMINANCE\fR tag is set to RELATIVE. >+ >+ .TP >+ .B \--absolute <max_lum>, -a <max_lum> >+ \fB--absolute\fR converts pixel values to an absolute linear luminance >+ (XYZ), that is the color space, in which channel Y contains luminance >+-given in cd/m^2. The sRGB color space is assumed for the input >+-image. The maximum pixel value (255,255,255) is mapped to >+-Y=\fI<max_lum>\fR. \fI<max_lum>\fR is typically set to 80 [cd/m^2] for >+-a CRT monitor. \fILUMINANCE\fR tag is set to >+-ABSOLUTE. \fB--absolute\fR process images almost the same as >+-\fB--relative\fR, but additionally it scales all pixels by >+-\fI<max_lum>\fR. >++given in cd/m^2. The maximum pixel value is mapped to Y=\fI<max_lum>\fR. >++\fI<max_lum>\fR is typically set to 80 [cd/m^2] for a CRT monitor. >++\fILUMINANCE\fR tag is set to ABSOLUTE. \fB--absolute\fR process images >++almost the same as \fB--relative\fR, but additionally it scales all >++pixels by \fI<max_lum>\fR. >+ >+ .SH EXAMPLES >+ .TP > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.1 >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.cpp (working copy) >@@ -0,0 +1,260 @@ >+--- src/fileformat/pfsinimgmagick.cpp.orig 2018-01-28 11:26:58 UTC >++++ src/fileformat/pfsinimgmagick.cpp >+@@ -42,7 +42,7 @@ class QuietException >+ >+ void printHelp() >+ { >+- std::cerr << PROG_NAME " [--linear] [--absolute <max_lum>] [--verbose] [--help]" << std::endl >++ std::cerr << PROG_NAME " [--ignore-alpha] [--linear] [--absolute <max_lum>] \\\n\t[--verbose] [--help]" << std::endl >+ << "See man page for more information." << std::endl; >+ } >+ >+@@ -55,6 +55,7 @@ void readFrames( int argc, char* argv[] >+ bool verbose = false; >+ bool opt_linear=false; >+ float absoluteMaxLum = 0; >++ bool opt_alpha = true; >+ >+ // Parse command line parameters >+ static struct option cmdLineOptions[] = { >+@@ -62,9 +63,10 @@ void readFrames( int argc, char* argv[] >+ { "verbose", no_argument, NULL, 'v' }, >+ { "linear", no_argument, NULL, 'l' }, >+ { "absolute", required_argument, NULL, 'a' }, >++ { "ignore-alpha", no_argument, NULL, 'A' }, >+ { NULL, 0, NULL, 0 } >+ }; >+- static const char optstring[] = "lhva:"; >++ static const char optstring[] = "lhva:A"; >+ >+ pfs::FrameFileIterator it( argc, argv, "rb", NULL, NULL, >+ optstring, cmdLineOptions ); >+@@ -86,6 +88,9 @@ void readFrames( int argc, char* argv[] >+ case 'a': >+ absoluteMaxLum = (float)strtod( optarg, NULL ); >+ break; >++ case 'A': >++ opt_alpha = false; >++ break; >+ case '?': >+ throw QuietException(); >+ case ':': >+@@ -93,93 +98,131 @@ void readFrames( int argc, char* argv[] >+ } >+ } >+ >+- if( absoluteMaxLum != 0 && opt_linear ) >+- throw pfs::Exception( "'absolute' and 'linear' are conflicting options" ); >++ size_t const quantumBits(sizeof(Magick::Quantum)*8); >+ >+- if( absoluteMaxLum < 0 ) >++ if( absoluteMaxLum < 0.0f ) >+ throw pfs::Exception( "maximum absolute luminance must be > 0" ); >+ >+- VERBOSE_STR << "linearize input image: " << ((opt_linear || absoluteMaxLum!=0) ? "yes" : "no") << std::endl; >+- if( absoluteMaxLum != 0 ) >++ Magick::InitializeMagick(*argv); >++ >++ VERBOSE_STR << "quantum range: " << QuantumRange << std::endl; >++ VERBOSE_STR << "internal quantum: " >++ << ( >++ std::numeric_limits<Magick::Quantum>::is_integer >++ ? (std::numeric_limits<Magick::Quantum>::is_signed ? "signed" : "unsigned") >++ : "floating-point" >++ ) >++ << " (" << quantumBits << " bits)" >++ << std::endl; >++ if (absoluteMaxLum > 0.0f) >+ VERBOSE_STR << "maximum absolute luminance: " << absoluteMaxLum << std::endl; >+ >+- Magick::InitializeMagick(""); >+- >+- while( true ) { >+- pfs::FrameFile ff = it.getNextFrameFile(); >+- if( ff.fh == NULL ) break; // No more frames >+- it.closeFrameFile( ff ); >++ VERBOSE_STR << "linearize input image(s): " << (opt_linear ? "yes" : "no") << std::endl; >++ >++ while (true) >++ { >++ pfs::FrameFile ff(it.getNextFrameFile()); >++ if (!ff.fh) break; // No more files >++ it.closeFrameFile(ff); >+ >+ VERBOSE_STR << "reading file '" << ff.fileName << "'" << std::endl; >+- Magick::Image imImage( ff.fileName ); >++ Magick::Image imImage(ff.fileName); >+ >+- VERBOSE_STR << "input image gamma: " << imImage.gamma() << std::endl; >+- bool hasAlpha = imImage.matte(); >+- if( hasAlpha ) >+- VERBOSE_STR << "alpha channel found" << std::endl; >+- >+- pfs::Frame *frame = pfsio.createFrame( imImage.columns(), >+- imImage.rows() ); >+- pfs::Channel *X, *Y, *Z; >+- frame->createXYZChannels( X, Y, Z ); >++ //VERBOSE_STR << "input image gamma: " << imImage.gamma() << std::endl; >++ bool saveAlpha(imImage.matte()); >++ if (saveAlpha) >++ VERBOSE_STR << "alpha channel found" >++ << (opt_alpha ? "" : " and ignored") >++ << std::endl; >++ saveAlpha &= opt_alpha; >+ >+- pfs::Channel *alpha = NULL; >+- if( hasAlpha ) >+- alpha = frame->createChannel( "ALPHA" ); >+- >+- // Copy line by line to pfs::Frame >+- int pixInd = 0; >+- const float maxValue = (float)(1<<QuantumDepth) - 1; >+- for( int r = 0; r < imImage.rows(); r++ ) { >+- const Magick::PixelPacket *pixels = >+- imImage.getConstPixels( 0, r, imImage.columns(), 1 ); >++ pfs::Frame *frame = pfsio.createFrame(imImage.columns(), imImage.rows()); >++ pfs::TagContainer *tags = frame->getTags(); >++ pfs::Channel *X, *Y, *Z, *alpha(0); >++ frame->createXYZChannels(X, Y, Z); >++ if (saveAlpha) >++ alpha = frame->createChannel("ALPHA"); >+ >+- for( int c = 0; c < imImage.columns(); c++ ) { >+- (*X)(pixInd) = (float)pixels[c].red / maxValue; >+- (*Y)(pixInd) = (float)pixels[c].green / maxValue; >+- (*Z)(pixInd) = (float)pixels[c].blue / maxValue; >+- if( alpha != NULL ) >+- (*alpha)(pixInd) = (float)pixels[c].opacity / maxValue; >+- pixInd++; >++ // Copy line by line to pfs::Frame >++ int const cols(imImage.columns()); >++ int const rows(imImage.rows()); >++ for (int r = 0; r < rows; ++r) >++ { >++ Magick::PixelPacket const *pixels = imImage.getConstPixels(0, r, cols, 1); >++ int const roffs(r*cols); >++#pragma omp parallel for >++ for (int c = 0; c < cols; ++c) >++ { >++ int const coffs(roffs+c); >++ (*X)(coffs) = (float)pixels[c].red / QuantumRange; >++ (*Y)(coffs) = (float)pixels[c].green / QuantumRange; >++ (*Z)(coffs) = (float)pixels[c].blue / QuantumRange; >++ if (alpha) >++ (*alpha)(coffs) = 1.0f - (float)pixels[c].opacity / QuantumRange; >+ } >+- } >++ } >+ >+ // Linearize data is necessary >+- if( opt_linear || absoluteMaxLum != 0 ) >+- { >+- pfs::transformColorSpace( pfs::CS_SRGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >+- if( absoluteMaxLum != 0 ) { >+- // Rescale to absolute luminance level >+- const int pixCount = X->getWidth()*X->getHeight(); >+- for( int i = 0; i < pixCount; i++ ) { >+- (*X)(i) *= absoluteMaxLum; >+- (*Y)(i) *= absoluteMaxLum; >+- (*Z)(i) *= absoluteMaxLum; >+- } >+- frame->getTags()->setString("LUMINANCE", "ABSOLUTE"); >+- } else >+- frame->getTags()->setString("LUMINANCE", "RELATIVE"); >+- } >+- else >++ pfs::transformColorSpace( >++ opt_linear ? pfs::CS_SRGB : pfs::CS_RGB, X, Y, Z, >++ pfs::CS_XYZ, X, Y, Z >++ ); >++ tags->setString("LUMINANCE", opt_linear ? "RELATIVE" : "DISPLAY"); >++ >++ if (absoluteMaxLum > 0.0f) >+ { >+- pfs::transformColorSpace( pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >+- frame->getTags()->setString("LUMINANCE", "DISPLAY"); >++ // Rescale to absolute luminance level >++ int const pixCount(X->getWidth()*X->getHeight()); >++#pragma omp parallel for >++ for (int i = 0; i < pixCount; ++i) >++ { >++ (*X)(i) *= absoluteMaxLum; >++ (*Y)(i) *= absoluteMaxLum; >++ (*Z)(i) *= absoluteMaxLum; >++ } >++ tags->setString("LUMINANCE", "ABSOLUTE"); >+ } >+ >+ // This is the luminance / luma perceived as reference white >+ // Some tone-mappers may need this >+- frame->getTags()->setString("WHITE_Y", "1"); >++ tags->setString("WHITE_Y", "1"); >+ >+ const char *fileNameTag = strcmp( "-", ff.fileName )==0 ? "stdin" : ff.fileName; >+- frame->getTags()->setString( "FILE_NAME", fileNameTag ); >++ tags->setString( "FILE_NAME", fileNameTag ); >+ >+- char strbuf[3]; >+- snprintf( strbuf, 3, "%d", (int)imImage.depth() ); >+- frame->getTags()->setString("BITDEPTH", strbuf ); >+- >++ char strbuf[8]; >++ snprintf(strbuf, 3, "%d", (int)imImage.depth()); >++ tags->setString("BITDEPTH", strbuf); >++ >++ // page geometry >++ tags->setString( >++ "UNITS", >++ CommandOptionToMnemonic( >++ MagickCore::MagickResolutionOptions, >++ (ssize_t)imImage.resolutionUnits() >++ ) >++ ); >++ { >++ Magick::Geometry density(imImage.density()); >++ snprintf(strbuf, 7, "%lu", density.width()); >++ tags->setString("DENSITY_X", strbuf); >++ snprintf(strbuf, 7, "%lu", density.height()); >++ tags->setString("DENSITY_Y", strbuf); >++ } >++ { >++ Magick::Geometry page(imImage.page()); >++ snprintf(strbuf, 7, "%lu", page.width()); >++ tags->setString("PAGE_W", strbuf); >++ snprintf(strbuf, 7, "%lu", page.height()); >++ tags->setString("PAGE_H", strbuf); >++ snprintf(strbuf, 7, "%+ld", page.xOff()); >++ tags->setString("PAGE_X", strbuf); >++ snprintf(strbuf, 7, "%+ld", page.yOff()); >++ tags->setString("PAGE_Y", strbuf); >++ } >++ >+ pfsio.writeFrame( frame, stdout ); >+ pfsio.freeFrame( frame ); >+- >+ } >+ } >+ >+@@ -189,15 +232,19 @@ int main( int argc, char* argv[] ) >+ try { >+ readFrames( argc, argv ); >+ } >+- catch( pfs::Exception ex ) { >++ catch( pfs::Exception const &ex ) { >+ std::cerr << PROG_NAME << " error: " << ex.getMessage() << std::endl; >+ return EXIT_FAILURE; >+ } >+- catch( Magick::Exception &ex ) { //This is comming from ImageMagick >++ catch( Magick::Exception const &ex ) { //This is comming from ImageMagick >+ std::cerr << PROG_NAME << " error: " << ex.what() << std::endl; >+ return EXIT_FAILURE; >+ } >+- catch( QuietException ex ) { >++ catch( std::exception const &ex ) { >++ std::cerr << PROG_NAME << " error: " << ex.what() << std::endl; >++ return EXIT_FAILURE; >++ } >++ catch( QuietException const &ex ) { >+ return EXIT_FAILURE; >+ } >+ return EXIT_SUCCESS; > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsinimgmagick.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsinjpeghdr.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsinjpeghdr.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsinjpeghdr.cpp (working copy) >@@ -0,0 +1,22 @@ >+--- src/fileformat/pfsinjpeghdr.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/fileformat/pfsinjpeghdr.cpp >+@@ -123,8 +123,8 @@ void readFrames( int argc, char* argv[] >+ case JPEG_HEADER_HDR: // HDR image >+ jpeghdr_start_decompress(&jhinf); >+ frame = pfsio.createFrame( jhinf.cinfo.output_width, jhinf.cinfo.output_height ); >+- hdrscan = (JHSAMPLE *)malloc(jhinf.cinfo.output_width * jhinf.cinfo.output_height * >+- sizeof(JHSAMPLE)*3); >++ hdrscan = >++ new JHSAMPLE[jhinf.cinfo.output_width * jhinf.cinfo.output_height * 3]; >+ // Important: test jhinf.output_scanline, not jhinf.cinfo >+ int index ; >+ index = 0; >+@@ -144,7 +144,7 @@ void readFrames( int argc, char* argv[] >+ (Z->getRawData())[i] = hdrscan[3*i + 2]; >+ } >+ pfs::transformColorSpace( pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >+- free((void *)hdrscan); >++ delete[] hdrscan; >+ break; >+ case JPEG_HEADER_OK: // LDR image >+ case JPEG_SUSPENDED: > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsinjpeghdr.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsintiff.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsintiff.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsintiff.cpp (working copy) >@@ -0,0 +1,90 @@ >+--- src/fileformat/pfsintiff.cpp.orig 2018-01-25 18:02:57 UTC >++++ src/fileformat/pfsintiff.cpp >+@@ -55,7 +55,8 @@ void readFrames( int argc, char* argv[] >+ pfs::DOMIO pfsio; >+ >+ bool verbose = false; >+- bool opt_linear=false; >++ bool opt_linear = false; >++ float absoluteMaxLum = 0; >+ bool opt_exponential_mode = false; >+ >+ // Parse command line parameters >+@@ -63,10 +64,11 @@ void readFrames( int argc, char* argv[] >+ { "help", no_argument, NULL, 'h' }, >+ { "verbose", no_argument, NULL, 'v' }, >+ { "linear", no_argument, NULL, 'l' }, >++ { "absolute", required_argument, NULL, 'a' }, >+ { "expmode", no_argument, NULL, 'e' }, >+ { NULL, 0, NULL, 0 } >+ }; >+- static const char optstring[] = "elhv"; >++ static const char optstring[] = "ela:hv"; >+ >+ pfs::FrameFileIterator it( argc, argv, "rb", NULL, stdin, >+ optstring, cmdLineOptions ); >+@@ -85,6 +87,9 @@ void readFrames( int argc, char* argv[] >+ case 'l': >+ opt_linear = true; >+ break; >++ case 'a': >++ absoluteMaxLum = (float)strtod( optarg, NULL ); >++ break; >+ case 'e': >+ opt_exponential_mode = true; >+ break; >+@@ -95,7 +100,9 @@ void readFrames( int argc, char* argv[] >+ } >+ } >+ >+- VERBOSE_STR << "linearize input image: " << (opt_linear ? "yes" : "no") << std::endl; >++ VERBOSE_STR << "linearize input image: " << ((opt_linear || absoluteMaxLum!=0) ? "yes" : "no") << std::endl; >++ if( absoluteMaxLum != 0 ) >++ VERBOSE_STR << "maximum absolute luminance: " << absoluteMaxLum << std::endl; >+ VERBOSE_STR << "exponential mode (Lars3 HDR camera): " >+ << (opt_exponential_mode ? "yes" : "no") << std::endl; >+ >+@@ -119,20 +126,35 @@ void readFrames( int argc, char* argv[] >+ >+ //Store RGB data temporarily in XYZ channels >+ reader.readImage( X, Y, Z ); >+- if( opt_linear && !reader.isRelative() ) >++ if( opt_linear || absoluteMaxLum != 0 ) >+ { >+ pfs::transformColorSpace( pfs::CS_SRGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >++ if( absoluteMaxLum != 0 ) { >++ // Rescale to absolute luminance level >++ const int pixCount = X->getWidth()*X->getHeight(); >++#pragma omp parallel for >++ for( int i = 0; i < pixCount; i++ ) { >++ (*X)(i) *= absoluteMaxLum; >++ (*Y)(i) *= absoluteMaxLum; >++ (*Z)(i) *= absoluteMaxLum; >++ } >++ } >++ } >++ else if( !reader.isColorspaceXYZ() ) >++ { >++ pfs::transformColorSpace( pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >++ } >++ if( absoluteMaxLum != 0 || reader.isColorspaceXYZ() ) >++ { >++ frame->getTags()->setString("LUMINANCE", "ABSOLUTE"); >++ } >++ else if( opt_linear ) >++ { >+ frame->getTags()->setString("LUMINANCE", "RELATIVE"); >+ } >+ else >+ { >+- if( !reader.isColorspaceXYZ() ) >+- pfs::transformColorSpace( pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z ); >+- >+- if( reader.isRelative() ) >+- frame->getTags()->setString("LUMINANCE", "RELATIVE"); >+- else >+- frame->getTags()->setString("LUMINANCE", "DISPLAY"); >++ frame->getTags()->setString("LUMINANCE", "DISPLAY"); >+ } >+ >+ const char *fileNameTag = strcmp( "-", ff.fileName )==0 ? "stdin" : ff.fileName; > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsintiff.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsinyuv.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsinyuv.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsinyuv.cpp (working copy) >@@ -0,0 +1,18 @@ >+--- src/fileformat/pfsinyuv.cpp.orig 2018-01-25 16:27:28 UTC >++++ src/fileformat/pfsinyuv.cpp >+@@ -482,6 +482,7 @@ void readFrames( int argc, char* argv[] >+ case pfs::CS_HLGYCbCr2020: >+ VERBOSE_STR << "colorspace: HDR HLG BT2020" << std::endl; >+ break; >++ default: ; >+ } >+ >+ if( width <= 0 || height <= 0 ) >+@@ -547,6 +548,7 @@ void readFrames( int argc, char* argv[] >+ case pfs::CS_HLGYCbCr2020: >+ frame->getTags()->setString("LUMINANCE", "ABSOLUTE"); >+ break; >++ default: ; >+ } >+ >+ if( fps > 0 ){ > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsinyuv.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.1 >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.1 (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.1 (working copy) >@@ -0,0 +1,86 @@ >+--- src/fileformat/pfsoutimgmagick.1.orig 2018-01-29 14:36:10 UTC >++++ src/fileformat/pfsoutimgmagick.1 >+@@ -1,9 +1,12 @@ >+ .TH "pfsoutimgmagick" 1 >+ .SH NAME >+-pfsoutimgmagick \- Write images or frames using Image Magick library >++pfsoutimgmagick \- Write images or frames using Magick++ library >+ .SH SYNOPSIS >+ .B pfsoutimgmagick >+-[--linear] [--quality <val>] [--bit-depth] [--frames <range>]) <file> [<file>...] >++[--ignore-alpha] [--srgb] [--absolute <max_lum>] >++[--quality <percent>] [--compress <method>] >++[--bit-depth <depth>] [--quantum-format <format>] >++<file> [<file> ...] [--frames <range>] >+ .SH DESCRIPTION >+ This command can write images or frames in the multitude of image >+ formats supported by the ImageMagick library. This includes but is not >+@@ -13,17 +16,20 @@ ImageMagick for the full list of availab >+ \fBpfsoutimgmagick\fR reads images or frames in \fIpfs\fR format from >+ the Standard Input and writes them under the specified file name(s). >+ .PP >+-The input of \fBpfsinimgmagick\fR must be within 0-1 range. If \fILUMINANCE\fR >+-tag set is set to \fIRELATIVE\fR or \fIABSOLUTE\fR, the linear >+-values will be gamma corrected, assuming sRGB color space. Use \fI--linear\fR >+-switch to disable gamma correction. >++The input of \fBpfsoutimgmagick\fR must be within 0-1 range. When input >++is \fIABSOLUTE\fR pfs stream with <max_lum> luminance, use '--absolute >++<max_lum>' switch to set valid range. To make an output image(s) >++gamma-corrected, assuming sRGB color space, use '--srgb' switch. >+ .PP >+ The images are stored using the bit-depth for which the ImageMagick >+ library was compiled (default is 16 bit). Note that some formats (for >+ example JPEG) do not support encoding more than 8 bits per color >+ channel. To use higher bit-depths, store images in the PNG format. >+ .PP >+-This command stores 'ALPHA' channel if it is present in the pfs stream. >++This command stores alpha channel if it is present in the pfs stream >++(channel name is 'ALPHA' or 'A') and output format supports transparency. >++Use '--ignore-alpha' switch if you don't want to output an alpha >++channel. >+ .PP >+ Each file name can contain a \%%d pattern, which is substituted with >+ frame numbers. The pattern has the same syntax as C \fIprintf\fR >+@@ -49,6 +55,9 @@ for frames 1,2,...,100 and >+ .I 0:2: >+ for frame 0,2,4,... up to the last file that exists. >+ .TP >++.B \--ignore-alpha, -A >++When input frame contains alpha channel, don't store it in output image. >++.TP >+ .B --srgb, -s >+ Apply the sRGB non-linearity (approximately 2.2 gamma) before writing >+ a file. This can be used instead of using \fIpfsgamma -g 2.2\fR to >+@@ -57,10 +66,18 @@ compress contrast to make sure that tone >+ a display. It should be only used with linearized (not gamma >+ corrected) images that are normalized to the 0-1 range. >+ .TP >+-\fB--quality\fR <val>, \fB-q\fR <val> >++\fB--absolute\fR <max_lum>, \fB-a\fR <max_lum> >++Normalize input pfs stream with absolute luminance <max_lum> to the >++0-1 range. >++.TP >++\fB--quality\fR <percent>, \fB-q\fR <percent> >+ Set JPEG/PNG compression level from 1 to 100. Default 75. >+ .TP >+-\fB--bit-depth\fR <val>, \fB-b <val> >++\fB--compress\fR <method>, \fB-c\fR <method> >++Set compression method. Default is 'none'. See ImageMagick manual >++for details. >++.TP >++\fB--bit-depth\fR <depth>, \fB-b\fR <depth> >+ Enforce bit-depth (per color >+ channel). The allowed values are from 8 to 32. If not specified, the >+ bit depth from the pfs stream ('BITDEPTH' tag) will be used >+@@ -68,6 +85,11 @@ instead. If the 'BITDEPTH' tag is missin >+ value will be used (usually 16). The bit depth of actually stored file >+ may be lower of that specified, if the file format does not support >+ higher bit depths. >++.TP >++\fB--quantum-format\fR <format>, \fB-F\fR <format> >++Defines an output quantum format. Default is 'unsigned'. Available >++formats depend on internal ImageMagick quantum format. See ImageMagick >++manual for details. >+ >+ .SH EXAMPLES >+ .TP > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.1 >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.cpp (working copy) >@@ -0,0 +1,368 @@ >+--- src/fileformat/pfsoutimgmagick.cpp.orig 2018-01-29 15:31:37 UTC >++++ src/fileformat/pfsoutimgmagick.cpp >+@@ -32,6 +32,7 @@ >+ #include <Magick++.h> >+ >+ #include <iostream> >++#include <sstream> >+ >+ #include <getopt.h> >+ #include <pfs.h> >+@@ -44,37 +45,37 @@ class QuietException >+ >+ void printHelp() >+ { >+- std::cerr << PROG_NAME " [--linear] [--quality] [--bit-depth] [--verbose] [--help]" << std::endl >++ std::cerr << PROG_NAME " [--ignore-alpha] [--srgb] [--absolute <max_lum>] \\\n\t[--quality <percent>] [--compress <method>] \\\n\t[--bit-depth <depth>] [--quantum-format <format>] \\\n\t[--verbose] [--help]" << std::endl >+ << "See man page for more information." << std::endl; >+ } >+ >+-template<class T> >+-inline T clamp( const T v, const T minV, const T maxV ) >+-{ >+- if( v < minV ) return minV; >+- if( v > maxV ) return maxV; >+- return v; >+-} >+- >+ void writeFrames( int argc, char* argv[] ) >+ { >+ pfs::DOMIO pfsio; >+ >+ bool verbose = false; >+ bool opt_srgb=false; >++ float absoluteMaxLum = 0; >+ int quality = 75; >++ char const *opt_compress = 0; >+ int opt_bit_depth = -1; >++ char const *opt_quantum = "unsigned"; >++ bool opt_alpha = true; >+ >+ // Parse command line parameters >+ static struct option cmdLineOptions[] = { >+ { "help", no_argument, NULL, 'h' }, >+ { "verbose", no_argument, NULL, 'v' }, >++ { "ignore-alpha", no_argument, NULL, 'A' }, >+ { "srgb", no_argument, NULL, 's' }, >++ { "absolute", required_argument, NULL, 'a' }, >+ { "quality", required_argument, NULL, 'q' }, >++ { "compress", required_argument, NULL, 'c' }, >+ { "bit-depth", required_argument, NULL, 'b' }, >++ { "quantum-format", required_argument, NULL, 'F' }, >+ { NULL, 0, NULL, 0 } >+ }; >+- static const char optstring[] = "shvq:b:"; >++ static const char optstring[] = "f:hvAsa:q:c:b:F:"; >+ >+ pfs::FrameFileIterator it( argc, argv, "wb", NULL, NULL, >+ optstring, cmdLineOptions ); >+@@ -90,14 +91,26 @@ void writeFrames( int argc, char* argv[] >+ case 'v': >+ verbose = true; >+ break; >++ case 'A': >++ opt_alpha = false; >++ break; >++ case 's': >++ opt_srgb = true; >++ break; >++ case 'a': >++ absoluteMaxLum = (float)strtod( optarg, NULL ); >++ break; >+ case 'q': >+ quality = strtol( optarg, NULL, 10 ); >+ break; >++ case 'c': >++ opt_compress = optarg; >++ break; >+ case 'b': >+ opt_bit_depth = strtol( optarg, NULL, 10 ); >+ break; >+- case 's': >+- opt_srgb = true; >++ case 'F': >++ opt_quantum = optarg; >+ break; >+ case '?': >+ throw QuietException(); >+@@ -106,31 +119,59 @@ void writeFrames( int argc, char* argv[] >+ } >+ } >+ >+- if( quality < 1 || quality > 100 ) >+- throw pfs::Exception( "'quality' argument must be within 1-100 range" ); >++ size_t const quantumBits(sizeof(Magick::Quantum)*8); >+ >+- if( opt_bit_depth != -1 && (opt_bit_depth < 8 || opt_bit_depth > 32 ) ) >+- throw pfs::Exception( "'bit-depth' argument must be within 8-32 range" ); >++ if (quality < 1 || quality > 100) >++ throw pfs::Exception("'quality' argument must be within 1-100 range"); >++ >++ if (opt_bit_depth != -1 >++ && (opt_bit_depth < 8 || opt_bit_depth > quantumBits)) >++ { >++ std::ostringstream msg; >++ msg << "'bit-depth' argument must be within 8-" << quantumBits << " range"; >++ throw pfs::Exception(msg.str().c_str()); >++ } >+ >+- VERBOSE_STR << "quality: " << quality << "%\n"; >++ if (absoluteMaxLum < 0.0f) >++ throw pfs::Exception( "maximum absolute luminance must be > 0" ); >+ >+- Magick::InitializeMagick(""); >++ Magick::InitializeMagick(*argv); >++ >++ VERBOSE_STR << "quantum range: " << QuantumRange << std::endl; >++ VERBOSE_STR << "internal quantum: " >++ << ( >++ std::numeric_limits<Magick::Quantum>::is_integer >++ ? (std::numeric_limits<Magick::Quantum>::is_signed ? "signed" : "unsigned") >++ : "floating-point" >++ ) >++ << " (" << quantumBits << " bits)" >++ << std::endl; >++ if (absoluteMaxLum > 0.0f) >++ VERBOSE_STR << "maximum absolute luminance: " << absoluteMaxLum << std::endl; >++ >++ ssize_t compress((ssize_t)Magick::NoCompression); >++ if (opt_compress) >++ { >++ compress = ParseCommandOption(MagickCore::MagickCompressOptions, Magick::MagickFalse, opt_compress); >++ if (compress < 0) >++ throw pfs::Exception((std::string("unknown compression method: '") + opt_compress + "'").c_str()); >++ } >+ >+- while( true ) { >+- pfs::Frame *frame = pfsio.readFrame( stdin ); >+- if( frame == NULL ) { >+- break; >+- } >++ while (true) >++ { >++ pfs::Frame *frame = pfsio.readFrame(stdin); >++ if (!frame) break; // No more frames >++ pfs::TagContainer const *tags = frame->getTags(); >+ >+ pfs::FrameFile ff = it.getNextFrameFile(); >+- if( ff.fh == NULL ) { >+- pfsio.freeFrame( frame ); >+- break; // No more frames >++ if (!ff.fh) >++ { >++ pfsio.freeFrame(frame); >++ break; // No more files >+ } >+- it.closeFrameFile( ff ); >+- >+- pfs::Channel *X, *Y, *Z, *alpha; >+- >++ it.closeFrameFile(ff); >++ >++ pfs::Channel *X, *Y, *Z, *alpha = 0; >+ frame->getXYZChannels( X, Y, Z ); >+ if( X == NULL ) // No color >+ { >+@@ -142,66 +183,152 @@ void writeFrames( int argc, char* argv[] >+ Z = frame->createChannel( "Z" ); >+ pfs::transformColorSpace( pfs::CS_RGB, Y, Y, Y, pfs::CS_XYZ, X, Y, Z ); >+ } >++ (alpha = frame->getChannel("ALPHA")) || (alpha = frame->getChannel("A")); >+ >+- alpha = frame->getChannel( "ALPHA" ); >+- if( alpha == NULL ) >+- alpha = frame->getChannel( "A" ); >+- >+- const char* luminanceTag = frame->getTags()->getString("LUMINANCE"); >+- if( luminanceTag!=NULL && strcmp(luminanceTag,"ABSOLUTE")==0 ) >++ size_t const frameWidth(frame->getWidth()); >++ size_t const frameHeight(frame->getHeight()); >++ size_t const pixelCount(frameWidth*frameHeight); >++ >++ if (absoluteMaxLum > 0.0f) >++ { >++#pragma omp parallel for >++ for (int pix = 0; pix < pixelCount; ++pix) >++ { >++ (*X)(pix) /= absoluteMaxLum; >++ (*Y)(pix) /= absoluteMaxLum; >++ (*Z)(pix) /= absoluteMaxLum; >++ } >++ } >++ >++ const char* luminanceTag = tags->getString("LUMINANCE"); >++ if( luminanceTag!=NULL && strcmp(luminanceTag,"ABSOLUTE")==0 && absoluteMaxLum == 0.0f ) >+ std::cerr << PROG_NAME << " warning: This file format cannot store absolute luminance values\n"; >+ if( opt_srgb ) >+ { >+ if( luminanceTag!=NULL && strcmp(luminanceTag,"DISPLAY")==0 ) >+ std::cerr << PROG_NAME << " warning: This image seems to be display referred thus there is no need for applying the sRGB non-linearity\n"; >+- pfs::transformColorSpace( pfs::CS_XYZ, X, Y, Z, pfs::CS_SRGB, X, Y, Z ); >++ pfs::transformColorSpace( pfs::CS_XYZ, X, Y, Z, pfs::CS_SRGB, X, Y, Z ); >+ VERBOSE_STR << "writing file (sRGB corrected) '" << ff.fileName << "'" << std::endl; >+ } >+ else >+ { >+- pfs::transformColorSpace( pfs::CS_XYZ, X, Y, Z, pfs::CS_RGB, X, Y, Z ); >++ pfs::transformColorSpace( pfs::CS_XYZ, X, Y, Z, pfs::CS_RGB, X, Y, Z ); >+ VERBOSE_STR << "writing file (linear) '" << ff.fileName << "'" << std::endl; >+ } >+ >+ // Determine bit-depth for writing images (bitdepth == -1 for default) >+ int bitdepth = -1; >+- if( opt_bit_depth != -1 ) >++ if( opt_bit_depth > 0 ) >+ bitdepth = opt_bit_depth; >+ else { >+- const char* bitDepthTag = frame->getTags()->getString("BITDEPTH"); >++ const char* bitDepthTag = tags->getString("BITDEPTH"); >+ if( bitDepthTag!=NULL ) { >+ bitdepth=strtol( bitDepthTag, NULL, 10 ); >+ if( bitdepth < 8 ) >+ bitdepth = 8; >+- else if( bitdepth > 16 ) >+- bitdepth = 16; >++ else if( bitdepth > quantumBits ) >++ bitdepth = quantumBits; >+ } >+ } >+ >+ { >+ // Copy image to array that can be accepted by ImageMagick >+- const int pixelCount = frame->getWidth()*frame->getHeight(); >+- unsigned short *imgBuffer = >+- new unsigned short[pixelCount*(alpha == NULL ? 3 : 4)]; >+- int i = 0; >+- float maxValue = (float)(1<<16) -1; >+- for( int pix = 0; pix < pixelCount; pix++ ) { >+- imgBuffer[i++] = (unsigned short)(clamp((*X)(pix),0.f,1.f)*maxValue); >+- imgBuffer[i++] = (unsigned short)(clamp((*Y)(pix),0.f,1.f)*maxValue); >+- imgBuffer[i++] = (unsigned short)(clamp((*Z)(pix),0.f,1.f)*maxValue); >+- if( alpha != NULL ) >+- imgBuffer[i++] = (unsigned short)(maxValue-clamp((*alpha)(pix),0.f,1.f)*maxValue); >++ int const channels(opt_alpha && alpha ? 4 : 3); >++ if (alpha) >++ VERBOSE_STR << "alpha channel found and " >++ << (channels > 3 ? "will be saved" : "ignored") >++ << std::endl; >++ std::vector<Magick::Quantum> imgBuffer(pixelCount*channels); >++#pragma omp parallel for >++ for (int pix = 0; pix < pixelCount; ++pix) >++ { >++ int const i(pix*channels); >++ imgBuffer[i+0] = (Magick::Quantum)((*X)(pix)*QuantumRange); >++ imgBuffer[i+1] = (Magick::Quantum)((*Y)(pix)*QuantumRange); >++ imgBuffer[i+2] = (Magick::Quantum)((*Z)(pix)*QuantumRange); >++ if (channels > 3) >++ imgBuffer[i+3] = (Magick::Quantum)((*alpha)(pix)*QuantumRange); >+ } >+- Magick::Image imImage( frame->getWidth(), frame->getHeight(), >+- (alpha == NULL ? "RGB" : "RGBA"), Magick::ShortPixel, imgBuffer ); >+- imImage.quality( quality ); >+- if( bitdepth != -1 ) >+- imImage.depth( bitdepth ); >+- imImage.write( ff.fileName ); >+- delete[] imgBuffer; >++ Magick::Image imImage( >++ frameWidth, frameHeight, >++ channels > 3 ? "RGBA" : "RGB", Magick::QuantumPixel, &imgBuffer[0] >++ ); >++ >++ // quantum format >++ imImage.defineValue("quantum", "format", opt_quantum); >++ VERBOSE_STR << "output quantum format: " >++ << imImage.defineValue("quantum", "format") >++ << std::endl; >++ >++ if (bitdepth > 0) >++ { >++ imImage.depth(bitdepth); >++ //!!dirty hack: bug in void Magick::Image::depth(const size_t depth) >++ imImage.image()->depth = bitdepth; >++ imImage.imageInfo()->depth = bitdepth; >++ //!!dirty hack >++ VERBOSE_STR << "bit depth: " >++ // << bitdepth << "/" >++ << imImage.depth() >++ << std::endl; >++ } >++ >++ // page geometry >++ char const *units = tags->getString("UNITS"); >++ if (units) >++ { >++ int resolutionUnits(ParseCommandOption(MagickCore::MagickResolutionOptions, Magick::MagickFalse, units)); >++ if (resolutionUnits < 0) >++ std::cerr << PROG_NAME " warning: unknown resolution units: '" << units << "', use default" << std::endl; >++ else >++ imImage.resolutionUnits((Magick::ResolutionType)resolutionUnits); >++ } >++ { >++ Magick::Geometry density(imImage.density()); >++ char const *dxy = tags->getString("DENSITY"); >++ char const *buf = tags->getString("DENSITY_X"); >++ if (!buf || !*buf) >++ buf = dxy; >++ if (buf && *buf) >++ density.width(strtol(buf, NULL, 10)); >++ buf = tags->getString("DENSITY_Y"); >++ if (!buf || !*buf) >++ buf = dxy; >++ if (buf && *buf) >++ density.height(strtol(buf, NULL, 10)); >++ imImage.density(density); >++ } >++ { >++ Magick::Geometry page(imImage.page()); >++ char const *buf = tags->getString("PAGE_W"); >++ if (buf && *buf) >++ page.width(strtol(buf, NULL, 10)); >++ buf = tags->getString("PAGE_H"); >++ if (buf && *buf) >++ page.height(strtol(buf, NULL, 10)); >++ buf = tags->getString("PAGE_X"); >++ if (buf && *buf) >++ page.xOff(strtol(buf, NULL, 10)); >++ buf = tags->getString("PAGE_Y"); >++ if (buf && *buf) >++ page.yOff(strtol(buf, NULL, 10)); >++ imImage.page(page); >++ } >++ >++ imImage.quality(quality); >++ VERBOSE_STR << "quality: " >++ // << quality << "%/" >++ << imImage.quality() << "%" >++ << std::endl; >++ >++ imImage.compressType((MagickCore::CompressionType)compress); >++ VERBOSE_STR << "compression method: " >++ << CommandOptionToMnemonic(MagickCore::MagickCompressOptions, (ssize_t)imImage.compressType()) >++ << std::endl; >++ >++ imImage.write(ff.fileName); >+ } >+- pfsio.freeFrame( frame ); >+- >++ pfsio.freeFrame(frame); >+ } >+ } >+ >+@@ -211,11 +338,15 @@ int main( int argc, char* argv[] ) >+ try { >+ writeFrames( argc, argv ); >+ } >+- catch( pfs::Exception ex ) { >++ catch( pfs::Exception const &ex ) { >+ std::cerr << PROG_NAME << " error: " << ex.getMessage() << std::endl; >+ return EXIT_FAILURE; >+ } >+- catch( Magick::Exception &ex ) { //This is comming from ImageMagick >++ catch( Magick::Exception const &ex ) { //This is comming from ImageMagick >++ std::cerr << PROG_NAME << " error: " << ex.what() << std::endl; >++ return EXIT_FAILURE; >++ } >++ catch( std::exception const &ex ) { >+ std::cerr << PROG_NAME << " error: " << ex.what() << std::endl; >+ return EXIT_FAILURE; >+ } > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsoutimgmagick.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsoutjpeghdr.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsoutjpeghdr.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsoutjpeghdr.cpp (working copy) >@@ -0,0 +1,40 @@ >+--- src/fileformat/pfsoutjpeghdr.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/fileformat/pfsoutjpeghdr.cpp >+@@ -69,8 +69,7 @@ void writeHDRJPEGGray( FILE *fh, int wid >+ jhinf.correction = correction; >+ jpeg_stdio_dest(&jhinf.cinfo, fh); >+ >+- image = (JHSAMPLE *)malloc(width * height * >+- sizeof(JHSAMPLE)*3); >++ image = new JHSAMPLE[width * height * 3]; >+ >+ for(int i=0;i<width * height;i++) >+ { >+@@ -91,7 +90,7 @@ void writeHDRJPEGGray( FILE *fh, int wid >+ // Or, assign jhinf.tmi 8-bit grayscale values in scanline order >+ jpeghdr_do_compress(&jhinf); >+ jpeghdr_destroy_compress(&jhinf); >+- fclose(fh); >++ delete[] image; >+ } >+ >+ void writeHDRJPEGRGB( FILE *fh, int width, int height, >+@@ -111,8 +110,7 @@ void writeHDRJPEGRGB( FILE *fh, int widt >+ jhinf.beta = beta; >+ jpeg_stdio_dest(&jhinf.cinfo, fh); >+ >+- image = (JHSAMPLE *)malloc(width * height * >+- sizeof(JHSAMPLE)*3); >++ image = new JHSAMPLE[width * height * 3]; >+ >+ for(int i=0;i<width * height;i++) >+ { >+@@ -135,7 +133,7 @@ void writeHDRJPEGRGB( FILE *fh, int widt >+ jpeghdr_do_compress(&jhinf); >+ jpeghdr_destroy_compress(&jhinf); >+ >+- free( image ); >++ delete[] image; >+ } >+ >+ void writeFrames( int argc, char* argv[] ) > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsoutjpeghdr.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsoutpfm.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsoutpfm.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsoutpfm.cpp (working copy) >@@ -0,0 +1,20 @@ >+--- src/fileformat/pfsoutpfm.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/fileformat/pfsoutpfm.cpp >+@@ -85,7 +85,7 @@ void writePFMFileColor( FILE *fh, int wi >+ } >+ int written = fwrite( line, sizeof( float ), lineSize, fh ); >+ if( written != lineSize ) >+- throw new pfs::Exception( "Unable to write data" ); >++ throw pfs::Exception( "Unable to write data" ); >+ } >+ delete[] line; >+ } >+@@ -109,7 +109,7 @@ void writePFMFileGrayscale( FILE *fh, in >+ } >+ int written = fwrite( line, sizeof( float ), lineSize, fh ); >+ if( written != lineSize ) >+- throw new pfs::Exception( "Unable to write data" ); >++ throw pfs::Exception( "Unable to write data" ); >+ } >+ delete[] line; >+ } > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsoutpfm.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_fileformat_pfsoutyuv.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_fileformat_pfsoutyuv.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_fileformat_pfsoutyuv.cpp (working copy) >@@ -0,0 +1,25 @@ >+--- src/fileformat/pfsoutyuv.cpp.orig 2018-01-25 16:27:28 UTC >++++ src/fileformat/pfsoutyuv.cpp >+@@ -215,7 +215,7 @@ class YUVWriter { >+ } >+ >+ template<typename T> >+- bool writeYuvImage(pfs::Array2D *R, pfs::Array2D *G, pfs::Array2D *B){ >++ void writeYuvImage(pfs::Array2D *R, pfs::Array2D *G, pfs::Array2D *B){ >+ //writes the entire image to fh R - Luminance, G - Cr, B - Cb >+ unsigned int width_chroma = R->getCols(); >+ unsigned int height_chroma = R->getRows(); >+@@ -388,10 +388,11 @@ void writeFrames( int argc, char* argv[] >+ } >+ >+ >+- if( srgb_input ) >++ if( srgb_input ) { >+ VERBOSE_STR << "Input data in sRGB (LDR) space" << std::endl; >+- else >++ } else { >+ VERBOSE_STR << "Input data in absolute linear (HDR) space" << std::endl; >++ } >+ >+ MetaDataFrameFileIterator it(argc, argv, "wb", NULL, stdout, optstring, cmdLineOptions, width, >+ height, bit_depth, colorSpaceStr, downscale_chroma ? "420" : "444", fps); > >Property changes on: graphics/pfstools/files/patch-src_fileformat_pfsoutyuv.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_filter_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_filter_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_filter_CMakeLists.txt (working copy) >@@ -0,0 +1,11 @@ >+--- src/filter/CMakeLists.txt.orig 2018-01-19 06:59:44 UTC >++++ src/filter/CMakeLists.txt >+@@ -6,7 +6,7 @@ link_directories("${PROJECT_SOURCE_DIR}/ >+ >+ set(PFS_FILT pfsgamma pfsclamp pfstag pfssize pfsextractchannels >+ pfspanoramic pfsrotate pfsflip pfscut pfspad pfscat pfsabsolute pfsretime >+-pfscolortransform) >++pfscolortransform pfswb) >+ >+ foreach(TRG ${PFS_FILT}) >+ add_executable(${TRG} ${TRG}.cpp "${GETOPT_OBJECT}") > >Property changes on: graphics/pfstools/files/patch-src_filter_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_filter_pfscat.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_filter_pfscat.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_filter_pfscat.cpp (working copy) >@@ -0,0 +1,37 @@ >+--- src/filter/pfscat.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/filter/pfscat.cpp >+@@ -27,6 +27,7 @@ >+ #include <pfs.h> >+ #include <climits> >+ #include <iostream> >++#include <vector> >+ #include <getopt.h> >+ #include <fcntl.h> >+ #include <stdlib.h> >+@@ -202,16 +203,12 @@ if (alignment==UNSP) throw pfs::Exceptio >+ >+ pfs::FrameFileIterator it ( argc, argv, "rb", NULL, NULL, optString, cmdLineOptions); >+ int pipe_no = 0; >+-pfs::FrameFile * ff; >+-ff = (pfs::FrameFile *) malloc ((pipe_no+1) * sizeof(pfs::FrameFile)); >+- >++std::vector<pfs::FrameFile> ff; >+ while (1) { >+- ff[pipe_no] = it.getNextFrameFile(); >++ ff.push_back(it.getNextFrameFile()); >+ if (ff[pipe_no].fh == NULL) break; // no more files >+ pipe_no++; >+- ff=(pfs::FrameFile *) realloc(ff, (pipe_no+1)*sizeof(pfs::FrameFile)); >+ } >+- >+ if(pipe_no == 0) { // no named pipes >+ pipe_no = 1; >+ pipes = false; >+@@ -408,7 +405,6 @@ if(!pipes) { >+ } >+ >+ for (int i=0; i<pipe_no; i++) it.closeFrameFile(ff[i]); >+-free(ff); >+ } >+ >+ > >Property changes on: graphics/pfstools/files/patch-src_filter_pfscat.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_filter_pfsclamp.1 >=================================================================== >--- graphics/pfstools/files/patch-src_filter_pfsclamp.1 (nonexistent) >+++ graphics/pfstools/files/patch-src_filter_pfsclamp.1 (working copy) >@@ -0,0 +1,17 @@ >+--- src/filter/pfsclamp.1.orig 2018-01-19 06:59:44 UTC >++++ src/filter/pfsclamp.1 >+@@ -16,12 +16,12 @@ The command operates directly on XYZ cha >+ .TP >+ --min <val> >+ >+-Lower bound for clamping. Default value: 0.0001 (10^-4) >++Lower bound for clamping. Default value: 1e-20 (10^-20) >+ >+ .TP >+ --max <val> >+ >+-Upper bound for clamping. Default value: 100000000 (10^8) >++Upper bound for clamping. Default value: 1e20 (10^20) >+ >+ .TP >+ --percentile, -p > >Property changes on: graphics/pfstools/files/patch-src_filter_pfsclamp.1 >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_filter_pfsclamp.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_filter_pfsclamp.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_filter_pfsclamp.cpp (working copy) >@@ -0,0 +1,13 @@ >+--- src/filter/pfsclamp.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/filter/pfsclamp.cpp >+@@ -153,8 +153,8 @@ void clampFrames( int argc, char* argv[] >+ } >+ else >+ { >+- clampMin = (clampMin>1e-4) ? clampMin : 1e-4; >+- clampMax = (clampMax<1e8) ? clampMax : 1e8; >++ clampMin = (clampMin>1e-20) ? clampMin : 1e-20; >++ clampMax = (clampMax<1e+20) ? clampMax : 1e+20; >+ if( clampMin >= clampMax ) >+ throw pfs::Exception("incorrect clamping range"); >+ } > >Property changes on: graphics/pfstools/files/patch-src_filter_pfsclamp.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_filter_pfstag.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_filter_pfstag.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_filter_pfstag.cpp (working copy) >@@ -0,0 +1,57 @@ >+--- src/filter/pfstag.cpp.orig 2018-01-26 13:15:24 UTC >++++ src/filter/pfstag.cpp >+@@ -106,7 +106,7 @@ void setTagsOnFrames( int argc, char* ar >+ >+ int optionIndex = 0; >+ while( 1 ) { >+- int c = getopt_long (argc, argv, "m:g:s:r:", cmdLineOptions, &optionIndex); >++ int c = getopt_long (argc, argv, "hvs:r:", cmdLineOptions, &optionIndex); >+ if( c == -1 ) break; >+ switch( c ) { >+ case 'h': >+@@ -141,10 +141,45 @@ void setTagsOnFrames( int argc, char* ar >+ } >+ >+ >++ int fcount(0); >+ while( true ) { >+ pfs::Frame *frame = pfsio.readFrame( stdin ); >+ if( frame == NULL ) break; // No more frames >++ ++fcount; >+ >++ if (verbose) >++ { >++ pfs::TagContainer const *tags = frame->getTags(); >++ pfs::TagIteratorPtr tit(tags->getIterator()); >++ if (tit->hasNext()) >++ std::cerr << PROG_NAME ": frame " << fcount << " tags:" << std::endl; >++ while (tit->hasNext()) >++ { >++ char const *name = tit->getNext(); >++ std::cerr << PROG_NAME ": " >++ << name << "=" << tags->getString(name) >++ << std::endl; >++ } >++ pfs::ChannelIteratorPtr cit(frame->getChannelIterator()); >++ while (cit->hasNext()) >++ { >++ pfs::Channel *channel = cit->getNext(); >++ char const *cname = channel->getName(); >++ pfs::TagContainer const *ctags = frame->getTags(); >++ pfs::TagIteratorPtr ctit(ctags->getIterator()); >++ //if (ctit->hasNext()) >++ // std::cerr << PROG_NAME ": channel " << cname << " tags:" >++ // << std::endl; >++ while (ctit->hasNext()) >++ { >++ char const *name = ctit->getNext(); >++ std::cerr << PROG_NAME ": " >++ << cname << ":" >++ << name << "=" << ctags->getString(name) >++ << std::endl; >++ } >++ } >++ } >+ >+ ListOfTags::iterator it; >+ for( it = setTags.begin(); it != setTags.end(); it++ ) { > >Property changes on: graphics/pfstools/files/patch-src_filter_pfstag.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_hdrhtml_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_hdrhtml_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_hdrhtml_CMakeLists.txt (working copy) >@@ -0,0 +1,13 @@ >+--- src/hdrhtml/CMakeLists.txt.orig 2018-01-25 16:27:28 UTC >++++ src/hdrhtml/CMakeLists.txt >+@@ -3,7 +3,9 @@ link_directories("${PROJECT_SOURCE_DIR}/ >+ >+ add_executable(pfsouthdrhtml pfsouthdrhtml.cpp hdrhtml.cpp) >+ target_link_libraries(pfsouthdrhtml pfs ${ImageMagick_LIBRARIES}) >+-set_target_properties(pfsouthdrhtml PROPERTIES COMPILE_FLAGS "-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16") >++#set_target_properties(pfsouthdrhtml PROPERTIES COMPILE_FLAGS "-DMAGICKCORE_HDRI_ENABLE=0 -DMAGICKCORE_QUANTUM_DEPTH=16") >++execute_process(COMMAND ${ImageMagick_EXECUTABLE_DIR}/Magick++-config --cflags OUTPUT_VARIABLE ImageMagick_CFLAGS) >++set_target_properties(pfsouthdrhtml PROPERTIES COMPILE_FLAGS "${ImageMagick_CFLAGS}") >+ >+ install (TARGETS pfsouthdrhtml DESTINATION bin) >+ install (FILES pfsouthdrhtml.1 DESTINATION ${MAN_DIR}) > >Property changes on: graphics/pfstools/files/patch-src_hdrhtml_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_hdrhtml_hdrhtml.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_hdrhtml_hdrhtml.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_hdrhtml_hdrhtml.cpp (working copy) >@@ -0,0 +1,183 @@ >+--- src/hdrhtml/hdrhtml.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/hdrhtml/hdrhtml.cpp >+@@ -27,6 +27,7 @@ >+ >+ #include "hdrhtml.h" >+ >++#include <limits> >+ #include <algorithm> >+ #include <math.h> >+ #include <fstream> >+@@ -50,6 +51,8 @@ >+ >+ using namespace std; >+ >++#define log2f(x) ((float)logf(x)/logf(2)) >++ >+ // ================================================ >+ // Parameters controllig the web page >+ // ================================================ >+@@ -96,8 +99,8 @@ public: >+ >+ if( min_val > max_val ) // missing min/max info >+ { >+- min_val = numeric_limits<T>::max(); >+- max_val = numeric_limits<T>::min(); >++ min_val = std::numeric_limits<T>::max(); >++ max_val = std::numeric_limits<T>::min(); >+ >+ for( int k=0; k < d_size; k++ ) { >+ if( data[k] > max_val ) max_val = data[k]; >+@@ -197,6 +200,7 @@ public: >+ this->y_i = new float[lut_size]; >+ own_y_i = true; >+ memcpy(this->y_i, other.y_i, lut_size * sizeof(float)); >++ return *this; >+ } >+ >+ ~UniformArrayLUT() >+@@ -343,7 +347,7 @@ public: >+ for( int k = 1; k < bin_n; k++ ) >+ hist.n[k] += hist.n[k-1]; >+ >+-// cerr << "d_size: " << d_size << " hist.n: " << hist.n[bin_n-1] << "\n"; >++// std::cerr << "d_size: " << d_size << " hist.n: " << hist.n[bin_n-1] << "\n"; >+ assert( hist.n[bin_n-1] == d_size ); >+ } >+ >+@@ -363,7 +367,7 @@ public: >+ // Text template file utils >+ // ================================================ >+ >+-typedef void (*replace_callback)( ostream &out, void *user_data, const char *parameter ); >++typedef void (*replace_callback)( std::ostream &out, void *user_data, const char *parameter ); >+ >+ class ReplacePattern >+ { >+@@ -405,7 +409,7 @@ public: >+ { >+ } >+ >+- virtual void write_replacement( ostream &out, const char *parameter = NULL ) >++ virtual void write_replacement( std::ostream &out, const char *parameter = NULL ) >+ { >+ if( callback != NULL ) >+ callback( out, user_data, parameter ); >+@@ -578,16 +582,16 @@ public: >+ } >+ len = std::string::npos; >+ } else >+- len = new_pos-pos; >++ len = (size_t)(new_pos-pos); >+ >+ float value; >+ if( len == 0 ) { >+- value = numeric_limits<float>::quiet_NaN(); >++ value = std::numeric_limits<float>::quiet_NaN(); >+ } else { >+ std::string token = line_str.substr( pos, len ); >+ const char *str_beg = token.c_str(); >+ char *str_end; >+-// cerr << "token: " << str_beg << "\n"; >++// std::cerr << "token: " << str_beg << "\n"; >+ value = strtof( str_beg, &str_end ); >+ if( str_beg == str_end ) { >+ std::ostringstream error_message; >+@@ -645,15 +649,15 @@ void HDRHTMLSet::add_image( int width, i >+ basis_table.data[0][k] = log2f( basis_table.data[0][k] ); >+ >+ // Fix zero and negative values in the image, convert to log2 space, find min and max values >+- float img_min = numeric_limits<float>::max(); >+- float img_max = numeric_limits<float>::min(); >++ float img_min = std::numeric_limits<float>::max(); >++ float img_max = std::numeric_limits<float>::min(); >+ { >+ float *arrays[] = { R, G, B, Y }; >+ int k; >+ >+ for( k = 0; k < 4; k++ ) { >+ float *x = arrays[k]; >+- float min_val = numeric_limits<float>::max(), max_val = numeric_limits<float>::min(); >++ float min_val = std::numeric_limits<float>::max(), max_val = std::numeric_limits<float>::min(); >+ for( int i=0; i < pixels; i++ ) { >+ if( x[i] < min_val && x[i] > 0) >+ min_val = x[i]; >+@@ -743,7 +747,7 @@ void HDRHTMLSet::add_image( int width, i >+ for( int k=1; k <= f8_stops+1; k++ ) { >+ >+ >+- float max_value = (float)numeric_limits<unsigned short>::max(); //(1<<16) -1; >++ float max_value = (float)std::numeric_limits<unsigned short>::max(); //(1<<16) -1; >+ >+ float exp_multip = log2f(1/powf( 2, l_start + k*8 )); >+ >+@@ -798,9 +802,9 @@ void HDRHTMLSet::add_image( int width, i >+ >+ } >+ >+-void print_image_objects( ostream &out, void *user_data, const char *parameter ); >+-void print_cf_table( ostream &out, void *user_data, const char *parameter ); >+-void print_image_htmlcode( ostream &out, void *user_data, const char *parameter ); >++void print_image_objects( std::ostream &out, void *user_data, const char *parameter ); >++void print_cf_table( std::ostream &out, void *user_data, const char *parameter ); >++void print_image_htmlcode( std::ostream &out, void *user_data, const char *parameter ); >+ >+ void HDRHTMLSet::generate_webpage( const char *page_template, const char *image_template, >+ const char *object_output, const char *html_output) >+@@ -854,11 +858,11 @@ void HDRHTMLSet::generate_webpage( const >+ >+ } >+ >+-void print_image_objects( ostream &out, void *user_data, const char *parameter ) >++void print_image_objects( std::ostream &out, void *user_data, const char *parameter ) >+ { >+ HDRHTMLSet *hdrhtml_set = (HDRHTMLSet*)user_data; >+ >+- list<HDRHTMLImage>::iterator it; >++ std::list<HDRHTMLImage>::iterator it; >+ for( it = hdrhtml_set->image_list.begin(); it != hdrhtml_set->image_list.end(); it++ ) { >+ std::string obj_name( "hdr_" ); >+ obj_name.append( it->base_name ); >+@@ -884,7 +888,7 @@ void print_image_objects( ostream &out, >+ >+ } >+ >+-void print_image_htmlcode( ostream &out, HDRHTMLSet *hdrhtml_set, const HDRHTMLImage &it ) >++void print_image_htmlcode( std::ostream &out, HDRHTMLSet *hdrhtml_set, const HDRHTMLImage &it ) >+ { >+ std::string obj_name( "hdr_" ); >+ obj_name.append( it.base_name ); >+@@ -909,13 +913,13 @@ void print_image_htmlcode( ostream &out, >+ >+ } >+ >+-void print_image_htmlcode( ostream &out, void *user_data, const char *parameter ) >++void print_image_htmlcode( std::ostream &out, void *user_data, const char *parameter ) >+ { >+ HDRHTMLSet *hdrhtml_set = (HDRHTMLSet*)user_data; >+ >+ if( parameter != NULL ) { >+ >+- list<HDRHTMLImage>::iterator it; >++ std::list<HDRHTMLImage>::iterator it; >+ for( it = hdrhtml_set->image_list.begin(); it != hdrhtml_set->image_list.end(); it++ ) { >+ if( it->base_name.compare( parameter ) == 0 ) >+ break; >+@@ -927,7 +931,7 @@ void print_image_htmlcode( ostream &out, >+ >+ } else { >+ >+- list<HDRHTMLImage>::iterator it; >++ std::list<HDRHTMLImage>::iterator it; >+ for( it = hdrhtml_set->image_list.begin(); it != hdrhtml_set->image_list.end(); it++ ) { >+ >+ print_image_htmlcode( out, hdrhtml_set, *it ); >+@@ -937,7 +941,7 @@ void print_image_htmlcode( ostream &out, >+ >+ } >+ >+-void print_cf_table( ostream &out, void *user_data, const char *parameter ) >++void print_cf_table( std::ostream &out, void *user_data, const char *parameter ) >+ { >+ CSVTable *cf = (CSVTable*)user_data; >+ > >Property changes on: graphics/pfstools/files/patch-src_hdrhtml_hdrhtml.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_octave_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_octave_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_octave_CMakeLists.txt (working copy) >@@ -0,0 +1,11 @@ >+--- src/octave/CMakeLists.txt.orig 2018-01-19 06:59:44 UTC >++++ src/octave/CMakeLists.txt >+@@ -7,7 +7,7 @@ set(SRC_OCT pfsread pfswrite pfstransfor >+ >+ set(SRC_M pfsview.m pfsview_rgb.m pfsview_list.m pfs_read_rgb.m pfs_read_xyz.m pfs_read_luminance.m pfs_write_rgb.m pfssize.m pfs_open_frames.m pfs_close_frames.m) >+ >+-set(OCT_SCRIPTS pfsoctavelum pfsoctavergb pfsstat) >++set(OCT_SCRIPTS pfsoctavelum pfsoctavergb pfsstat pfssmoothresp pfsplotresp) >+ >+ set(CMAKE_CXXFLAGS "-cxx -largeArrayDims") >+ set(ENV{CXXFLAGS} ${CMAKE_CXXFLAGS}) > >Property changes on: graphics/pfstools/files/patch-src_octave_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_octave_pfsstat >=================================================================== >--- graphics/pfstools/files/patch-src_octave_pfsstat (nonexistent) >+++ graphics/pfstools/files/patch-src_octave_pfsstat (working copy) >@@ -0,0 +1,17 @@ >+--- src/octave/pfsstat.orig 2017-11-13 17:38:28 UTC >++++ src/octave/pfsstat >+@@ -1,4 +1,4 @@ >+-#!/usr/bin/octave -q >++#!/usr/local/bin/octave-cli -qf >+ # >+ # This file is a part of PFSTOOLS package. >+ # ---------------------------------------------------------------------- >+@@ -25,6 +25,8 @@ >+ # >+ # See man page for more information >+ >++pkg load signal; >++ >+ pin = pfsopen( "stdin" ); >+ >+ #fprintf( stderr, "l = %d\n", length( argv ) ); > >Property changes on: graphics/pfstools/files/patch-src_octave_pfsstat >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_pfs_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_pfs_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_pfs_CMakeLists.txt (working copy) >@@ -0,0 +1,11 @@ >+--- src/pfs/CMakeLists.txt.orig 2018-01-19 06:59:44 UTC >++++ src/pfs/CMakeLists.txt >+@@ -29,7 +29,7 @@ install (TARGETS pfs >+ >+ #install (FILES ${CMAKE_CURRENT_BINARY_DIR}/cygpfs.dll DESTINATION bin) >+ install (FILES ${CMAKE_CURRENT_SOURCE_DIR}/pfs.h ${CMAKE_CURRENT_SOURCE_DIR}/array2d.h DESTINATION include/pfs) >+-install (FILES ${CMAKE_CURRENT_BINARY_DIR}/pfs.pc DESTINATION lib${LIB_SUFFIX}/pkgconfig) >++install (FILES ${CMAKE_CURRENT_BINARY_DIR}/pfs.pc DESTINATION libdata/pkgconfig) >+ >+ #install (FILES pfsoutppm.1 DESTINATION ${MAN_DIR}) >+ > >Property changes on: graphics/pfstools/files/patch-src_pfs_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_pfs_pfs.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_pfs_pfs.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_pfs_pfs.cpp (working copy) >@@ -0,0 +1,40 @@ >+--- src/pfs/pfs.cpp.orig 2018-01-26 11:40:37 UTC >++++ src/pfs/pfs.cpp >+@@ -159,6 +159,16 @@ public: >+ } >+ return it; >+ } >++ >++ TagList::const_iterator findTag( const char *tagName ) const >++ { >++ size_t tagNameLen = strlen( tagName ); >++ TagList::const_iterator it; >++ for( it = tagList.begin(); it != tagList.end(); it++ ) { >++ if( !memcmp( tagName, it->c_str(), tagNameLen ) ) break; // Found >++ } >++ return it; >++ } >+ >+ void setTag( const char *tagName, const char *tagValue ) >+ { >+@@ -174,9 +184,9 @@ public: >+ } >+ } >+ >+- const char *getTag( const char *tagName ) >++ const char *getTag( const char *tagName ) const >+ { >+- TagList::iterator element = findTag( tagName ); >++ TagList::const_iterator element = findTag( tagName ); >+ if( element == tagList.end() ) return NULL; >+ >+ string::size_type equalSign = element->find( '=' ); >+@@ -187,7 +197,7 @@ public: >+ >+ >+ //Implementation of TagContainer >+- const char* getString( const char *tagName ) >++ const char* getString( const char *tagName ) const >+ { >+ return getTag( tagName ); >+ } > >Property changes on: graphics/pfstools/files/patch-src_pfs_pfs.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_pfs_pfs.h >=================================================================== >--- graphics/pfstools/files/patch-src_pfs_pfs.h (nonexistent) >+++ graphics/pfstools/files/patch-src_pfs_pfs.h (working copy) >@@ -0,0 +1,45 @@ >+--- src/pfs/pfs.h.orig 2018-01-26 11:18:46 UTC >++++ src/pfs/pfs.h >+@@ -141,12 +141,13 @@ namespace pfs >+ class TagContainer >+ { >+ public: >++ virtual ~TagContainer() {}; >+ /** >+ * Get a string tag of the name tagName from the TagContainer. >+ * @param tagName name of the tag to retrieve >+ * @return tag value or NULL if tag was not found >+ */ >+- virtual const char* getString( const char *tagName ) = 0; >++ virtual const char* getString( const char *tagName ) const = 0; >+ >+ /** >+ * Set or add a string tag of the name tagName. >+@@ -187,6 +188,7 @@ namespace pfs >+ */ >+ class Channel : public Array2D { >+ public: >++ virtual ~Channel() {}; >+ /** >+ * Gets width of the channel (in pixels). >+ * This is a synonym for Array2D::getCols(). >+@@ -596,7 +598,9 @@ namespace pfs >+ */ >+ Exception( const char* const message ) >+ { >+- strcpy( msg, message ); >++ const size_t s = sizeof(msg)/sizeof(msg[0]) - 1; >++ strncpy( msg, message, s ); >++ msg[s] = '\0'; >+ } >+ >+ ~Exception() {}; >+@@ -606,7 +610,7 @@ namespace pfs >+ * >+ * @return text description of the cause for the exception >+ */ >+- const char* getMessage() >++ const char* getMessage() const throw() >+ { >+ return msg; >+ } > >Property changes on: graphics/pfstools/files/patch-src_pfs_pfs.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_pfs_pfsutils.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_pfs_pfsutils.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_pfs_pfsutils.cpp (working copy) >@@ -0,0 +1,16 @@ >+--- src/pfs/pfsutils.cpp.orig 2018-01-25 17:09:12 UTC >++++ src/pfs/pfsutils.cpp >+@@ -57,7 +57,13 @@ string getColorspaceString(ColorSpace cs >+ return "HLG YCbCr 2020"; >+ case CS_RGB2020: >+ return "RGB2020"; >++ case CS_YUV: >++ return "YUV"; >++ case CS_Yxy: >++ return "Yxy"; >++ default: ; >+ } >++ return "(unknown)"; >+ } >+ >+ string intToString(int a){ > >Property changes on: graphics/pfstools/files/patch-src_pfs_pfsutils.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_pfsglview_m__histogram.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_pfsglview_m__histogram.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_pfsglview_m__histogram.cpp (working copy) >@@ -0,0 +1,11 @@ >+--- src/pfsglview/m_histogram.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/pfsglview/m_histogram.cpp >+@@ -176,7 +176,7 @@ void M_Histogram::drawHistogram() { >+ >+ int array_pos ; >+ int ch = 0 ; >+- if(!strcmp(channel, "XYZ") == 0) >++ if(!(strcmp(channel, "XYZ") == 0)) >+ switch(channel[0]) { >+ case 'X': ch = 1 ; break ; >+ case 'Y': ch = 2 ; break ; > >Property changes on: graphics/pfstools/files/patch-src_pfsglview_m__histogram.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_pfsview_pfsview__widget.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_pfsview_pfsview__widget.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_pfsview_pfsview__widget.cpp (working copy) >@@ -0,0 +1,22 @@ >+--- src/pfsview/pfsview_widget.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/pfsview/pfsview_widget.cpp >+@@ -147,7 +147,7 @@ void PFSViewWidget::setFrame( pfs::Frame >+ // Chose first available channel >+ pfs::ChannelIterator *it = frame->getChannels(); >+ if( !it->hasNext() ) // TODO: failover >+- throw new pfs::Exception( "No channels available!" ); >++ throw pfs::Exception( "No channels available!" ); >+ visibleChannel = it->getNext()->getName(); >+ } else if( visibleChannel != COLOR_CHANNELS ) { >+ // Get a new pointer, as the old frame object >+@@ -340,8 +340,8 @@ static void mapFrameToImage( pfs::Array2 >+ assert( !color || (color && B != NULL) ); >+ >+ >+- float lutPixFloor[257*2]; >+- QRgb lutPixel[257*2]; >++ float lutPixFloor[257*2+1]; >++ QRgb lutPixel[257*2+1]; >+ int lutSize; >+ if( !color && ( negativeTreatment == NEGATIVE_GREEN_SCALE || >+ negativeTreatment == NEGATIVE_ABSOLUTE ) ) { // Handle negative numbers > >Property changes on: graphics/pfstools/files/patch-src_pfsview_pfsview__widget.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_durand02_fastbilateral.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_durand02_fastbilateral.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_durand02_fastbilateral.cpp (working copy) >@@ -0,0 +1,27 @@ >+--- src/tmo/durand02/fastbilateral.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/durand02/fastbilateral.cpp >+@@ -67,11 +67,11 @@ public: >+ { >+ int ox = nx; >+ int oy = ny/2 + 1; // saves half of the data >+- const int osize = ox * oy; >+- source = (float*)fftwf_malloc(sizeof(float) * nx * 2 * (ny/2+1) ); >++ const size_t osize = ox * oy; >++ source = (float*)fftwf_malloc(sizeof(float) * (size_t)nx * 2 * ((size_t)ny/2+1) ); >+ freq = (fftwf_complex*) fftwf_malloc(sizeof(fftwf_complex) * osize); >+-// if( source == NULL || freq == NULL ) >+- //TODO: throw exception >++ if( source == NULL || freq == NULL ) >++ throw std::bad_alloc(); >+ fplan_fw = fftwf_plan_dft_r2c_2d(nx, ny, source, freq, FFTW_ESTIMATE); >+ fplan_in = fftwf_plan_dft_c2r_2d(nx, ny, freq, source, FFTW_ESTIMATE); >+ } >+@@ -101,7 +101,7 @@ public: >+ for( x=0 ; x<ox/2 ; x++ ) >+ for( y=0 ; y<oy ; y++ ) >+ { >+- float d2 = x*x + y*y; >++ float d2 = (float)x*x + (float)y*y; >+ float kernel = exp( -d2 / sig2 ); >+ >+ freq[x*oy+y][0] *= kernel; > >Property changes on: graphics/pfstools/files/patch-src_tmo_durand02_fastbilateral.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_fattal02_pde.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_fattal02_pde.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_fattal02_pde.cpp (working copy) >@@ -0,0 +1,196 @@ >+--- src/tmo/fattal02/pde.cpp.orig 2018-01-25 16:27:28 UTC >++++ src/tmo/fattal02/pde.cpp >+@@ -72,15 +72,15 @@ using namespace std; >+ // precision >+ #define EPS 1.0e-12 >+ >+-void linbcg(unsigned long n, float b[], float x[], int itol, float tol, >++static void linbcg(unsigned long n, float b[], float x[], int itol, float tol, >+ int itmax, int *iter, float *err); >+ >+-inline float max( float a, float b ) >++static inline float max( float a, float b ) >+ { >+ return a > b ? a : b; >+ } >+ >+-inline float min( float a, float b ) >++static inline float min( float a, float b ) >+ { >+ return a < b ? a : b; >+ } >+@@ -111,7 +111,7 @@ inline float min( float a, float b ) >+ // Full Multigrid Algorithm for solving partial differential equations >+ ////////////////////////////////////////////////////////////////////// >+ >+-void restrict( const pfstmo::Array2D *in, pfstmo::Array2D *out ) >++static void restrict( const pfstmo::Array2D *in, pfstmo::Array2D *out ) >+ { >+ const float inRows = in->getRows(); >+ const float inCols = in->getCols(); >+@@ -174,7 +174,7 @@ void restrict( const pfstmo::Array2D *in >+ // } >+ >+ >+-void prolongate( const pfstmo::Array2D *in, pfstmo::Array2D *out ) >++static void prolongate( const pfstmo::Array2D *in, pfstmo::Array2D *out ) >+ { >+ float dx = (float)in->getCols() / (float)out->getCols(); >+ float dy = (float)in->getRows() / (float)out->getRows(); >+@@ -218,7 +218,7 @@ void prolongate( const pfstmo::Array2D * >+ } >+ >+ // to_level<from_level, from_size<to_size >+-void prolongate_old( pfstmo::Array2D *F, pfstmo::Array2D *T ) >++static void prolongate_old( pfstmo::Array2D *F, pfstmo::Array2D *T ) >+ { >+ // DEBUG_STR << "prolongate" << endl; >+ >+@@ -279,7 +279,7 @@ void prolongate_old( pfstmo::Array2D *F, >+ } >+ } >+ >+-void exact_sollution( pfstmo::Array2D *F, pfstmo::Array2D *U ) >++static void exact_sollution( pfstmo::Array2D *F, pfstmo::Array2D *U ) >+ { >+ // DEBUG_STR << "exact sollution" << endl; >+ >+@@ -316,13 +316,13 @@ void exact_sollution( pfstmo::Array2D *F >+ >+ static int rows, cols; >+ >+-inline int idx( int r, int c ) >++static inline int idx( int r, int c ) >+ { >+ return r*cols+c+1; >+ } >+ >+ // smooth u using f at level >+-void smooth( pfstmo::Array2D *U, pfstmo::Array2D *F ) >++static void smooth( pfstmo::Array2D *U, pfstmo::Array2D *F ) >+ { >+ // DEBUG_STR << "smooth" << endl; >+ >+@@ -371,7 +371,7 @@ void smooth( pfstmo::Array2D *U, pfstmo: >+ // } >+ } >+ >+-void calculate_defect( pfstmo::Array2D *D, pfstmo::Array2D *U, pfstmo::Array2D *F ) >++static void calculate_defect( pfstmo::Array2D *D, pfstmo::Array2D *U, pfstmo::Array2D *F ) >+ { >+ // DEBUG_STR << "calculate defect" << endl; >+ >+@@ -397,7 +397,7 @@ void calculate_defect( pfstmo::Array2D * >+ >+ } >+ >+-void add_correction( pfstmo::Array2D *U, pfstmo::Array2D *C ) >++static void add_correction( pfstmo::Array2D *U, pfstmo::Array2D *C ) >+ { >+ // DEBUG_STR << "add_correction" << endl; >+ >+@@ -634,8 +634,9 @@ void solve_pde_sor( pfstmo::Array2D *F, >+ omega = ( n==1 && ipass==1 ? 1.0 / (1.0 - 0.5 * rjac * rjac) >+ : 1.0 / (1.0 - 0.25 * rjac * rjac * omega)); >+ } >+- if( !(n%100) || n==1) >++ if( !(n%100) || n==1) { >+ DEBUG_STR << "SOR:> " << n << "\tAnorm: " << anorm << "\n"; >++ } >+ if (anorm < EPS * anormf ) { >+ DEBUG_STR << "SOR:> solved.\n"; >+ return; >+@@ -648,7 +649,7 @@ void solve_pde_sor( pfstmo::Array2D *F, >+ >+ //#define EPS 1.0e-14 >+ >+-void asolve(unsigned long n, float b[], float x[], int itrnsp) >++static void asolve(float b[], float x[]) >+ { >+ for( int r = 0; r < rows; r++ ) >+ for( int c = 0; c < cols; c++ ) { >+@@ -656,7 +657,7 @@ void asolve(unsigned long n, float b[], >+ } >+ } >+ >+-void atimes(unsigned long n, float x[], float res[], int itrnsp) >++static void atimes(float x[], float res[]) >+ { >+ for( int r = 1; r < rows-1; r++ ) >+ for( int c = 1; c < cols-1; c++ ) { >+@@ -684,7 +685,7 @@ void atimes(unsigned long n, float x[], >+ - 2*x[idx(rows-1,cols-1)]; >+ } >+ >+-float snrm(unsigned long n, float sx[], int itol) >++static float snrm(unsigned long n, float sx[], int itol) >+ { >+ unsigned long i,isamax; >+ float ans; >+@@ -706,7 +707,7 @@ float snrm(unsigned long n, float sx[], >+ * Biconjugate Gradient Method >+ * from Numerical Recipes in C >+ */ >+-void linbcg(unsigned long n, float b[], float x[], int itol, float tol, int itmax, int *iter, float *err) >++static void linbcg(unsigned long n, float b[], float x[], int itol, float tol, int itmax, int *iter, float *err) >+ { >+ unsigned long j; >+ float ak,akden,bk,bkden,bknum,bnrm,dxnrm,xnrm,zm1nrm,znrm; >+@@ -720,30 +721,30 @@ void linbcg(unsigned long n, float b[], >+ zz=new float[n+1]; >+ >+ *iter=0; >+- atimes(n,x,r,0); >++ atimes(x,r); >+ for (j=1;j<=n;j++) { >+ r[j]=b[j]-r[j]; >+ rr[j]=r[j]; >+ } >+- atimes(n,r,rr,0); // minimum residual >++ atimes(r,rr); // minimum residual >+ znrm=1.0; >+ if (itol == 1) bnrm=snrm(n,b,itol); >+ else if (itol == 2) { >+- asolve(n,b,z,0); >++ asolve(b,z); >+ bnrm=snrm(n,z,itol); >+ } >+ else if (itol == 3 || itol == 4) { >+- asolve(n,b,z,0); >++ asolve(b,z); >+ bnrm=snrm(n,z,itol); >+- asolve(n,r,z,0); >++ asolve(r,z); >+ znrm=snrm(n,z,itol); >+ } else printf("illegal itol in linbcg"); >+- asolve(n,r,z,0); >++ asolve(r,z); >+ >+ while (*iter <= itmax) { >+ ++(*iter); >+ zm1nrm=znrm; >+- asolve(n,rr,zz,1); >++ asolve(rr,zz); >+ for (bknum=0.0,j=1;j<=n;j++) bknum += z[j]*rr[j]; >+ if (*iter == 1) { >+ for (j=1;j<=n;j++) { >+@@ -759,16 +760,16 @@ void linbcg(unsigned long n, float b[], >+ } >+ } >+ bkden=bknum; >+- atimes(n,p,z,0); >++ atimes(p,z); >+ for (akden=0.0,j=1;j<=n;j++) akden += z[j]*pp[j]; >+ ak=bknum/akden; >+- atimes(n,pp,zz,1); >++ atimes(pp,zz); >+ for (j=1;j<=n;j++) { >+ x[j] += ak*p[j]; >+ r[j] -= ak*z[j]; >+ rr[j] -= ak*zz[j]; >+ } >+- asolve(n,r,z,0); >++ asolve(r,z); >+ if (itol == 1 || itol == 2) { >+ znrm=1.0; >+ *err=snrm(n,r,itol)/bnrm; > >Property changes on: graphics/pfstools/files/patch-src_tmo_fattal02_pde.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_fattal02_tmo__fattal02.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_fattal02_tmo__fattal02.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_fattal02_tmo__fattal02.cpp (working copy) >@@ -0,0 +1,10 @@ >+--- src/tmo/fattal02/tmo_fattal02.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/fattal02/tmo_fattal02.cpp >+@@ -105,7 +105,6 @@ void gaussianBlur( pfstmo::Array2D* I, p >+ { >+ int width = I->getCols(); >+ int height = I->getRows(); >+- int size = width*height; >+ int x,y; >+ >+ pfstmo::Array2D* T = new pfstmo::Array2D(width,height); > >Property changes on: graphics/pfstools/files/patch-src_tmo_fattal02_tmo__fattal02.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_ferradans11_pfstmo__ferradans11.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_ferradans11_pfstmo__ferradans11.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_ferradans11_pfstmo__ferradans11.cpp (working copy) >@@ -0,0 +1,17 @@ >+--- src/tmo/ferradans11/pfstmo_ferradans11.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/ferradans11/pfstmo_ferradans11.cpp >+@@ -66,12 +66,13 @@ void pfstmo_ferradans11( int argc, char* >+ >+ static struct option cmdLineOptions[] = { >+ { "help", no_argument, NULL, 'h' }, >++ { "verbose", no_argument, NULL, 'v' }, >+ { "rho", required_argument, NULL, 'r' }, >+ { "inv_alpha", required_argument, NULL, 'a' }, >+ { NULL, 0, NULL, 0 } >+ }; >+ >+- static const char optstring[] = "hr:a:"; >++ static const char optstring[] = "hvr:a:"; >+ >+ int optionIndex = 0; >+ while( 1 ) { > >Property changes on: graphics/pfstools/files/patch-src_tmo_ferradans11_pfstmo__ferradans11.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_mantiuk06_CMakeLists.txt >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_mantiuk06_CMakeLists.txt (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_mantiuk06_CMakeLists.txt (working copy) >@@ -0,0 +1,14 @@ >+--- src/tmo/mantiuk06/CMakeLists.txt.orig 2018-01-25 16:09:20 UTC >++++ src/tmo/mantiuk06/CMakeLists.txt >+@@ -5,6 +5,11 @@ if( NOT HAS_GETOPT ) >+ endif( NOT HAS_GETOPT ) >+ link_directories("${PROJECT_SOURCE_DIR}/src/pfs") >+ >++if(OPENMP_FOUND) >++ set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) >++ set( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_C_FLAGS}" ) >++endif(OPENMP_FOUND) >++ >+ set(TRG pfstmo_mantiuk06) >+ add_executable(${TRG} ${TRG}.cpp contrast_domain.cpp "${GETOPT_OBJECT}") >+ target_link_libraries(${TRG} pfs) > >Property changes on: graphics/pfstools/files/patch-src_tmo_mantiuk06_CMakeLists.txt >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_mantiuk06_contrast__domain.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_mantiuk06_contrast__domain.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_mantiuk06_contrast__domain.cpp (working copy) >@@ -0,0 +1,263 @@ >+--- src/tmo/mantiuk06/contrast_domain.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/mantiuk06/contrast_domain.cpp >+@@ -74,8 +74,6 @@ static void matrix_subtract(const int n, >+ static void matrix_copy(const int n, const float* const a, float* const b); >+ static void matrix_multiply_const(const int n, float* const a, const float val); >+ static void matrix_divide(const int n, const float* const a, float* const b); >+-static float* matrix_alloc(const int size); >+-static void matrix_free(float* m); >+ static float matrix_DotProduct(const int n, const float* const a, const float* const b); >+ static void matrix_zero(const int n, float* const m); >+ static void calculate_and_add_divergence(const int rows, const int cols, const float* const Gx, const float* const Gy, float* const divG); >+@@ -317,24 +315,6 @@ static inline void matrix_divide(const i >+ } >+ >+ >+-// alloc memory for the float table >+-static inline float* matrix_alloc(int size){ >+- >+- float* m = (float*)malloc(sizeof(float)*size); >+- if(m == NULL){ >+- fprintf(stderr, "ERROR: malloc in matrix_alloc() (size:%d)", size); >+- exit(155); >+- } >+- >+- return m; >+-} >+- >+-// free memory for matrix >+-static inline void matrix_free(float* m){ >+- if(m != NULL) >+- free(m); >+-} >+- >+ // multiply vector by vector (each vector should have one dimension equal to 1) >+ static inline float matrix_DotProduct(const int n, const float* const a, const float* const b){ >+ float val = 0; >+@@ -382,7 +362,7 @@ static inline void calculate_and_add_div >+ // temp is a temporary matrix of size (cols, rows), assumed to already be allocated >+ static void pyramid_calculate_divergence_sum(pyramid_t* pyramid, float* divG_sum) >+ { >+- float* temp = matrix_alloc(pyramid->rows*pyramid->cols); >++ float* temp = new float[pyramid->rows*pyramid->cols]; >+ >+ // Find the coarsest pyramid, and the number of pyramid levels >+ int levels = 1; >+@@ -426,7 +406,7 @@ static void pyramid_calculate_divergence >+ pyramid = pyramid->prev; >+ } >+ >+- matrix_free(temp); >++ delete[] temp; >+ } >+ >+ // calculate scale factors (Cx,Cy) for gradients (Gx,Gy) >+@@ -495,20 +475,10 @@ static void pyramid_free(pyramid_t* pyra >+ { >+ while (pyramid) >+ { >+- if(pyramid->Gx != NULL) >+- { >+- free(pyramid->Gx); >+- pyramid->Gx = NULL; >+- } >+- if(pyramid->Gy != NULL) >+- { >+- free(pyramid->Gy); >+- pyramid->Gy = NULL; >+- } >++ delete[] pyramid->Gx; >++ delete[] pyramid->Gy; >+ pyramid_t* const next = pyramid->next; >+- pyramid->prev = NULL; >+- pyramid->next = NULL; >+- free(pyramid); >++ delete pyramid; >+ pyramid = next; >+ } >+ } >+@@ -523,19 +493,14 @@ static pyramid_t * pyramid_allocate(int >+ >+ while(rows >= PYRAMID_MIN_PIXELS && cols >= PYRAMID_MIN_PIXELS) >+ { >+- level = (pyramid_t *) malloc(sizeof(pyramid_t)); >+- if(level == NULL) >+- { >+- fprintf(stderr, "ERROR: malloc in pyramid_alloc() (size:%d)", (int)sizeof(pyramid_t)); >+- exit(155); >+- } >++ level = new pyramid_t; >+ memset( level, 0, sizeof(pyramid_t) ); >+ >+ level->rows = rows; >+ level->cols = cols; >+ const int size = level->rows * level->cols; >+- level->Gx = matrix_alloc(size); >+- level->Gy = matrix_alloc(size); >++ level->Gx = new float[size]; >++ level->Gy = new float[size]; >+ >+ level->prev = prev; >+ if(prev != NULL) >+@@ -598,7 +563,7 @@ static void dump_matrix_to_file(const in >+ // lum_temp gets overwritten! >+ static void pyramid_calculate_gradient(pyramid_t* pyramid, float* lum_temp) >+ { >+- float* temp = matrix_alloc((pyramid->rows/2)*(pyramid->cols/2)); >++ float* temp = new float[(pyramid->rows/2)*(pyramid->cols/2)]; >+ float* const temp_saved = temp; >+ >+ calculate_gradient(pyramid->cols, pyramid->rows, lum_temp, pyramid->Gx, pyramid->Gy); >+@@ -626,7 +591,7 @@ static void pyramid_calculate_gradient(p >+ pyramid = pyramid->next; >+ } >+ >+- matrix_free(temp_saved); >++ delete[] temp_saved; >+ } >+ >+ >+@@ -658,13 +623,13 @@ static void linbcg(pyramid_t* pyramid, p >+ const int n = rows*cols; >+ const float tol2 = tol*tol; >+ >+- float* const z = matrix_alloc(n); >+- float* const zz = matrix_alloc(n); >+- float* const p = matrix_alloc(n); >+- float* const pp = matrix_alloc(n); >+- float* const r = matrix_alloc(n); >+- float* const rr = matrix_alloc(n); >+- float* const x_save = matrix_alloc(n); >++ float* const z = new float[n]; >++ float* const zz = new float[n]; >++ float* const p = new float[n]; >++ float* const pp = new float[n]; >++ float* const r = new float[n]; >++ float* const rr = new float[n]; >++ float* const x_save = new float[n]; >+ >+ const float bnrm2 = matrix_DotProduct(n, b, b); >+ >+@@ -799,13 +764,13 @@ static void linbcg(pyramid_t* pyramid, p >+ progress_cb(100); >+ >+ >+- matrix_free(x_save); >+- matrix_free(p); >+- matrix_free(pp); >+- matrix_free(z); >+- matrix_free(zz); >+- matrix_free(r); >+- matrix_free(rr); >++ delete[] x_save; >++ delete[] p; >++ delete[] pp; >++ delete[] z; >++ delete[] zz; >++ delete[] r; >++ delete[] rr; >+ } >+ >+ >+@@ -818,10 +783,10 @@ static void lincg(pyramid_t* pyramid, py >+ const int n = rows*cols; >+ const float tol2 = tol*tol; >+ >+- float* const x_save = matrix_alloc(n); >+- float* const r = matrix_alloc(n); >+- float* const p = matrix_alloc(n); >+- float* const Ap = matrix_alloc(n); >++ float* const x_save = new float[n]; >++ float* const r = new float[n]; >++ float* const p = new float[n]; >++ float* const Ap = new float[n]; >+ >+ // bnrm2 = ||b|| >+ const float bnrm2 = matrix_DotProduct(n, b, b); >+@@ -943,10 +908,10 @@ static void lincg(pyramid_t* pyramid, py >+ else if (progress_cb != NULL) >+ progress_cb(100); >+ >+- matrix_free(x_save); >+- matrix_free(p); >+- matrix_free(Ap); >+- matrix_free(r); >++ delete[] x_save; >++ delete[] p; >++ delete[] Ap; >++ delete[] r; >+ } >+ >+ >+@@ -1070,7 +1035,7 @@ static void transform_to_luminance(pyram >+ pyramid_calculate_scale_factor(pp, pC); // calculate (Cx,Cy) >+ pyramid_scale_gradient(pp, pC); // scale small gradients by (Cx,Cy); >+ >+- float* b = matrix_alloc(pp->cols * pp->rows); >++ float* b = new float[pp->cols * pp->rows]; >+ pyramid_calculate_divergence_sum(pp, b); // calculate the sum of divergences (equal to b) >+ >+ // calculate luminances from gradients >+@@ -1079,7 +1044,7 @@ static void transform_to_luminance(pyram >+ else >+ lincg(pp, pC, b, x, itmax, tol, progress_cb); >+ >+- matrix_free(b); >++ delete[] b; >+ pyramid_free(pC); >+ } >+ >+@@ -1121,12 +1086,7 @@ static void contrast_equalization( pyram >+ } >+ >+ // Allocate memory >+- struct hist_data* hist = (struct hist_data*) malloc(sizeof(struct hist_data) * total_pixels); >+- if (hist == NULL) >+- { >+- fprintf(stderr, "ERROR: malloc in contrast_equalization() (size:%d)", (int)sizeof(struct hist_data) * total_pixels); >+- exit(155); >+- } >++ struct hist_data* hist = new hist_data[total_pixels]; >+ >+ // Build histogram info >+ l = pp; >+@@ -1175,7 +1135,7 @@ static void contrast_equalization( pyram >+ l = l->next; >+ } >+ >+- free(hist); >++ delete[] hist; >+ } >+ >+ >+@@ -1211,10 +1171,10 @@ int tmo_mantiuk06_contmap(const int c, c >+ } >+ >+ pyramid_t* pp = pyramid_allocate(c,r); // create pyramid >+- float* tY = matrix_alloc(n); >++ float* tY = new float[n]; >+ matrix_copy(n, Y, tY); // copy Y to tY >+ pyramid_calculate_gradient(pp,tY); // calculate gradients for pyramid, destroys tY >+- matrix_free(tY); >++ delete[] tY; >+ pyramid_transform_to_R(pp); // transform gradients to R >+ >+ /* Contrast map */ >+@@ -1228,7 +1188,7 @@ int tmo_mantiuk06_contmap(const int c, c >+ pyramid_free(pp); >+ >+ /* Renormalize luminance */ >+- float* temp = matrix_alloc(n); >++ float* temp = new float[n]; >+ >+ matrix_copy(n, Y, temp); // copy Y to temp >+ qsort(temp, n, sizeof(float), sort_float); // sort temp in ascending order >+@@ -1244,7 +1204,7 @@ int tmo_mantiuk06_contmap(const int c, c >+ delta = trim - floorf(trim); >+ const float l_max = temp[(int)floorf(trim)] * delta + temp[(int)ceilf(trim)] * (1.0f-delta); >+ >+- matrix_free(temp); >++ delete[] temp; >+ >+ const float disp_dyn_range = 2.3f; >+ #pragma omp parallel for schedule(static) > >Property changes on: graphics/pfstools/files/patch-src_tmo_mantiuk06_contrast__domain.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_mantiuk06_pfstmo__mantiuk06.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_mantiuk06_pfstmo__mantiuk06.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_mantiuk06_pfstmo__mantiuk06.cpp (working copy) >@@ -0,0 +1,17 @@ >+--- src/tmo/mantiuk06/pfstmo_mantiuk06.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/mantiuk06/pfstmo_mantiuk06.cpp >+@@ -219,6 +219,14 @@ int main( int argc, char* argv[] ) >+ try { >+ tmo_mantiuk06( argc, argv ); >+ } >++ catch (std::bad_alloc ex) { >++ fprintf(stderr, PROG_NAME " error: out of memory\n"); >++ return EXIT_FAILURE; >++ } >++ catch (std::exception ex) { >++ fprintf(stderr, PROG_NAME " error: %s\n", ex.what()); >++ return EXIT_FAILURE; >++ } >+ catch( pfs::Exception ex ) { >+ fprintf( stderr, PROG_NAME " error: %s\n", ex.getMessage() ); >+ return EXIT_FAILURE; > >Property changes on: graphics/pfstools/files/patch-src_tmo_mantiuk06_pfstmo__mantiuk06.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_mantiuk08_display__adaptive__tmo.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_mantiuk08_display__adaptive__tmo.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_mantiuk08_display__adaptive__tmo.cpp (working copy) >@@ -0,0 +1,86 @@ >+--- src/tmo/mantiuk08/display_adaptive_tmo.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/mantiuk08/display_adaptive_tmo.cpp >+@@ -36,6 +36,9 @@ >+ #include <memory.h> >+ #include <assert.h> >+ #include <memory> >++#include <vector> >++ >++#include <pfs.h> >+ >+ #include "display_adaptive_tmo.h" >+ >+@@ -158,12 +161,16 @@ public: >+ } >+ } >+ >+- UniformArrayLUT() : x_i( 0 ), y_i(0), lut_size( 0 ), delta( 0. ) {} >++ UniformArrayLUT() : x_i(0), own_y_i(false), y_i(0), lut_size(0), delta(0.) {} >+ >+ UniformArrayLUT(const UniformArrayLUT& other) : x_i( other.x_i ), lut_size( other.lut_size ), delta( other.delta ) >+ { >+ this->y_i = new double[lut_size]; >+ own_y_i = true; >++ if (!other.y_i) >++ { >++ throw pfs::Exception("UniformArrayLUT copy constructor: source y_i is uninitialized"); >++ } >+ memcpy(this->y_i, other.y_i, lut_size * sizeof(double)); >+ } >+ >+@@ -172,6 +179,10 @@ public: >+ this->lut_size = other.lut_size; >+ this->delta = other.delta; >+ this->x_i = other.x_i; >++ if (!other.y_i) >++ { >++ throw pfs::Exception("UniformArrayLUT = operator: source y_i is uninitialized"); >++ } >+ this->y_i = new double[lut_size]; >+ own_y_i = true; >+ memcpy(this->y_i, other.y_i, lut_size * sizeof(double)); >+@@ -203,7 +214,7 @@ public: >+ >+ }; >+ >+-#define PFSEOL "\x0a" >++/*#define PFSEOL "\x0a" >+ static void dumpPFS( const char *fileName, const int width, const int height, float *data, const char *channelName ) >+ { >+ FILE *fh = fopen( fileName, "wb" ); >+@@ -218,7 +229,7 @@ static void dumpPFS( const char *fileNam >+ } >+ >+ fclose( fh ); >+-} >++}*/ >+ >+ >+ void compute_gaussian_level( const int width, const int height, const pfstmo::Array2D& in, pfstmo::Array2D& out, int level, pfstmo::Array2D& temp ) >+@@ -594,7 +605,7 @@ double contrast_transducer_kulikowski( d >+ float Mt = std::min( 0.99, 1./sensitivity ); // threshold as Michelson contrast >+ float Gt = 0.5 * log10( (Mt+1)/(1-Mt) ); // threshold as log contrast >+ >+- return sign(C) * powf( abs(C)-Gt+1, 0.5 ); >++ return sign(C) * powf( fabs(C)-Gt+1, 0.5 ); >+ } else { >+ return C * sensitivity; >+ } >+@@ -748,7 +759,7 @@ int optimize_tonecurve( datmoConditional >+ double d_dr = log10( dm->display( 1.f )/dm->display( 0.f ) ); // display dynamic range >+ >+ // Create LUTs for CSF to speed up computations >+- UniformArrayLUT *csf_lut = new UniformArrayLUT[C->f_count]; >++ std::vector<UniformArrayLUT> csf_lut(C->f_count); >+ for( int f = 0; f < C->f_count; f++ ) { >+ csf_lut[f] = UniformArrayLUT( C->x_count, C->x_scale ); >+ for( int i=0; i < C->x_count; i++ ) >+@@ -1005,7 +1016,7 @@ int optimize_tonecurve( datmoConditional >+ >+ compute_y( y, x, skip_lut, C->x_count, L, dm->display(0), dm->display(1) ); >+ >+- delete [] csf_lut; >++ //delete [] csf_lut; >+ >+ return PFSTMO_OK; >+ } > >Property changes on: graphics/pfstools/files/patch-src_tmo_mantiuk08_display__adaptive__tmo.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_mantiuk08_pfstmo__mantiuk08.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_mantiuk08_pfstmo__mantiuk08.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_mantiuk08_pfstmo__mantiuk08.cpp (working copy) >@@ -0,0 +1,45 @@ >+--- src/tmo/mantiuk08/pfstmo_mantiuk08.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/mantiuk08/pfstmo_mantiuk08.cpp >+@@ -31,7 +31,6 @@ >+ >+ #include <config.h> >+ >+-#include <iostream> >+ #include <stdio.h> >+ #include <stdlib.h> >+ #include <math.h> >+@@ -395,16 +394,28 @@ bool read_tone_curve( FILE *fh, datmoTon >+ >+ >+ >+-int main( int argc, char* argv[] ) >++int main(int argc, char* argv[]) >+ { >+ try { >+- tmo_mantiuk08( argc, argv ); >++ tmo_mantiuk08(argc, argv); >+ } >+- catch( pfs::Exception ex ) { >+- fprintf( stderr, PROG_NAME " error: %s\n", ex.getMessage() ); >++ catch (const std::bad_alloc &ex) { >++ fprintf(stderr, PROG_NAME " error: out of memory (%s)\n", ex.what()); >+ return EXIT_FAILURE; >+- } >+- catch( QuietException ex ) { >++ } >++ catch (const std::exception &ex) { >++ fprintf(stderr, PROG_NAME " error: %s\n", ex.what()); >++ return EXIT_FAILURE; >++ } >++ catch (const pfs::Exception &ex) { >++ fprintf(stderr, PROG_NAME " error: %s\n", ex.getMessage()); >++ return EXIT_FAILURE; >++ } >++ catch (const QuietException &) { >++ return EXIT_FAILURE; >++ } >++ catch (...) { >++ fprintf(stderr, PROG_NAME " something wrong...\n"); >+ return EXIT_FAILURE; >+ } >+ return EXIT_SUCCESS; > >Property changes on: graphics/pfstools/files/patch-src_tmo_mantiuk08_pfstmo__mantiuk08.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_reinhard02_approx.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_reinhard02_approx.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_reinhard02_approx.cpp (working copy) >@@ -0,0 +1,223 @@ >+--- src/tmo/reinhard02/approx.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/reinhard02/approx.cpp >+@@ -17,36 +17,36 @@ >+ #include <stdio.h> >+ #include <math.h> >+ >++#include <pfstmo.h> >++ >+ // interpolated version of approximation (always use this one!) (:krawczyk) >+ #define INTERPOLATED >+ >+-extern double **luminance; >+-int ImageWidth, ImageHeight; >++extern pfstmo::Array2D *lum; >++extern int width, height; >+ >+-double ***Pyramid; >+-int PyramidHeight; >+-int PyramidWidth0; >++int PyramidHeight; >+ >+-void build_pyramid( double **luminance, int ImageWidth, int ImageHeight ); >+-double V1( int x, int y, int level ); >++static float ***Pyramid; >++static int PyramidWidth0; >+ >+-int div2( const unsigned int n ) >++static int div2( const unsigned int n ) >+ { >+ const int q = n/2; >+ return(2*q < n ? q + 1 : q); >+ } >+ >+-double pyramid_lookup( int x, int y, int level ) >++static float pyramid_lookup( int x, int y, int level ) >+ /* PRE: */ >+ { >+ int n, s; >+ >+ /* Level 0 is a special case, the value is just the image */ >+ if (level == 0) { >+- if ( (x < 0) || (y < 0) || (x >= ImageWidth) || (y >= ImageHeight) ) >++ if ( (x < 0) || (y < 0) || (x >= width) || (y >= height) ) >+ return(0.0); >+ else >+- return(luminance[y][x]); >++ return((*lum)(x,y)); >+ } >+ >+ /* Compute the size of the slice */ >+@@ -58,25 +58,24 @@ double pyramid_lookup( int x, int y, int >+ //y = y >> level; >+ >+ if ( (x < 0) || (y < 0) || (x >= s) || (y >= s) ) >+- return(0.0); >++ return(0.0f); >+ else >+ return(Pyramid[level][y][x]); >+ } >+ >+-void build_pyramid( double **luminance, int image_width, int image_height ) >++void build_pyramid() >+ { >+ int k; >+ int x, y; >+ int i, j; >+- int width, height; >+ int max_dim; >+- int pyramid_height; >+- double sum = 0; >++ int pyramid_width; >++ double sum = 0.f; >+ >+- double a = 0.4; >+- double b = 0.25; >+- double c = b - a/2; >+- double w[5]; >++ float a = 0.4f; >++ float b = 0.25f; >++ float c = b - a/2.f; >++ float w[5]; >+ >+ /* Compute the "filter kernel" */ >+ w[0] = c; >+@@ -90,50 +89,35 @@ void build_pyramid( double **luminance, >+ /* For simplicity, the first level is padded to a square whose side is a */ >+ /* power of two. */ >+ >+- ImageWidth = image_width; >+- ImageHeight = image_height; >+- >+ /* Compute the size of the Pyramid array */ >+- max_dim = (ImageHeight > ImageWidth ? ImageHeight : ImageWidth); >+- PyramidHeight = (int) floor(log(max_dim - 0.5)/log(2)) + 1; >++ max_dim = (height > width ? height : width); >++ PyramidHeight = (int)floorf(logf(max_dim - 0.5f)/logf(2)) + 1; >+ >+ /* Compute the dimensions of the first level */ >+- width = 1 << (PyramidHeight - 1); >+- PyramidWidth0 = width; >++ pyramid_width = 1 << (PyramidHeight - 1); >++ PyramidWidth0 = pyramid_width; >+ >+ // fprintf(stderr, "max_dim %d height %d\n", max_dim, PyramidHeight); >+ >+ /* Allocate the outer Pyramid array */ >+- Pyramid = (double***) calloc(PyramidHeight, sizeof(double**)); >+- if (!Pyramid) { >+- fprintf(stderr, "Unable to allocate pyramid array.\n"); >+- exit(1); >+- } >++ Pyramid = new float**[PyramidHeight]; >+ >+ /* Allocate and assign the Pyramid slices */ >+ k = 0; >+ >+- while (width) { >++ while (pyramid_width) { >+ >+ // fprintf(stderr, "level %d, width = %d\n", k, width); >+ >+ /* Allocate the slice */ >+- Pyramid[k] = (double**) calloc(width, sizeof(double*)); >+- if (!Pyramid[k]) { >+- fprintf(stderr, "Unable to allocate pyramid array.\n"); >+- exit(1); >+- } >+- for (y = 0; y < width; y++) { >+- Pyramid[k][y] = (double*) calloc(width, sizeof(double)); >+- if (!Pyramid[k][y]) { >+- fprintf(stderr, "Unable to allocate pyramid array.\n"); >+- exit(1); >+- } >++ Pyramid[k] = new float*[pyramid_width]; >++ for (y = 0; y < pyramid_width; y++) { >++ Pyramid[k][y] = new float[pyramid_width]; >+ } >+ >+ /* Compute the values in the slice */ >+- for (y = 0; y < width; y++) { >+- for (x = 0; x < width; x++) { >++ for (y = 0; y < pyramid_width; y++) { >++ for (x = 0; x < pyramid_width; x++) { >+ >+ sum = 0; >+ for (i = 0; i < 5; i++) { >+@@ -146,7 +130,7 @@ void build_pyramid( double **luminance, >+ } >+ >+ /* compute the width of the next slice */ >+- width /= 2; >++ pyramid_width /= 2; >+ k++; >+ } >+ } >+@@ -154,27 +138,27 @@ void build_pyramid( double **luminance, >+ void clean_pyramid() >+ { >+ int k=0; >+- int width = PyramidWidth0; >+- while(width) >++ int pyramid_width = PyramidWidth0; >++ while(pyramid_width) >+ { >+- for( int y=0 ; y<width ; y++ ) >+- free(Pyramid[k][y]); >+- free(Pyramid[k]); >++ for( int y=0 ; y<pyramid_width ; y++ ) >++ delete[] Pyramid[k][y]; >++ delete[] Pyramid[k]; >+ k++; >+- width /= 2; >++ pyramid_width /= 2; >+ } >+- free(Pyramid); >++ delete[] Pyramid; >+ } >+ >+ #ifndef INTERPOLATED >+-double V1( int x, int y, int level ) >++float V1( int x, int y, int level ) >+ /* PRE: */ >+ { >+ int n, s; >+ >+ /* Level 0 is a special case, the value is just the image */ >+ if (level <= 0) >+- return(luminance[y][x]); >++ return((*lum)(x,y)); >+ >+ /* Compute the size of the slice */ >+ >+@@ -184,16 +168,16 @@ double V1( int x, int y, int level ) >+ return(Pyramid[level-1][y][x]); >+ } >+ #else >+-double V1( int x, int y, int level ) >++float V1( int x, int y, int level ) >+ /* PRE: */ >+ { >+ int x0, y0; >+ int l, size; >+- double s, t; >++ float s, t; >+ >+ /* Level 0 is a special case, the value is just the image */ >+ if (level == 0) >+- return(luminance[y][x]); >++ return((*lum)(x,y)); >+ >+ /* Compute the size of the slice */ >+ l = 1 << level; >+@@ -204,8 +188,8 @@ double V1( int x, int y, int level ) >+ x0 = (x0 >= size ? size - 1 : x0); >+ y0 = (y0 >= size ? size - 1 : y0); >+ >+- s = (double)(x - x0*l)/(double)l; >+- t = (double)(y - y0*l)/(double)l; >++ s = (float)(x - x0*l)/(float)l; >++ t = (float)(y - y0*l)/(float)l; >+ >+ level--; >+ > >Property changes on: graphics/pfstools/files/patch-src_tmo_reinhard02_approx.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.1 >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.1 (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.1 (working copy) >@@ -0,0 +1,63 @@ >+--- src/tmo/reinhard02/pfstmo_reinhard02.1.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/reinhard02/pfstmo_reinhard02.1 >+@@ -6,6 +6,7 @@ pfstmo_reinhard02 \- Photographic Tone R >+ [--scales] [--key <val>] [--phi <val>] >+ [--range <val>] [--lower <val>] [--upper <val>] >+ [--temporal-coherent] >++[--border <val>] >+ [--verbose] [--help] >+ .SH DESCRIPTION >+ This command implements a tone mapping operator as described in: >+@@ -17,32 +18,32 @@ In ACM Transactions on Graphics, 2002. >+ According to the paper, results of this TMO require gamma correction. >+ .SH OPTIONS >+ .TP >+-[--scales] >++[--scales] [-s] >+ >+ Use scales to calculate local adaptation. That means: use local >+ version of this operator. By default, global version is used. >+ .TP >+-[--key <val>] >++[--key <val>] [-k <val>] >+ >+ Set key value for the image (refer to paper for details). >+ Default value: 0.18, accepted range <0..1>. >+ .TP >+-[--phi <val>] >++[--phi <val>] [-p <val>] >+ >+ Set phi value (refer to paper for details). >+ Default value: 1.0, accepted range >=0.0. >+ .TP >+-[--range <val>] >++[--range <val>] [-r <val>] >+ >+ Set range size (refer to paper for details). >+ Default value: 8, accepted range >1. >+ .TP >+-[--lower <val>] >++[--lower <val>] [-l <val>] >+ >+ Set lower scale size (refer to paper for details). >+ Default value: 1, accepted range >=1. >+ .TP >+-[--upper <val>] >++[--upper <val>] [-u <val>] >+ >+ Set upper scale size (refer to paper for details). >+ Default value: 43, accepted range >=1. >+@@ -54,6 +55,13 @@ sequences. Currently the option imposes >+ luminance value can change at most by 1% between two consecutive >+ frames. >+ .TP >++[--border <val>] [-b <val>] >++ >++Use border mechanism with specified relative border width. >++Actual border size will be calculated as the minimal size of the image >++(width or height) multiplied on relative border width. >++Default value: 0 (don't use border mechanism), accepted range: 0 >= b < 0.5. >++.TP >+ --verbose >+ >+ Print additional information during program execution. > >Property changes on: graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.1 >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.cpp (working copy) >@@ -0,0 +1,139 @@ >+--- src/tmo/reinhard02/pfstmo_reinhard02.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/reinhard02/pfstmo_reinhard02.cpp >+@@ -33,6 +33,7 @@ >+ >+ #include <config.h> >+ >++#include <exception> >+ #include <iostream> >+ #include <stdio.h> >+ #include <stdlib.h> >+@@ -40,6 +41,7 @@ >+ #include <math.h> >+ >+ #include <pfs.h> >++#include <pfstmo.h> >+ >+ #include "tmo_reinhard02.h" >+ >+@@ -61,6 +63,7 @@ void printHelp() >+ "\t[--key <val>] [--phi <val>] \n" >+ "\t[--range <val>] [--lower <val>] [--upper <val>] \n" >+ "\t[--temporal-coherent]\n" >++ "\t[--border <val>] \n" >+ "\t[--verbose] [--help] \n" >+ "See man page for more information.\n" ); >+ } >+@@ -77,6 +80,7 @@ void pfstmo_reinhard02( int argc, char* >+ int high = 43; >+ bool use_scales = false; >+ bool temporal_coherent = false; >++ float border = 0.f; >+ >+ static struct option cmdLineOptions[] = { >+ { "help", no_argument, NULL, 'h' }, >+@@ -88,12 +92,13 @@ void pfstmo_reinhard02( int argc, char* >+ { "lower", required_argument, NULL, 'l' }, >+ { "upper", required_argument, NULL, 'u' }, >+ { "temporal-coherent", no_argument, NULL, 't' }, >++ { "border", required_argument, NULL, 'b' }, >+ { NULL, 0, NULL, 0 } >+ }; >+ >+ int optionIndex = 0; >+ while( 1 ) { >+- int c = getopt_long (argc, argv, "hvsk:p:r:l:u:t", cmdLineOptions, &optionIndex); >++ int c = getopt_long (argc, argv, "hvsk:p:r:l:u:tb:", cmdLineOptions, &optionIndex); >+ if( c == -1 ) break; >+ switch( c ) { >+ case 'h': >+@@ -133,6 +138,11 @@ void pfstmo_reinhard02( int argc, char* >+ case 't': >+ temporal_coherent = true; >+ break; >++ case 'b': >++ border = (float)strtod( optarg, NULL ); >++ if( border<0.0f || border>=0.5f ) >++ throw pfs::Exception("border width value out of range, should be >=0 and <0.5"); >++ break; >+ case '?': >+ throw QuietException(); >+ case ':': >+@@ -140,17 +150,23 @@ void pfstmo_reinhard02( int argc, char* >+ } >+ } >+ >+- VERBOSE_STR << "use scales: " << (use_scales ? "yes" : "no" ) << endl; >+ VERBOSE_STR << "key value: " << key << endl; >+- VERBOSE_STR << "phi value: " << phi << endl; >++ VERBOSE_STR << "use scales: " << (use_scales ? "yes" : "no" ) << endl; >+ if( use_scales ) >+ { >+- VERBOSE_STR << "number of scales: " << num << endl; >+- VERBOSE_STR << "lower scale size: " << low << endl; >+- VERBOSE_STR << "upper scale size: " << high << endl; >+ #ifndef HAVE_ZFFT >+ VERBOSE_STR << "approximate implementation of scales" << endl; >+ #endif >++ VERBOSE_STR << "number of scales: " << num << endl; >++ VERBOSE_STR << "lower scale size: " << low << endl; >++ VERBOSE_STR << "upper scale size: " << high << endl; >++ VERBOSE_STR << "phi value: " << phi << endl; >++ } >++ VERBOSE_STR << "temporal coherent: " << (temporal_coherent ? "yes" : "no" ) << endl; >++ VERBOSE_STR << "use border: " << (border>0.f ? "yes" : "no" ) << endl; >++ if( border>0.f ) >++ { >++ VERBOSE_STR << "border width: " << border << endl; >+ } >+ >+ while( true ) >+@@ -169,21 +185,19 @@ void pfstmo_reinhard02( int argc, char* >+ // tone mapping >+ int w = Y->getCols(); >+ int h = Y->getRows(); >+- pfs::Array2DImpl* L = new pfs::Array2DImpl(w,h); >+- >+- tmo_reinhard02( w, h, Y->getRawData(), L->getRawData(), use_scales, key, phi, num, low, high, temporal_coherent ); >++ const pfstmo::Array2D ay(w, h, const_cast<float*>(Y->getRawData())); >++ pfstmo::Array2D al(w,h); >++ tmo_reinhard02( &ay, &al, use_scales, key, phi, num, low, high, temporal_coherent, border ); >+ >+ for( int x=0 ; x<w ; x++ ) >+ for( int y=0 ; y<h ; y++ ) >+ { >+- float scale = (*L)(x,y) / (*Y)(x,y); >++ float scale = al(x,y) / ay(x,y); >+ (*Y)(x,y) *= scale; >+ (*X)(x,y) *= scale; >+ (*Z)(x,y) *= scale; >+ } >+ >+- delete L; >+- >+ //--- >+ pfsio.writeFrame( frame, stdout ); >+ pfsio.freeFrame( frame ); >+@@ -195,11 +209,19 @@ int main( int argc, char* argv[] ) >+ try { >+ pfstmo_reinhard02( argc, argv ); >+ } >+- catch( pfs::Exception ex ) { >+- fprintf( stderr, PROG_NAME " error: %s\n", ex.getMessage() ); >++ catch (std::bad_alloc ex) { >++ fprintf(stderr, PROG_NAME " error: out of memory\n"); >+ return EXIT_FAILURE; >+ } >+- catch( QuietException ex ) { >++ catch (std::exception ex) { >++ fprintf(stderr, PROG_NAME " error: %s\n", ex.what()); >++ return EXIT_FAILURE; >++ } >++ catch (pfs::Exception ex) { >++ fprintf(stderr, PROG_NAME " error: %s\n", ex.getMessage()); >++ return EXIT_FAILURE; >++ } >++ catch (QuietException ex) { >+ return EXIT_FAILURE; >+ } >+ return EXIT_SUCCESS; > >Property changes on: graphics/pfstools/files/patch-src_tmo_reinhard02_pfstmo__reinhard02.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.cpp (working copy) >@@ -0,0 +1,722 @@ >+--- src/tmo/reinhard02/tmo_reinhard02.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/reinhard02/tmo_reinhard02.cpp >+@@ -17,11 +17,12 @@ >+ >+ #include <config.h> >+ >++#include <memory> >+ #include <stdlib.h> >+ #include <stdio.h> >+ #include <math.h> >+ >+-#include "pfstmo.h" >++#include <pfstmo.h> >+ >+ #ifdef HAVE_ZFFT >+ #include <fft.h> >+@@ -30,53 +31,44 @@ >+ #define APPROXIMATE >+ #endif >+ >+-//--- from defines.h >+-typedef struct { >+- int xmax, ymax; /* image dimensions */ >+-} CVTS; >+- >+-typedef double COLOR[3]; /* red, green, blue (or X,Y,Z) */ >+-//--- end of defines.h >+ >++static int scale; >++static float sigma_0, sigma_1; >++static pfstmo::Array2D *img = 0; >++pfstmo::Array2D *lum = 0; >++int width, height; >+ >+-static int width, height, scale; >+-static COLOR **image; >+-static double ***convolved_image; >+-static double sigma_0, sigma_1; >+-double **luminance; >+- >+-static double k = 1. / (2. * 1.4142136); >+-static double key = 0.18; >+-static double threshold = 0.05; >+-static double phi = 8.; >+-static double white = 1e20; >+-static int scale_low = 1; >+-static int scale_high = 43; // 1.6^8 = 43 >+-static int range = 8; >+-static int use_scales = 0; >+-static int use_border = 0; >+-static CVTS cvts = {0, 0}; >++static float k = 1.f / (2.f * 1.4142136f); >++static float key = 0.18f; >++static float threshold = 0.05f; >++static float phi = 8.f; >++static float white = 1e20f; >++static int scale_low = 1; >++static int scale_high = 43; // 1.6^8 = 43 >++static int range = 8; >++static int use_scales = 0; >++static float border = 0.f; >+ >+ static bool temporal_coherent; >+ >+ #ifdef APPROXIMATE >+ extern int PyramidHeight; // set by build_pyramid, defines actual pyramid size >+-extern double V1 (int x, int y, int level); >+-extern void build_pyramid (double **luminance, int image_width, int image_height); >+-extern void clean_pyramid (); >++extern float V1(int x, int y, int level); >++extern void build_pyramid(); >++extern void clean_pyramid(); >+ #else >+- >++static double ***convolved_image; >+ static zomplex **filter_fft; >+ static zomplex *image_fft, *coeff; >+ >+-#define V1(x,y,i) (convolved_image[i][x][y]) >++#define V1(x,y,i) ((float)convolved_image[i][x][y]) >+ >+ #endif >+ >+-#define SIGMA_I(i) (sigma_0 + ((double)i/(double)range)*(sigma_1 - sigma_0)) >+-#define S_I(i) (exp (SIGMA_I(i))) >+-#define V2(x,y,i) (V1(x,y,i+1)) >+-#define ACTIVITY(x,y,i) ((V1(x,y,i) - V2(x,y,i)) / (((key * pow (2., phi))/(S_I(i)*S_I(i))) + V1(x,y,i))) >++#define SIGMA_I(i) (sigma_0 + ((float)i/(float)range)*(sigma_1 - sigma_0)) >++#define S_I(i) (expf(SIGMA_I(i))) >++#define V2(x,y,i) (V1(x,y,i+1)) >++#define ACTIVITY(x,y,i) ((V1(x,y,i) - V2(x,y,i)) / (((key * powf(2.f, phi))/(S_I(i)*S_I(i))) + V1(x,y,i))) >+ >+ >+ >+@@ -119,32 +111,32 @@ public: >+ }; >+ >+ >+-static TemporalSmoothVariable<double> avg_luminance, max_luminance; >++static TemporalSmoothVariable<float> avg_luminance, max_luminance; >+ >+ >+ /* >+ * Kaiser-Bessel stuff >+ */ >+ >+-static double alpha = 2.; /* Kaiser-Bessel window parameter */ >+-static double bbeta; /* Will contain bessel (PI * alpha) */ >++static float alpha = 2.f; /* Kaiser-Bessel window parameter */ >++static float bbeta; /* Will contain bessel (PI * alpha) */ >+ >+ /* >+ * Modified zeroeth order bessel function of the first kind >+ */ >+ >+-double bessel (double x) >++static float bessel (float x) >+ { >+- const double f = 1e-9; >++ const float f = 1e-9f; >+ int n = 1; >+- double s = 1.; >+- double d = 1.; >++ float s = 1.f; >++ float d = 1.f; >+ >+- double t; >++ float t; >+ >+ while (d > f * s) >+ { >+- t = x / (2. * n); >++ t = x / (2.f * n); >+ n++; >+ d *= t * t; >+ s += d; >+@@ -156,7 +148,7 @@ double bessel (double x) >+ * Initialiser for Kaiser-Bessel computations >+ */ >+ >+-void compute_bessel () >++static void compute_bessel () >+ { >+ bbeta = bessel (M_PI * alpha); >+ } >+@@ -166,12 +158,12 @@ void compute_bessel () >+ * Window length M = min (width, height) / 2 >+ */ >+ >+-double kaiserbessel (double x, double y, double M) >++static float kaiserbessel (float x, float y, float M) >+ { >+- double d = 1. - ((x*x + y*y) / (M * M)); >+- if (d <= 0.) >+- return 0.; >+- return bessel (M_PI * alpha * sqrt (d)) / bbeta; >++ float d = 1.f - ((x*x + y*y) / (M * M)); >++ if (d <= 0.f) >++ return 0.f; >++ return bessel(M_PI * alpha * sqrtf(d)) / bbeta; >+ } >+ >+ >+@@ -180,57 +172,57 @@ double kaiserbessel (double x, double y, >+ */ >+ #ifdef HAVE_ZFFT >+ >+-void initialise_fft (int width, int height) >++static void initialise_fft (int width, int height) >+ { >+ coeff = zfft2di (width, height, NULL); >+ } >+ >+-void compute_fft (zomplex *array, int width, int height) >++static void compute_fft (zomplex *array, int width, int height) >+ { >+ zfft2d (-1, width, height, array, width, coeff); >+ } >+ >+-void compute_inverse_fft (zomplex *array, int width, int height) >++static void compute_inverse_fft (zomplex *array, int width, int height) >+ { >+ zfft2d (1, width, height, array, width, coeff); >+ } >+ >+ >+ // Compute Gaussian blurred images >+-void gaussian_filter (zomplex *filter, double scale, double k ) >++static void gaussian_filter (zomplex *filter, double scale, double k ) >+ { >+ int x, y; >+ double x1, y1, s; >+ double a = 1. / (k * scale); >+ double c = 1. / 4.; >+ >+- for (y = 0; y < cvts.ymax; y++) >++ for (y = 0; y < height; y++) >+ { >+- y1 = (y >= cvts.ymax / 2) ? y - cvts.ymax : y; >++ y1 = (y >= height / 2) ? y - height : y; >+ s = erf (a * (y1 - .5)) - erf (a * (y1 + .5)); >+- for (x = 0; x < cvts.xmax; x++) >++ for (x = 0; x < width; x++) >+ { >+- x1 = (x >= cvts.xmax / 2) ? x - cvts.xmax : x; >+- filter[y*cvts.xmax + x].re = s * (erf (a * (x1 - .5)) - erf (a * (x1 + .5))) * c; >+- filter[y*cvts.xmax + x].im = 0.; >++ x1 = (x >= width / 2) ? x - width : x; >++ filter[y*width + x].re = s * (erf (a * (x1 - .5)) - erf (a * (x1 + .5))) * c; >++ filter[y*width + x].im = 0.; >+ } >+ } >+ } >+ >+-void build_gaussian_fft () >++static void build_gaussian_fft () >+ { >+- int i; >+- double length = cvts.xmax * cvts.ymax; >+- double fft_scale = 1. / sqrt (length); >+- filter_fft = (zomplex**) calloc (range, sizeof (zomplex*)); >++ int i; >++ int length = width * height; >++ double fft_scale = 1. / sqrt((double)length); >++ filter_fft = new zomplex*[range]; >+ >+ for (scale = 0; scale < range; scale++) >+ { >+ fprintf (stderr, "Computing FFT of Gaussian at scale %i (size %i x %i)%c", >+- scale, cvts.xmax, cvts.ymax, (char)13); >+- filter_fft[scale] = (zomplex*) calloc (length, sizeof (zomplex)); >++ scale, width, height, (char)13); >++ filter_fft[scale] = new zomplex[length]; >+ gaussian_filter (filter_fft[scale], S_I(scale), k); >+- compute_fft (filter_fft[scale], cvts.xmax, cvts.ymax); >++ compute_fft (filter_fft[scale], width, height); >+ for (i = 0; i < length; i++) >+ { >+ filter_fft[scale][i].re *= fft_scale; >+@@ -240,20 +232,20 @@ void build_gaussian_fft () >+ fprintf (stderr, "\n"); >+ } >+ >+-void build_image_fft () >++static void build_image_fft () >+ { >+- int i, x, y; >+- double length = cvts.xmax * cvts.ymax; >+- double fft_scale = 1. / sqrt (length); >++ int i, x, y; >++ int length = width * height; >++ double fft_scale = 1. / sqrt((double)length); >+ >+ fprintf (stderr, "Computing image FFT\n"); >+- image_fft = (zomplex*) calloc (length, sizeof (zomplex)); >++ image_fft = new zomplex[length]; >+ >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >+- image_fft[y*cvts.xmax + x].re = luminance[y][x]; >++ for (y = 0; y < height; y++) >++ for (x = 0; x < width; x++) >++ image_fft[y*width + x].re = (*lum)(x,y); >+ >+- compute_fft (image_fft, cvts.xmax, cvts.ymax); >++ compute_fft (image_fft, width, height); >+ for (i = 0; i < length; i++) >+ { >+ image_fft[i].re *= fft_scale; >+@@ -261,47 +253,61 @@ void build_image_fft () >+ } >+ } >+ >+-void convolve_filter (int scale, zomplex *convolution_fft) >++static void convolve_filter (int scale, zomplex *convolution_fft) >+ { >+ int i, x, y; >+ >+- for (i = 0; i < cvts.xmax * cvts.ymax; i++) >++ for (i = 0; i < width * height; i++) >+ { >+ convolution_fft[i].re = image_fft[i].re * filter_fft[scale][i].re - >+ image_fft[i].im * filter_fft[scale][i].im; >+ convolution_fft[i].im = image_fft[i].re * filter_fft[scale][i].im + >+ image_fft[i].im * filter_fft[scale][i].re; >+ } >+- compute_inverse_fft (convolution_fft, cvts.xmax, cvts.ymax); >++ compute_inverse_fft (convolution_fft, width, height); >+ i = 0; >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >++ for (y = 0; y < height; y++) >++ for (x = 0; x < width; x++) >+ convolved_image[scale][x][y] = convolution_fft[i++].re; >+ } >+ >+-void compute_fourier_convolution () >++static void compute_fourier_convolution () >+ { >+ int x; >+ zomplex *convolution_fft; >+ >+- initialise_fft (cvts.xmax, cvts.ymax); >++ initialise_fft (width, height); >+ build_image_fft (); >+ build_gaussian_fft (); >+- convolved_image = (double ***) malloc (range * sizeof (double **)); >++ convolved_image = new double**[range]; >+ >+- convolution_fft = (zomplex *) calloc (cvts.xmax * cvts.ymax, sizeof (zomplex)); >++ convolution_fft = new zomplex[width * height]; >+ for (scale = 0; scale < range; scale++) >+ { >+ fprintf (stderr, "Computing convolved image at scale %i%c", scale, (char)13); >+- convolved_image[scale] = (double **) malloc (cvts.xmax * sizeof (double *)); >+- for (x = 0; x < cvts.xmax; x++) >+- convolved_image[scale][x] = (double *) malloc (cvts.ymax * sizeof (double)); >++ convolved_image[scale] = new double*[width]; >++ for (x = 0; x < width; x++) >++ convolved_image[scale][x] = new double[height]; >+ convolve_filter (scale, convolution_fft); >+- free (filter_fft[scale]); >++ delete[] filter_fft[scale]; >+ } >++ delete[] filter_fft; >+ fprintf (stderr, "\n"); >+- free (convolution_fft); >+- free (image_fft); >++ delete[] convolution_fft; >++ delete[] image_fft; >++} >++ >++static void clean_convolved_image() >++{ >++ for (scale = 0; scale < range; scale++) >++ { >++ for (x = 0; x < width; x++) >++ { >++ delete[] convolved_image[scale][x]; >++ } >++ delete[] convolved_image[scale]; >++ } >++ delete[] convolved_image; >+ } >+ >+ #endif // #ifdef HAVE_ZFFT >+@@ -312,188 +318,141 @@ void compute_fourier_convolution () >+ * Tonemapping routines >+ */ >+ >+-double get_maxvalue () >+-{ >+- double max = 0.; >+- int x, y; >+- >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >+- max = (max < image[y][x][0]) ? image[y][x][0] : max; >+- return max; >+-} >+- >+-void tonemap_image () >++static void tonemap() >+ { >+- double Lmax2; >+- int x, y; >+- int scale, prefscale; >+- >+- if (white < 1e20) >+- Lmax2 = white * white; >+- else >++ for (int y = 0; y<height; y++) >+ { >+- if( temporal_coherent ) { >+- max_luminance.set( get_maxvalue() ); >+- Lmax2 = max_luminance.get(); >+- } else Lmax2 = get_maxvalue(); >+- Lmax2 *= Lmax2; >+- } >+- >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >++ for (int x = 0; x<width; x++) >+ { >+- if (use_scales) >++ int prefscale = range-1; >++ for (int scale = 0; scale<range-1; scale++) >+ { >+- prefscale = range - 1; >+- for (scale = 0; scale < range - 1; scale++) >+- if ( scale >= PyramidHeight || fabs (ACTIVITY(x,y,scale)) > threshold) >++ if (scale>=PyramidHeight || fabsf(ACTIVITY(x,y,scale))>threshold) >+ { >+ prefscale = scale; >+ break; >+ } >+- image[y][x][0] /= 1. + V1(x,y,prefscale); >+ } >+- else >+- image[y][x][0] = image[y][x][0] * (1. + (image[y][x][0] / Lmax2)) / (1. + image[y][x][0]); >+- // image[y][x][0] /= (1. + image[y][x][0]); >++ (*img)(x,y) = (*lum)(x,y)/(1.f+V1(x,y,prefscale)); >+ } >++ } >+ } >+ >+-/* >+- * Miscellaneous functions >+- */ >+- >+-void clamp_image () >++static float get_maxvalue() >+ { >+- int x, y; >++ float max = 0.f; >++ int x, y; >++ for (int i = width*height; i--; ) >++ { >++ float l = (*img)(i); >++ if (max<l) max = l; >++ } >++ return max; >++} >+ >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >++static void tonecompress() >++{ >++ float Lmax2; >++ if (white<1e20f) >++ { >++ Lmax2 = white; >++ } >++ else >++ { >++ if (temporal_coherent) >+ { >+- image[y][x][0] = (image[y][x][0] > 1.) ? 1. : image[y][x][0]; >+- image[y][x][1] = (image[y][x][1] > 1.) ? 1. : image[y][x][1]; >+- image[y][x][2] = (image[y][x][2] > 1.) ? 1. : image[y][x][2]; >++ max_luminance.set(get_maxvalue()); >++ Lmax2 = max_luminance.get(); >+ } >++ else >++ { >++ Lmax2 = get_maxvalue(); >++ } >++ } >++ Lmax2 *= Lmax2; >++ for (int i = width*height; i--; ) >++ { >++ (*img)(i) = (*lum)(i)*(1.f+(*lum)(i)/Lmax2)/(1.f+(*lum)(i)); >++ } >+ } >+ >+-double log_average () >++/* >++ * Miscellaneous functions >++ */ >++ >++static float log_average() >+ { >+- int x, y; >+ double sum = 0.; >+- >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >+- sum += log (0.00001 + luminance[y][x]); >+- return exp (sum / (double)(cvts.xmax * cvts.ymax)); >++ int s = width*height; >++ for (int i = s; i--; ) >++ { >++ sum += log(0.00001+(*lum)(i)); >++ } >++ return expf((float)sum/(float)s); >+ } >+ >+-void scale_to_midtone () >++static void scale_to_midtone() >+ { >+- int x, y, u, v, d; >+- double factor; >+- double scale_factor; >+- double low_tone = key / 3.; >+- int border_size = (cvts.xmax < cvts.ymax) ? int(cvts.xmax / 5.) : int(cvts.ymax / 5.); >+- int hw = cvts.xmax >> 1; >+- int hh = cvts.ymax >> 1; >++ float avg, scale_factor; >++ int border_size = (int)(((width<height) ? width : height)*border); >+ >+- double avg; >+- if( temporal_coherent ) { >+- avg_luminance.set( log_average() ); >++ avg = log_average(); >++ if (temporal_coherent) >++ { >++ avg_luminance.set(avg); >+ avg = avg_luminance.get(); >+- } else avg = log_average(); >++ } >+ >+- scale_factor = 1.0 / avg; >+- for (y = 0; y < cvts.ymax; y++) >+- for (x = 0; x < cvts.xmax; x++) >++ scale_factor = key / avg; >++ for (int i = width*height; i--; ) >++ { >++ (*lum)(i) *= scale_factor; >++ } >++ if (border_size) >++ { >++ int hw = width >> 1; >++ int hh = height >> 1; >++ for (int y = 0; y < height; y++) >+ { >+- if (use_border) >++ int v = (y > hh) ? height - y : y; >++ for (int x = 0; x < width; x++) >+ { >+- u = (x > hw) ? cvts.xmax - x : x; >+- v = (y > hh) ? cvts.ymax - y : y; >+- d = (u < v) ? u : v; >+- factor = (d < border_size) ? (key - low_tone) * >+- kaiserbessel (border_size - d, 0, border_size) + >+- low_tone : key; >++ int u = (x > hw) ? width - x : x; >++ int d = (u < v) ? u : v; >++ if (d < border_size) >++ (*lum)(x,y) *= >++ (2.f * kaiserbessel(border_size - d, 0, border_size) + 1.f) / 3.f; >+ } >+- else >+- factor = key; >+- image[y][x][0] *= scale_factor * factor; >+- luminance[y][x] *= scale_factor * factor; >+ } >+-} >+- >+-void copy_luminance () >+-{ >+- int x, y; >+- >+- for (x = 0; x < cvts.xmax; x++) >+- for (y = 0; y < cvts.ymax; y++) >+- luminance[y][x] = image[y][x][0]; >+-} >+- >+-/* >+- * Memory allocation >+- */ >+-void allocate_memory () >+-{ >+- int y; >+- >+- luminance = (double **) malloc (cvts.ymax * sizeof (double *)); >+- image = (COLOR **) malloc (cvts.ymax * sizeof (COLOR *)); >+- for (y = 0; y < cvts.ymax; y++) >+- { >+- luminance[y] = (double *) malloc (cvts.xmax * sizeof (double)); >+- image[y] = (COLOR *) malloc (cvts.xmax * sizeof (COLOR)); >+ } >+ } >+ >+-void deallocate_memory () >++static void dynamic_range() >+ { >+- int y; >+- >+- for (y = 0; y < cvts.ymax; y++) >++ float min = 1e20f; >++ float max = -1e20f; >++ for (int i = width*height; i--; ) >+ { >+- free(luminance[y]); >+- free(image[y]); >++ float l = (*lum)(i); >++ if (min>l && l>0.f) min = l; >++ if (max<l) max = l; >+ } >+- free( luminance ); >+- free( image ); >+-} >+- >+- >+-void dynamic_range () >+-{ >+- int x, y; >+- double minval = 1e20; >+- double maxval = -1e20; >+- >+- for (x = 0; x < cvts.xmax; x++) >+- for (y = 0; y < cvts.ymax; y++) >+- { >+- if ((luminance[y][x] < minval) && >+- (luminance[y][x] > 0.0)) >+- minval = luminance[y][x]; >+- if (luminance[y][x] > maxval) >+- maxval = luminance[y][x]; >+- } >+- fprintf (stderr, "\tRange of values = %9.8f - %9.8f\n", minval, maxval); >+- fprintf (stderr, "\tDynamic range = %i:1\n", (int)(maxval/minval)); >++ fprintf(stderr, "\tRange of values = %9.8f - %9.8f\n", min, max); >++ fprintf(stderr, "\tDynamic range = %i:1\n", (int)(max/min)); >+ } >+ >+-void print_parameter_settings () >++static void print_parameter_settings() >+ { >+- fprintf (stderr, "\tImage size = %i %i\n", cvts.xmax, cvts.ymax); >+- fprintf (stderr, "\tLowest scale = %i pixels\t\t(-low <integer>)\n", scale_low); >+- fprintf (stderr, "\tHighest scale = %i pixels\t\t(-high <integer>)\n", scale_high); >+- fprintf (stderr, "\tNumber of scales = %i\t\t\t(-num <integer>)\n", range); >+- fprintf (stderr, "\tScale spacing = %f\n", S_I(1) / S_I(0)); >+- fprintf (stderr, "\tKey value = %f\t\t(-key <float>)\n", key); >+- fprintf (stderr, "\tWhite value = %f\t\t(-white <float>)\n", white); >+- fprintf (stderr, "\tPhi = %f\t\t(-phi <float>)\n", phi); >+- fprintf (stderr, "\tThreshold = %f\t\t(-threshold <float>)\n", threshold); >+- dynamic_range (); >++ fprintf(stderr, "\tImage size = %i %i\n", width, height); >++ fprintf(stderr, "\tLowest scale = %i pixels\t\t(-low <integer>)\n", scale_low); >++ fprintf(stderr, "\tHighest scale = %i pixels\t\t(-high <integer>)\n", scale_high); >++ fprintf(stderr, "\tNumber of scales = %i\t\t\t(-num <integer>)\n", range); >++ fprintf(stderr, "\tScale spacing = %f\n", S_I(1) / S_I(0)); >++ fprintf(stderr, "\tKey value = %f\t\t(-key <float>)\n", key); >++ fprintf(stderr, "\tWhite value = %f\t\t(-white <float>)\n", white); >++ fprintf(stderr, "\tPhi = %f\t\t(-phi <float>)\n", phi); >++ fprintf(stderr, "\tThreshold = %f\t\t(-threshold <float>)\n", threshold); >++ dynamic_range(); >+ } >+ >+ /* >+@@ -507,16 +466,15 @@ void print_parameter_settings () >+ * @param num number of scales to use in computation (default: 8) >+ * @param low size in pixels of smallest scale (should be kept at 1) >+ * @param high size in pixels of largest scale (default 1.6^8 = 43) >++ * @param temporal_coherent tone mapping is time coherent for video sequences >++ * @param border relative width of image area scaled to midtone separately (default: 0 - use key for whole image) >+ */ >+ void tmo_reinhard02( >+- unsigned int width, unsigned int height, >+- const float *nY, float *nL, >++ const pfstmo::Array2D *Y, pfstmo::Array2D *L, >+ bool use_scales, float key, float phi, >+- int num, int low, int high, bool temporal_coherent ) >++ int num, int low, int high, bool temporal_coherent, float border) >+ { >+- const pfstmo::Array2D* Y = new pfstmo::Array2D(width, height, const_cast<float*>(nY)); >+- pfstmo::Array2D* L = new pfstmo::Array2D(width, height, nL); >+- >++ std::auto_ptr<pfstmo::Array2D> l(0); >+ int x,y; >+ >+ ::key = key; >+@@ -526,45 +484,45 @@ void tmo_reinhard02( >+ ::scale_high = high; >+ ::use_scales = (use_scales) ? 1 : 0; >+ ::temporal_coherent = temporal_coherent; >++ ::border = border; >+ >+- cvts.xmax = Y->getCols(); >+- cvts.ymax = Y->getRows(); >++ width = Y->getCols(); >++ height = Y->getRows(); >+ >+- sigma_0 = log (scale_low); >+- sigma_1 = log (scale_high); >++ sigma_0 = logf(scale_low); >++ sigma_1 = logf(scale_high); >+ >+ compute_bessel(); >+- allocate_memory (); >+ >+- // reading image >+- for( y=0 ; y<cvts.ymax ; y++ ) >+- for( x=0 ; x<cvts.xmax ; x++ ) >+- image[y][x][0] = (*Y)(x,y); >++ img = lum = L; >++ if (use_scales) >++ { >++ l.reset(new pfstmo::Array2D(width,height)); >++ lum = l.get(); >++ } >++ copyArray(Y,lum); >+ >+- copy_luminance(); >+ scale_to_midtone(); >+ >+- if( use_scales ) >++ if (use_scales) >+ { >+ #ifdef APPROXIMATE >+- build_pyramid(luminance, cvts.xmax, cvts.ymax); >++ build_pyramid(); >+ #else >+ compute_fourier_convolution(); >+ #endif >++ tonemap(); >++ } >++ else >++ { >++ tonecompress(); >+ } >+- >+- tonemap_image(); >+- >+- // saving image >+- for( y=0 ; y<cvts.ymax ; y++ ) >+- for( x=0 ; x<cvts.xmax ; x++ ) >+- (*L)(x,y) = image[y][x][0]; >+ >+ // print_parameter_settings(); >+ >+- deallocate_memory(); >++#ifdef APPROXIMATE >+ clean_pyramid(); >+- >+- delete L; >+- delete Y; >++#else >++ clean_convolved_image(); >++#endif >+ } > >Property changes on: graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.h >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.h (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.h (working copy) >@@ -0,0 +1,27 @@ >+--- src/tmo/reinhard02/tmo_reinhard02.h.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/reinhard02/tmo_reinhard02.h >+@@ -13,8 +13,6 @@ >+ /* >+ * @brief Photographic tone-reproduction >+ * >+- * @param width image width >+- * @param height image height >+ * @param Y input luminance >+ * @param L output tonemapped intensities >+ * @param use_scales true: local version, false: global version of TMO >+@@ -23,10 +21,12 @@ >+ * @param num number of scales to use in computation (default: 8) >+ * @param low size in pixels of smallest scale (should be kept at 1) >+ * @param high size in pixels of largest scale (default 1.6^8 = 43) >++ * @param temporal_coherent tone mapping is time coherent for video sequences >++ * @param border relative width of image area scaled to midtone separately (default: 0 - use key for whole image) >+ */ >+-void tmo_reinhard02(unsigned int width, unsigned int height, >+- const float *Y, float *L, >++void tmo_reinhard02( >++ const pfstmo::Array2D *Y, pfstmo::Array2D *L, >+ bool use_scales, float key, float phi, >+- int num, int low, int high, bool temporal_coherent ); >++ int num, int low, int high, bool temporal_coherent, float border = 0.f); >+ >+ #endif /* _tmo_reinhard02_h_ */ > >Property changes on: graphics/pfstools/files/patch-src_tmo_reinhard02_tmo__reinhard02.h >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/patch-src_tmo_reinhard05_pfstmo__reinhard05.cpp >=================================================================== >--- graphics/pfstools/files/patch-src_tmo_reinhard05_pfstmo__reinhard05.cpp (nonexistent) >+++ graphics/pfstools/files/patch-src_tmo_reinhard05_pfstmo__reinhard05.cpp (working copy) >@@ -0,0 +1,17 @@ >+--- src/tmo/reinhard05/pfstmo_reinhard05.cpp.orig 2018-01-19 06:59:44 UTC >++++ src/tmo/reinhard05/pfstmo_reinhard05.cpp >+@@ -157,6 +157,14 @@ int main( int argc, char* argv[] ) >+ try { >+ pfstmo_reinhard05( argc, argv ); >+ } >++ catch (std::bad_alloc ex) { >++ fprintf(stderr, PROG_NAME " error: out of memory\n"); >++ return EXIT_FAILURE; >++ } >++ catch (std::exception ex) { >++ fprintf(stderr, PROG_NAME " error: %s\n", ex.what()); >++ return EXIT_FAILURE; >++ } >+ catch( pfs::Exception ex ) { >+ fprintf( stderr, PROG_NAME " error: %s\n", ex.getMessage() ); >+ return EXIT_FAILURE; > >Property changes on: graphics/pfstools/files/patch-src_tmo_reinhard05_pfstmo__reinhard05.cpp >___________________________________________________________________ >Added: fbsd:nokeywords >## -0,0 +1 ## >+yes >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/camera/robertson02old.cpp >=================================================================== >--- graphics/pfstools/files/port/src/camera/robertson02old.cpp (nonexistent) >+++ graphics/pfstools/files/port/src/camera/robertson02old.cpp (working copy) >@@ -0,0 +1,340 @@ >+/** >+ * @brief Robertson02 algorithm for automatic self-calibration. >+ * >+ * >+ * This file is a part of PFS CALIBRATION package. >+ * ---------------------------------------------------------------------- >+ * Copyright (C) 2004 Grzegorz Krawczyk >+ * >+ * 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. >+ * >+ * 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 >+ * ---------------------------------------------------------------------- >+ * >+ * @author Grzegorz Krawczyk, <gkrawczyk@users.sourceforge.net> >+ * >+ * $Id: robertson02.cpp,v 1.7 2006/11/16 15:06:17 gkrawczyk Exp $ >+ */ >+ >+ >+#include <config.h> >+ >+#include <iostream> >+#include <vector> >+#include <cstdlib> >+ >+#include <math.h> >+ >+#include <responses.h> >+#include <robertson02old.h> >+ >+#define PROG_NAME "robertson02" >+ >+// maximum iterations after algorithm accepts local minima >+#define MAXIT 500 >+ >+// maximum accepted error >+#define MAX_DELTA 1e-5f >+ >+extern bool verbose; /* verbose should be declared for each standalone code */ >+ >+static float normalizeI(float *I, int M); >+ >+ >+int robertson02old_applyResponse(pfs::Array2D *xj, ExposureList const &imgs, float const *I, int Mr, float const *w, int Mw) >+{ >+ float const rfactor(Mr); >+ float const wfactor(Mw); >+ float const rwfactor(rfactor/wfactor); >+ // number of exposures >+ int N = imgs.size(); >+ >+ // frame size >+ int width = xj->getCols(); >+ int height = xj->getRows(); >+ >+ // number of saturated pixels >+ int saturated_pixels = 0; >+ >+ // --- anti saturation: calculate trusted camera output range >+ int minM = 0; >+ for( int wm=0 ; wm<Mw ; ++wm ) >+ if( w[wm]>0 ) >+ { >+ minM = wm; >+ break; >+ } >+ int maxM = Mw-1; >+ for( int wm=Mw-1 ; wm>=0 ; --wm ) >+ if( w[wm]>0 ) >+ { >+ maxM = wm; >+ break; >+ } >+ >+ // --- anti ghosting: for each image i, find images with >+ // the immediately higher and lower exposure times >+ int* i_lower = new int[N]; >+ int* i_upper = new int[N]; >+ for( int i=0 ; i<N ; i++ ) >+ { >+ i_lower[i]=-1; >+ i_upper[i]=-1; >+ float ti = imgs[i].ti; >+ float ti_upper = imgs[0].ti; >+ float ti_lower = imgs[0].ti; >+ >+ for( int j=0 ; j<N ; j++ ) >+ if( i!=j ) >+ { >+ if( imgs[j].ti>ti && imgs[j].ti<ti_upper ) >+ { >+ ti_upper=imgs[j].ti; >+ i_upper[i]=j; >+ } >+ if( imgs[j].ti<ti && imgs[j].ti>ti_lower ) >+ { >+ ti_lower=imgs[j].ti; >+ i_lower[i]=j; >+ } >+ } >+ if( i_lower[i]==-1 ) >+ i_lower[i]=i; >+ if( i_upper[i]==-1 ) >+ i_upper[i]=i; >+ } >+ >+ >+ // all pixels >+ for( int j=0 ; j<width*height ; j++ ) >+ { >+ // all exposures for each pixel >+ float sum = 0.0f; >+ float div = 0.0f; >+ >+ float maxti = -1e6f; >+ float minti = +1e6f; >+ >+ for( int i=0 ; i<N ; i++ ) >+ { >+ float v = (*imgs[i].yi)(j); >+ int rm = (int) ((v - std::numeric_limits<float>::epsilon()) * rfactor); >+ int wm = (int) ((v - std::numeric_limits<float>::epsilon()) * wfactor); >+ float ti = imgs[i].ti; >+ >+ // --- anti saturation: observe minimum exposure time at which >+ // saturated value is present, and maximum exp time at which >+ // black value is present >+ if( wm>maxM ) >+ minti = fminf(minti,ti); >+ if( wm<minM ) >+ maxti = fmaxf(maxti,ti); >+ >+ // --- anti ghosting: monotonous increase in time should result >+ // in monotonous increase in intensity; make forward and >+ // backward check, ignore value if condition not satisfied >+ //int m_lower = (int) (*imgs[i_lower[i]].yi)(j); >+ //int m_upper = (int) (*imgs[i_upper[i]].yi)(j); >+ //if( m_lower>m || m_upper<m) >+ if ((*imgs[i_lower[i]].yi)(j) > v || (*imgs[i_upper[i]].yi)(j) < v) >+ continue; >+ >+ sum += w[wm] * ti * I[rm]; >+ div += w[wm] * ti * ti; >+ } >+ >+ // --- anti saturation: if a meaningful representation of pixel >+ // was not found, replace it with information from observed data >+ if( div==0.0f ) >+ saturated_pixels++; >+ if( div==0.0f && maxti>-1e6f ) >+ { >+ int rm = (int) (minM * rwfactor); >+ sum = I[rm]; >+ div = maxti; >+ } >+ if( div==0.0f && minti<+1e6f ) >+ { >+ int rm = (int) (maxM * rwfactor); >+ sum = I[rm]; >+ div = minti; >+ } >+ >+ if( div!=0.0f ) >+ (*xj)(j) = sum/div; >+ else >+ (*xj)(j) = 0.0f; >+ } >+ >+ delete[] i_lower; >+ delete[] i_upper; >+ >+ return saturated_pixels; >+} >+ >+ >+int robertson02old_getResponse(pfs::Array2D *xj, ExposureList const &imgs, float *I, int Mr, float const *w, int Mw) >+{ >+ float const rfactor(Mr); >+ //float const wfactor(Mw); >+ // number of exposures >+ int N = imgs.size(); >+ >+ // frame size >+ int width = imgs[0].yi->getCols(); >+ int height = imgs[0].yi->getRows(); >+ >+ // number of saturated pixels >+ int saturated_pixels = 0; >+ >+ // indexes >+ int i,j; >+ >+ float* Ip = new float[Mr]; // previous response >+ if( Ip==NULL ) >+ { >+ std::cerr << "robertson02: could not allocate memory for camera response" << std::endl; >+ exit(1); >+ } >+ >+ // 0. Initialization >+ normalizeI( I, Mr ); >+ for( int rm=0 ; rm<Mr ; ++rm ) >+ Ip[rm] = I[rm]; >+ >+ robertson02old_applyResponse( xj, imgs, I, Mr, w, Mw ); >+ >+ // Optimization process >+ bool converged=false; >+ long* cardEm = new long[Mr]; >+ float* sum = new float[Mr]; >+ if( sum==NULL || cardEm==NULL ) >+ { >+ std::cerr << "robertson02: could not allocate memory for optimization process" << std::endl; >+ exit(1); >+ } >+ >+ int cur_it = 0; >+ float pdelta= 0.0f; >+ while( !converged ) >+ { >+ // 1. Minimize with respect to I >+ for( int rm=0 ; rm<Mr ; ++rm ) >+ { >+ cardEm[rm]=0; >+ sum[rm]=0.0f; >+ } >+ >+ for( i=0 ; i<N ; i++ ) >+ { >+ pfs::Array2D* yi = imgs[i].yi; >+ float ti = imgs[i].ti; >+ for( j=0 ; j<width*height ; j++ ) >+ { >+ float v = (*yi)(j); >+ int rm = (int) ((v - std::numeric_limits<float>::epsilon()) * rfactor); >+ //int wm = (int) ((v - std::numeric_limits<float>::epsilon()) * wfactor); >+ if( rm<Mr && rm>=0 ) >+ { >+ sum[rm] += ti * (*xj)(j); >+ cardEm[rm]++; >+ } >+ else >+ std::cerr << "robertson02: m out of range: " << rm << std::endl; >+ } >+ } >+ >+ for( int rm=0 ; rm<Mr ; ++rm ) >+ if( cardEm[rm]!=0 ) >+ I[rm] = sum[rm] / cardEm[rm]; >+ else >+ I[rm] = 0.0f; >+ >+ // 2. Normalize I >+ float middle_response = normalizeI( I, Mr ); >+ >+ // 3. Apply new response >+ saturated_pixels = robertson02old_applyResponse( xj, imgs, I, Mr, w, Mw ); >+ >+ // 4. Check stopping condition >+ float delta = 0.0f; >+ int hits=0; >+ for( int rm=0 ; rm<Mr ; ++rm ) >+ if( I[rm]!=0.0f ) >+ { >+ float diff = I[rm]-Ip[rm];; >+ delta += diff * diff; >+ Ip[rm] = I[rm]; >+ hits++; >+ } >+ delta /= hits; >+ >+ VERBOSE_STR << " #" << cur_it >+ << " delta=" << delta >+ << " (coverage: " << 100*hits/Mr << "%)\n"; >+ >+ if( delta < MAX_DELTA ) >+ converged=true; >+ else if( isnan(delta) || (cur_it>MAXIT && pdelta<delta) ) >+ { >+ VERBOSE_STR << "algorithm failed to converge, too noisy data in range\n"; >+ break; >+ } >+ >+ pdelta = delta; >+ cur_it++; >+ } >+ >+ if( converged ) >+ VERBOSE_STR << " #" << cur_it >+ << " delta=" << pdelta << " <- converged\n"; >+ >+ delete[] Ip; >+ delete[] cardEm; >+ delete[] sum; >+ >+ return saturated_pixels; >+} >+ >+ >+//---------------------------------------------------------- >+// private part >+ >+static float normalizeI(float *I, int M) >+{ >+ int Mmin, Mmax; >+ // find min max >+ for( Mmin=0 ; Mmin<M && I[Mmin]==0 ; Mmin++ ); >+ for( Mmax=M-1 ; Mmax>0 && I[Mmax]==0 ; Mmax-- ); >+ >+ int Mmid = Mmin+(Mmax-Mmin)/2; >+ float mid = I[Mmid]; >+ >+// std::cerr << "robertson02: middle response, mid=" << mid >+// << " [" << Mmid << "]" >+// << " " << Mmin << ".." << Mmax << std::endl; >+ >+ if( mid==0.0f ) >+ { >+ // find first non-zero middle response >+ while( Mmid<Mmax && I[Mmid]==0.0f ) >+ Mmid++; >+ mid = I[Mmid]; >+ } >+ >+ if( mid!=0.0f ) >+ for( int m=0 ; m<M ; m++ ) >+ I[m] /= mid; >+ return mid; >+} >+ > >Property changes on: graphics/pfstools/files/port/src/camera/robertson02old.cpp >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/camera/robertson02old.h >=================================================================== >--- graphics/pfstools/files/port/src/camera/robertson02old.h (nonexistent) >+++ graphics/pfstools/files/port/src/camera/robertson02old.h (working copy) >@@ -0,0 +1,61 @@ >+/** >+ * @brief Robertson02 algorithm for automatic self-calibration. >+ * >+ * >+ * This file is a part of PFS CALIBRATION package. >+ * ---------------------------------------------------------------------- >+ * Copyright (C) 2004 Grzegorz Krawczyk >+ * >+ * 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. >+ * >+ * 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 >+ * ---------------------------------------------------------------------- >+ * >+ * @author Grzegorz Krawczyk, <gkrawczyk@users.sourceforge.net> >+ * >+ * $Id: robertson02.h,v 1.3 2006/09/13 11:52:56 gkrawczyk Exp $ >+ */ >+ >+#ifndef _robertson02old_h_ >+#define _robertson02old_h_ >+ >+#include <responses.h> >+ >+/** >+ * @brief Calculate camera response using Robertson02 algorithm >+ * >+ * @param xj [out] estimated luminance values >+ * @param imgs reference to vector containing source exposures >+ * @param I [out] array to put response function >+ * @param w weights >+ * @param M max camera output (no of discrete steps) >+ * @return number of saturated pixels in the HDR image (0: all OK) >+ */ >+int robertson02old_getResponse(pfs::Array2D *xj, ExposureList const &imgs, float *I, int Mr, float const *w, int Mw); >+ >+ >+/** >+ * @brief Create HDR image by applying response curve to given images >+ * taken with different exposures >+ * >+ * @param xj [out] HDR image >+ * @param imgs reference to vector containing source exposures >+ * @param I camera response function (array size of M) >+ * @param w weighting function for camera output values (array size of M) >+ * @param M number of camera output levels >+ * @return number of saturated pixels in the HDR image (0: all OK) >+ */ >+int robertson02old_applyResponse(pfs::Array2D *xj, ExposureList const &imgs, float const *I, int Mr, float const *w, int Mw); >+ >+ >+#endif /* #ifndef _robertson02old_h_ */ > >Property changes on: graphics/pfstools/files/port/src/camera/robertson02old.h >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/filter/pfswb.1 >=================================================================== >--- graphics/pfstools/files/port/src/filter/pfswb.1 (nonexistent) >+++ graphics/pfstools/files/port/src/filter/pfswb.1 (working copy) >@@ -0,0 +1,110 @@ >+.TH "pfswb" 1 >+.SH NAME >+pfswb \- Change white balance. >+.SH SYNOPSIS >+.B pfswb >+[--red <val>] [--green <val>] [--blue <val>] >+[--auto] [--x <val>] [--y <val>] [--width <val>] [--height <val>] >+[--keep-lum] >+[--verbose] [--help] >+.SH DESCRIPTION >+Use this command to change white balance in the RGB color space. >+ >+The command converts image(s) from XYZ colorspace to RGB, apply red, >+green and blue multipliers and convet the result back to XYZ. >+ >+Multipliers are calculated as: <base value> * <auto value>. >+The base values for each channel can be set by --red, --green and --blue >+options, default is 1. The auto values will be calculated on the rectangle >+defined by --x, --y, --width and --height options when --auto option was >+given, othervice auto values sets to 1. >+.SH OPTIONS >+.TP >+--red <val>, -r <val> >+ >+Base red multiplier. Default value: 1.0 >+ >+.TP >+--green <val>, -g <val> >+ >+Base green multiplier. Default value: 1.0 >+ >+.TP >+--blue <val>, -b <val> >+ >+Base blue multiplier. Default value: 1.0 >+ >+.TP >+--auto, -a >+ >+Auto WB. Calculate auto multipliers using rectangle given by --x, --y, >+--width and --height options. Default values of auto multipliers are 1.0 >+ >+.TP >+--x <val>, -X <val> >+ >+Horizontal offset of the auto WB rectangle. Default value: 0 >+ >+.TP >+--y <val>, -Y <val> >+ >+Vertical offset of the auto WB rectangle. Default value: 0 >+ >+.TP >+--width <val>, -W <val> >+ >+Width of the auto WB rectangle. >+Default value: <frame width> - <horizontal offset> >+ >+.TP >+--height <val>, -H <val> >+ >+Height of the auto WB rectangle. >+Default value: <frame height> - <vertical offset> >+ >+.TP >+--keep-lum, -k >+ >+Keep luminance range of the original frame. >+ >+.TP >+--verbose, -v >+ >+Print additional info to stderr. >+ >+.TP >+--help, -h >+ >+Print short help an exit. >+ >+.SH EXAMPLES >+.TP >+pfsin memorial.hdr | pfswb -r 1.005 -g 0.999 -b 1.003 | pfsout memorial_cl.hdr >+ >+Adjust WB using 1.005,0.999,1.003 base multipliers. Effective multipliers >+will be the same as the base ones. Luminance range of the original frame >+will not be kept. >+ >+.TP >+pfsin memorial.hdr | pfswb -v -a | pfsout memorial_cl.hdr >+ >+Auto adjust WB using frame rectangle to calculate multipliers. Base >+multipliers are 1,1,1. Effective multipliers will be the same as auto >+ones. Auto-calculated (and effective) multipliers will be printed >+to stderr. Luminance range of the original frame will not be kept. >+ >+.TP >+pfsin memorial.hdr \ >+| pfswb -v -a -r 1.005 -g 0.999 -b 1.003 -k \ >+| pfsout memorial_cl.hdr >+ >+Auto adjust WB using frame rectangle to calculate multipliers. Base >+multipliers are 1.005,0.999,1.003. Effective multipliers will be >+calculated as multiplication of base and auto ones. Multipliers will >+be printed to stderr. Luminance range of the original frame will be >+kept. >+.SH "SEE ALSO" >+.BR pfsin (1) >+.BR pfsout (1) >+.SH BUGS >+Please report bugs and comments to Iouri Ivliev <fbsd@any.com.ru> > >Property changes on: graphics/pfstools/files/port/src/filter/pfswb.1 >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/filter/pfswb.cpp >=================================================================== >--- graphics/pfstools/files/port/src/filter/pfswb.cpp (nonexistent) >+++ graphics/pfstools/files/port/src/filter/pfswb.cpp (working copy) >@@ -0,0 +1,299 @@ >+/** >+ * @file pfswb.cpp >+ * @brief Adjust white balance in RGB color space >+ * >+ * This file is a part of PFSTOOLS package. >+ * ---------------------------------------------------------------------- >+ * Copyright (C) 2008-2016 Iouri V. Ivliev >+ * >+ * 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. >+ * >+ * 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 >+ * ---------------------------------------------------------------------- >+ * >+ * @author Iouri V. Ivliev <fbsd@any.com.ru> >+ * >+ * $Id: $ >+ */ >+ >+#include <config.h> >+ >+#include <exception> >+#include <iostream> >+#include <sys/limits.h> >+#include <stdlib.h> >+#include <getopt.h> >+ >+#include <pfs.h> >+ >+#define PROG_NAME "pfswb" >+ >+class QuietException >+{ >+}; >+ >+static void printHelp() >+{ >+ std::cerr << PROG_NAME " (" PACKAGE_STRING ") :\n" >+ "\t[--red <val>] [--green <val>] [--blue <val>]\n" >+ "\t[--auto] [--x <val>] [--y <val>] [--width <val>] [--height <val>]\n" >+ "\t[--keep-lum]\n" >+ "\t[--verbose] [--help]\n" >+ "See man page for more information.\n"; >+} >+ >+// verbose mode >+static bool verbose = false; >+ >+// auto WB >+static bool autowb = false; >+// default gray box bounds >+static int x = 0; >+static int y = 0; >+static int width = INT_MAX/2; >+static int height = INT_MAX/2; >+ >+// keep original luminance >+static bool keep = false; >+ >+// default WB multipliers >+static float red = 1.f; >+static float green = 1.f; >+static float blue = 1.f; >+ >+static void multipliers( >+ const pfs::Array2D &R, const pfs::Array2D &G, const pfs::Array2D &B, >+ float &r, float &g, float &b) >+{ >+ r = red; >+ g = green; >+ b = blue; >+ if (!autowb) return; >+ // auto WB gray box >+ int w = R.getCols(); >+ int h = R.getRows(); >+ if (x>=w || y>=h) >+ throw pfs::Exception("gray box is out of frame bounds"); >+ int x1 = width+x; >+ if (x1>w) x1 = w; >+ int y1 = height+y; >+ if (y1>h) y1 = h; >+ VERBOSE_STR >+ << "auto WB gray box: " >+ << (x1-x) << "x" << (y1-y) << "+" << x << "+" << y << std::endl; >+ // auto WB multipliers >+ double ar = 0.; >+ double ag = 0.; >+ double ab = 0.; >+ for (int y0=y; y0<y1; ++y0) >+ { >+ for (int x0=x; x0<x1; ++x0) >+ { >+ ar += R(x0,y0); >+ ag += G(x0,y0); >+ ab += B(x0,y0); >+ } >+ } >+ int n = (x1-x)*(y1-y); >+ ar /= n; >+ ag /= n; >+ ab /= n; >+ VERBOSE_STR << "average red value: " << ar << std::endl; >+ VERBOSE_STR << "average green value: " << ag << std::endl; >+ VERBOSE_STR << "average blue value: " << ab << std::endl; >+ float a = (float)((ar+ag+ab)/3.); >+ r *= a/ar; >+ g *= a/ag; >+ b *= a/ab; >+} >+ >+static void pfswb() >+{ >+ pfs::DOMIO pfsio; >+ VERBOSE_STR << "auto WB: " << (autowb ? "yes" : "no" ) << std::endl; >+ VERBOSE_STR << "base red multiplier value: " << red << std::endl; >+ VERBOSE_STR << "base green multiplier value: " << green << std::endl; >+ VERBOSE_STR << "base blue multiplier value: " << blue << std::endl; >+ VERBOSE_STR << "keep original luminance: " << (keep ? "yes" : "no" ) << std::endl; >+ while (true) >+ { >+ // Read frame >+ pfs::Frame *frame = pfsio.readFrame( stdin ); >+ if (!frame) >+ { >+ break; // No more frames >+ } >+ // Get channels >+ pfs::Channel *X, *Y, *Z; >+ frame->getXYZChannels(X, Y, Z); >+ if (!(Y && X && Z)) >+ { >+ throw pfs::Exception( "Missing X, Y, Z channels in the PFS stream" ); >+ } >+ int w = Y->getCols(); >+ int h = Y->getRows(); >+ int s = w*h; >+ float min = 1e20, max = -1e20; >+ for (int i=s; i--; ) >+ { >+ float const &l = (*Y)(i); >+ if (min > l) min = l; >+ if (max < l) max = l; >+ } >+ VERBOSE_STR << "luminance range of original frame: " << min << ":" << max << std::endl; >+ // Convert from XYZ to RGB >+ pfs::transformColorSpace(pfs::CS_XYZ, X, Y, Z, pfs::CS_RGB, X, Y, Z); >+ // WB adjustment >+ float r, g, b; >+ multipliers(*X,*Y,*Z,r,g,b); >+ VERBOSE_STR << "red multiplier value: " << r << std::endl; >+ VERBOSE_STR << "green multiplier value: " << g << std::endl; >+ VERBOSE_STR << "blue multiplier value: " << b << std::endl; >+ for (int i=s; i--; ) >+ { >+ (*X)(i) *= r; >+ (*Y)(i) *= g; >+ (*Z)(i) *= b; >+ } >+ // Convert back to XYZ >+ pfs::transformColorSpace(pfs::CS_RGB, X, Y, Z, pfs::CS_XYZ, X, Y, Z); >+ float amin = 1e20, amax = -1e20; >+ for (int i=s; i--; ) >+ { >+ float const &l = (*Y)(i); >+ if (amin > l) amin = l; >+ if (amax < l) amax = l; >+ } >+ VERBOSE_STR << "luminance range of adjusted frame: " << amin << ":" << amax << std::endl; >+ if (keep) >+ { >+ float k = (max-min)/(amax-amin); >+ float nmin = 1e20, nmax = -1e20; >+ for (int i=s; i--; ) >+ { >+ float const &l = ((*Y)(i)-amin)*k+min; >+ if (nmin > l) nmin = l; >+ if (nmax < l) nmax = l; >+ (*Y)(i) = l; >+ (*X)(i) *= k; >+ (*Z)(i) *= k; >+ } >+ VERBOSE_STR << "restored luminance range: " << nmin << ":" << nmax << std::endl; >+ } >+ // Write frame >+ pfsio.writeFrame(frame, stdout); >+ pfsio.freeFrame(frame); >+ } >+} >+ >+int main(int argc, char *const argv[]) >+{ >+ static const struct option cmdLineOptions[] = { >+ { "help", no_argument, NULL, 'h' }, >+ { "verbose", no_argument, NULL, 'v' }, >+ { "auto", no_argument, NULL, 'A' }, >+ { "x", required_argument, NULL, 'X' }, >+ { "y", required_argument, NULL, 'Y' }, >+ { "width", required_argument, NULL, 'W' }, >+ { "height", required_argument, NULL, 'H' }, >+ { "keep-lum", no_argument, NULL, 'k' }, >+ { "red", required_argument, NULL, 'r' }, >+ { "green", required_argument, NULL, 'g' }, >+ { "blue", required_argument, NULL, 'b' }, >+ { NULL, 0, NULL, 0 } >+ }; >+ >+ try >+ { >+ int optionIndex = 0; >+ while (true) >+ { >+ int c = getopt_long(argc, argv, "hvAX:Y:W:H:kr:g:b:", cmdLineOptions, &optionIndex); >+ if (c == -1) >+ { >+ break; >+ } >+ switch (c) >+ { >+ case 'h': >+ printHelp(); >+ throw QuietException(); >+ case 'v': >+ verbose = true; >+ break; >+ case 'A': >+ autowb = true; >+ break; >+ case 'X': >+ x = (int)strtol(optarg, NULL, 10); >+ if (x<=0) >+ throw pfs::Exception("gray box x value out of range, should be >0"); >+ break; >+ case 'Y': >+ y = (int)strtol(optarg, NULL, 10); >+ if (y<=0) >+ throw pfs::Exception("gray box y value out of range, should be >0"); >+ break; >+ case 'W': >+ width = (int)strtol(optarg, NULL, 10); >+ if (width<=0) >+ throw pfs::Exception("gray box width value out of range, should be >0"); >+ break; >+ case 'H': >+ height = (int)strtol(optarg, NULL, 10); >+ if (height<=0) >+ throw pfs::Exception("gray box height value out of range, should be >0"); >+ break; >+ case 'k': >+ keep = true; >+ break; >+ case 'r': >+ red = strtof(optarg, NULL); >+ if (red<=0.0f) >+ throw pfs::Exception("red multiplier value out of range, should be >0"); >+ break; >+ case 'g': >+ green = strtof(optarg, NULL); >+ if (green<=0.0f) >+ throw pfs::Exception("green multiplier value out of range, should be >0"); >+ break; >+ case 'b': >+ blue = strtof(optarg, NULL); >+ if (blue<=0.0f) >+ throw pfs::Exception("blue multiplier value out of range, should be >0"); >+ break; >+ case '?': >+ throw QuietException(); >+ case ':': >+ throw QuietException(); >+ } >+ } >+ >+ pfswb(); >+ } >+ catch (std::exception const &ex) >+ { >+ std::cerr << PROG_NAME" error (std): " << ex.what() << std::endl; >+ return EXIT_FAILURE; >+ } >+ catch (pfs::Exception const &ex) >+ { >+ std::cerr << PROG_NAME" error (pfs): " << ex.getMessage() << std::endl; >+ return EXIT_FAILURE; >+ } >+ catch (QuietException const &ex) >+ { >+ return EXIT_FAILURE; >+ } >+ return EXIT_SUCCESS; >+} > >Property changes on: graphics/pfstools/files/port/src/filter/pfswb.cpp >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/octave/pfsplotresp >=================================================================== >--- graphics/pfstools/files/port/src/octave/pfsplotresp (nonexistent) >+++ graphics/pfstools/files/port/src/octave/pfsplotresp (working copy) >@@ -0,0 +1,34 @@ >+#!/usr/bin/octave -qf >+ >+if (nargin < 1 || nargin > 2) >+ error("Expecting arguments:\n\t<response> [<print options>]\n"); >+endif >+arg_list = argv(); >+ >+IY = []; >+ >+load(arg_list{1}); >+ >+WM=W(max(find(W(:,1))),2); >+Wm=W(min(find(W(:,1))),2); >+ >+#graphics_toolkit('gnuplot'); >+figure(1); >+clf(); >+grid on; >+grid minor on; >+ >+if rows(IY) > 0 >+ RM=max(IY(:,3)); >+ plot(IY(:,2),IY(:,3),'-g', W(:,2),W(:,1),'-k', [Wm Wm],[0 RM],'-k',[WM WM],[0 RM],'-k'); >+else >+ RM=max(max([IR(:,3) IG(:,3) IB(:,3)])); >+ plot(IR(:,2),IR(:,3),'-r', IG(:,2),IG(:,3),'-g', IB(:,2),IB(:,3),'-b', W(:,2),W(:,1),'-k', [Wm Wm],[0 RM],'-k',[WM WM],[0 RM],'-k'); >+endif >+ >+if nargin == 2 >+ eval(["print " arg_list{2}]); >+else >+ pause; >+endif >+close; > >Property changes on: graphics/pfstools/files/port/src/octave/pfsplotresp >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/octave/pfsplotresp.1 >=================================================================== >--- graphics/pfstools/files/port/src/octave/pfsplotresp.1 (nonexistent) >+++ graphics/pfstools/files/port/src/octave/pfsplotresp.1 (working copy) >@@ -0,0 +1,33 @@ >+.TH "pfsplotresp" 1 >+.SH NAME >+pfsplotresp \- Plot response curve and weighting function using GNU Octave. >+.SH SYNOPSIS >+.B pfsplotresp >+<response> [<print options>] >+.SH DESCRIPTION >+Use this command to polt charts of response curves and weighting functions. >+ >+Response argument is a name of file containing response produced by >+pfshdrcalibrate(1) command with -s key. >+ >+For details about print options see GNU Octave help on print function. >+ >+.SH EXAMPLES >+.TP >+pfsplotresp response.m >+ >+Chart of response curve and weighting function from response.m file >+well be plotted and displayed it using gnuplot or internal Octave >+plotting tool. >+ >+.TP >+pfsplotresp response.m response.png >+ >+Chart of response curve and weighting function from response.m file >+well be plotted and displayed. >+Also chart will be saved as a response.png image file. >+.SH "SEE ALSO" >+.BR pfshdrcalibrate (1) >+.BR pfssmoothresp (1) >+.SH BUGS >+Please report bugs and comments to Iouri Ivliev <fbsd@any.com.ru> > >Property changes on: graphics/pfstools/files/port/src/octave/pfsplotresp.1 >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/octave/pfssmoothresp >=================================================================== >--- graphics/pfstools/files/port/src/octave/pfssmoothresp (nonexistent) >+++ graphics/pfstools/files/port/src/octave/pfssmoothresp (working copy) >@@ -0,0 +1,89 @@ >+#!/usr/bin/octave -qf >+ >+pkg load signal; >+ >+if (nargin < 2 || nargin > 5) >+ error("Expecting arguments:\n\t<src-response> <dst-response> [<levels> [<length> [<polynomial order>]]]\n"); >+endif >+arg_list = argv(); >+ >+l = -1; >+if (nargin > 2) >+ l = sscanf(arg_list{3},"%d"); >+endif >+n = -1; >+if (nargin > 3) >+ n = sscanf(arg_list{4},"%d"); >+endif >+p = 1; >+if (nargin == 5) >+ p = sscanf(arg_list{5},"%d"); >+endif >+ >+interp = getenv("INTERP"); >+if length(interp) == 0 >+ interp = "cubic"; >+endif >+ >+zero = 1e-31; >+IY = []; >+ >+load(arg_list{1}); >+ >+r = rows(W); >+if l == -1 >+ l = r; >+endif >+if n == -1 >+ n = l/32-1; >+endif >+k = l/r; >+o = 0; >+if k > 1 >+ o = k/2; >+endif >+R1 = [0:r-1]'.*k.+o; >+R2 = [0:l-1]'; >+ >+fprintf(stderr,"src response levels: %d\n",rows(R1)); >+fprintf(stderr,"dst response levels: %d\n",rows(R2)); >+if k != 1 >+ fprintf(stderr,"interpolation: %s\n",interp); >+endif >+fprintf(stderr,"polynomial order: %d; length: %d\n",p,n); >+ >+if rows(IY) > 0 >+ IY = sgolayfilt(IY(:,3),p,(n+1)/k-1); >+ IY(find(IY<zero)) = zero; >+ if k != 1 >+ IY = interp1(R1,IY,R2,interp,0); >+ W = [interp1(R1,W(:,1),R2,interp,0),R2]; >+ IY = sgolayfilt(IY,p,n); >+ IY(find(IY<zero)) = zero; >+ endif >+ IY = [log10(IY),R2,IY]; >+ save(arg_list{2},'IY','W'); >+else >+ IR = sgolayfilt(IR(:,3),p,(n+1)/k-1); >+ IR(find(IR<zero)) = zero; >+ IG = sgolayfilt(IG(:,3),p,(n+1)/k-1); >+ IG(find(IG<zero)) = zero; >+ IB = sgolayfilt(IB(:,3),p,(n+1)/k-1); >+ IB(find(IB<zero)) = zero; >+ if k != 1 >+ IR = interp1(R1,IR,R2,interp,0); >+ IG = interp1(R1,IG,R2,interp,0); >+ IB = interp1(R1,IB,R2,interp,0); >+ W = [interp1(R1,W(:,1),R2,interp,0),R2]; >+ IR = sgolayfilt(IR,p,n); >+ IR(find(IR<zero)) = zero; >+ IG = sgolayfilt(IG,p,n); >+ IG(find(IG<zero)) = zero; >+ IB = sgolayfilt(IB,p,n); >+ IB(find(IB<zero)) = zero; >+ endif >+ IR = [log10(IR),R2,IR]; >+ IG = [log10(IG),R2,IG]; >+ IB = [log10(IB),R2,IB]; >+ save(arg_list{2},'IR','IG','IB','W'); >+endif > >Property changes on: graphics/pfstools/files/port/src/octave/pfssmoothresp >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/files/port/src/octave/pfssmoothresp.1 >=================================================================== >--- graphics/pfstools/files/port/src/octave/pfssmoothresp.1 (nonexistent) >+++ graphics/pfstools/files/port/src/octave/pfssmoothresp.1 (working copy) >@@ -0,0 +1,46 @@ >+.TH "pfssmoothresp" 1 >+.SH NAME >+pfssmoothresp \- Smooth response curve with a Savitsky-Golay smoothing filter. >+.SH SYNOPSIS >+.B pfssmoothresp >+<src-response> <dst-response> [<out-levels> [<length> [<polynomial order>]]] >+.SH DESCRIPTION >+Use this command to sommoth the response curves generated by pfshdrcalibrate(1). >+When the number of output levels given by the 3rd argument does not match >+the input, the response curve and the weighing function will be interpolated. >+ >+Sourse and destination response arguments are the file names. Sourse >+contains response produced by pfshdrcalibrate(1) command with -s key. >+Smoothed response will be saved into destination. >+ >+Output levels argument sets the number of levels for output response curve >+and weighing function. Default is the same as input. >+ >+Length and polynomial order arguments are parameters of Savitsky-Golay >+smoothing filter. For more details see GNU Octave help on sgolayfilt >+function. Default lentgth is <out-levels>/32-1. Default polynomial order >+is 1. >+ >+.SH ENVIRONMENT >+.TP >+INTERP >+Interpolation method. For more details see GNU Octave help on interp1 >+function. Default is cubic. >+ >+.SH EXAMPLES >+.TP >+pfssmoothresp response.m smoothed.m >+ >+Smooth response curve from response.m file and save result into smoothed.m >+file. >+ >+.TP >+env INTERP=spline pfssmoothresp response.m smoothed.m $((1<<12)) >+ >+Smooth response curve from response.m file and save result into smoothed.m >+file. Response curve and weighing function will be interpolated for 4096 >+levels (12 bpp) using spline interpolation algorithm. >+.SH "SEE ALSO" >+.BR pfshdrcalibrate (1) >+.SH BUGS >+Please report bugs and comments to Iouri Ivliev <fbsd@any.com.ru> > >Property changes on: graphics/pfstools/files/port/src/octave/pfssmoothresp.1 >___________________________________________________________________ >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Index: graphics/pfstools/pkg-plist >=================================================================== >--- graphics/pfstools/pkg-plist (revision 462869) >+++ graphics/pfstools/pkg-plist (working copy) >@@ -1,134 +1,164 @@ >-bin/pfsinrgbe >-bin/pfsoutrgbe >-bin/pfsinpfm >-bin/pfsoutpfm >-bin/pfsin >-bin/pfsout >-bin/pfsoutffmpeg >-bin/pfsinmulti >-bin/pfsindcraw >+bin/dcraw2hdrgen >+bin/jpeg2hdrgen >+bin/pfsabsolute >+%%ALIGN%%bin/pfsalign >+bin/pfscat > bin/pfsclamp >-bin/pfsgamma >-bin/pfstag >-bin/pfssize >+bin/pfscolortransform >+bin/pfscut >+bin/pfsdisplayfunction > bin/pfsextractchannels >-bin/pfspanoramic >-bin/pfsrotate > bin/pfsflip >-bin/pfscut >-bin/pfspad >-bin/pfscat >-bin/pfsabsolute >-bin/pfsdisplayfunction >-bin/pfswb >-%%IMAGEMAGICK%%bin/pfsouthdrhtml >-%%NETPBM%%bin/pfsinppm >-%%NETPBM%%bin/pfsoutppm >+bin/pfsgamma >+%%GLVIEW%%bin/pfsglview >+bin/pfshdrcalibrate >+bin/pfsin >+bin/pfsindcraw > %%OPENEXR%%bin/pfsinexr >-%%OPENEXR%%bin/pfsoutexr >+bin/pfsinhdrgen >+%%IMAGEMAGICK%%bin/pfsinimgmagick >+bin/pfsinme >+bin/pfsinpfm >+%%TIFF%%%%NETPBM%%bin/pfsinppm >+bin/pfsinrgbe > %%TIFF%%bin/pfsintiff >-%%TIFF%%bin/pfsouttiff >-%%IMAGEMAGICK%%bin/pfsinimgmagick >-%%IMAGEMAGICK%%bin/pfsoutimgmagick >-%%QT%%bin/pfsview >-%%QT%%bin/pfsv >+bin/pfsinyuv > %%OCTAVE%%bin/pfsoctavelum > %%OCTAVE%%bin/pfsoctavergb >+bin/pfsout >+%%OPENEXR%%bin/pfsoutexr >+%%IMAGEMAGICK%%bin/pfsouthdrhtml >+%%IMAGEMAGICK%%bin/pfsoutimgmagick >+bin/pfsoutpfm >+%%TIFF%%%%NETPBM%%bin/pfsoutppm >+bin/pfsoutrgbe >+%%TIFF%%bin/pfsouttiff >+bin/pfsoutyuv >+bin/pfspad >+bin/pfspanoramic >+%%OCTAVE%%bin/pfsplotresp >+bin/pfsplotresponse >+bin/pfsretime >+bin/pfsrotate >+bin/pfssize >+%%OCTAVE%%bin/pfssmoothresp > %%OCTAVE%%bin/pfsstat >-%%OPENGL%%bin/pfsglview >-%%GDAL%%bin/pfsingdal >-include/pfs-1.2/pfs.h >-include/pfs-1.2/array2d.h >-lib/libpfs-1.2.so.0.0.0 >-lib/libpfs-1.2.so.0 >-lib/libpfs-1.2.so >-lib/libpfs-1.2.a >+bin/pfstag >+bin/pfstmo_drago03 >+bin/pfstmo_durand02 >+bin/pfstmo_fattal02 >+%%FFTW%%bin/pfstmo_ferradans11 >+bin/pfstmo_mai11 >+bin/pfstmo_mantiuk06 >+%%GSL%%bin/pfstmo_mantiuk08 >+bin/pfstmo_pattanaik00 >+bin/pfstmo_reinhard02 >+bin/pfstmo_reinhard05 >+%%VIEW%%bin/pfsv >+%%VIEW%%bin/pfsview >+bin/pfswb >+include/pfs/array2d.h >+include/pfs/pfs.h >+lib/libpfs.so >+lib/libpfs.so.2 >+lib/libpfs.so.2.0.0 >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfsclose.oct >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfsget.oct >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfsopen.oct >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfsput.oct >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfsread.oct >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfstransform_colorspace.oct >+%%OCTAVE%%%%OCTAVE_SITE_OCT%%/pfstools/pfswrite.oct > libdata/pkgconfig/pfs.pc >+man/man1/dcraw2hdrgen.1.gz >+man/man1/jpeg2hdrgen.1.gz > man/man1/pfsabsolute.1.gz >+%%ALIGN%%man/man1/pfsalign.1.gz > man/man1/pfscat.1.gz > man/man1/pfsclamp.1.gz >+man/man1/pfscolortransform.1.gz > man/man1/pfscut.1.gz > man/man1/pfsdisplayfunction.1.gz > man/man1/pfsextractchannels.1.gz > man/man1/pfsflip.1.gz > man/man1/pfsgamma.1.gz >-%%OPENGL%%man/man1/pfsglview.1.gz >+%%GLVIEW%%man/man1/pfsglview.1.gz >+man/man1/pfshdrcalibrate.1.gz > man/man1/pfsin.1.gz > man/man1/pfsindcraw.1.gz >-man/man1/pfsinexr.1.gz >-man/man1/pfsingdal.1.gz >-man/man1/pfsinimgmagick.1.gz >-man/man1/pfsinjpeghdr.1.gz >-man/man1/pfsinmulti.1.gz >+%%OPENEXR%%man/man1/pfsinexr.1.gz >+man/man1/pfsinhdrgen.1.gz >+%%IMAGEMAGICK%%man/man1/pfsinimgmagick.1.gz >+man/man1/pfsinme.1.gz > man/man1/pfsinpfm.1.gz >-man/man1/pfsinppm.1.gz >+%%TIFF%%%%NETPBM%%man/man1/pfsinppm.1.gz > man/man1/pfsinrgbe.1.gz >-man/man1/pfsintiff.1.gz >+%%TIFF%%man/man1/pfsintiff.1.gz >+man/man1/pfsinyuv.1.gz > %%OCTAVE%%man/man1/pfsoctavelum.1.gz > %%OCTAVE%%man/man1/pfsoctavergb.1.gz > man/man1/pfsout.1.gz >-man/man1/pfsoutexr.1.gz >-man/man1/pfsoutffmpeg.1.gz >+%%OPENEXR%%man/man1/pfsoutexr.1.gz > %%IMAGEMAGICK%%man/man1/pfsouthdrhtml.1.gz >-man/man1/pfsoutimgmagick.1.gz >-man/man1/pfsoutjpeghdr.1.gz >+%%IMAGEMAGICK%%man/man1/pfsoutimgmagick.1.gz > man/man1/pfsoutpfm.1.gz >-man/man1/pfsoutppm.1.gz >+%%TIFF%%%%NETPBM%%man/man1/pfsoutppm.1.gz > man/man1/pfsoutrgbe.1.gz >-man/man1/pfsouttiff.1.gz >+%%TIFF%%man/man1/pfsouttiff.1.gz >+man/man1/pfsoutyuv.1.gz > man/man1/pfspad.1.gz > man/man1/pfspanoramic.1.gz >+%%OCTAVE%%man/man1/pfsplotresp.1.gz >+man/man1/pfsplotresponse.1.gz >+man/man1/pfsretime.1.gz > man/man1/pfsrotate.1.gz > man/man1/pfssize.1.gz >+%%OCTAVE%%man/man1/pfssmoothresp.1.gz > %%OCTAVE%%man/man1/pfsstat.1.gz > man/man1/pfstag.1.gz >-%%QT%%man/man1/pfsv.1.gz >-%%QT%%man/man1/pfsview.1.gz >+man/man1/pfstmo_drago03.1.gz >+man/man1/pfstmo_durand02.1.gz >+man/man1/pfstmo_fattal02.1.gz >+%%FFTW%%man/man1/pfstmo_ferradans11.1.gz >+man/man1/pfstmo_mai11.1.gz >+man/man1/pfstmo_mantiuk06.1.gz >+%%GSL%%man/man1/pfstmo_mantiuk08.1.gz >+man/man1/pfstmo_pattanaik00.1.gz >+man/man1/pfstmo_reinhard02.1.gz >+man/man1/pfstmo_reinhard05.1.gz >+%%VIEW%%man/man1/pfsview.1.gz >+man/man1/pfswb.1.gz >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfs_close_frames.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfs_open_frames.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfs_read_luminance.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfs_read_rgb.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfs_read_xyz.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfs_write_rgb.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfssize.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfsview.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfsview_list.m >+%%OCTAVE%%%%OCTAVE_SITE_M%%/pfstools/pfsview_rgb.m > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_c_b2.csv >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b2.csv > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_c_b3.csv >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b3.csv > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_c_b4.csv >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b4.csv > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_c_b5.csv >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b5.csv >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_default_templ/hdrhtml_image_templ.html > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_default_templ/hdrhtml_page_templ.html >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_default_templ/hdrhtml_image_templ.html >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/loading-spinner.gif >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/hdr_viewer.css >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/hdr_viewer.js > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/information-red.png >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/slider-red.png >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/hdr_viewer.js >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/slider-black.png > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/information.png >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/loading-spinner.gif >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/mootools-1.2.4.js > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/mouse2touch.js >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/mootools-1.2.4.js >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/hdr_viewer.css >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/slider-black.png >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/slider-red.png > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets/slider-white.png >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_image_templ.html >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_image_templ_slider-above.html > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_page_templ.html >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_image_templ_slider-above.html >-%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_image_templ.html > %%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_page_templ_short.html >-@dir include/pfs-1.2 >-%%IMAGEMAGICK%%@dir %%DATADIR%%/hdrhtml_hdrlabs_templ/hdrhtml_assets >-%%IMAGEMAGICK%%@dir %%DATADIR%%/hdrhtml_hdrlabs_templ >-%%IMAGEMAGICK%%@dir %%DATADIR%%/hdrhtml_default_templ >-%%IMAGEMAGICK%%@dir %%DATADIR%% >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfsclose.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfsget.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfsopen.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfsput.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfsread.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfstransform_colorspace.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_OCT%%/pfstools/pfswrite.oct >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfs_close_frames.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfs_open_frames.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfs_read_luminance.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfs_read_rgb.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfs_read_xyz.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfs_write_rgb.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfssize.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfsview.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfsview_list.m >-%%OCTAVE%%%%OCTAVE_BASE%%/%%OCTAVE_SITE_M%%/pfstools/pfsview_rgb.m >-%%OCTAVE%%@dir %%OCTAVE_SITE_OCT%%/pfstools >-%%OCTAVE%%@dir %%OCTAVE_SITE_M%%/pfstools >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b2.csv >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b3.csv >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b4.csv >+%%IMAGEMAGICK%%%%DATADIR%%/hdrhtml_t_b5.csv
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 226185
:
190970
|
190973
|
190976