[Hdrflow-svn] SF.net SVN: hdrflow: [103] lib/openlibraries
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-04-24 22:00:21
|
Revision: 103
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=103&view=rev
Author: glslang
Date: 2007-04-24 15:00:03 -0700 (Tue, 24 Apr 2007)
Log Message:
-----------
+ bug fixes
Modified Paths:
--------------
lib/openlibraries/installer/openlibraries_runtime.nsi
lib/openlibraries/installer/openlibraries_sdk.nsi
lib/openlibraries/src/openimagelib/il/utility.cpp
lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp
Modified: lib/openlibraries/installer/openlibraries_runtime.nsi
===================================================================
--- lib/openlibraries/installer/openlibraries_runtime.nsi 2007-04-23 23:07:38 UTC (rev 102)
+++ lib/openlibraries/installer/openlibraries_runtime.nsi 2007-04-24 22:00:03 UTC (rev 103)
@@ -122,6 +122,8 @@
File "..\src\openimagelib\plugins\gdi+\Multi-threaded Release DLL\openimagelib_gdi-vc80-r-0_4_0.dll"
File "..\src\openimagelib\plugins\hdr\hdr_plugin.opl"
File "..\src\openimagelib\plugins\hdr\Multi-threaded Release DLL\openimagelib_hdr-vc80-r-0_4_0.dll"
+ File "..\src\openimagelib\plugins\jpg\jpg_plugin.opl"
+ File "..\src\openimagelib\plugins\jpg\Multi-threaded Release DLL\openimagelib_jpg-vc80-r-0_4_0.dll"
File "..\src\openimagelib\plugins\sgi\sgi_plugin.opl"
File "..\src\openimagelib\plugins\sgi\Multi-threaded Release DLL\openimagelib_sgi-vc80-r-0_4_0.dll"
File "..\src\openimagelib\plugins\tga\tga_plugin.opl"
Modified: lib/openlibraries/installer/openlibraries_sdk.nsi
===================================================================
--- lib/openlibraries/installer/openlibraries_sdk.nsi 2007-04-23 23:07:38 UTC (rev 102)
+++ lib/openlibraries/installer/openlibraries_sdk.nsi 2007-04-24 22:00:03 UTC (rev 103)
@@ -235,6 +235,8 @@
File "..\src\openimagelib\plugins\gdi+\Multi-threaded Debug DLL\openimagelib_gdi-vc80-d-0_4_0.dll"
File "..\src\openimagelib\plugins\hdr\hdr_plugin.opl"
File "..\src\openimagelib\plugins\hdr\Multi-threaded Debug DLL\openimagelib_hdr-vc80-d-0_4_0.dll"
+ File "..\src\openimagelib\plugins\jpg\jpg_plugin.opl"
+ File "..\src\openimagelib\plugins\jpg\Multi-threaded Debug DLL\openimagelib_jpg-vc80-d-0_4_0.dll"
File "..\src\openimagelib\plugins\sgi\sgi_plugin.opl"
File "..\src\openimagelib\plugins\sgi\Multi-threaded Debug DLL\openimagelib_sgi-vc80-d-0_4_0.dll"
File "..\src\openimagelib\plugins\tga\tga_plugin.opl"
@@ -281,6 +283,8 @@
File "..\src\openimagelib\plugins\gdi+\Multi-threaded Release DLL\openimagelib_gdi-vc80-r-0_4_0.dll"
File "..\src\openimagelib\plugins\hdr\hdr_plugin.opl"
File "..\src\openimagelib\plugins\hdr\Multi-threaded Release DLL\openimagelib_hdr-vc80-r-0_4_0.dll"
+ File "..\src\openimagelib\plugins\jpg\jpg_plugin.opl"
+ File "..\src\openimagelib\plugins\jpg\Multi-threaded Release DLL\openimagelib_jpg-vc80-r-0_4_0.dll"
File "..\src\openimagelib\plugins\sgi\sgi_plugin.opl"
File "..\src\openimagelib\plugins\sgi\Multi-threaded Release DLL\openimagelib_sgi-vc80-r-0_4_0.dll"
File "..\src\openimagelib\plugins\tga\tga_plugin.opl"
Modified: lib/openlibraries/src/openimagelib/il/utility.cpp
===================================================================
--- lib/openlibraries/src/openimagelib/il/utility.cpp 2007-04-23 23:07:38 UTC (rev 102)
+++ lib/openlibraries/src/openimagelib/il/utility.cpp 2007-04-24 22:00:03 UTC (rev 103)
@@ -925,12 +925,15 @@
unsigned char u, v;
+ // TODO: Fix the chroma subsampling logic here
while( height > 1 )
{
if ( a == -1 )
{
while( width > 1 )
{
+ //u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
+ //v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
u = ( *src2 );
v = ( *src3 );
@@ -949,8 +952,10 @@
if ( width )
{
- u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
- v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
+ //u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
+ //v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
+ u = ( *src2 );
+ v = ( *src3 );
yuv444_to_rgb24( rgb[ 0 ], rgb[ 1 ], rgb[ 2 ], *src0 ++, *src2 ++, *src3 ++ );
assign3( dst0, rgb[ r ], rgb[ g ], rgb[ b ] );
yuv444_to_rgb24( rgb[ 0 ], rgb[ 1 ], rgb[ 2 ], *src1 ++, u, v );
@@ -961,8 +966,10 @@
{
while( width > 1 )
{
- u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
- v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
+ //u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
+ //v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
+ u = ( *src2 );
+ v = ( *src3 );
yuv444_to_rgb24( rgb[ 0 ], rgb[ 1 ], rgb[ 2 ], *src0 ++, *src2, *src3 );
assign4( dst0, rgb[ r ], rgb[ g ], rgb[ b ], rgb[ a ] );
@@ -979,8 +986,10 @@
if ( width )
{
- u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
- v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
+ //u = ( *src2 + *( src2 + chroma_pitch ) ) >> 1;
+ //v = ( *src3 + *( src3 + chroma_pitch ) ) >> 1;
+ u = ( *src2 );
+ v = ( *src3 );
yuv444_to_rgb24( rgb[ 0 ], rgb[ 1 ], rgb[ 2 ], *src0 ++, *src2 ++, *src3 ++ );
assign4( dst0, rgb[ r ], rgb[ g ], rgb[ b ], rgb[ a ] );
yuv444_to_rgb24( rgb[ 0 ], rgb[ 1 ], rgb[ 2 ], *src1 ++, u, v );
@@ -1996,7 +2005,7 @@
size_type orig_width = width / 2;
- while( height -- )
+ while( height )
{
width = orig_width;
dst = dptr;
@@ -2026,6 +2035,8 @@
sptr[ 1 ] += src_pitch[ 1 ];
sptr[ 2 ] += src_pitch[ 2 ];
}
+
+ height --;
}
}
Modified: lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp
===================================================================
--- lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp 2007-04-23 23:07:38 UTC (rev 102)
+++ lib/openlibraries/src/openimagelib/plugins/jpg/jpg_plugin.cpp 2007-04-24 22:00:03 UTC (rev 103)
@@ -57,8 +57,6 @@
pixels += pitch;
}
- ( *info->mem->free_pool )( ( j_common_ptr ) info, JPOOL_IMAGE );
-
jpeg_finish_decompress( info );
jpeg_destroy_decompress( info );
}
@@ -131,7 +129,11 @@
#endif
#ifdef HAVE_JPEGHDR
- il::image_type_ptr image = il::allocate( L"r32g32b32f", info.cinfo.output_width, info.cinfo.output_height );
+ il::image_type_ptr image;
+ if( jpeghdr_decompress_ishdr( &info ) )
+ image = il::allocate( L"r32g32b32f", info.cinfo.output_width, info.cinfo.output_height );
+ else
+ image = il::allocate( L"r8g8b8", info.cinfo.output_width, info.cinfo.output_height );
#else
il::image_type_ptr image = il::allocate( L"r8g8b8", info.output_width, info.output_height );
#endif
@@ -155,10 +157,9 @@
bool store_jpg( const boost::filesystem::path& path, il::image_type_ptr img )
{
- int i;
struct jpeg_compress_struct cinfo;
struct jpeg_error_mgr jerr;
- unsigned char *line;
+
FILE *out = Fopen_s( path.native_directory_string( ), "wb" );
il::image_type_ptr image = il::convert( img, L"r8g8b8" );
@@ -166,7 +167,7 @@
if ( out != NULL )
{
- line = image->data( );
+ il::image_type::pointer line = image->data( );
cinfo.err = jpeg_std_error( &jerr );
jpeg_create_compress( &cinfo );
jpeg_stdio_dest( &cinfo, out );
@@ -178,7 +179,7 @@
jpeg_set_defaults( &cinfo );
jpeg_set_quality( &cinfo, 50, TRUE );
jpeg_start_compress( &cinfo, TRUE );
- for ( i = 0 ; i < image->height( ); i ++, line += image->pitch( ) )
+ for ( int i = 0 ; i < image->height( ); i ++, line += image->pitch( ) )
jpeg_write_scanlines( &cinfo, &line, 1 );
jpeg_finish_compress( &cinfo );
fclose( out );
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|