[Hdrflow-svn] SF.net SVN: hdrflow: [106] lib/openlibraries/src/openmedialib/plugins/ofx/ ofx_plugin
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-04-27 23:47:48
|
Revision: 106
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=106&view=rev
Author: glslang
Date: 2007-04-27 16:47:47 -0700 (Fri, 27 Apr 2007)
Log Message:
-----------
+ more ofx bindings
Modified Paths:
--------------
lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
Modified: lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
===================================================================
--- lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-04-27 22:05:41 UTC (rev 105)
+++ lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-04-27 23:47:47 UTC (rev 106)
@@ -1001,15 +1001,15 @@
, image_effect_prop_components_( pcos::key::from_string( kOfxImageEffectPropComponents ) )
, image_effect_prop_pre_multiplication_( pcos::key::from_string( kOfxImageEffectPropPreMultiplication ) )
, image_effect_prop_render_scale_( pcos::key::from_string( kOfxImageEffectPropRenderScale ) )
- , image_effect_prop_pixel_aspect_ratio_( pcos::key::from_string( kOfxImagePropPixelAspectRatio ) )
- , image_effect_prop_data_( pcos::key::from_string( kOfxImagePropData ) )
- , image_effect_prop_bounds_( pcos::key::from_string( kOfxImagePropBounds ) )
- , image_effect_prop_region_of_definition_( pcos::key::from_string( kOfxImagePropRegionOfDefinition ) )
- , image_effect_prop_row_bytes_( pcos::key::from_string( kOfxImagePropRowBytes ) )
- , image_effect_prop_field_( pcos::key::from_string( kOfxImagePropField ) )
- , image_effect_prop_unique_identifier_( pcos::key::from_string( kOfxImagePropUniqueIdentifier ) )
+ , image_prop_pixel_aspect_ratio_( pcos::key::from_string( kOfxImagePropPixelAspectRatio ) )
+ , image_prop_data_( pcos::key::from_string( kOfxImagePropData ) )
+ , image_prop_bounds_( pcos::key::from_string( kOfxImagePropBounds ) )
+ , image_prop_region_of_definition_( pcos::key::from_string( kOfxImagePropRegionOfDefinition ) )
+ , image_prop_row_bytes_( pcos::key::from_string( kOfxImagePropRowBytes ) )
+ , image_prop_field_( pcos::key::from_string( kOfxImagePropField ) )
+ , image_prop_unique_identifier_( pcos::key::from_string( kOfxImagePropUniqueIdentifier ) )
{
- image_props_.append( image_prop_type_ = kOfxTypeImage );
+ set_image_properties( );
}
virtual property_container_ptr get_property_set( )
@@ -1017,15 +1017,47 @@
bool set_image( il::image_type_ptr im )
{
+ if( !im )
+ return false;
+
+ // TODO: handle bit depths properly.
il::image_type_ptr dst_img = il::convert( im, L"r8g8b8a8" );
- if( dst_img )
- {
-
-
- return true;
- }
+ if( !dst_img )
+ return false;
+
+ image_prop_data_ = ( void* ) dst_img->data( );
+
+ int_vec i_vec( 4 );
+ i_vec[ 0 ] = 0; i_vec[ 1 ] = 0; i_vec[ 2 ] = dst_img->width( ); i_vec[ 3 ] = dst_img->height( );
+ image_prop_bounds_ = i_vec;
+ image_prop_region_of_definition_ = i_vec;
+
+ image_prop_row_bytes_ = dst_img->pitch( );
+
+ return true;
+ }
+
+ private:
+ void set_image_properties( )
+ {
+ double_vec d_vec( 2 );
+ d_vec[ 0 ] = 1.0; d_vec[ 1 ] = 1.0;
- return false;
+ int_vec i_vec( 4 );
+ i_vec[ 0 ] = 0; i_vec[ 1 ] = 0; i_vec[ 2 ] = 0; i_vec[ 3 ] = 0;
+
+ image_props_.append( image_prop_type_ = kOfxTypeImage );
+ image_props_.append( image_effect_prop_pixel_depth_ = kOfxBitDepthNone );
+ image_props_.append( image_effect_prop_components_ = kOfxImageComponentNone );
+ image_props_.append( image_effect_prop_pre_multiplication_ = kOfxImageUnPreMultiplied );
+ image_props_.append( image_effect_prop_render_scale_ = d_vec );
+ image_props_.append( image_prop_pixel_aspect_ratio_ = 1.0 );
+ image_props_.append( image_prop_data_ = ( void* ) 0 );
+ image_props_.append( image_prop_bounds_ = i_vec );
+ image_props_.append( image_prop_region_of_definition_ = i_vec );
+ image_props_.append( image_prop_row_bytes_ = 0 );
+ image_props_.append( image_prop_field_ = kOfxImageFieldNone );
+ image_props_.append( image_prop_unique_identifier_ = "No Unique Identifier" );
}
private:
@@ -1035,13 +1067,13 @@
pcos::property image_effect_prop_components_;
pcos::property image_effect_prop_pre_multiplication_;
pcos::property image_effect_prop_render_scale_;
- pcos::property image_effect_prop_pixel_aspect_ratio_;
- pcos::property image_effect_prop_data_;
- pcos::property image_effect_prop_bounds_;
- pcos::property image_effect_prop_region_of_definition_;
- pcos::property image_effect_prop_row_bytes_;
- pcos::property image_effect_prop_field_;
- pcos::property image_effect_prop_unique_identifier_;
+ pcos::property image_prop_pixel_aspect_ratio_;
+ pcos::property image_prop_data_;
+ pcos::property image_prop_bounds_;
+ pcos::property image_prop_region_of_definition_;
+ pcos::property image_prop_row_bytes_;
+ pcos::property image_prop_field_;
+ pcos::property image_prop_unique_identifier_;
};
class clip_descriptor : public Ofx_base
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|