[Hdrflow-svn] SF.net SVN: hdrflow: [300] trunk/lib/openlibraries/src
Status: Pre-Alpha
Brought to you by:
glslang
From: <gl...@us...> - 2007-09-13 17:58:45
|
Revision: 300 http://hdrflow.svn.sourceforge.net/hdrflow/?rev=300&view=rev Author: glslang Date: 2007-09-13 10:58:41 -0700 (Thu, 13 Sep 2007) Log Message: ----------- +build fixes Modified Paths: -------------- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp trunk/lib/openlibraries/src/openimagelib/plugins/tiff/tiff_plugin.cpp trunk/lib/openlibraries/src/openobjectlib/sg/hw_GL_renderer.cpp trunk/lib/openlibraries/src/openobjectlib/sg/render_buffer.hpp trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.cpp trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.hpp Modified: trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp =================================================================== --- trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp 2007-09-12 16:52:46 UTC (rev 299) +++ trunk/lib/openlibraries/src/openimagelib/plugins/quicktime/quicktime_plugin.cpp 2007-09-13 17:58:41 UTC (rev 300) @@ -109,7 +109,9 @@ SetGWorld( port, device ); DisposeGWorld( gworld ); - return il::convert( im, L"a8b8g8r8" ); + im = il::convert( im, L"a8b8g8r8" ); + im->set_flipped( true ); + return im; } } Modified: trunk/lib/openlibraries/src/openimagelib/plugins/tiff/tiff_plugin.cpp =================================================================== --- trunk/lib/openlibraries/src/openimagelib/plugins/tiff/tiff_plugin.cpp 2007-09-12 16:52:46 UTC (rev 299) +++ trunk/lib/openlibraries/src/openimagelib/plugins/tiff/tiff_plugin.cpp 2007-09-13 17:58:41 UTC (rev 300) @@ -58,10 +58,12 @@ if( config != PLANARCONFIG_CONTIG ) return tiff_null_image( tif ); - unsigned short photo, compression, sample_format; + unsigned short photo, compression; + unsigned short sample_format, orientation; TIFFGetFieldDefaulted( tif, TIFFTAG_PHOTOMETRIC, &photo ); TIFFGetFieldDefaulted( tif, TIFFTAG_SAMPLEFORMAT, &sample_format ); TIFFGetFieldDefaulted( tif, TIFFTAG_COMPRESSION, &compression ); + TIFFGetFieldDefaulted( tif, TIFFTAG_ORIENTATION, &orientation ); bool is_float = false; switch( photo ) @@ -83,6 +85,9 @@ if( !im ) return il::image_type_ptr( ); + if( orientation == ORIENTATION_TOPLEFT ) + im->set_flipped( true ); + il::image_type::pointer data = im->data( ); int bytes_per_pixel = components * bpp / 8; @@ -117,6 +122,10 @@ } else { + size_t pitch = im->pitch( ); + if( is_float ) + pitch *= sizeof( float ); + unsigned int rows; TIFFGetField( tif, TIFFTAG_ROWSPERSTRIP, &rows ); @@ -124,7 +133,7 @@ for( int i = 0; i < height * depth; i += rows ) { tstrip_t strip = TIFFComputeStrip( tif, i, 0 ); - TIFFReadEncodedStrip( tif, strip, data + i * im->pitch( ), strip_size ); + TIFFReadEncodedStrip( tif, strip, data + i * pitch, strip_size ); } } Modified: trunk/lib/openlibraries/src/openobjectlib/sg/hw_GL_renderer.cpp =================================================================== --- trunk/lib/openlibraries/src/openobjectlib/sg/hw_GL_renderer.cpp 2007-09-12 16:52:46 UTC (rev 299) +++ trunk/lib/openlibraries/src/openobjectlib/sg/hw_GL_renderer.cpp 2007-09-13 17:58:41 UTC (rev 300) @@ -975,8 +975,9 @@ num_im = 6; } - typedef std::pair<GLenum, GLenum> internal_and_base_format; - internal_and_base_format pf = opl::pf_to_gl_format( im->pf( ).c_str( ) ); + GLint internal_format; + GLenum format, type; + opl::pf_to_gl_format( im->pf( ).c_str( ), internal_format, format, type ); glPixelStorei( GL_UNPACK_ALIGNMENT, 4 ); @@ -990,20 +991,20 @@ size_t mipsize = il::calculate_mipmap_size( im, 0 ); if( width != 0 && height == 0 && !im->is_volume( ) ) - glCompressedTexImage1DARB( target + i, 0, pf.second, static_cast<GLsizei>( width ), 0, mipsize, texels ); + glCompressedTexImage1DARB( target + i, 0, format, static_cast<GLsizei>( width ), 0, mipsize, texels ); else if( width != 0 && height != 0 && !im->is_volume( ) ) - glCompressedTexImage2DARB( target + i, 0, pf.second, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), 0, mipsize, texels ); + glCompressedTexImage2DARB( target + i, 0, format, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), 0, mipsize, texels ); else if( width != 0 && height != 0 && im->is_volume( ) ) - glCompressedTexImage3DARB( target + i, 0, pf.second, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), static_cast<GLsizei>( depth ), 0, mipsize, texels ); + glCompressedTexImage3DARB( target + i, 0, format, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), static_cast<GLsizei>( depth ), 0, mipsize, texels ); } else { if( width != 0 && height == 0 && !im->is_volume( ) ) - glTexImage1D( target + i, 0, pf.first, static_cast<GLsizei>( width ), 0, pf.second, GL_UNSIGNED_BYTE, texels ); + glTexImage1D( target + i, 0, internal_format, static_cast<GLsizei>( width ), 0, format, type, texels ); else if( width != 0 && height != 0 && !im->is_volume( ) ) - glTexImage2D( target + i, 0, pf.first, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), 0, pf.second, GL_UNSIGNED_BYTE, texels ); + glTexImage2D( target + i, 0, internal_format, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), 0, format, type, texels ); else if( width != 0 && height != 0 && im->is_volume( ) ) - glTexImage3D( target + i, 0, pf.first, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), static_cast<GLsizei>( depth ), 0, pf.second, GL_UNSIGNED_BYTE, texels ); + glTexImage3D( target + i, 0, internal_format, static_cast<GLsizei>( width ), static_cast<GLsizei>( height ), static_cast<GLsizei>( depth ), 0, format, type, texels ); } } Modified: trunk/lib/openlibraries/src/openobjectlib/sg/render_buffer.hpp =================================================================== --- trunk/lib/openlibraries/src/openobjectlib/sg/render_buffer.hpp 2007-09-12 16:52:46 UTC (rev 299) +++ trunk/lib/openlibraries/src/openobjectlib/sg/render_buffer.hpp 2007-09-13 17:58:41 UTC (rev 300) @@ -719,8 +719,9 @@ { GLenum target = buffer_type<surface_format>::get_GL_target( force_2_0_targets ); - typedef std::pair<GLenum, GLenum> internal_and_base_format; - internal_and_base_format pf = openpluginlib::pf_to_gl_format( data_->pf( ) ); + GLint internal_format; + GLenum format, type; + openpluginlib::pf_to_gl_format( data_->pf( ), internal_format, format, type ); glEnable( target ); glBindTexture( target, id_ ); @@ -736,11 +737,11 @@ { glTexParameteri( target, GL_TEXTURE_MIN_FILTER, GL_NEAREST ); glTexParameteri( target, GL_TEXTURE_MAG_FILTER, GL_NEAREST ); - glTexImage2D( target, 0, pf.first, phy_w, phy_h, 0, pf.second, GL_UNSIGNED_BYTE, data_->data( ) ); + glTexImage2D( target, 0, internal_format, phy_w, phy_h, 0, format, type, data_->data( ) ); } else { - glTexSubImage2D( target, 0, 0, 0, phy_w, phy_h, pf.second, GL_UNSIGNED_BYTE, data_->data( ) ); + glTexSubImage2D( target, 0, 0, 0, phy_w, phy_h, format, type, data_->data( ) ); } glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); Modified: trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.cpp =================================================================== --- trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.cpp 2007-09-12 16:52:46 UTC (rev 299) +++ trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.cpp 2007-09-13 17:58:41 UTC (rev 300) @@ -124,4 +124,7 @@ } } +openplugin::~openplugin( ) +{ } + } } } Modified: trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.hpp =================================================================== --- trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.hpp 2007-09-12 16:52:46 UTC (rev 299) +++ trunk/lib/openlibraries/src/openpluginlib/pl/openplugin.hpp 2007-09-13 17:58:41 UTC (rev 300) @@ -75,11 +75,9 @@ }; } -class OPENPLUGINLIB_DECLSPEC openplugin +struct OPENPLUGINLIB_DECLSPEC openplugin { -public: - explicit openplugin( ) { } - virtual ~openplugin( ) { } + virtual ~openplugin( ); }; typedef boost::shared_ptr<openplugin> opl_ptr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |