[Hdrflow-svn] SF.net SVN: hdrflow: [392] trunk/lib
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2008-01-02 23:02:04
|
Revision: 392
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=392&view=rev
Author: glslang
Date: 2008-01-02 15:02:01 -0800 (Wed, 02 Jan 2008)
Log Message:
-----------
+ adds a fixed point float format to il
+ more wic
Modified Paths:
--------------
trunk/lib/extras/src/wic/wic.cpp
trunk/lib/openlibraries/openlibraries_vc8.sln
trunk/lib/openlibraries/src/openimagelib/il/float_traits.hpp
trunk/lib/openlibraries/src/openimagelib/il/utility.cpp
Modified: trunk/lib/extras/src/wic/wic.cpp
===================================================================
--- trunk/lib/extras/src/wic/wic.cpp 2008-01-01 17:55:53 UTC (rev 391)
+++ trunk/lib/extras/src/wic/wic.cpp 2008-01-02 23:02:01 UTC (rev 392)
@@ -30,10 +30,12 @@
namespace
{
- il::image_type_ptr GUID_to_pf( WICPixelFormatGUID guid, UINT width, UINT height, UINT& pitch )
+ il::image_type_ptr GUID_to_pf( WICPixelFormatGUID guid, UINT width, UINT height, UINT& pitch, bool& convert )
{
il::image_type_ptr im;
+ convert = false;
+
if( guid == GUID_WICPixelFormat128bppRGBAFloat )
{
im = il::allocate( L"r32g32b32a32f", width, height );
@@ -41,6 +43,8 @@
}
else if( guid == GUID_WICPixelFormat128bppRGBFloat )
{
+ im = il::allocate( L"r32g32b32f", width, height );
+ pitch = im->pitch( ) * sizeof( float );
}
return im;
@@ -75,7 +79,8 @@
source->GetPixelFormat( &pixelformat );
UINT pitch;
- im = GUID_to_pf( pixelformat, width, height, pitch );
+ bool convert;
+ im = GUID_to_pf( pixelformat, width, height, pitch, convert );
if( !im )
return im;
Modified: trunk/lib/openlibraries/openlibraries_vc8.sln
===================================================================
--- trunk/lib/openlibraries/openlibraries_vc8.sln 2008-01-01 17:55:53 UTC (rev 391)
+++ trunk/lib/openlibraries/openlibraries_vc8.sln 2008-01-02 23:02:01 UTC (rev 392)
@@ -304,26 +304,6 @@
{3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0} = {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0}
EndProjectSection
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "multipass_draw", "test\openobjectlib\GL\multipass_draw\multipass_draw_vc8.vcproj", "{AB0137D5-38BE-45A5-ACE9-02BB34D02358}"
- ProjectSection(ProjectDependencies) = postProject
- {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0} = {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "noise_volume", "test\openobjectlib\GL\noise_volume\noise_volume_vc8.vcproj", "{3780D440-9C37-4186-B9B2-861EF3833CD4}"
- ProjectSection(ProjectDependencies) = postProject
- {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0} = {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "obj_draw", "test\openobjectlib\GL\obj_draw\obj_draw_vc8.vcproj", "{DD597B0F-DE01-4A1A-A399-F2355ABB06B0}"
- ProjectSection(ProjectDependencies) = postProject
- {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0} = {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0}
- EndProjectSection
-EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "texture_draw", "test\openobjectlib\GL\texture_draw\texture_draw_vc8.vcproj", "{8032E526-0866-4764-A4E9-F18C7CEE12D2}"
- ProjectSection(ProjectDependencies) = postProject
- {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0} = {3D424B92-233E-4BA0-AFD3-0FD1D80F5DD0}
- EndProjectSection
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "GL", "GL", "{B972DCEB-386E-42D2-8C5E-DD2942EC7F63}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "plugins", "plugins", "{C85EDDFB-1A91-4ABD-8E86-6AFDF0C85CBA}"
@@ -551,22 +531,6 @@
{E6EFFB88-1563-4AB7-9D07-5B8853CD8ECF}.Multi-threaded Debug DLL|Win32.Build.0 = Multi-threaded Debug DLL|Win32
{E6EFFB88-1563-4AB7-9D07-5B8853CD8ECF}.Multi-threaded Release DLL|Win32.ActiveCfg = Multi-threaded Release DLL|Win32
{E6EFFB88-1563-4AB7-9D07-5B8853CD8ECF}.Multi-threaded Release DLL|Win32.Build.0 = Multi-threaded Release DLL|Win32
- {AB0137D5-38BE-45A5-ACE9-02BB34D02358}.Multi-threaded Debug DLL|Win32.ActiveCfg = Multi-threaded Debug DLL|Win32
- {AB0137D5-38BE-45A5-ACE9-02BB34D02358}.Multi-threaded Debug DLL|Win32.Build.0 = Multi-threaded Debug DLL|Win32
- {AB0137D5-38BE-45A5-ACE9-02BB34D02358}.Multi-threaded Release DLL|Win32.ActiveCfg = Multi-threaded Release DLL|Win32
- {AB0137D5-38BE-45A5-ACE9-02BB34D02358}.Multi-threaded Release DLL|Win32.Build.0 = Multi-threaded Release DLL|Win32
- {3780D440-9C37-4186-B9B2-861EF3833CD4}.Multi-threaded Debug DLL|Win32.ActiveCfg = Multi-threaded Debug DLL|Win32
- {3780D440-9C37-4186-B9B2-861EF3833CD4}.Multi-threaded Debug DLL|Win32.Build.0 = Multi-threaded Debug DLL|Win32
- {3780D440-9C37-4186-B9B2-861EF3833CD4}.Multi-threaded Release DLL|Win32.ActiveCfg = Multi-threaded Release DLL|Win32
- {3780D440-9C37-4186-B9B2-861EF3833CD4}.Multi-threaded Release DLL|Win32.Build.0 = Multi-threaded Release DLL|Win32
- {DD597B0F-DE01-4A1A-A399-F2355ABB06B0}.Multi-threaded Debug DLL|Win32.ActiveCfg = Multi-threaded Debug DLL|Win32
- {DD597B0F-DE01-4A1A-A399-F2355ABB06B0}.Multi-threaded Debug DLL|Win32.Build.0 = Multi-threaded Debug DLL|Win32
- {DD597B0F-DE01-4A1A-A399-F2355ABB06B0}.Multi-threaded Release DLL|Win32.ActiveCfg = Multi-threaded Release DLL|Win32
- {DD597B0F-DE01-4A1A-A399-F2355ABB06B0}.Multi-threaded Release DLL|Win32.Build.0 = Multi-threaded Release DLL|Win32
- {8032E526-0866-4764-A4E9-F18C7CEE12D2}.Multi-threaded Debug DLL|Win32.ActiveCfg = Multi-threaded Debug DLL|Win32
- {8032E526-0866-4764-A4E9-F18C7CEE12D2}.Multi-threaded Debug DLL|Win32.Build.0 = Multi-threaded Debug DLL|Win32
- {8032E526-0866-4764-A4E9-F18C7CEE12D2}.Multi-threaded Release DLL|Win32.ActiveCfg = Multi-threaded Release DLL|Win32
- {8032E526-0866-4764-A4E9-F18C7CEE12D2}.Multi-threaded Release DLL|Win32.Build.0 = Multi-threaded Release DLL|Win32
{6D618CAE-230F-4ADD-936B-6C1D3D723236}.Multi-threaded Debug DLL|Win32.ActiveCfg = Multi-threaded Debug DLL|Win32
{6D618CAE-230F-4ADD-936B-6C1D3D723236}.Multi-threaded Debug DLL|Win32.Build.0 = Multi-threaded Debug DLL|Win32
{6D618CAE-230F-4ADD-936B-6C1D3D723236}.Multi-threaded Release DLL|Win32.ActiveCfg = Multi-threaded Release DLL|Win32
@@ -670,10 +634,6 @@
{4CC2C554-1EB4-4E53-A73F-38F0A1862F49} = {C2EBF114-BFF6-4520-BC11-EB54565B92D6}
{F30DAA25-794E-44F6-BF01-867A72BE385B} = {C2EBF114-BFF6-4520-BC11-EB54565B92D6}
{DBF9F309-3C1F-4563-AA2B-69FA27C2CBF7} = {C2EBF114-BFF6-4520-BC11-EB54565B92D6}
- {3780D440-9C37-4186-B9B2-861EF3833CD4} = {B972DCEB-386E-42D2-8C5E-DD2942EC7F63}
- {DD597B0F-DE01-4A1A-A399-F2355ABB06B0} = {B972DCEB-386E-42D2-8C5E-DD2942EC7F63}
- {8032E526-0866-4764-A4E9-F18C7CEE12D2} = {B972DCEB-386E-42D2-8C5E-DD2942EC7F63}
- {AB0137D5-38BE-45A5-ACE9-02BB34D02358} = {B972DCEB-386E-42D2-8C5E-DD2942EC7F63}
{6D618CAE-230F-4ADD-936B-6C1D3D723236} = {C85EDDFB-1A91-4ABD-8E86-6AFDF0C85CBA}
EndGlobalSection
EndGlobal
Modified: trunk/lib/openlibraries/src/openimagelib/il/float_traits.hpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/il/float_traits.hpp 2008-01-01 17:55:53 UTC (rev 391)
+++ trunk/lib/openlibraries/src/openimagelib/il/float_traits.hpp 2008-01-02 23:02:01 UTC (rev 392)
@@ -268,6 +268,49 @@
{ flop_scan_line_( p, ( float* ) dst, ( const float* ) src, w ); }
};
+template<typename T = float, class storage = default_storage<T> >
+class r16g16b16fixed : public surface_format<T, storage>
+{
+public:
+ typedef typename storage::const_pointer const_pointer;
+ typedef typename storage::pointer pointer;
+ typedef typename surface_format<T, storage>::size_type size_type;
+
+private:
+ static const size_type bs = 3;
+
+public:
+ explicit r16g16b16fixed( size_type width,
+ size_type height,
+ size_type depth,
+ size_type count = 1,
+ bool cubemap = false )
+ : surface_format<T, storage>( bs, width, height, depth, count, cubemap, L"r16g16b16fixed" )
+ { surface_format<T, storage>::allocate( ); }
+
+ r16g16b16fixed( const r16g16b16fixed& other, size_type w, size_type h )
+ : surface_format<T, storage>( other.bs, w, h, other.depth( ), other.count( ), other.is_cubemap( ), L"r16g16b16fixed" )
+ { surface_format<T, storage>::allocate( ); }
+
+ ~r16g16b16fixed( )
+ { }
+
+public:
+ virtual size_type allocsize( size_type width, size_type height, size_type depth ) const
+ { return sizeof( unsigned short ) * detail::rgb_Allocate_size<T>( )( bs, width, height, depth ); }
+
+ virtual size_type bitdepth( ) const
+ { return 16; }
+
+ virtual bool is_float( ) const { return true; }
+
+ virtual r16g16b16fixed* clone( size_type w, size_type h )
+ { return new r16g16b16fixed( *this, w, h ); }
+
+ virtual void flop_scan_line( size_t p, pointer dst, const_pointer src, size_type w ) const
+ { flop_scan_line_( p, ( short* ) dst, ( const unsigned short* ) src, w ); }
+};
+
} } }
#endif
Modified: trunk/lib/openlibraries/src/openimagelib/il/utility.cpp
===================================================================
--- trunk/lib/openlibraries/src/openimagelib/il/utility.cpp 2008-01-01 17:55:53 UTC (rev 391)
+++ trunk/lib/openlibraries/src/openimagelib/il/utility.cpp 2008-01-02 23:02:01 UTC (rev 392)
@@ -154,6 +154,7 @@
typedef image< unsigned char, r16g16b16a16log > r16g16b16a16log_image_type;
typedef image< unsigned char, r32g32b32f > r32g32b32f_image_type;
typedef image< unsigned char, r32g32b32a32f > r32g32b32a32f_image_type;
+typedef image< unsigned char, r16g16b16fixed > r16g16b16fixed_image_type;
typedef image< unsigned char, rgbe > rgbe_image_type;
typedef image< unsigned char, yuv444p > yuv444p_image_type;
typedef image< unsigned char, yuv444 > yuv444_image_type;
@@ -235,6 +236,8 @@
dst_img = image_type_ptr( new image_type( r32g32b32f_image_type( width, height, 1 ) ) );
else if( pf == L"r32g32b32a32f" )
dst_img = image_type_ptr( new image_type( r32g32b32a32f_image_type( width, height, 1 ) ) );
+ else if( pf == L"r16g16b16fixed" )
+ dst_img = image_type_ptr( new image_type( r16g16b16fixed_image_type( width, height, 1 ) ) );
else if( pf == L"rgbe" )
dst_img = image_type_ptr( new image_type( rgbe_image_type( width, height, 1 ) ) );
else if ( pf == L"yuv444p" )
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|