[Hdrflow-svn] SF.net SVN: hdrflow: [279] trunk/lib/openlibraries/src/openimagelib/il/ utility.cpp
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-08-27 17:40:54
|
Revision: 279
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=279&view=rev
Author: glslang
Date: 2007-08-26 07:14:16 -0700 (Sun, 26 Aug 2007)
Log Message:
-----------
+ rgbe to r32g32b32a32f conversion
Modified Paths:
--------------
trunk/lib/openlibraries/src/openimagelib/il/utility.cpp
Modified: trunk/lib/openlibraries/src/openimagelib/il/utility.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/il/utility.cpp 2007-08-26 13:54:02 UTC (rev 278)
+++ trunk/lib/openlibraries/src/openimagelib/il/utility.cpp 2007-08-26 14:14:16 UTC (rev 279)
@@ -1565,7 +1565,7 @@
return dst_img;
}
-static image_type_ptr rgbe_to_r32g32b32f( image_type_ptr src_img, const std::wstring &format )
+static image_type_ptr rgbe_to_r32g32b32a32f( image_type_ptr src_img, const std::wstring &format )
{
size_type width = src_img->width( );
size_type height = src_img->height( );
@@ -1588,8 +1588,9 @@
while( width-- )
{
rgbe2float( src, *( dst + 0 ), *( dst + 1 ), *( dst + 2 ) );
+ *( dst + 3 ) = 1.0f;
- dst += 3;
+ dst += 4;
src += 4;
}
@@ -1914,13 +1915,15 @@
return tm_linear( src );
else if( dst_pf == L"ldr8" ) // stub colour space for straight truncation to LDR data.
return r32g32b32f_to_b8g8r8a8( src, L"b8g8r8a8" );
+ else if( dst_pf == L"rgbe" )
+ return r32g32b32f_to_rgbe( src, L"rgbe" );
}
else if( src_pf == L"rgbe" )
{
if( dst_pf == L"b8g8r8a8" )
- return tm_linear( rgbe_to_r32g32b32f( src, L"r32g32b32f" ) );
- else if( dst_pf == L"r32g32b32f" )
- return rgbe_to_r32g32b32f( src, L"r32g32b32f" );
+ return tm_linear( rgbe_to_r32g32b32a32f( src, L"r32g32b32a32f" ) );
+ else if( dst_pf == L"r32g32b32a32f" )
+ return rgbe_to_r32g32b32a32f( src, L"r32g32b32a32f" );
}
else if ( src_pf == L"yuv444" )
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|