[Hdrflow-svn] SF.net SVN: hdrflow: [123] lib
Status: Pre-Alpha
Brought to you by:
glslang
|
From: <gl...@us...> - 2007-05-18 22:43:08
|
Revision: 123
http://hdrflow.svn.sourceforge.net/hdrflow/?rev=123&view=rev
Author: glslang
Date: 2007-05-18 15:43:06 -0700 (Fri, 18 May 2007)
Log Message:
-----------
+initial pcos refactoring and raw filter
Modified Paths:
--------------
lib/extras/src/raw/raw.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp
lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp
lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp
lib/openlibraries/src/openpluginlib/py/pcos/property.cpp
Modified: lib/extras/src/raw/raw.cpp
===================================================================
--- lib/extras/src/raw/raw.cpp 2007-05-17 20:17:44 UTC (rev 122)
+++ lib/extras/src/raw/raw.cpp 2007-05-18 22:43:06 UTC (rev 123)
@@ -11,29 +11,76 @@
#include <windows.h>
#endif
-#include <openimagelib/il/openimagelib_plugin.hpp>
+#include <openmedialib/ml/openmedialib_plugin.hpp>
namespace pl = olib::openpluginlib;
namespace il = olib::openimagelib::il;
+namespace ml = olib::openmedialib::ml;
namespace fs = boost::filesystem;
+namespace pcos = olib::openpluginlib::pcos;
namespace extras { namespace hdrflow { namespace raw {
namespace
{
- il::image_type_ptr load( const fs::path& path )
- {
- return il::image_type_ptr( );
- }
}
-class raw_plugin : public il::openimagelib_plugin
+class raw_input : public ml::input_type
{
public:
- virtual il::image_type_ptr load( const fs::path& path ) { return load( path ); }
- virtual bool store( const fs::path&, const il::image_type_ptr& ) { return false; }
+ explicit raw_input( const pl::wstring& resource )
+ : verbose_( pcos::key::from_string( "verbose" ) )
+ , thumbnail_( pcos::key::from_string( "thumbnail" ) )
+ , camera_white_balance_( pcos::key::from_string( "camera_white_balance" ) )
+ , average_white_balance_( pcos::key::from_string( "average_white_balance" ) )
+ , average_grey_box_white_balance_( pcos::key::from_string( "average_grey_box_white_balance" ) )
+ , user_white_balance_( pcos::key::from_string( "user_white_balance" ) )
+ , brightness_( pcos::key::from_string( "brightness" ) )
+ , wavelet_denoising_threshold_( pcos::key::from_string( "wavelet_denoising_threshold" ) )
+ , black_point_( pcos::key::from_string( "black_point" ) )
+ , highlight_mode_( pcos::key::from_string( "highlight_mode" ) )
+ , flip_image_( pcos::key::from_string( "flip_image" ) )
+ , output_colorspace_( pcos::key::from_string( "output_colorspace" ) )
+ , document_mode_( pcos::key::from_string( "document_mode" ) )
+ , stretch_rotate_( pcos::key::from_string( "stretch_rotate" ) )
+ , interpolation_quality_( pcos::key::from_string( "interpolation_quality" ) )
+ , half_size_( pcos::key::from_string( "half_size" ) )
+ , four_colour_interpolation_( pcos::key::from_string( "four_colour_interpolation" ) )
+ , which_raw_( pcos::key::from_string( "which_raw" ) )
+ , sRGB_output_( pcos::key::from_string( "sRGB_output" ) )
+ , tiff_output_( pcos::key::from_string( "tiff_output" ) )
+ { }
+
+private:
+ pcos::property verbose_;
+ pcos::property thumbnail_;
+ pcos::property camera_white_balance_;
+ pcos::property average_white_balance_;
+ pcos::property average_grey_box_white_balance_;
+ pcos::property user_white_balance_;
+ pcos::property brightness_;
+ pcos::property wavelet_denoising_threshold_;
+ pcos::property black_point_;
+ pcos::property highlight_mode_;
+ pcos::property flip_image_;
+ pcos::property output_colorspace_;
+ pcos::property document_mode_;
+ pcos::property stretch_rotate_;
+ pcos::property interpolation_quality_;
+ pcos::property half_size_;
+ pcos::property four_colour_interpolation_;
+ pcos::property which_raw_;
+ pcos::property sRGB_output_;
+ pcos::property tiff_output_;
};
+class raw_plugin : public ml::openmedialib_plugin
+{
+public:
+ explicit raw_plugin( )
+ { }
+};
+
} } }
extern "C"
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-05-17 20:17:44 UTC (rev 122)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.cpp 2007-05-18 22:43:06 UTC (rev 123)
@@ -12,7 +12,6 @@
#include <openpluginlib/pl/utf8_utils.hpp>
#include <openpluginlib/pl/pcos/property.hpp>
#include <openpluginlib/pl/pcos/subject.hpp>
-#include <openpluginlib/pl/pcos/property_container.hpp>
namespace opl = olib::openpluginlib;
@@ -564,7 +563,6 @@
property_impl* result = new property_impl( key_ );
result->value = value;
result->always_notify = always_notify;
- result->container_ = container_;
return result;
}
@@ -573,7 +571,6 @@
any value;
bool always_notify;
subject subject_;
- property_container container_;
};
property property::NULL_PROPERTY;
@@ -615,21 +612,6 @@
impl_->subject_.unblock( obs );
}
-property property::get_property_with_string( const char* k ) const
-{
- return impl_->container_.get_property_with_string( k );
-}
-
-property property::get_property_with_key( const key& k ) const
-{
- return impl_->container_.get_property_with_key( k );
-}
-
-key_vector property::get_keys() const
-{
- return impl_->container_.get_keys();
-}
-
property* property::clone() const
{
property* result = new property( get_key() );
@@ -711,7 +693,6 @@
void property::accept( visitor& v )
{
v.visit_property( *this );
- v.visit_property_container( impl_->container_ );
}
bool property::valid() const
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp 2007-05-17 20:17:44 UTC (rev 122)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property.hpp 2007-05-18 22:43:06 UTC (rev 123)
@@ -57,11 +57,6 @@
void block( boost::shared_ptr< observer > );
void unblock( boost::shared_ptr< observer > );
- // iproperty_container interface
- property get_property_with_string( const char* k ) const;
- property get_property_with_key( const key& k ) const;
- key_vector get_keys( ) const;
-
// clonable interface
property* clone( ) const;
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp 2007-05-17 20:17:44 UTC (rev 122)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/property_container.cpp 2007-05-18 22:43:06 UTC (rev 123)
@@ -20,17 +20,17 @@
class forwarding_observer : public observer
{
public:
- forwarding_observer( isubject* forwardTo )
+ forwarding_observer( subject* forwardTo )
: forwardTo_( forwardTo )
- {}
+ { }
- virtual void updated( isubject* )
+ virtual void updated(isubject* )
{
forwardTo_->update();
}
private:
- isubject* forwardTo_;
+ subject* forwardTo_;
};
/// inner class
Modified: lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp
===================================================================
--- lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp 2007-05-17 20:17:44 UTC (rev 122)
+++ lib/openlibraries/src/openpluginlib/pl/pcos/subject.hpp 2007-05-18 22:43:06 UTC (rev 123)
@@ -17,30 +17,30 @@
/// A standard subject to be part of the observer pattern.
/// The observer pointers are held by shared references.
-class OPENPLUGINLIB_DECLSPEC subject : public isubject
+class OPENPLUGINLIB_DECLSPEC subject// : public isubject
{
public:
- subject();
+ explicit subject();
virtual ~subject();
//// attach an observer to this subject
- void attach( boost::shared_ptr< observer > );
+ virtual void attach( boost::shared_ptr< observer > );
/// detach an observer from this subject
- void detach( boost::shared_ptr< observer > );
+ virtual void detach( boost::shared_ptr< observer > );
/// notify all observers
- void update();
+ virtual void update();
/// block notification for an observer; this is
/// a counted block operation i.e. if you call
/// block n times on the same observer, no
/// notification will be given until unblock()
/// has been called a matching number of times.
- void block( boost::shared_ptr< observer > );
+ virtual void block( boost::shared_ptr< observer > );
/// unblock notification for an observer
- void unblock( boost::shared_ptr< observer > );
+ virtual void unblock( boost::shared_ptr< observer > );
private:
subject& operator=( const subject& );
Modified: lib/openlibraries/src/openpluginlib/py/pcos/property.cpp
===================================================================
--- lib/openlibraries/src/openpluginlib/py/pcos/property.cpp 2007-05-17 20:17:44 UTC (rev 122)
+++ lib/openlibraries/src/openpluginlib/py/pcos/property.cpp 2007-05-18 22:43:06 UTC (rev 123)
@@ -164,11 +164,6 @@
.def( "is_a_uint_list", is_a_uint_list )
.def( "is_a_double_list", is_a_double_list )
.def( "is_a_bool", is_a_bool )
- .def( "get_property", &pcos::property::get_property_with_string, py::return_value_policy< py::return_by_value >() )
- .def( "get_property", &pcos::property::get_property_with_key, py::return_value_policy< py::return_by_value >() )
- .def( "get_keys", &pcos::property::get_keys )
-// .def( "append", &pcos::property::append )
-// .def( "remove", &pcos::property::remove )
.def( "accept", &pcos::property::accept )
.def( "clone", &pcos::property::clone, py::return_value_policy< py::manage_new_object >() );
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|