[Hdrflow-svn] SF.net SVN: hdrflow: [107] lib/openlibraries/src
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-04-30 23:57:04
|
Revision: 107
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=107&view=rev
Author: glslang
Date: 2007-04-30 16:56:54 -0700 (Mon, 30 Apr 2007)
Log Message:
-----------
+ ofx bindings M1 (milestone 1)
Modified Paths:
--------------
lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
Modified: lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
===================================================================
--- lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-04-27 23:47:47 UTC (rev 106)
+++ lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-04-30 23:56:54 UTC (rev 107)
@@ -317,7 +317,7 @@
{ }
};
- class param_set_descriptor
+ class param_set_descriptor : public Ofx_base
{
public:
typedef pl::string key_type;
@@ -420,8 +420,12 @@
return 0;
}
+ virtual property_container_ptr get_property_set( )
+ { return ¶m_set_descriptor_props_; }
+
private:
container params_;
+ pcos::property_container param_set_descriptor_props_;
};
class param : public Ofx_base
@@ -1025,13 +1029,15 @@
if( !dst_img )
return false;
+ int_vec bounds_and_rod( 4 );
+ bounds_and_rod[ 0 ] = 0;
+ bounds_and_rod[ 1 ] = 0;
+ bounds_and_rod[ 2 ] = dst_img->width( );
+ bounds_and_rod[ 3 ] = dst_img->height( );
+
+ image_prop_bounds_ = bounds_and_rod;
+ image_prop_region_of_definition_ = bounds_and_rod;
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;
@@ -1040,21 +1046,19 @@
private:
void set_image_properties( )
{
- double_vec d_vec( 2 );
- d_vec[ 0 ] = 1.0; d_vec[ 1 ] = 1.0;
+ double_vec render_scale( 2 );
+ render_scale[ 0 ] = 1.0;
+ render_scale[ 1 ] = 1.0;
- 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_effect_prop_render_scale_ = render_scale );
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_bounds_ = int_vec( 4 ) );
+ image_props_.append( image_prop_region_of_definition_ = int_vec( 4 ) );
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" );
@@ -1130,99 +1134,6 @@
pcos::property clip_descriptor_prop_supports_tiles_;
};
- class clip_instance : public Ofx_base
- {
- public:
- explicit clip_instance( )
- : clip_instance_prop_type_( pcos::key::from_string( kOfxPropType ) )
- , clip_instance_prop_name_( pcos::key::from_string( kOfxPropName ) )
- , clip_instance_prop_label_( pcos::key::from_string( kOfxPropLabel ) )
- , clip_instance_prop_short_label_( pcos::key::from_string( kOfxPropShortLabel ) )
- , clip_instance_prop_long_label_( pcos::key::from_string( kOfxPropLongLabel ) )
- , clip_instance_prop_supported_components_( pcos::key::from_string( kOfxImageEffectPropSupportedComponents ) )
- , clip_instance_prop_temporal_clip_access_( pcos::key::from_string( kOfxImageEffectPropTemporalClipAccess ) )
- , clip_instance_prop_optional_( pcos::key::from_string( kOfxImageClipPropOptional ) )
- , clip_instance_prop_field_extraction_( pcos::key::from_string( kOfxImageClipPropFieldExtraction ) )
- , clip_instance_prop_is_mask_( pcos::key::from_string( kOfxImageClipPropIsMask ) )
- , clip_instance_prop_supports_tiles_( pcos::key::from_string( kOfxImageEffectPropSupportsTiles ) )
- , clip_instance_prop_pixel_depth_( pcos::key::from_string( kOfxImageEffectPropPixelDepth ) )
- , clip_instance_prop_components_( pcos::key::from_string( kOfxImageEffectPropComponents ) )
- , clip_instance_prop_unmapped_pixel_depth_( pcos::key::from_string( kOfxImageClipPropUnmappedPixelDepth ) )
- , clip_instance_prop_unmapped_components_( pcos::key::from_string( kOfxImageClipPropUnmappedComponents ) )
- , clip_instance_prop_premultiplication_( pcos::key::from_string( kOfxImageEffectPropPreMultiplication ) )
- , clip_instance_prop_pixel_aspect_ratio_( pcos::key::from_string( kOfxImagePropPixelAspectRatio ) )
- , clip_instance_prop_frame_rate_( pcos::key::from_string( kOfxImageEffectPropFrameRate ) )
- , clip_instance_prop_frame_range_( pcos::key::from_string( kOfxImageEffectPropFrameRange ) )
- , clip_instance_prop_field_order_( pcos::key::from_string( kOfxImageClipPropFieldOrder ) )
- , clip_instance_prop_connected_( pcos::key::from_string( kOfxImageClipPropConnected ) )
- , clip_instance_prop_unmapped_frame_range_( pcos::key::from_string( kOfxImageEffectPropUnmappedFrameRange ) )
- , clip_instance_prop_unmapped_frame_rate_( pcos::key::from_string( kOfxImageEffectPropUnmappedFrameRate ) )
- , clip_instance_prop_continuous_samples_( pcos::key::from_string( kOfxImageClipPropContinuousSamples ) )
- {
- set_clip_instance_properties( );
- }
-
- virtual property_container_ptr get_property_set( )
- { return &clip_instance_props_; }
-
- private:
- void set_clip_instance_properties( )
- {
- clip_instance_props_.append( clip_instance_prop_type_ = kOfxTypeClip );
- clip_instance_props_.append( clip_instance_prop_name_ = "" );
- clip_instance_props_.append( clip_instance_prop_label_ = "" );
- clip_instance_props_.append( clip_instance_prop_short_label_ = "" );
- clip_instance_props_.append( clip_instance_prop_long_label_ = "" );
- clip_instance_props_.append( clip_instance_prop_supported_components_ = string_vec( ) );
- clip_instance_props_.append( clip_instance_prop_temporal_clip_access_ = 0 );
- clip_instance_props_.append( clip_instance_prop_optional_ = 0 );
- clip_instance_props_.append( clip_instance_prop_field_extraction_ = kOfxImageFieldDoubled );
- clip_instance_props_.append( clip_instance_prop_is_mask_ = 0 );
- clip_instance_props_.append( clip_instance_prop_supports_tiles_ = 1 );
- clip_instance_props_.append( clip_instance_prop_pixel_depth_ = kOfxBitDepthNone );
- clip_instance_props_.append( clip_instance_prop_components_ = kOfxImageComponentNone );
- clip_instance_props_.append( clip_instance_prop_unmapped_pixel_depth_ = kOfxBitDepthNone );
- clip_instance_props_.append( clip_instance_prop_unmapped_components_ = kOfxImageComponentNone );
- clip_instance_props_.append( clip_instance_prop_premultiplication_ = kOfxImageOpaque );
- clip_instance_props_.append( clip_instance_prop_pixel_aspect_ratio_ = 0.0 );
- clip_instance_props_.append( clip_instance_prop_frame_rate_ = 0.0 );
- clip_instance_props_.append( clip_instance_prop_frame_range_ = double_vec( 2 ) );
- clip_instance_props_.append( clip_instance_prop_field_order_ = kOfxImageFieldNone );
- clip_instance_props_.append( clip_instance_prop_connected_ = 0 );
- clip_instance_props_.append( clip_instance_prop_unmapped_frame_range_ = double_vec( 2 ) );
- clip_instance_props_.append( clip_instance_prop_unmapped_frame_rate_ = 0.0 );
- clip_instance_props_.append( clip_instance_prop_continuous_samples_ = 0 );
- }
-
- // Clip instance properties.
- private:
- pcos::property_container clip_instance_props_;
- pcos::property clip_instance_prop_type_;
- pcos::property clip_instance_prop_name_;
- pcos::property clip_instance_prop_label_;
- pcos::property clip_instance_prop_short_label_;
- pcos::property clip_instance_prop_long_label_;
- pcos::property clip_instance_prop_supported_components_;
- pcos::property clip_instance_prop_temporal_clip_access_;
- pcos::property clip_instance_prop_optional_;
- pcos::property clip_instance_prop_field_extraction_;
- pcos::property clip_instance_prop_is_mask_;
- pcos::property clip_instance_prop_supports_tiles_;
- pcos::property clip_instance_prop_pixel_depth_;
- pcos::property clip_instance_prop_components_;
- pcos::property clip_instance_prop_unmapped_pixel_depth_;
- pcos::property clip_instance_prop_unmapped_components_;
- pcos::property clip_instance_prop_premultiplication_;
- pcos::property clip_instance_prop_pixel_aspect_ratio_;
- pcos::property clip_instance_prop_frame_rate_;
- pcos::property clip_instance_prop_frame_range_;
- pcos::property clip_instance_prop_field_order_;
- pcos::property clip_instance_prop_connected_;
- pcos::property clip_instance_prop_unmapped_frame_range_;
- pcos::property clip_instance_prop_unmapped_frame_rate_;
- pcos::property clip_instance_prop_continuous_samples_;
- };
-
class image_effect_descriptor : public param_set_descriptor
{
public:
@@ -1334,8 +1245,126 @@
private:
container clip_desc_;
};
+
+ struct image_effect_instance_base : public param_set
+ {
+ virtual il::image_type_ptr get_source( ) = 0;
+ virtual il::image_type_ptr get_output( ) = 0;
+ };
+
+ class clip_instance : public Ofx_base
+ {
+ public:
+ explicit clip_instance( image_effect_instance_base* const image_instance, const pl::string& name )
+ : clip_instance_prop_type_( pcos::key::from_string( kOfxPropType ) )
+ , clip_instance_prop_name_( pcos::key::from_string( kOfxPropName ) )
+ , clip_instance_prop_label_( pcos::key::from_string( kOfxPropLabel ) )
+ , clip_instance_prop_short_label_( pcos::key::from_string( kOfxPropShortLabel ) )
+ , clip_instance_prop_long_label_( pcos::key::from_string( kOfxPropLongLabel ) )
+ , clip_instance_prop_supported_components_( pcos::key::from_string( kOfxImageEffectPropSupportedComponents ) )
+ , clip_instance_prop_temporal_clip_access_( pcos::key::from_string( kOfxImageEffectPropTemporalClipAccess ) )
+ , clip_instance_prop_optional_( pcos::key::from_string( kOfxImageClipPropOptional ) )
+ , clip_instance_prop_field_extraction_( pcos::key::from_string( kOfxImageClipPropFieldExtraction ) )
+ , clip_instance_prop_is_mask_( pcos::key::from_string( kOfxImageClipPropIsMask ) )
+ , clip_instance_prop_supports_tiles_( pcos::key::from_string( kOfxImageEffectPropSupportsTiles ) )
+ , clip_instance_prop_pixel_depth_( pcos::key::from_string( kOfxImageEffectPropPixelDepth ) )
+ , clip_instance_prop_components_( pcos::key::from_string( kOfxImageEffectPropComponents ) )
+ , clip_instance_prop_unmapped_pixel_depth_( pcos::key::from_string( kOfxImageClipPropUnmappedPixelDepth ) )
+ , clip_instance_prop_unmapped_components_( pcos::key::from_string( kOfxImageClipPropUnmappedComponents ) )
+ , clip_instance_prop_premultiplication_( pcos::key::from_string( kOfxImageEffectPropPreMultiplication ) )
+ , clip_instance_prop_pixel_aspect_ratio_( pcos::key::from_string( kOfxImagePropPixelAspectRatio ) )
+ , clip_instance_prop_frame_rate_( pcos::key::from_string( kOfxImageEffectPropFrameRate ) )
+ , clip_instance_prop_frame_range_( pcos::key::from_string( kOfxImageEffectPropFrameRange ) )
+ , clip_instance_prop_field_order_( pcos::key::from_string( kOfxImageClipPropFieldOrder ) )
+ , clip_instance_prop_connected_( pcos::key::from_string( kOfxImageClipPropConnected ) )
+ , clip_instance_prop_unmapped_frame_range_( pcos::key::from_string( kOfxImageEffectPropUnmappedFrameRange ) )
+ , clip_instance_prop_unmapped_frame_rate_( pcos::key::from_string( kOfxImageEffectPropUnmappedFrameRate ) )
+ , clip_instance_prop_continuous_samples_( pcos::key::from_string( kOfxImageClipPropContinuousSamples ) )
+ , image_instance_( image_instance )
+ , name_( name )
+ {
+ set_clip_instance_properties( );
+ }
+
+ virtual property_container_ptr get_property_set( )
+ { return &clip_instance_props_; }
+
+ property_container_ptr get_image( )
+ {
+ if( name_ == "Source" )
+ im_.set_image( image_instance_->get_source( ) );
+ else if( name_ == "Output" )
+ im_.set_image( image_instance_->get_output( ) );
+
+ return im_.get_property_set( );
+ }
+
+ private:
+ void set_clip_instance_properties( )
+ {
+ clip_instance_props_.append( clip_instance_prop_type_ = kOfxTypeClip );
+ clip_instance_props_.append( clip_instance_prop_name_ = "" );
+ clip_instance_props_.append( clip_instance_prop_label_ = "" );
+ clip_instance_props_.append( clip_instance_prop_short_label_ = "" );
+ clip_instance_props_.append( clip_instance_prop_long_label_ = "" );
+ clip_instance_props_.append( clip_instance_prop_supported_components_ = string_vec( ) );
+ clip_instance_props_.append( clip_instance_prop_temporal_clip_access_ = 0 );
+ clip_instance_props_.append( clip_instance_prop_optional_ = 0 );
+ clip_instance_props_.append( clip_instance_prop_field_extraction_ = kOfxImageFieldDoubled );
+ clip_instance_props_.append( clip_instance_prop_is_mask_ = 0 );
+ clip_instance_props_.append( clip_instance_prop_supports_tiles_ = 1 );
+ clip_instance_props_.append( clip_instance_prop_pixel_depth_ = kOfxBitDepthNone );
+ clip_instance_props_.append( clip_instance_prop_components_ = kOfxImageComponentNone );
+ clip_instance_props_.append( clip_instance_prop_unmapped_pixel_depth_ = kOfxBitDepthNone );
+ clip_instance_props_.append( clip_instance_prop_unmapped_components_ = kOfxImageComponentNone );
+ clip_instance_props_.append( clip_instance_prop_premultiplication_ = kOfxImageOpaque );
+ clip_instance_props_.append( clip_instance_prop_pixel_aspect_ratio_ = 0.0 );
+ clip_instance_props_.append( clip_instance_prop_frame_rate_ = 0.0 );
+ clip_instance_props_.append( clip_instance_prop_frame_range_ = double_vec( 2 ) );
+ clip_instance_props_.append( clip_instance_prop_field_order_ = kOfxImageFieldNone );
+ clip_instance_props_.append( clip_instance_prop_connected_ = 0 );
+ clip_instance_props_.append( clip_instance_prop_unmapped_frame_range_ = double_vec( 2 ) );
+ clip_instance_props_.append( clip_instance_prop_unmapped_frame_rate_ = 0.0 );
+ clip_instance_props_.append( clip_instance_prop_continuous_samples_ = 0 );
+ }
- class image_effect_instance : public param_set
+ // Clip instance properties.
+ private:
+ pcos::property_container clip_instance_props_;
+ pcos::property clip_instance_prop_type_;
+ pcos::property clip_instance_prop_name_;
+ pcos::property clip_instance_prop_label_;
+ pcos::property clip_instance_prop_short_label_;
+ pcos::property clip_instance_prop_long_label_;
+ pcos::property clip_instance_prop_supported_components_;
+ pcos::property clip_instance_prop_temporal_clip_access_;
+ pcos::property clip_instance_prop_optional_;
+ pcos::property clip_instance_prop_field_extraction_;
+ pcos::property clip_instance_prop_is_mask_;
+ pcos::property clip_instance_prop_supports_tiles_;
+ pcos::property clip_instance_prop_pixel_depth_;
+ pcos::property clip_instance_prop_components_;
+ pcos::property clip_instance_prop_unmapped_pixel_depth_;
+ pcos::property clip_instance_prop_unmapped_components_;
+ pcos::property clip_instance_prop_premultiplication_;
+ pcos::property clip_instance_prop_pixel_aspect_ratio_;
+ pcos::property clip_instance_prop_frame_rate_;
+ pcos::property clip_instance_prop_frame_range_;
+ pcos::property clip_instance_prop_field_order_;
+ pcos::property clip_instance_prop_connected_;
+ pcos::property clip_instance_prop_unmapped_frame_range_;
+ pcos::property clip_instance_prop_unmapped_frame_rate_;
+ pcos::property clip_instance_prop_continuous_samples_;
+
+ private:
+ image im_;
+
+ private:
+ image_effect_instance_base* const image_instance_;
+ pl::string name_;
+ };
+
+ class image_effect_instance : public image_effect_instance_base
{
public:
typedef pl::string key_type;
@@ -1375,12 +1404,27 @@
if( I != clip_instance_.end( ) )
return I->second.get( );
- clip_instance_ptr new_clip_instance( new clip_instance( ) );
- clip_instance_.insert( container::value_type( name, new_clip_instance ) );
-
- return new_clip_instance.get( );
+ return 0;
}
+
+ clip_instance* add_clip_instance( const pl::string& name )
+ {
+ clip_instance_ptr clip( new clip_instance( this, name ) );
+ clip_instance_.insert( container::value_type( name, clip ) );
+
+ return clip.get( );
+ }
+
+ il::image_type_ptr get_source( )
+ { return source_; }
+ il::image_type_ptr get_output( )
+ { return output_; }
+ void set_source( il::image_type_ptr im )
+ { source_ = im; }
+ void set_output( il::image_type_ptr im )
+ { output_ = im; }
+
private:
void set_image_effect_instance_properties( )
{
@@ -1414,7 +1458,11 @@
private:
container clip_instance_;
- };
+
+ private:
+ il::image_type_ptr source_;
+ il::image_type_ptr output_;
+ };
}
class ML_PLUGIN_DECLSPEC ofx_filter : public filter_type, public OfxHost
@@ -1491,25 +1539,40 @@
{
acquire_values( );
- frame_type_ptr result = frame_type::deep_copy( fetch_from_slot( ) );
-
+ frame_type_ptr result = fetch_from_slot( );
if( result && result->get_image( ) )
{
+ il::image_type_ptr src = result->get_image( );
+ image_effect_instance_.set_source( src );
+ image_effect_instance_.set_output( il::allocate( src->pf( ), src->width( ), src->height( ) ) );
+
pcos::property_container sequence_in_args;
sequence_in_args.append( sequence_prop_frame_range_ = double_vec( 2 ) );
sequence_in_args.append( sequence_prop_frame_step_ = 1.0 );
sequence_in_args.append( sequence_prop_is_interactive_ = 0 );
sequence_in_args.append( sequence_prop_render_scale_ = double_vec( 2 ) );
+ int_vec render_win( 4 );
+ render_win[ 0 ] = 0;
+ render_win[ 1 ] = 0;
+ render_win[ 2 ] = src->width( );
+ render_win[ 3 ] = src->height( );
+
+ int_vec render_scale( 2 );
+ render_scale[ 0 ] = 1;
+ render_scale[ 1 ] = 1;
+
pcos::property_container render_in_args;
render_in_args.append( render_prop_time_ = 0.0 );
render_in_args.append( render_prop_field_to_render_ = kOfxImageFieldNone );
- render_in_args.append( render_prop_render_window_ = int_vec( 4 ) );
- render_in_args.append( render_prop_render_scale_ = int_vec( 2 ) );
+ render_in_args.append( render_prop_render_window_ = render_win );
+ render_in_args.append( render_prop_render_scale_ = render_scale );
plug_->mainEntry( kOfxImageEffectActionBeginSequenceRender, &image_effect_instance_, ( OfxPropertySetHandle ) &sequence_in_args, 0 );
plug_->mainEntry( kOfxImageEffectActionRender, &image_effect_instance_, ( OfxPropertySetHandle ) &render_in_args, 0 );
plug_->mainEntry( kOfxImageEffectActionEndSequenceRender, &image_effect_instance_, ( OfxPropertySetHandle ) &sequence_in_args, 0 );
+
+ result->set_image( image_effect_instance_.get_output( ) );
}
return result;
@@ -1757,7 +1820,7 @@
template<typename T, typename U>
OfxStatus get_multiple_property( OfxPropertySetHandle properties, const char* property, int count, T* value )
{
- pcos::property_container* prop_set = ( pcos::property_container* ) properties;
+ property_container_ptr prop_set = ( property_container_ptr ) properties;
pcos::property src = prop_set->get_property_with_string( property );
if( src.is_a<U>( ) )
@@ -1799,6 +1862,16 @@
{
return set_multiple_property<int, int_vec>( properties, property, count, value );
}
+
+ OfxStatus prop_get_pointer( OfxPropertySetHandle properties, const char* property, int index, void** value )
+ {
+ pcos::property_container* prop_set = ( pcos::property_container* ) properties;
+
+ pcos::property src = prop_set->get_property_with_string( property );
+ *value = src.value<void*>( );
+
+ return kOfxStatOK;
+ }
OfxStatus prop_get_string( OfxPropertySetHandle properties, const char* property, int index, char** value )
{
@@ -2314,9 +2387,7 @@
OfxStatus get_property_set( OfxImageEffectHandle image_effect, OfxPropertySetHandle* prop_handle )
{
Ofx_base* plug = ( Ofx_base* ) image_effect;
-
*prop_handle = ( OfxPropertySetHandle ) plug->get_property_set( );
-
return kOfxStatOK;
}
@@ -2328,9 +2399,7 @@
OfxStatus clip_define( OfxImageEffectHandle image_effect, const char* name, OfxPropertySetHandle* property_set )
{
image_effect_descriptor* desc = ( image_effect_descriptor* ) image_effect;
-
desc->clip_define( name, property_set );
-
return kOfxStatOK;
}
@@ -2339,37 +2408,54 @@
image_effect_instance* instance = ( image_effect_instance* ) image_effect;
clip_instance* clip = instance->clip_get_handle( name );
+ if( !clip )
+ clip = instance->add_clip_instance( name );
- if( *handle )
+ if( handle )
*handle = ( OfxImageClipHandle ) clip;
+ if( property_set )
+ *property_set = ( OfxPropertySetHandle ) clip->get_property_set( );
- if( *property_set )
- *property_set = ( OfxPropertySetHandle ) clip;
-
return kOfxStatOK;
}
OfxStatus clip_get_property_set( OfxImageClipHandle clip, OfxPropertySetHandle* handle )
{
clip_instance* instance = ( clip_instance* ) clip;
-
*handle = ( OfxPropertySetHandle ) instance->get_property_set( );
-
return kOfxStatOK;
}
OfxStatus clip_get_image( OfxImageClipHandle clip, OfxTime time, OfxRectD* region, OfxPropertySetHandle* image_handle )
{
+ clip_instance* instance = ( clip_instance* ) clip;
+ if( !instance )
+ return kOfxStatErrBadHandle;
+
+ *image_handle = ( OfxPropertySetHandle ) instance->get_image( );
+
return kOfxStatOK;
}
- OfxStatus clip_release_image( OfxPropertySetHandle image_handle )
+ OfxStatus clip_release_image( OfxPropertySetHandle )
{
return kOfxStatOK;
}
-
+
OfxStatus clip_get_region_of_definition( OfxImageClipHandle clip, OfxTime time, OfxRectD* bounds )
{
+ clip_instance* instance = ( clip_instance* ) clip;
+ if( !instance )
+ return kOfxStatErrBadHandle;
+
+ property_container_ptr image = instance->get_image( );
+ int_vec b = image->get_property_with_string( kOfxImagePropBounds ).value<int_vec>( );
+
+ bounds->x1 = b[ 0 ];
+ bounds->y1 = b[ 1 ];
+ bounds->x2 = b[ 2 ];
+ bounds->y2 = b[ 3 ];
+
return kOfxStatOK;
}
@@ -2412,6 +2498,7 @@
property_suite.propSetStringN = prop_set_stringN;
property_suite.propSetDoubleN = prop_set_doubleN;
property_suite.propSetIntN = prop_set_intN;
+ property_suite.propGetPointer = prop_get_pointer;
property_suite.propGetString = prop_get_string;
property_suite.propGetDouble = prop_get_double;
property_suite.propGetInt = prop_get_int;
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-04-27 23:47:47 UTC (rev 106)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-04-30 23:56:54 UTC (rev 107)
@@ -122,6 +122,9 @@
template<typename U>
T operator( )( const U& ) const
{ return T( ); }
+
+ T operator( )( const T& t ) const
+ { return t; }
};
template<>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|