[Hdrflow-svn] SF.net SVN: hdrflow: [114] lib/openlibraries/src
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-05-09 00:29:10
|
Revision: 114
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=114&view=rev
Author: glslang
Date: 2007-05-08 17:29:07 -0700 (Tue, 08 May 2007)
Log Message:
-----------
+ OFX bindings continued
Modified Paths:
--------------
lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp
Modified: lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp
===================================================================
--- lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-05-04 17:24:48 UTC (rev 113)
+++ lib/openlibraries/src/openmedialib/plugins/ofx/ofx_plugin.cpp 2007-05-09 00:29:07 UTC (rev 114)
@@ -476,9 +476,26 @@
{
public:
explicit choice_param_descriptor( )
- { }
+ : choice_param_descriptor_param_prop_default_( pcos::key::from_string( kOfxParamPropDefault ) )
+ , choice_param_descriptor_param_prop_choice_option_( pcos::key::from_string( kOfxParamPropChoiceOption ) )
+ {
+ set_choice_param_descriptor_properties( );
+ }
virtual param* create_instance( );
+
+ private:
+ void set_choice_param_descriptor_properties( )
+ {
+ property_container_ptr param_props_ = get_property_set( );
+
+ param_props_->append( choice_param_descriptor_param_prop_default_ = 0 );
+ param_props_->append( choice_param_descriptor_param_prop_choice_option_ = pl::string_vec( ) );
+ }
+
+ private:
+ pcos::property choice_param_descriptor_param_prop_default_;
+ pcos::property choice_param_descriptor_param_prop_choice_option_;
};
class group_param_descriptor : public value_param_descriptor
@@ -1196,13 +1213,38 @@
explicit choice_param( choice_param_descriptor& vpd )
: value_param( vpd )
, choice_param_value_( pcos::key::from_string( "value" ) )
- { }
+ , choice_param_prop_default_( pcos::key::from_string( kOfxParamPropDefault ) )
+ , choice_param_prop_choice_option_( pcos::key::from_string( kOfxParamPropChoiceOption ) )
+ {
+ set_choice_param_properties( vpd );
+ }
virtual pcos::property get_value( ) { return choice_param_value_; }
virtual pl::string get_type( ) { return kOfxParamTypeChoice; }
private:
+ // assign the instance properties from the descriptor. do not assign properties since
+ // they have shallow copy semantics and clone will cause a leak.
+ // therefore extract all the values and assign those. descriptors and instances are
+ // meant to be separate entities and values should not be shared.
+ void set_choice_param_properties( choice_param_descriptor& vpd )
+ {
+ property_container_ptr param_props_ = get_property_set( );
+
+ property_container_ptr vpd_set = vpd.get_property_set( );
+
+ int def = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropDefault ) ).value<int>( );
+ pl::string_vec choice_vec = vpd_set->get_property_with_key( pcos::key::from_string( kOfxParamPropChoiceOption ) ).value<pl::string_vec>( );
+
+ param_props_->append( choice_param_value_ = def );
+ param_props_->append( choice_param_prop_default_ = def );
+ param_props_->append( choice_param_prop_choice_option_ = choice_vec );
+ }
+
+ private:
pcos::property choice_param_value_;
+ pcos::property choice_param_prop_default_;
+ pcos::property choice_param_prop_choice_option_;
};
class group_param : public value_param
@@ -1442,6 +1484,31 @@
pcos::property clip_descriptor_prop_is_mask_;
pcos::property clip_descriptor_prop_supports_tiles_;
};
+
+ class interact_descriptor : public Ofx_base
+ {
+ public:
+ explicit interact_descriptor( )
+ : interact_descriptor_prop_has_alpha_( pcos::key::from_string( kOfxInteractPropHasAlpha ) )
+ , interact_descriptor_prop_bit_depth_( pcos::key::from_string( kOfxInteractPropBitDepth ) )
+ {
+ set_interact_descriptor_properties( );
+ }
+
+ virtual property_container_ptr get_property_set( ) { return &interact_descriptor_props_; }
+
+ private:
+ void set_interact_descriptor_properties( )
+ {
+ interact_descriptor_props_.append( interact_descriptor_prop_has_alpha_ = 1 );
+ interact_descriptor_props_.append( interact_descriptor_prop_bit_depth_ = 8 );
+ }
+
+ private:
+ pcos::property_container interact_descriptor_props_;
+ pcos::property interact_descriptor_prop_has_alpha_;
+ pcos::property interact_descriptor_prop_bit_depth_;
+ };
class image_effect_descriptor : public param_set_descriptor
{
@@ -1652,6 +1719,49 @@
private:
image im_;
};
+
+ class interact_instance : public Ofx_base
+ {
+ public:
+ explicit interact_instance( )
+ : interact_instance_prop_effect_instance_( pcos::key::from_string( kOfxPropEffectInstance ) )
+ , interact_instance_prop_instance_data_( pcos::key::from_string( kOfxPropInstanceData ) )
+ , interact_instance_prop_pixel_scale_( pcos::key::from_string( kOfxInteractPropPixelScale ) )
+ , interact_instance_prop_background_colour_( pcos::key::from_string( kOfxInteractPropBackgroundColour ) )
+ , interact_instance_prop_viewport_size_( pcos::key::from_string( kOfxInteractPropViewportSize ) )
+ , interact_instance_prop_has_alpha_( pcos::key::from_string( kOfxInteractPropHasAlpha ) )
+ , interact_instance_prop_bit_depth_( pcos::key::from_string( kOfxInteractPropBitDepth ) )
+ , interact_instance_prop_slave_to_param_( pcos::key::from_string( kOfxInteractPropSlaveToParam ) )
+ {
+ set_interact_instance_properties( );
+ }
+
+ virtual property_container_ptr get_property_set( ) { return &interact_instance_props_; }
+
+ private:
+ void set_interact_instance_properties( )
+ {
+ interact_instance_props_.append( interact_instance_prop_effect_instance_ = ( void* ) 0 );
+ interact_instance_props_.append( interact_instance_prop_instance_data_ = ( void* ) 0 );
+ interact_instance_props_.append( interact_instance_prop_pixel_scale_ = pcos::double_vec( 2, 0.0 ) );
+ interact_instance_props_.append( interact_instance_prop_background_colour_ = pcos::double_vec( 3, 0.0 ) );
+ interact_instance_props_.append( interact_instance_prop_viewport_size_ = pcos::int_vec( 2, 0 ) ); // deprecated
+ interact_instance_props_.append( interact_instance_prop_has_alpha_ = 1 );
+ interact_instance_props_.append( interact_instance_prop_bit_depth_ = 8 );
+ interact_instance_props_.append( interact_instance_prop_slave_to_param_ = pl::string_vec( ) );
+ }
+
+ private:
+ pcos::property_container interact_instance_props_;
+ pcos::property interact_instance_prop_effect_instance_;
+ pcos::property interact_instance_prop_instance_data_;
+ pcos::property interact_instance_prop_pixel_scale_;
+ pcos::property interact_instance_prop_background_colour_;
+ pcos::property interact_instance_prop_viewport_size_;
+ pcos::property interact_instance_prop_has_alpha_;
+ pcos::property interact_instance_prop_bit_depth_;
+ pcos::property interact_instance_prop_slave_to_param_;
+ };
class image_effect_instance : public param_set_base
{
@@ -1847,9 +1957,8 @@
param* page_param_descriptor::create_instance( ) { return new page_param( *this ); }
param* push_button_param_descriptor::create_instance( ) { return new push_button_param( *this ); }
param* custom_param_descriptor::create_instance( ) { return new custom_param( *this ); }
-
- param_set* param_set_descriptor::create_instance( ) { return new param_set( *this ); }
- clip_instance* clip_descriptor::create_instance( ) { return new clip_instance( *this ); }
+ param_set* param_set_descriptor::create_instance( ) { return new param_set( *this ); }
+ clip_instance* clip_descriptor::create_instance( ) { return new clip_instance( *this ); }
}
class ML_PLUGIN_DECLSPEC ofx_filter : public filter_type, public OfxHost
@@ -1862,6 +1971,7 @@
, host_prop_label_( pcos::key::from_string( kOfxPropLabel ) )
, host_prop_is_background_( pcos::key::from_string( kOfxImageEffectHostPropIsBackground ) )
, host_prop_supports_overlays_( pcos::key::from_string( kOfxImageEffectPropSupportsOverlays ) )
+ , host_prop_supported_pixel_depths_( pcos::key::from_string( kOfxImageEffectPropSupportedPixelDepths ) )
, host_prop_supports_multiresolution_( pcos::key::from_string( kOfxImageEffectPropSupportsMultiResolution ) )
, host_prop_supports_tiles_( pcos::key::from_string( kOfxImageEffectPropSupportsTiles ) )
, host_prop_temporal_clip_access_( pcos::key::from_string( kOfxImageEffectPropTemporalClipAccess ) )
@@ -1880,16 +1990,7 @@
, host_prop_max_pages_( pcos::key::from_string( kOfxParamHostPropMaxPages ) )
, host_prop_page_row_column_count_( pcos::key::from_string( kOfxParamHostPropPageRowColumnCount ) )
, host_prop_this_pointer_( pcos::key::from_string( "this_pointer" ) )
- , interact_descriptor_prop_has_alpha_( pcos::key::from_string( kOfxInteractPropHasAlpha ) )
- , interact_descriptor_prop_bit_depth_( pcos::key::from_string( kOfxInteractPropBitDepth ) )
- , interact_instance_prop_effect_instance_( pcos::key::from_string( kOfxPropEffectInstance ) )
- , interact_instance_prop_instance_data_( pcos::key::from_string( kOfxPropInstanceData ) )
- , interact_instance_prop_pixel_scale_( pcos::key::from_string( kOfxInteractPropPixelScale ) )
- , interact_instance_prop_background_colour_( pcos::key::from_string( kOfxInteractPropBackgroundColour ) )
- , interact_instance_prop_viewport_size_( pcos::key::from_string( kOfxInteractPropViewportSize ) )
- , interact_instance_prop_has_alpha_( pcos::key::from_string( kOfxInteractPropHasAlpha ) )
- , interact_instance_prop_bit_depth_( pcos::key::from_string( kOfxInteractPropBitDepth ) )
- , interact_instance_prop_slave_to_param_( pcos::key::from_string( kOfxInteractPropSlaveToParam ) )
+ , render_prop_name_( pcos::key::from_string( kOfxPropName ) )
, render_prop_time_( pcos::key::from_string( kOfxPropTime ) )
, render_prop_field_to_render_( pcos::key::from_string( kOfxImageEffectPropFieldToRender ) )
, render_prop_render_window_( pcos::key::from_string( kOfxImageEffectPropRenderWindow ) )
@@ -1898,6 +1999,17 @@
, sequence_prop_frame_step_( pcos::key::from_string( kOfxImageEffectPropFrameStep ) )
, sequence_prop_is_interactive_( pcos::key::from_string( kOfxPropIsInteractive ) )
, sequence_prop_render_scale_( pcos::key::from_string( kOfxImageEffectPropRenderScale ) )
+ , clip_preferences_prop_components_source_( pcos::key::from_string( "OfxImageClipPropComponents_Source" ) )
+ , clip_preferences_prop_components_output_( pcos::key::from_string( "OfxImageClipPropComponents_Output" ) )
+ , clip_preferences_prop_depth_source_( pcos::key::from_string( "OfxImageClipPropDepth_Source" ) )
+ , clip_preferences_prop_depth_output_( pcos::key::from_string( "OfxImageClipPropDepth_Output" ) )
+ , clip_preferences_prop_par_source_( pcos::key::from_string( "OfxImageClipPropPAR_Source" ) )
+ , clip_preferences_prop_par_output_( pcos::key::from_string( "OfxImageClipPropPAR_Output" ) )
+ , clip_preferences_prop_frame_rate_( pcos::key::from_string( kOfxImageEffectPropFrameRate ) )
+ , clip_preferences_prop_field_order_( pcos::key::from_string( kOfxImageClipPropFieldOrder ) )
+ , clip_preferences_prop_premultiplication_( pcos::key::from_string( kOfxImageEffectPropPreMultiplication ) )
+ , clip_preferences_prop_continuous_samples_( pcos::key::from_string( kOfxImageClipPropContinuousSamples ) )
+ , clip_preferences_prop_frame_varying_( pcos::key::from_string( kOfxImageEffectPropFrameRate ) )
{
set_host( );
set_suites( );
@@ -1910,7 +2022,11 @@
// create instance from descriptor
image_effect_instance_.init( image_effect_descriptor_ );
+
plug_->mainEntry( kOfxActionCreateInstance, &image_effect_instance_, 0, 0 );
+
+ set_clip_prefs_filter_ctx( );
+ plug_->mainEntry( kOfxImageEffectActionGetClipPreferences, &image_effect_instance_, 0, ( OfxPropertySetHandle ) &clip_preferences_props_filter_ );
}
virtual ~ofx_filter( )
@@ -1930,38 +2046,50 @@
if( result && result->get_image( ) )
{
il::image_type_ptr src = il::convert( result->get_image( ), L"r8g8b8a8" );
- il::image_type_ptr dst = il::allocate( src->pf( ), src->width( ), src->height( ) );
- image_effect_instance_.set_source( src );
- image_effect_instance_.set_output( dst );
-
- pcos::property_container sequence_in_args;
- sequence_in_args.append( sequence_prop_frame_range_ = pcos::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_ = pcos::double_vec( 2 ) );
+ pcos::property_container render_in_args;
+ pcos::property_container render_out_args;
- pcos::int_vec render_win( 4 );
- render_win[ 0 ] = 0;
- render_win[ 1 ] = 0;
+ pcos::int_vec render_win( 4, 0 );
render_win[ 2 ] = src->width( );
render_win[ 3 ] = src->height( );
- pcos::int_vec render_scale( 2 );
- render_scale[ 0 ] = 1;
- render_scale[ 1 ] = 1;
+ pcos::int_vec render_scale( 2, 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_ = pl::string( kOfxImageFieldNone ) );
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 );
+ render_out_args.append( render_prop_name_ );
+ render_out_args.append( render_prop_time_ );
+
+ OfxStatus is_identity = plug_->mainEntry( kOfxImageEffectActionIsIdentity, &image_effect_instance_,
+ ( OfxPropertySetHandle ) &render_in_args, ( OfxPropertySetHandle ) &render_out_args );
+ if( is_identity == kOfxStatReplyDefault )
+ {
+ src = il::convert( result->get_image( ), L"r8g8b8a8" );
+ il::image_type_ptr dst = il::allocate( src->pf( ), src->width( ), src->height( ) );
- result->set_image( dst );
+ image_effect_instance_.set_source( src );
+ image_effect_instance_.set_output( dst );
+
+ pcos::property_container sequence_in_args;
+ sequence_in_args.append( sequence_prop_frame_range_ = pcos::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_ = pcos::double_vec( 2 ) );
+
+ 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( dst );
+ }
+ else if( is_identity == kOfxStatOK )
+ {
+ // select the appropriate clip from the out_args.
+ }
}
return result;
@@ -2005,11 +2133,17 @@
void set_host_parameters( )
{
+ pl::string_vec pixel_depths( 3 );
+ pixel_depths[ 0 ] = pl::string( kOfxBitDepthByte );
+ pixel_depths[ 1 ] = pl::string( kOfxBitDepthShort );
+ pixel_depths[ 2 ] = pl::string( kOfxBitDepthFloat );
+
host_props_.append( host_prop_type_ = pl::string( kOfxTypeImageEffectHost ) );
host_props_.append( host_prop_name_ = pl::string( "org.openlibraries.ofx_host" ) );
host_props_.append( host_prop_label_ = pl::string( "OpenLibraries OFX host" ) );
host_props_.append( host_prop_is_background_ = 0 );
host_props_.append( host_prop_supports_overlays_ = 1 );
+ host_props_.append( host_prop_supported_pixel_depths_ = pixel_depths );
host_props_.append( host_prop_supports_multiresolution_ = 1 );
host_props_.append( host_prop_supports_tiles_ = 0 );
host_props_.append( host_prop_temporal_clip_access_ = 0 );
@@ -2064,6 +2198,21 @@
}
}
+ void set_clip_prefs_filter_ctx( )
+ {
+ clip_preferences_props_filter_.append( clip_preferences_prop_components_source_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_components_output_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_depth_source_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_depth_output_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_par_source_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_par_output_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_frame_rate_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_field_order_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_premultiplication_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_continuous_samples_ );
+ clip_preferences_props_filter_.append( clip_preferences_prop_frame_varying_ );
+ }
+
private:
OfxPlugin* plug_;
@@ -2084,6 +2233,7 @@
pcos::property host_prop_label_;
pcos::property host_prop_is_background_;
pcos::property host_prop_supports_overlays_;
+ pcos::property host_prop_supported_pixel_depths_;
pcos::property host_prop_supports_multiresolution_;
pcos::property host_prop_supports_tiles_;
pcos::property host_prop_temporal_clip_access_;
@@ -2111,24 +2261,9 @@
private:
image_effect_instance image_effect_instance_;
-// Interact descriptor properties.
-private:
- pcos::property interact_descriptor_prop_has_alpha_;
- pcos::property interact_descriptor_prop_bit_depth_;
-
-// Interact instance properties.
-private:
- pcos::property interact_instance_prop_effect_instance_;
- pcos::property interact_instance_prop_instance_data_;
- pcos::property interact_instance_prop_pixel_scale_;
- pcos::property interact_instance_prop_background_colour_;
- pcos::property interact_instance_prop_viewport_size_;
- pcos::property interact_instance_prop_has_alpha_;
- pcos::property interact_instance_prop_bit_depth_;
- pcos::property interact_instance_prop_slave_to_param_;
-
// Render action properties.
private:
+ pcos::property render_prop_name_;
pcos::property render_prop_time_;
pcos::property render_prop_field_to_render_;
pcos::property render_prop_render_window_;
@@ -2140,6 +2275,21 @@
pcos::property sequence_prop_frame_step_;
pcos::property sequence_prop_is_interactive_;
pcos::property sequence_prop_render_scale_;
+
+// Clip Preferences action properties.
+private:
+ pcos::property_container clip_preferences_props_filter_;
+ pcos::property clip_preferences_prop_components_source_;
+ pcos::property clip_preferences_prop_components_output_;
+ pcos::property clip_preferences_prop_depth_source_;
+ pcos::property clip_preferences_prop_depth_output_;
+ pcos::property clip_preferences_prop_par_source_;
+ pcos::property clip_preferences_prop_par_output_;
+ pcos::property clip_preferences_prop_frame_rate_;
+ pcos::property clip_preferences_prop_field_order_;
+ pcos::property clip_preferences_prop_premultiplication_;
+ pcos::property clip_preferences_prop_continuous_samples_;
+ pcos::property clip_preferences_prop_frame_varying_;
};
namespace
@@ -2269,12 +2419,12 @@
pcos::property src = prop_set->get_property_with_string( property );
if( src.is_a<pl::string_vec>( ) )
{
- pl::string_vec val = src.value<pl::string_vec>( );
- *value = const_cast<char*>( val[ index ].c_str( ) );
+ pl::string_vec* val = src.pointer<pl::string_vec>( );
+ *value = const_cast<char*>( ( *val )[ index ].c_str( ) );
}
else
{
- *value = const_cast<char*>( src.value<opl::string>( ).c_str( ) );
+ *value = const_cast<char*>( src.pointer<opl::string>( )->c_str( ) );
}
return kOfxStatOK;
@@ -2315,6 +2465,35 @@
return get_multiple_property<int, pcos::int_vec>( properties, property, count, value );
}
+ OfxStatus prop_get_dimension( OfxPropertySetHandle properties, const char* property, int* count )
+ {
+ pcos::property_container* prop_set = ( pcos::property_container* ) properties;
+
+ pcos::property src = prop_set->get_property_with_string( property );
+ if( src.is_a<pl::string_vec>( ) )
+ {
+ *count = static_cast<int>( src.value<pl::string_vec>( ).size( ) );
+ }
+ else if( src.is_a<pcos::int_vec>( ) )
+ {
+ *count = static_cast<int>( src.value<pcos::int_vec>( ).size( ) );
+ }
+ else if( src.is_a<pcos::double_vec>( ) )
+ {
+ *count = static_cast<int>( src.value<pcos::double_vec>( ).size( ) );
+ }
+ else if( src.is_a<pcos::void_vec>( ) )
+ {
+ *count = static_cast<int>( src.value<pcos::void_vec>( ).size( ) );
+ }
+ else
+ {
+ *count = 1;
+ }
+
+ return kOfxStatOK;
+ }
+
// Memory Suite.
OfxStatus memory_alloc( void* handle, size_t nbytes, void** allocated_data )
{
@@ -2464,42 +2643,30 @@
pcos::property val = p->get_value( );
pl::string type = p->get_type( );
- if( type == kOfxParamTypeInteger )
+ if( type == kOfxParamTypeInteger || type == kOfxParamTypeBoolean || type == kOfxParamTypeChoice )
{
int* v;
if( ( v = va_arg( ap, int* ) ) != 0 )
*v = val.value<int>( );
}
- else if( type == kOfxParamTypeInteger2D )
+ else if( type == kOfxParamTypeInteger2D || type == kOfxParamTypeInteger3D )
{
+ int* v, i = 0;
+ while( ( v = va_arg( ap, int* ) ) != 0 )
+ *v = val.value<pcos::int_vec>( )[ i++ ];
}
- else if( type == kOfxParamTypeInteger3D )
- {
- }
else if( type == kOfxParamTypeDouble )
{
double* v;
if( ( v = va_arg( ap, double* ) ) != 0 )
*v = val.value<double>( );
}
- else if( type == kOfxParamTypeDouble2D )
+ else if( type == kOfxParamTypeDouble2D || type == kOfxParamTypeDouble3D || type == kOfxParamTypeRGB || type == kOfxParamTypeRGBA )
{
+ double* v, i = 0;
+ while( ( v = va_arg( ap, double* ) ) != 0 )
+ *v = val.value<pcos::double_vec>( )[ i++ ];
}
- else if( type == kOfxParamTypeDouble3D )
- {
- }
- else if( type == kOfxParamTypeRGB )
- {
- }
- else if( type == kOfxParamTypeRGBA )
- {
- }
- else if( type == kOfxParamTypeBoolean )
- {
- }
- else if( type == kOfxParamTypeChoice )
- {
- }
else if( type == kOfxParamTypeGroup )
{
}
@@ -2531,42 +2698,30 @@
pcos::property val = p->get_value( );
pl::string type = p->get_type( );
- if( type == kOfxParamTypeInteger )
+ if( type == kOfxParamTypeInteger || type == kOfxParamTypeBoolean || type == kOfxParamTypeChoice )
{
int* v;
if( ( v = va_arg( ap, int* ) ) != 0 )
*v = val.value<int>( );
}
- else if( type == kOfxParamTypeInteger2D )
+ else if( type == kOfxParamTypeInteger2D || type == kOfxParamTypeInteger3D )
{
+ int* v, i = 0;
+ while( ( v = va_arg( ap, int* ) ) != 0 )
+ *v = val.value<pcos::int_vec>( )[ i++ ];
}
- else if( type == kOfxParamTypeInteger3D )
- {
- }
else if( type == kOfxParamTypeDouble )
{
double* v;
if( ( v = va_arg( ap, double* ) ) != 0 )
*v = val.value<double>( );
}
- else if( type == kOfxParamTypeDouble2D )
+ else if( type == kOfxParamTypeDouble2D || type == kOfxParamTypeDouble3D || type == kOfxParamTypeRGB || type == kOfxParamTypeRGBA )
{
+ double* v, i = 0;
+ while( ( v = va_arg( ap, double* ) ) != 0 )
+ *v = val.value<pcos::double_vec>( )[ i++ ];
}
- else if( type == kOfxParamTypeDouble3D )
- {
- }
- else if( type == kOfxParamTypeRGB )
- {
- }
- else if( type == kOfxParamTypeRGBA )
- {
- }
- else if( type == kOfxParamTypeBoolean )
- {
- }
- else if( type == kOfxParamTypeChoice )
- {
- }
else if( type == kOfxParamTypeGroup )
{
}
@@ -2608,7 +2763,7 @@
pcos::property val = p->get_value( );
pl::string type = p->get_type( );
- if( type == kOfxParamTypeInteger )
+ if( type == kOfxParamTypeInteger || type == kOfxParamTypeBoolean || type == kOfxParamTypeChoice )
{
int v;
if( ( v = va_arg( ap, int ) ) != 0 )
@@ -2638,12 +2793,6 @@
else if( type == kOfxParamTypeRGBA )
{
}
- else if( type == kOfxParamTypeBoolean )
- {
- }
- else if( type == kOfxParamTypeChoice )
- {
- }
else if( type == kOfxParamTypeGroup )
{
}
@@ -2732,42 +2881,42 @@
return kOfxStatOK;
}
- OfxStatus param_get_num_keys( OfxParamHandle param, unsigned int* num_keys )
+ OfxStatus param_get_num_keys( OfxParamHandle, unsigned int* )
{
return kOfxStatOK;
}
- OfxStatus param_get_key_time( OfxParamHandle param, unsigned int nth_key, OfxTime* time )
+ OfxStatus param_get_key_time( OfxParamHandle, unsigned int, OfxTime* )
{
return kOfxStatOK;
}
- OfxStatus param_get_key_index( OfxParamHandle param, OfxTime time, int direction, int* index )
+ OfxStatus param_get_key_index( OfxParamHandle, OfxTime, int, int* )
{
return kOfxStatOK;
}
- OfxStatus param_delete_key( OfxParamHandle param, OfxTime time )
+ OfxStatus param_delete_key( OfxParamHandle, OfxTime )
{
return kOfxStatOK;
}
- OfxStatus param_delete_all_keys( OfxParamHandle param )
+ OfxStatus param_delete_all_keys( OfxParamHandle )
{
return kOfxStatOK;
}
- OfxStatus param_copy( OfxParamHandle param_to, OfxParamHandle param_from, OfxTime dst_offset, OfxRangeD* frame_range )
+ OfxStatus param_copy( OfxParamHandle, OfxParamHandle, OfxTime, OfxRangeD* )
{
return kOfxStatOK;
}
- OfxStatus param_edit_begin( OfxParamSetHandle param_set, const char* name )
+ OfxStatus param_edit_begin( OfxParamSetHandle, const char* )
{
return kOfxStatOK;
}
- OfxStatus param_edit_end( OfxParamSetHandle param_set )
+ OfxStatus param_edit_end( OfxParamSetHandle )
{
return kOfxStatOK;
}
@@ -2863,33 +3012,33 @@
return kOfxStatOK;
}
- int abort( OfxImageEffectHandle image_effect )
+ int abort( OfxImageEffectHandle )
{
return 0;
}
- OfxStatus image_memory_alloc( OfxImageEffectHandle instance_handle, size_t nbytes, OfxImageMemoryHandle* memory_handle )
+ OfxStatus image_memory_alloc( OfxImageEffectHandle, size_t, OfxImageMemoryHandle* )
{
return kOfxStatOK;
}
- OfxStatus image_memory_free( OfxImageMemoryHandle memory_handle )
+ OfxStatus image_memory_free( OfxImageMemoryHandle )
{
return kOfxStatOK;
}
- OfxStatus image_memory_lock( OfxImageMemoryHandle memory_handle, void** returned_ptr )
+ OfxStatus image_memory_lock( OfxImageMemoryHandle, void** )
{
return kOfxStatOK;
}
- OfxStatus image_memory_unlock( OfxImageMemoryHandle memory_handle )
+ OfxStatus image_memory_unlock( OfxImageMemoryHandle )
{
return kOfxStatOK;
}
// Message Suite
- OfxStatus message( void* handle, const char* message_type, const char* message_id, const char* format, ... )
+ OfxStatus message( void*, const char*, const char*, const char*, ... )
{
return kOfxStatOK;
}
@@ -2911,7 +3060,7 @@
property_suite.propGetDoubleN = prop_get_doubleN;
property_suite.propGetIntN = prop_get_intN;
//property_suite.propReset = prop_reset;
- //property_suite.propGetDimension = prop_get_dimension;
+ property_suite.propGetDimension = prop_get_dimension;
}
void set_image_effect_suite( OfxImageEffectSuiteV1& image_effect_suite )
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-05-04 17:24:48 UTC (rev 113)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-05-09 00:29:07 UTC (rev 114)
@@ -689,6 +689,11 @@
{
return boost::apply_visitor( convert_to<T>( ), impl_->value );
}
+
+template < typename T > T* property::pointer() const
+{
+ return boost::get<T>( &impl_->value );
+}
template < typename T > bool property::is_a() const
{
@@ -725,6 +730,11 @@
template OPENPLUGINLIB_DECLSPEC void* property::value<void*>( ) const;
template OPENPLUGINLIB_DECLSPEC void_vec property::value<void_vec>( ) const;
+template OPENPLUGINLIB_DECLSPEC wstring* property::pointer< wstring >() const;
+template OPENPLUGINLIB_DECLSPEC string* property::pointer< string >() const;
+template OPENPLUGINLIB_DECLSPEC wstring_vec* property::pointer< wstring_vec >() const;
+template OPENPLUGINLIB_DECLSPEC string_vec* property::pointer< string_vec >() const;
+
template OPENPLUGINLIB_DECLSPEC void property::set< int >( const int& );
template OPENPLUGINLIB_DECLSPEC void property::set< unsigned int >( const unsigned int& );
template OPENPLUGINLIB_DECLSPEC void property::set< double >( const double& );
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp 2007-05-04 17:24:48 UTC (rev 113)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp 2007-05-09 00:29:07 UTC (rev 114)
@@ -89,6 +89,9 @@
/// we try to extract the wrong value type
template<typename T>
T value() const;
+
+ template<typename T>
+ T* pointer() const;
/// query the type held by the property
template<typename T>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|