From 1eba4547e1b09cf58fa00f9a94ef7f79686112a0 Mon Sep 17 00:00:00 2001 From: Matt Leotta Date: Sun, 5 Sep 2010 21:05:58 -0400 Subject: [PATCH] Renamed vpro to spl avoid a conflict with vpro in VXL. --- CMakeLists.txt | 2 +- dml/CMakeLists.txt | 2 +- dml/dml_vehicle_fit_video.cxx | 10 +- dml/dml_vehicle_fit_video.h | 2 +- dml/dml_vehicle_tracker.cxx | 156 +++++++------- dml/dml_vehicle_tracker.h | 24 +-- dml/python/py_dml_manager.cxx | 12 +- gui/pca_vehicle_manager.cxx | 48 ++--- spl/CMakeLists.txt | 58 +++++ .../Templates/spl_parameters+bool-.cxx | 4 +- .../Templates/spl_parameters+float-.cxx | 4 +- .../Templates/spl_parameters+int-.cxx | 4 +- .../spl_parameters+spl_filepath-.cxx | 4 +- .../Templates/spl_parameters+vcl_string-.cxx | 4 +- .../Templates/vbl_smart_ptr+spl_observer-.cxx | 4 +- .../vbl_smart_ptr+spl_parameters-.cxx | 4 +- .../Templates/vbl_smart_ptr+spl_process-.cxx | 8 +- .../Templates/vbl_smart_ptr+spl_storage-.cxx | 4 +- {vpro => spl}/filters/CMakeLists.txt | 8 +- {vpro => spl}/filters/bbgm_filters.h | 30 +-- .../filters/vidl_frame_to_resource.cxx | 14 +- .../filters/vidl_frame_to_resource.h | 8 +- {vpro => spl}/filters/vidl_multi_source.cxx | 10 +- {vpro => spl}/filters/vidl_multi_source.h | 8 +- .../filters/vidl_resource_to_frame.cxx | 10 +- .../filters/vidl_resource_to_frame.h | 8 +- {vpro => spl}/filters/vidl_sink.cxx | 12 +- {vpro => spl}/filters/vidl_sink.h | 10 +- {vpro => spl}/filters/vidl_source.cxx | 10 +- {vpro => spl}/filters/vidl_source.h | 10 +- {vpro => spl}/filters/vil_convert_filters.h | 16 +- {vpro => spl}/filters/vil_diff_process.cxx | 18 +- {vpro => spl}/filters/vil_diff_process.h | 16 +- {vpro => spl}/filters/vil_gauss_filter.h | 18 +- .../filters/vil_gaussian_blur_process.cxx | 18 +- .../filters/vil_gaussian_blur_process.h | 16 +- {vpro => spl}/filters/vil_grad_sqr_filter.h | 10 +- {vpro => spl}/filters/vil_math_filters.h | 16 +- .../filters/vil_monotone_process.cxx | 18 +- {vpro => spl}/filters/vil_monotone_process.h | 16 +- .../filters/vil_morphology_filters.cxx | 10 +- .../filters/vil_morphology_filters.h | 12 +- {vpro => spl}/filters/vil_sobel_1x3_filter.h | 10 +- .../filters/vil_subpix_edge_filter.h | 10 +- .../filters/vil_transform3_1_filter.h | 10 +- spl/introduction_doxy.txt | 15 ++ .../spl_basic_processes.h | 80 +++---- vpro/vpro_config.h.in => spl/spl_config.h.in | 12 +- .../spl_connector.cxx | 26 +-- vpro/vpro_connector.h => spl/spl_connector.h | 30 +-- .../spl_connector_sptr.h | 16 +- vpro/vpro_delay.cxx => spl/spl_delay.cxx | 50 ++--- vpro/vpro_delay.h => spl/spl_delay.h | 40 ++-- .../spl_executive.cxx | 90 ++++---- vpro/vpro_executive.h => spl/spl_executive.h | 46 ++-- vpro/vpro_fwd.h => spl/spl_fwd.h | 18 +- .../spl_ios_processes.h | 54 ++--- vpro/vpro_mutex.cxx => spl/spl_mutex.cxx | 28 +-- vpro/vpro_mutex.h => spl/spl_mutex.h | 14 +- vpro/vpro_observer.h => spl/spl_observer.h | 24 +-- .../spl_observer_sptr.h | 34 +-- .../spl_parameters.cxx | 62 +++--- .../vpro_parameters.h => spl/spl_parameters.h | 90 ++++---- .../spl_parameters.txx | 24 +-- .../spl_parameters_sptr.h | 12 +- vpro/vpro_process.cxx => spl/spl_process.cxx | 198 +++++++++--------- vpro/vpro_process.h => spl/spl_process.h | 124 +++++------ .../spl_process_factory.cxx | 26 +-- .../spl_process_factory.h | 34 +-- .../spl_process_sptr.h | 12 +- vpro/vpro_storage.h => spl/spl_storage.h | 48 ++--- .../spl_storage_sptr.h | 12 +- .../spl_try_option.cxx | 32 +-- .../vpro_try_option.h => spl/spl_try_option.h | 22 +- .../spl_vsl_processes.h | 48 ++--- spl/tests/CMakeLists.txt | 28 +++ spl/tests/spl_sample_processes.cxx | 44 ++++ .../tests/spl_sample_processes.h | 64 +++--- {vpro => spl}/tests/test_delay_filter.cxx | 22 +- {vpro => spl}/tests/test_driver.cxx | 0 spl/tests/test_include.cxx | 26 +++ {vpro => spl}/tests/test_process.cxx | 36 ++-- {vpro => spl}/tests/test_process_factory.cxx | 8 +- {vpro => spl}/tests/test_storage.cxx | 4 +- {vpro => spl}/vis/CMakeLists.txt | 12 +- .../vis/spl_basic_gui_observers.h | 20 +- .../vis/spl_run_tableau.cxx | 38 ++-- .../vis/spl_run_tableau.h | 32 +-- .../vis/spl_run_tableau_sptr.h | 14 +- vpro/CMakeLists.txt | 58 ----- vpro/introduction_doxy.txt | 15 -- vpro/tests/CMakeLists.txt | 28 --- vpro/tests/test_include.cxx | 26 --- vpro/tests/vpro_sample_processes.cxx | 44 ---- 94 files changed, 1273 insertions(+), 1273 deletions(-) create mode 100644 spl/CMakeLists.txt rename vpro/Templates/vpro_parameters+int-.cxx => spl/Templates/spl_parameters+bool-.cxx (76%) rename vpro/Templates/vpro_parameters+bool-.cxx => spl/Templates/spl_parameters+float-.cxx (76%) rename vpro/Templates/vpro_parameters+float-.cxx => spl/Templates/spl_parameters+int-.cxx (75%) rename vpro/Templates/vpro_parameters+vpro_filepath-.cxx => spl/Templates/spl_parameters+spl_filepath-.cxx (73%) rename vpro/Templates/vpro_parameters+vcl_string-.cxx => spl/Templates/spl_parameters+vcl_string-.cxx (76%) rename vpro/Templates/vbl_smart_ptr+vpro_observer-.cxx => spl/Templates/vbl_smart_ptr+spl_observer-.cxx (77%) rename vpro/Templates/vbl_smart_ptr+vpro_parameters-.cxx => spl/Templates/vbl_smart_ptr+spl_parameters-.cxx (76%) rename vpro/Templates/vbl_smart_ptr+vpro_process-.cxx => spl/Templates/vbl_smart_ptr+spl_process-.cxx (65%) rename vpro/Templates/vbl_smart_ptr+vpro_storage-.cxx => spl/Templates/vbl_smart_ptr+spl_storage-.cxx (78%) rename {vpro => spl}/filters/CMakeLists.txt (88%) rename {vpro => spl}/filters/bbgm_filters.h (89%) rename {vpro => spl}/filters/vidl_frame_to_resource.cxx (91%) rename {vpro => spl}/filters/vidl_frame_to_resource.h (94%) rename {vpro => spl}/filters/vidl_multi_source.cxx (86%) rename {vpro => spl}/filters/vidl_multi_source.h (89%) rename {vpro => spl}/filters/vidl_resource_to_frame.cxx (83%) rename {vpro => spl}/filters/vidl_resource_to_frame.h (82%) rename {vpro => spl}/filters/vidl_sink.cxx (79%) rename {vpro => spl}/filters/vidl_sink.h (82%) rename {vpro => spl}/filters/vidl_source.cxx (80%) rename {vpro => spl}/filters/vidl_source.h (82%) rename {vpro => spl}/filters/vil_convert_filters.h (82%) rename {vpro => spl}/filters/vil_diff_process.cxx (80%) rename {vpro => spl}/filters/vil_diff_process.h (72%) rename {vpro => spl}/filters/vil_gauss_filter.h (77%) rename {vpro => spl}/filters/vil_gaussian_blur_process.cxx (83%) rename {vpro => spl}/filters/vil_gaussian_blur_process.h (72%) rename {vpro => spl}/filters/vil_grad_sqr_filter.h (92%) rename {vpro => spl}/filters/vil_math_filters.h (85%) rename {vpro => spl}/filters/vil_monotone_process.cxx (82%) rename {vpro => spl}/filters/vil_monotone_process.h (76%) rename {vpro => spl}/filters/vil_morphology_filters.cxx (92%) rename {vpro => spl}/filters/vil_morphology_filters.h (82%) rename {vpro => spl}/filters/vil_sobel_1x3_filter.h (88%) rename {vpro => spl}/filters/vil_subpix_edge_filter.h (89%) rename {vpro => spl}/filters/vil_transform3_1_filter.h (92%) create mode 100644 spl/introduction_doxy.txt rename vpro/vpro_basic_processes.h => spl/spl_basic_processes.h (68%) rename vpro/vpro_config.h.in => spl/spl_config.h.in (72%) rename vpro/vpro_connector.cxx => spl/spl_connector.cxx (63%) rename vpro/vpro_connector.h => spl/spl_connector.h (65%) rename vpro/vpro_connector_sptr.h => spl/spl_connector_sptr.h (66%) rename vpro/vpro_delay.cxx => spl/spl_delay.cxx (73%) rename vpro/vpro_delay.h => spl/spl_delay.h (51%) rename vpro/vpro_executive.cxx => spl/spl_executive.cxx (62%) rename vpro/vpro_executive.h => spl/spl_executive.h (58%) rename vpro/vpro_fwd.h => spl/spl_fwd.h (70%) rename vpro/vpro_ios_processes.h => spl/spl_ios_processes.h (74%) rename vpro/vpro_mutex.cxx => spl/spl_mutex.cxx (67%) rename vpro/vpro_mutex.h => spl/spl_mutex.h (86%) rename vpro/vpro_observer.h => spl/spl_observer.h (69%) rename vpro/vpro_observer_sptr.h => spl/spl_observer_sptr.h (52%) rename vpro/vpro_parameters.cxx => spl/spl_parameters.cxx (56%) rename vpro/vpro_parameters.h => spl/spl_parameters.h (76%) rename vpro/vpro_parameters.txx => spl/spl_parameters.txx (64%) rename vpro/vpro_parameters_sptr.h => spl/spl_parameters_sptr.h (73%) rename vpro/vpro_process.cxx => spl/spl_process.cxx (64%) rename vpro/vpro_process.h => spl/spl_process.h (61%) rename vpro/vpro_process_factory.cxx => spl/spl_process_factory.cxx (65%) rename vpro/vpro_process_factory.h => spl/spl_process_factory.h (64%) rename vpro/vpro_process_sptr.h => spl/spl_process_sptr.h (75%) rename vpro/vpro_storage.h => spl/spl_storage.h (61%) rename vpro/vpro_storage_sptr.h => spl/spl_storage_sptr.h (75%) rename vpro/vpro_try_option.cxx => spl/spl_try_option.cxx (68%) rename vpro/vpro_try_option.h => spl/spl_try_option.h (72%) rename vpro/vpro_vsl_processes.h => spl/spl_vsl_processes.h (70%) create mode 100644 spl/tests/CMakeLists.txt create mode 100644 spl/tests/spl_sample_processes.cxx rename vpro/tests/vpro_sample_processes.h => spl/tests/spl_sample_processes.h (71%) rename {vpro => spl}/tests/test_delay_filter.cxx (64%) rename {vpro => spl}/tests/test_driver.cxx (100%) create mode 100644 spl/tests/test_include.cxx rename {vpro => spl}/tests/test_process.cxx (60%) rename {vpro => spl}/tests/test_process_factory.cxx (76%) rename {vpro => spl}/tests/test_storage.cxx (82%) rename {vpro => spl}/vis/CMakeLists.txt (50%) rename vpro/vis/vpro_basic_gui_observers.h => spl/vis/spl_basic_gui_observers.h (66%) rename vpro/vis/vpro_run_tableau.cxx => spl/vis/spl_run_tableau.cxx (73%) rename vpro/vis/vpro_run_tableau.h => spl/vis/spl_run_tableau.h (62%) rename vpro/vis/vpro_run_tableau_sptr.h => spl/vis/spl_run_tableau_sptr.h (53%) delete mode 100644 vpro/CMakeLists.txt delete mode 100644 vpro/introduction_doxy.txt delete mode 100644 vpro/tests/CMakeLists.txt delete mode 100644 vpro/tests/test_include.cxx delete mode 100644 vpro/tests/vpro_sample_processes.cxx diff --git a/CMakeLists.txt b/CMakeLists.txt index bed55fc..66e1e8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,7 +31,7 @@ if(VXL_FOUND) include_directories(SYSTEM ${VXL_BRL_INCLUDE_DIR}) include_directories(SYSTEM ${VXL_GEL_INCLUDE_DIR}/mrc) - add_subdirectory(vpro) + add_subdirectory(spl) add_subdirectory(klt) add_subdirectory(dml) add_subdirectory(cmd) diff --git a/dml/CMakeLists.txt b/dml/CMakeLists.txt index c4a126b..285fd0b 100644 --- a/dml/CMakeLists.txt +++ b/dml/CMakeLists.txt @@ -33,7 +33,7 @@ set(dml_sources add_library(dml ${dml_sources}) -target_link_libraries(dml vpro vpro_filters bbgm rrel imesh_algo vpgl vil_algo klt) +target_link_libraries(dml spl spl_filters bbgm rrel imesh_algo vpgl vil_algo klt) if( BUILD_TESTING ) add_subdirectory(tests) diff --git a/dml/dml_vehicle_fit_video.cxx b/dml/dml_vehicle_fit_video.cxx index 17ba250..b8df2b9 100644 --- a/dml/dml_vehicle_fit_video.cxx +++ b/dml/dml_vehicle_fit_video.cxx @@ -18,25 +18,25 @@ #include #include #include -#include +#include #include -#include +#include #include #include //: update the tracker with the edge map -class dml_edgemap_observer: public vpro_observer +class dml_edgemap_observer: public spl_observer { public: dml_edgemap_observer(dml_vehicle_fit_video& opt) : optimizer(opt) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(data); - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vil_image_resource_sptr)); vil_image_resource_sptr edge_rsc = data->data(); if(edge_rsc){ diff --git a/dml/dml_vehicle_fit_video.h b/dml/dml_vehicle_fit_video.h index 55a117c..62db741 100644 --- a/dml/dml_vehicle_fit_video.h +++ b/dml/dml_vehicle_fit_video.h @@ -68,7 +68,7 @@ class dml_vehicle_fit_video : public dml_vehicle_fit //: advance the video and process on frame - vpro_signal process_once() { return tracker_.process_once(); } + spl_signal process_once() { return tracker_.process_once(); } //: enable tracking (otherwise only BG modeling is run) void enable_tracking(bool enable) { tracker_.enable_tracking(enable); } diff --git a/dml/dml_vehicle_tracker.cxx b/dml/dml_vehicle_tracker.cxx index 4f960ec..bc78707 100644 --- a/dml/dml_vehicle_tracker.cxx +++ b/dml/dml_vehicle_tracker.cxx @@ -18,17 +18,17 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -193,7 +193,7 @@ void vpdt_update_gaussian(vpdt_gaussian, //: Extract the subpixel locations and an existence mask -class extract_subpix_filter : public vpro_filter +class extract_subpix_filter : public spl_filter { public: @@ -204,16 +204,16 @@ class extract_subpix_filter : public vpro_filter virtual ~extract_subpix_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr image = input(0); if(!image) - return VPRO_INVALID; + return SPL_INVALID; vil_image_view edge_map = image->get_view(); if(!edge_map) - return VPRO_INVALID; + return SPL_INVALID; const unsigned int ni = edge_map.ni(); const unsigned int nj = edge_map.nj(); @@ -244,14 +244,14 @@ class extract_subpix_filter : public vpro_filter output(0,vil_new_image_resource_of_view(edgels)); output(1,vil_new_image_resource_of_view(mask)); - return VPRO_VALID; + return SPL_VALID; } }; //: Estimate a translation to align the edge maps -class est_translation_filter : public vpro_filter +class est_translation_filter : public spl_filter { public: @@ -262,25 +262,25 @@ class est_translation_filter : public vpro_filter virtual ~est_translation_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr last_image = input(0); if(!last_image){ vcl_cout << "first image"<< vcl_endl; output(0,vnl_vector_fixed(0,0)); - return VPRO_VALID; + return SPL_VALID; } assert(input_type_id(1) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr curr_image = input(1); if(!curr_image) - return VPRO_INVALID; + return SPL_INVALID; vil_image_view last = last_image->get_view(); vil_image_view curr = curr_image->get_view(); if(!last || !curr) - return VPRO_INVALID; + return SPL_INVALID; const unsigned int ni = last.ni(); const unsigned int nj = last.nj(); @@ -325,14 +325,14 @@ class est_translation_filter : public vpro_filter output(0,vnl_vector_fixed(ox,oy)); - return VPRO_VALID; + return SPL_VALID; } }; //: Align the edge maps with a translation -class edgemap_translation_filter : public vpro_filter +class edgemap_translation_filter : public spl_filter { public: @@ -343,12 +343,12 @@ class edgemap_translation_filter : public vpro_filter virtual ~edgemap_translation_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr image = input(0); if(!image) - return VPRO_INVALID; + return SPL_INVALID; vil_image_view in_edge_map = image->get_view(); @@ -373,14 +373,14 @@ class edgemap_translation_filter : public vpro_filter output(0, vil_new_image_resource_of_view(out_edge_map)); - return VPRO_VALID; + return SPL_VALID; } }; //: mask some edges in an edgemap -class mask_edgemap_filter : public vpro_filter +class mask_edgemap_filter : public spl_filter { public: @@ -391,19 +391,19 @@ class mask_edgemap_filter : public vpro_filter virtual ~mask_edgemap_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr image = input(0); if(!image) - return VPRO_INVALID; + return SPL_INVALID; vil_image_view in_edge_map = image->get_view(); assert(input_type_id(1) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr mask_image = input(1); if(!mask_image) - return VPRO_INVALID; + return SPL_INVALID; vil_image_view mask = mask_image->get_view(); @@ -429,21 +429,21 @@ class mask_edgemap_filter : public vpro_filter output(0, vil_new_image_resource_of_view(out_edge_map)); - return VPRO_VALID; + return SPL_VALID; } }; //: Suppress all non-maximal edges and estimate subpixel locations -class vil_subpix_point_filter : public vpro_filter +class vil_subpix_point_filter : public spl_filter { public: //: Constructor vil_subpix_point_filter(float threshold=10.0f) : threshold_(threshold) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -457,7 +457,7 @@ class vil_subpix_point_filter : public vpro_filter pts[i].set(px[i],py[i]); output(0, pts); - return VPRO_VALID; + return SPL_VALID; } float threshold_; @@ -466,7 +466,7 @@ class vil_subpix_point_filter : public vpro_filter //: detect blobs in a BG detection image -class blob_detector_filter : public vpro_filter +class blob_detector_filter : public spl_filter { public: @@ -477,12 +477,12 @@ class blob_detector_filter : public vpro_filter virtual ~blob_detector_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr image = input(0); if(!image) - return VPRO_INVALID; + return SPL_INVALID; vil_image_view bin_image = image->get_view(); @@ -524,7 +524,7 @@ class blob_detector_filter : public vpro_filter output(0, polys); - return VPRO_VALID; + return SPL_VALID; } double min_area_; vil_image_view work_image_; @@ -532,7 +532,7 @@ class blob_detector_filter : public vpro_filter //: Compute KLT tracked points -class klt_flow_filter : public vpro_filter +class klt_flow_filter : public spl_filter { public: @@ -550,7 +550,7 @@ class klt_flow_filter : public vpro_filter } //: Execute this process - vpro_signal execute() + spl_signal execute() { typedef vcl_pair,vgl_vector_2d > pv_pair; vcl_vector flow; @@ -558,7 +558,7 @@ class klt_flow_filter : public vpro_filter assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr image1 = input(0); if(!image1) - return VPRO_INVALID; + return SPL_INVALID; assert(input_type_id(1) == typeid(vcl_vector >)); vcl_vector > pts = @@ -575,7 +575,7 @@ class klt_flow_filter : public vpro_filter vcl_cout << "sizeof(vxl_byte) " << sizeof(vxl_byte) <<" sizeof(KLT_PixelType) "<,vgl_vector_2d > pv_pair; @@ -645,7 +645,7 @@ class flow_translation_filter : public vpro_filter if(flow.empty()){ output(0, flow); - return VPRO_VALID; + return SPL_VALID; } assert(input_type_id(1) == typeid(vnl_vector_fixed)); @@ -667,14 +667,14 @@ class flow_translation_filter : public vpro_filter output(0, t_flow); - return VPRO_VALID; + return SPL_VALID; } }; //: initialize tracks of vehicles -class track_init_filter : public vpro_filter +class track_init_filter : public spl_filter { public: track_init_filter(const vpgl_perspective_camera& cam = vpgl_perspective_camera()) @@ -684,7 +684,7 @@ class track_init_filter : public vpro_filter virtual ~track_init_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { typedef vcl_pair,vgl_vector_2d > pv_pair; @@ -701,18 +701,18 @@ class track_init_filter : public vpro_filter if(!tracking_enabled_){ output(0, vcl_vector()); - return VPRO_VALID; + return SPL_VALID; } if(silhouettes.empty()){ output(0, states); - return VPRO_VALID; + return SPL_VALID; } track_init_.find_states(silhouettes, flow, states); output(0, states); - return VPRO_VALID; + return SPL_VALID; } //: Helper class to initialize tracks @@ -736,7 +736,7 @@ float min_eigenvalue(float a, float b, float c){ //: correct track positions by fitting to images -class track_correct_filter : public vpro_filter +class track_correct_filter : public spl_filter { public: track_correct_filter(dml_vehicle_fit_video* optimizer) @@ -746,7 +746,7 @@ class track_correct_filter : public vpro_filter virtual ~track_correct_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vcl_vector)); @@ -764,7 +764,7 @@ class track_correct_filter : public vpro_filter output(0, states); - return VPRO_VALID; + return SPL_VALID; } dml_vehicle_fit_video* optimizer_; @@ -772,7 +772,7 @@ class track_correct_filter : public vpro_filter //: predict tracks changes with a motion model -class track_predict_filter : public vpro_filter +class track_predict_filter : public spl_filter { public: track_predict_filter(double t=1.0/30) : time_(t) {} @@ -781,7 +781,7 @@ class track_predict_filter : public vpro_filter virtual ~track_predict_filter(){} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vcl_vector)); @@ -795,7 +795,7 @@ class track_predict_filter : public vpro_filter output(0, pstates); - return VPRO_VALID; + return SPL_VALID; } //: the time interval between frames @@ -805,13 +805,13 @@ class track_predict_filter : public vpro_filter // a null sink that allows disabling -class optional_sink : public vpro_sink +class optional_sink : public spl_sink { public: optional_sink() : enabled_(true) {} //: Execute the process - vpro_signal execute() { return VPRO_VALID; } + spl_signal execute() { return SPL_VALID; } virtual bool enabled() const { return enabled_; } @@ -845,11 +845,11 @@ dml_vehicle_tracker::dml_vehicle_tracker(dml_vehicle_fit_video* optimizer) vidl_frame_to_resource::PLANES, vidl_frame_to_resource::ALLOCATE_MEMORY); //vidl_frame_to_resource::REUSE_MEMORY); - graph_["gauss_img"] = new vil_vpro_gauss_filter(); + graph_["gauss_img"] = new vil_spl_gauss_filter(); graph_["grad_ij"] = new vil_sobel_1x3_filter(); graph_["edge_map"] = new vil_subpix_edge_filter(); graph_["grad2"] = new vil_grad_sqr_filter(); - graph_["gauss_grad2"] = new vil_vpro_gauss_filter(); + graph_["gauss_grad2"] = new vil_spl_gauss_filter(); typedef float (*eig_func_ptr)(float a, float b, float c); graph_["min_eigval"] = new vil_transform3_1_filter(min_eigenvalue); graph_["klt_pts"] = new vil_subpix_point_filter(); @@ -859,26 +859,26 @@ dml_vehicle_tracker::dml_vehicle_tracker(dml_vehicle_fit_video* optimizer) graph_["bin_erode2"] = new vil_binary_erode_filter(se); graph_["bin_dilate2"] = new vil_binary_dilate_filter(se); - graph_["e_delay"] = new vpro_delay(1,vil_image_resource_sptr(NULL)); + graph_["e_delay"] = new spl_delay(1,vil_image_resource_sptr(NULL)); graph_["est_t"] = new est_translation_filter(); - graph_["t_delay"] = new vpro_delay(1,vnl_vector_fixed(0.0,0.0)); + graph_["t_delay"] = new spl_delay(1,vnl_vector_fixed(0.0,0.0)); graph_["t_edge_map"] = new edgemap_translation_filter(); graph_["m_edge_map"] = new mask_edgemap_filter(); graph_["x_edgels"] = new extract_subpix_filter(); graph_["blob_detect"] = new blob_detector_filter(); graph_["track_init"] = new track_init_filter(); - graph_["s_delay"] = new vpro_delay(1,vcl_vector()); + graph_["s_delay"] = new spl_delay(1,vcl_vector()); graph_["trk_predict"] = new track_predict_filter(); graph_["trk_correct"] = new track_correct_filter(optimizer); graph_["opt_flow"] = new klt_flow_filter(); graph_["t_flow"] = new flow_translation_filter(); - //graph_["f_delay"] = new vpro_delay(1,vil_image_resource_sptr(NULL)); + //graph_["f_delay"] = new spl_delay(1,vil_image_resource_sptr(NULL)); graph_["disp_sink"] = new optional_sink(); graph_["trk_sink"] = new optional_sink(); - graph_["bgm_sink"] = new vpro_null_sink(); + graph_["bgm_sink"] = new spl_null_sink(); // intensity background modeling @@ -990,7 +990,7 @@ void dml_vehicle_tracker::init_bgm_pro() graph_["bg_update"] = new bbgm_update_filter(updater); graph_["bg_detect"] = new bbgm_detect_filter(detector); - graph_["bg_delay"] = new vpro_delay(1,bg_model); + graph_["bg_delay"] = new spl_delay(1,bg_model); } @@ -1022,7 +1022,7 @@ void dml_vehicle_tracker::init_ebgm_pro() graph_["bge_update"] = new bbgm_update_filter(updater); graph_["bge_detect"] = new bbgm_detect_filter(detector); - graph_["bge_delay"] = new vpro_delay(1,bg_model); + graph_["bge_delay"] = new spl_delay(1,bg_model); } @@ -1067,7 +1067,7 @@ void dml_vehicle_tracker::set_istream(const vidl_istream_sptr& istream) //: add an observer of input video frames -void dml_vehicle_tracker::add_video_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_video_observer(const spl_observer_sptr& obs) { assert(graph_["to_resource"].ptr()); graph_["to_resource"]->add_output_observer(0,obs); @@ -1075,7 +1075,7 @@ void dml_vehicle_tracker::add_video_observer(const vpro_observer_sptr& obs) //: add an observer of the background detection image -void dml_vehicle_tracker::add_bg_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_bg_observer(const spl_observer_sptr& obs) { //assert(graph_["bg_detect"].ptr()); //graph_["bg_detect"]->add_output_observer(0,obs); @@ -1085,7 +1085,7 @@ void dml_vehicle_tracker::add_bg_observer(const vpro_observer_sptr& obs) //: add an observer of detected vehicle silhouette polygons -void dml_vehicle_tracker::add_silhouette_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_silhouette_observer(const spl_observer_sptr& obs) { assert(graph_["blob_detect"].ptr()); graph_["blob_detect"]->add_output_observer(0,obs); @@ -1093,7 +1093,7 @@ void dml_vehicle_tracker::add_silhouette_observer(const vpro_observer_sptr& obs) //: add an observer of detected vehicle hypotheses -void dml_vehicle_tracker::add_hypotheses_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_hypotheses_observer(const spl_observer_sptr& obs) { assert(graph_["track_init"].ptr()); graph_["track_init"]->add_output_observer(0,obs); @@ -1101,7 +1101,7 @@ void dml_vehicle_tracker::add_hypotheses_observer(const vpro_observer_sptr& obs) //: add an observer of the vehicle tracks -void dml_vehicle_tracker::add_track_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_track_observer(const spl_observer_sptr& obs) { assert(graph_["trk_correct"].ptr()); graph_["trk_correct"]->add_output_observer(0,obs); @@ -1109,7 +1109,7 @@ void dml_vehicle_tracker::add_track_observer(const vpro_observer_sptr& obs) //: add an observer of the edge map image -void dml_vehicle_tracker::add_edgemap_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_edgemap_observer(const spl_observer_sptr& obs) { assert(graph_["m_edge_map"].ptr()); graph_["m_edge_map"]->add_output_observer(0,obs); @@ -1117,7 +1117,7 @@ void dml_vehicle_tracker::add_edgemap_observer(const vpro_observer_sptr& obs) //: add an observer of the optical flow -void dml_vehicle_tracker::add_optical_flow_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_optical_flow_observer(const spl_observer_sptr& obs) { assert(graph_["t_flow"].ptr()); graph_["t_flow"]->add_output_observer(0,obs); @@ -1125,7 +1125,7 @@ void dml_vehicle_tracker::add_optical_flow_observer(const vpro_observer_sptr& ob //: add an observer of the point map image -void dml_vehicle_tracker::add_pointmap_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_pointmap_observer(const spl_observer_sptr& obs) { assert(graph_["min_eigval"].ptr()); graph_["min_eigval"]->add_output_observer(0,obs); @@ -1133,7 +1133,7 @@ void dml_vehicle_tracker::add_pointmap_observer(const vpro_observer_sptr& obs) //: add an observer of the points -void dml_vehicle_tracker::add_point_observer(const vpro_observer_sptr& obs) +void dml_vehicle_tracker::add_point_observer(const spl_observer_sptr& obs) { assert(graph_["klt_pts"].ptr()); graph_["klt_pts"]->add_output_observer(0,obs); diff --git a/dml/dml_vehicle_tracker.h b/dml/dml_vehicle_tracker.h index a2c2d5f..9a10b99 100644 --- a/dml/dml_vehicle_tracker.h +++ b/dml/dml_vehicle_tracker.h @@ -20,7 +20,7 @@ //========================================================================= -#include +#include #include #include #include @@ -47,31 +47,31 @@ class dml_vehicle_tracker void set_istream(const vidl_istream_sptr& istream); //: add an observer of input video frames - void add_video_observer(const vpro_observer_sptr& obs); + void add_video_observer(const spl_observer_sptr& obs); //: add an observer of the background detection image - void add_bg_observer(const vpro_observer_sptr& obs); + void add_bg_observer(const spl_observer_sptr& obs); //: add an observer of detected vehicle silhouette polygons - void add_silhouette_observer(const vpro_observer_sptr& obs); + void add_silhouette_observer(const spl_observer_sptr& obs); //: add an observer of detected vehicle hypotheses - void add_hypotheses_observer(const vpro_observer_sptr& obs); + void add_hypotheses_observer(const spl_observer_sptr& obs); //: add an observer of the vehicle tracks - void add_track_observer(const vpro_observer_sptr& obs); + void add_track_observer(const spl_observer_sptr& obs); //: add an observer of the edge map image - void add_edgemap_observer(const vpro_observer_sptr& obs); + void add_edgemap_observer(const spl_observer_sptr& obs); //: add an observer of the point map image - void add_pointmap_observer(const vpro_observer_sptr& obs); + void add_pointmap_observer(const spl_observer_sptr& obs); //: add an observer of the points - void add_point_observer(const vpro_observer_sptr& obs); + void add_point_observer(const spl_observer_sptr& obs); //: add an observer of the optical flow - void add_optical_flow_observer(const vpro_observer_sptr& obs); + void add_optical_flow_observer(const spl_observer_sptr& obs); //: enable tracking void enable_tracking(bool enable_track); @@ -83,7 +83,7 @@ class dml_vehicle_tracker void set_estimate_shape(bool val); //: advance the video and process on frame - vpro_signal process_once() { return graph_.run_step(); } + spl_signal process_once() { return graph_.run_step(); } private: //: initialize the intensity background modeling processes @@ -93,7 +93,7 @@ class dml_vehicle_tracker void init_ebgm_pro(); //: store the process graph - vpro_executive graph_; + spl_executive graph_; }; diff --git a/dml/python/py_dml_manager.cxx b/dml/python/py_dml_manager.cxx index 986334f..ed6b017 100644 --- a/dml/python/py_dml_manager.cxx +++ b/dml/python/py_dml_manager.cxx @@ -30,21 +30,21 @@ #include #include -#include +#include //: observer to capture current vehicle tracking states -class track_observer: public vpro_observer +class track_observer: public spl_observer { public: track_observer(py_dml_manager& m) : manager_(m) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(data); - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vcl_vector)); const vcl_vector& states = data->data >(); @@ -635,9 +635,9 @@ void py_dml_manager::video_seek(int fnum) //: advance the video to the next frame bool py_dml_manager::advance_video() { - vpro_signal s = video_optimizer_.process_once(); + spl_signal s = video_optimizer_.process_once(); compute_sun_direction(); - if(s == VPRO_VALID ) + if(s == SPL_VALID ) return true; return false; } diff --git a/gui/pca_vehicle_manager.cxx b/gui/pca_vehicle_manager.cxx index 3cdf506..8e984c7 100644 --- a/gui/pca_vehicle_manager.cxx +++ b/gui/pca_vehicle_manager.cxx @@ -35,7 +35,7 @@ #include #include -#include +#include #include #include @@ -77,14 +77,14 @@ #include //: observer to clear vis_edgels_ -class clear_vis_edgels_observer: public vpro_observer +class clear_vis_edgels_observer: public spl_observer { public: clear_vis_edgels_observer(vcl_vector >& vis_edgels) : vis_edgels_(vis_edgels) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { vis_edgels_.clear(); return true; @@ -94,17 +94,17 @@ class clear_vis_edgels_observer: public vpro_observer //: observer to draw hypotheses -class hypothesis_observer: public vpro_observer +class hypothesis_observer: public spl_observer { public: hypothesis_observer(pca_vehicle_manager& m) : manager_(m) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(data); - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vcl_vector)); const vcl_vector& states = data->data >(); @@ -120,17 +120,17 @@ class hypothesis_observer: public vpro_observer //: observer to capture current vehicle tracking states -class track_observer: public vpro_observer +class track_observer: public spl_observer { public: track_observer(pca_vehicle_manager& m) : manager_(m) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(data); - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vcl_vector)); const vcl_vector& states = data->data >(); @@ -144,18 +144,18 @@ class track_observer: public vpro_observer //: observer to draw polygons -class polygon_observer: public vpro_observer +class polygon_observer: public spl_observer { public: polygon_observer(const vgui_easy2D_tableau_sptr& tab) : easy2D_tab_(tab) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(easy2D_tab_); assert(data); - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vcl_vector >)); const vcl_vector >& polys = data->data > >(); @@ -181,18 +181,18 @@ class polygon_observer: public vpro_observer //: observer to draw polygons -class point_observer: public vpro_observer +class point_observer: public spl_observer { public: point_observer(const vgui_easy2D_tableau_sptr& tab) : easy2D_tab_(tab) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(easy2D_tab_); assert(data); - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vcl_vector >)); const vcl_vector >& pts = data->data > >(); @@ -210,19 +210,19 @@ class point_observer: public vpro_observer //: observer to draw optical flow vectors -class opt_flow_observer: public vpro_observer +class opt_flow_observer: public spl_observer { public: opt_flow_observer(const vgui_easy2D_tableau_sptr& tab) : easy2D_tab_(tab) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(easy2D_tab_); assert(data); typedef vcl_pair,vgl_vector_2d > pv_pair; - if(data->info() == VPRO_VALID){ + if(data->info() == SPL_VALID){ assert(data->type_id() == typeid(vcl_vector)); const vcl_vector& flow = data->data >(); //easy2D_tab_->clear(); @@ -485,10 +485,10 @@ vgui_tableau_sptr pca_vehicle_manager::init_proj_view() selector_tab_->add(detect_tab_,"Vehicle Detection"); selector_tab_->add(gnd_cal_tab_,"Calibration"); - video_optimizer_.tracker().add_video_observer(new vpro_image_observer(image_tab_)); - //video_optimizer_.tracker().add_bg_observer(new vpro_image_observer(debug_image_tab_)); + video_optimizer_.tracker().add_video_observer(new spl_image_observer(image_tab_)); + //video_optimizer_.tracker().add_bg_observer(new spl_image_observer(debug_image_tab_)); video_optimizer_.tracker().add_edgemap_observer(new clear_vis_edgels_observer(vis_edgels_)); - video_optimizer_.tracker().add_edgemap_observer(new vpro_image_observer(edge_map_tab_)); + video_optimizer_.tracker().add_edgemap_observer(new spl_image_observer(edge_map_tab_)); video_optimizer_.tracker().add_silhouette_observer(new polygon_observer(detect_tab_)); video_optimizer_.tracker().add_hypotheses_observer(new hypothesis_observer(*this)); video_optimizer_.tracker().add_track_observer(new track_observer(*this)); @@ -496,7 +496,7 @@ vgui_tableau_sptr pca_vehicle_manager::init_proj_view() video_optimizer_.tracker().enable_display(false); - //video_optimizer_.tracker().add_pointmap_observer(new vpro_image_observer(debug_image_tab_)); + //video_optimizer_.tracker().add_pointmap_observer(new spl_image_observer(debug_image_tab_)); //video_optimizer_.tracker().add_point_observer(new point_observer(detect_tab_)); scene_handler_tableau_new handler(this,selector_tab_); @@ -1179,9 +1179,9 @@ bool pca_vehicle_manager::advance_video() return true; } - vpro_signal s = video_optimizer_.process_once(); + spl_signal s = video_optimizer_.process_once(); compute_sun_direction(); - if(s == VPRO_VALID ) + if(s == SPL_VALID ) return true; return false; } diff --git a/spl/CMakeLists.txt b/spl/CMakeLists.txt new file mode 100644 index 0000000..9cfe491 --- /dev/null +++ b/spl/CMakeLists.txt @@ -0,0 +1,58 @@ + +# Copyright Matthew Leotta 2006 - 2010. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file ../LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# spl/CMakeLists.txt + +project(spl) + +include_directories( ${VXL_BRL_INCLUDE_DIR} ) + +find_package( Threads ) + +configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/spl_config.h.in + ${CMAKE_CURRENT_BINARY_DIR}/spl_config.h ) + + +set(spl_sources + spl_mutex.cxx spl_mutex.h + spl_parameters.cxx spl_parameters.h spl_parameters_sptr.h + spl_parameters.txx + spl_process.cxx spl_process.h spl_process_sptr.h + spl_basic_processes.h + spl_vsl_processes.h + spl_ios_processes.h + spl_process_factory.cxx spl_process_factory.h + spl_storage.h spl_storage_sptr.h + spl_observer.h spl_observer_sptr.h + spl_connector.cxx spl_connector.h spl_connector_sptr.h + spl_delay.cxx spl_delay.h + spl_try_option.cxx spl_try_option.h + spl_executive.cxx spl_executive.h +) + + + +aux_source_directory(Templates spl_sources) + +add_library(spl ${spl_sources}) + + +target_link_libraries(spl vul vbl) + +if( CMAKE_USE_PTHREADS_INIT ) + set_target_properties(spl PROPERTIES COMPILE_FLAGS -pthread) + target_link_libraries(spl pthread) +endif() + + +add_subdirectory( vis ) + +add_subdirectory( filters ) + + +if(BUILD_TESTING) + add_subdirectory(tests) +endif() diff --git a/vpro/Templates/vpro_parameters+int-.cxx b/spl/Templates/spl_parameters+bool-.cxx similarity index 76% rename from vpro/Templates/vpro_parameters+int-.cxx rename to spl/Templates/spl_parameters+bool-.cxx index 5265a53..e253eb4 100644 --- a/vpro/Templates/vpro_parameters+int-.cxx +++ b/spl/Templates/spl_parameters+bool-.cxx @@ -3,6 +3,6 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include -VPRO_PARAMETERS_INSTANTIATE(int); +SPL_PARAMETERS_INSTANTIATE(bool); diff --git a/vpro/Templates/vpro_parameters+bool-.cxx b/spl/Templates/spl_parameters+float-.cxx similarity index 76% rename from vpro/Templates/vpro_parameters+bool-.cxx rename to spl/Templates/spl_parameters+float-.cxx index 913cf83..965e511 100644 --- a/vpro/Templates/vpro_parameters+bool-.cxx +++ b/spl/Templates/spl_parameters+float-.cxx @@ -3,6 +3,6 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include -VPRO_PARAMETERS_INSTANTIATE(bool); +SPL_PARAMETERS_INSTANTIATE(float); diff --git a/vpro/Templates/vpro_parameters+float-.cxx b/spl/Templates/spl_parameters+int-.cxx similarity index 75% rename from vpro/Templates/vpro_parameters+float-.cxx rename to spl/Templates/spl_parameters+int-.cxx index 51d396c..996717f 100644 --- a/vpro/Templates/vpro_parameters+float-.cxx +++ b/spl/Templates/spl_parameters+int-.cxx @@ -3,6 +3,6 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include -VPRO_PARAMETERS_INSTANTIATE(float); +SPL_PARAMETERS_INSTANTIATE(int); diff --git a/vpro/Templates/vpro_parameters+vpro_filepath-.cxx b/spl/Templates/spl_parameters+spl_filepath-.cxx similarity index 73% rename from vpro/Templates/vpro_parameters+vpro_filepath-.cxx rename to spl/Templates/spl_parameters+spl_filepath-.cxx index a882534..4894ffc 100644 --- a/vpro/Templates/vpro_parameters+vpro_filepath-.cxx +++ b/spl/Templates/spl_parameters+spl_filepath-.cxx @@ -3,6 +3,6 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include -VPRO_PARAMETERS_INSTANTIATE(vpro_filepath); +SPL_PARAMETERS_INSTANTIATE(spl_filepath); diff --git a/vpro/Templates/vpro_parameters+vcl_string-.cxx b/spl/Templates/spl_parameters+vcl_string-.cxx similarity index 76% rename from vpro/Templates/vpro_parameters+vcl_string-.cxx rename to spl/Templates/spl_parameters+vcl_string-.cxx index 49b570d..5d21f74 100644 --- a/vpro/Templates/vpro_parameters+vcl_string-.cxx +++ b/spl/Templates/spl_parameters+vcl_string-.cxx @@ -4,6 +4,6 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include -VPRO_PARAMETERS_INSTANTIATE(vcl_string); +SPL_PARAMETERS_INSTANTIATE(vcl_string); diff --git a/vpro/Templates/vbl_smart_ptr+vpro_observer-.cxx b/spl/Templates/vbl_smart_ptr+spl_observer-.cxx similarity index 77% rename from vpro/Templates/vbl_smart_ptr+vpro_observer-.cxx rename to spl/Templates/vbl_smart_ptr+spl_observer-.cxx index 28208ae..d0e4c1f 100644 --- a/vpro/Templates/vbl_smart_ptr+vpro_observer-.cxx +++ b/spl/Templates/vbl_smart_ptr+spl_observer-.cxx @@ -3,7 +3,7 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include #include -VBL_SMART_PTR_INSTANTIATE(vpro_observer); +VBL_SMART_PTR_INSTANTIATE(spl_observer); diff --git a/vpro/Templates/vbl_smart_ptr+vpro_parameters-.cxx b/spl/Templates/vbl_smart_ptr+spl_parameters-.cxx similarity index 76% rename from vpro/Templates/vbl_smart_ptr+vpro_parameters-.cxx rename to spl/Templates/vbl_smart_ptr+spl_parameters-.cxx index 53bf08c..4ac6d18 100644 --- a/vpro/Templates/vbl_smart_ptr+vpro_parameters-.cxx +++ b/spl/Templates/vbl_smart_ptr+spl_parameters-.cxx @@ -3,7 +3,7 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include #include -VBL_SMART_PTR_INSTANTIATE(vpro_parameters); +VBL_SMART_PTR_INSTANTIATE(spl_parameters); diff --git a/vpro/Templates/vbl_smart_ptr+vpro_process-.cxx b/spl/Templates/vbl_smart_ptr+spl_process-.cxx similarity index 65% rename from vpro/Templates/vbl_smart_ptr+vpro_process-.cxx rename to spl/Templates/vbl_smart_ptr+spl_process-.cxx index 06ae937..5a39873 100644 --- a/vpro/Templates/vbl_smart_ptr+vpro_process-.cxx +++ b/spl/Templates/vbl_smart_ptr+spl_process-.cxx @@ -3,9 +3,9 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include -#include -#include +#include +#include +#include #include -VBL_SMART_PTR_INSTANTIATE(vpro_process); +VBL_SMART_PTR_INSTANTIATE(spl_process); diff --git a/vpro/Templates/vbl_smart_ptr+vpro_storage-.cxx b/spl/Templates/vbl_smart_ptr+spl_storage-.cxx similarity index 78% rename from vpro/Templates/vbl_smart_ptr+vpro_storage-.cxx rename to spl/Templates/vbl_smart_ptr+spl_storage-.cxx index b79713e..a771db8 100644 --- a/vpro/Templates/vbl_smart_ptr+vpro_storage-.cxx +++ b/spl/Templates/vbl_smart_ptr+spl_storage-.cxx @@ -3,7 +3,7 @@ // (See accompanying file ../../LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) -#include +#include #include -VBL_SMART_PTR_INSTANTIATE(vpro_storage); +VBL_SMART_PTR_INSTANTIATE(spl_storage); diff --git a/vpro/filters/CMakeLists.txt b/spl/filters/CMakeLists.txt similarity index 88% rename from vpro/filters/CMakeLists.txt rename to spl/filters/CMakeLists.txt index 24a1ff9..17ad381 100644 --- a/vpro/filters/CMakeLists.txt +++ b/spl/filters/CMakeLists.txt @@ -4,10 +4,10 @@ # (See accompanying file ../../LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -# vpro/filters/CMakeLists.txt +# spl/filters/CMakeLists.txt -set(vpro_filters_sources +set(spl_filters_sources vil_gaussian_blur_process.cxx vil_gaussian_blur_process.h vil_diff_process.cxx vil_diff_process.h vil_morphology_filters.cxx vil_morphology_filters.h @@ -30,7 +30,7 @@ set(vpro_filters_sources ) -add_library(vpro_filters ${vpro_filters_sources}) +add_library(spl_filters ${spl_filters_sources}) -target_link_libraries(vpro_filters vpro vil vil_algo vidl) +target_link_libraries(spl_filters spl vil vil_algo vidl) diff --git a/vpro/filters/bbgm_filters.h b/spl/filters/bbgm_filters.h similarity index 89% rename from vpro/filters/bbgm_filters.h rename to spl/filters/bbgm_filters.h index 4736644..ecccb93 100644 --- a/vpro/filters/bbgm_filters.h +++ b/spl/filters/bbgm_filters.h @@ -1,10 +1,10 @@ -// This is vpro/filters/bbgm_filters.h +// This is spl/filters/bbgm_filters.h #ifndef bbgm_filters_h_ #define bbgm_filters_h_ //: // \file -// \brief vpro filters for background modeling +// \brief spl filters for background modeling // \author Matt Leotta (mleotta@lems.brown.edu) // \date 6/12/06 // @@ -22,7 +22,7 @@ #include #include -#include +#include #include #include #include @@ -33,13 +33,13 @@ template -class bbgm_update_filter : public vpro_filter +class bbgm_update_filter : public spl_filter { public: typedef typename updater_t::distribution_type dist_t; bbgm_update_filter(const updater_t& u) : updater_(u) {} - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(bbgm_image_sptr)); bbgm_image_sptr model_sptr = input(0); @@ -55,7 +55,7 @@ class bbgm_update_filter : public vpro_filter update(*model,img,updater_); output(0,model_sptr); - return VPRO_VALID; + return SPL_VALID; } private: @@ -64,13 +64,13 @@ class bbgm_update_filter : public vpro_filter template -class bbgm_update_masked_filter : public vpro_filter +class bbgm_update_masked_filter : public spl_filter { public: typedef typename updater_t::distribution_type dist_t; bbgm_update_masked_filter(const updater_t& u) : updater_(u) {} - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(bbgm_image_sptr)); bbgm_image_sptr model_sptr = input(0); @@ -90,7 +90,7 @@ class bbgm_update_masked_filter : public vpro_filter update_masked(*model,img,updater_,mask); output(0,model_sptr); - return VPRO_VALID; + return SPL_VALID; } private: @@ -100,13 +100,13 @@ class bbgm_update_masked_filter : public vpro_filter template -class bbgm_detect_filter : public vpro_filter +class bbgm_detect_filter : public spl_filter { public: typedef typename detector_t::distribution_type dist_t; bbgm_detect_filter(const detector_t& d) : detector_(d) {} - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(bbgm_image_sptr)); bbgm_image_sptr model_sptr = input(0); @@ -125,7 +125,7 @@ class bbgm_detect_filter : public vpro_filter //bbgm_apply(*model,detector_,img,mask); output(0, vil_new_image_resource_of_view(mask)); - return VPRO_VALID; + return SPL_VALID; } private: @@ -135,13 +135,13 @@ class bbgm_detect_filter : public vpro_filter template -class bbgm_detect_masked_filter : public vpro_filter +class bbgm_detect_masked_filter : public spl_filter { public: typedef typename detector_t::distribution_type dist_t; bbgm_detect_masked_filter(const detector_t& d) : detector_(d) {} - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(bbgm_image_sptr)); bbgm_image_sptr model_sptr = input(0); @@ -164,7 +164,7 @@ class bbgm_detect_masked_filter : public vpro_filter //bbgm_apply_masked(*model,detector_,img,mask); output(0, vil_new_image_resource_of_view(mask)); - return VPRO_VALID; + return SPL_VALID; } private: diff --git a/vpro/filters/vidl_frame_to_resource.cxx b/spl/filters/vidl_frame_to_resource.cxx similarity index 91% rename from vpro/filters/vidl_frame_to_resource.cxx rename to spl/filters/vidl_frame_to_resource.cxx index 8728b92..3f101a0 100644 --- a/vpro/filters/vidl_frame_to_resource.cxx +++ b/spl/filters/vidl_frame_to_resource.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_frame_to_resource.cxx +// This is spl/filters/vidl_frame_to_resource.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -14,13 +14,13 @@ //: Run the process on the current frame -vpro_signal +spl_signal vidl_frame_to_resource::execute() { assert(input_type_id(0) == typeid(vidl_frame_sptr)); vidl_frame_sptr frame = input(0); if(!frame) - return VPRO_INVALID; + return SPL_INVALID; // try to wrap the frame in a view if( wrap_mode_ == REQUIRE_WRAP || @@ -35,11 +35,11 @@ vidl_frame_to_resource::execute() color_ == vidl_pixel_format_color(frame->pixel_format()) ) ) { output(0,image); - return VPRO_VALID; + return SPL_VALID; } } else if(wrap_mode_ == REQUIRE_WRAP) - return VPRO_INVALID; + return SPL_INVALID; } // create a new memory image and copy/convert the frame into this resource @@ -61,11 +61,11 @@ vidl_frame_to_resource::execute() } if(!vidl_convert_to_view(*frame,*image_rsc_->get_view(),color_)) - return VPRO_INVALID; + return SPL_INVALID; output(0,image_rsc_); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vidl_frame_to_resource.h b/spl/filters/vidl_frame_to_resource.h similarity index 94% rename from vpro/filters/vidl_frame_to_resource.h rename to spl/filters/vidl_frame_to_resource.h index 517b43a..d0d7ab9 100644 --- a/vpro/filters/vidl_frame_to_resource.h +++ b/spl/filters/vidl_frame_to_resource.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_frame_to_resource.h +// This is spl/filters/vidl_frame_to_resource.h #ifndef vidl_frame_to_resource_h_ #define vidl_frame_to_resource_h_ @@ -18,14 +18,14 @@ // \endverbatim -#include +#include #include #include #include //: Convert a vidl_frame into a vil_image_resource -class vidl_frame_to_resource : public vpro_filter +class vidl_frame_to_resource : public spl_filter { public: @@ -67,7 +67,7 @@ class vidl_frame_to_resource : public vpro_filter virtual ~vidl_frame_to_resource(){} //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: vil_image_resource_sptr image_rsc_; diff --git a/vpro/filters/vidl_multi_source.cxx b/spl/filters/vidl_multi_source.cxx similarity index 86% rename from vpro/filters/vidl_multi_source.cxx rename to spl/filters/vidl_multi_source.cxx index debbca5..72b2204 100644 --- a/vpro/filters/vidl_multi_source.cxx +++ b/spl/filters/vidl_multi_source.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_multi_source.cxx +// This is spl/filters/vidl_multi_source.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -13,7 +13,7 @@ //: Run the process on the current frame -vpro_signal +spl_signal vidl_multi_source::execute() { bool all_passed = true; @@ -22,7 +22,7 @@ vidl_multi_source::execute() all_passed = istreams_[i]->advance() && all_passed; } if(!all_passed) - return VPRO_EOS; + return SPL_EOS; vidl_frame_sptr frame = NULL; for(unsigned int i=0; i #include -#include +#include #include //: A source that provides frames from multiple video streams in sync -class vidl_multi_source : public vpro_source +class vidl_multi_source : public spl_source { public: @@ -47,7 +47,7 @@ class vidl_multi_source : public vpro_source vidl_istream_sptr stream(unsigned int idx) const { return istreams_[idx]; } //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: vcl_vector istreams_; diff --git a/vpro/filters/vidl_resource_to_frame.cxx b/spl/filters/vidl_resource_to_frame.cxx similarity index 83% rename from vpro/filters/vidl_resource_to_frame.cxx rename to spl/filters/vidl_resource_to_frame.cxx index 1ad3614..9f75964 100644 --- a/vpro/filters/vidl_resource_to_frame.cxx +++ b/spl/filters/vidl_resource_to_frame.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_resource_to_frame.cxx +// This is spl/filters/vidl_resource_to_frame.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -14,22 +14,22 @@ //: Run the process on the current frame -vpro_signal +spl_signal vidl_resource_to_frame::execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr image = input(0); if(!image) - return VPRO_INVALID; + return SPL_INVALID; vidl_frame_sptr frame = vidl_convert_to_frame(image->get_view()); if(!frame) - return VPRO_INVALID; + return SPL_INVALID; output(0,frame); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vidl_resource_to_frame.h b/spl/filters/vidl_resource_to_frame.h similarity index 82% rename from vpro/filters/vidl_resource_to_frame.h rename to spl/filters/vidl_resource_to_frame.h index 830954a..fe13af9 100644 --- a/vpro/filters/vidl_resource_to_frame.h +++ b/spl/filters/vidl_resource_to_frame.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_resource_to_frame.h +// This is spl/filters/vidl_resource_to_frame.h #ifndef vidl_resource_to_frame_h_ #define vidl_resource_to_frame_h_ @@ -18,12 +18,12 @@ // \endverbatim -#include +#include #include //: Convert a vil_image_resource into a vidl_frame -class vidl_resource_to_frame : public vpro_filter +class vidl_resource_to_frame : public spl_filter { public: @@ -34,7 +34,7 @@ class vidl_resource_to_frame : public vpro_filter virtual ~vidl_resource_to_frame(){} //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: diff --git a/vpro/filters/vidl_sink.cxx b/spl/filters/vidl_sink.cxx similarity index 79% rename from vpro/filters/vidl_sink.cxx rename to spl/filters/vidl_sink.cxx index b10d8a1..078efbe 100644 --- a/vpro/filters/vidl_sink.cxx +++ b/spl/filters/vidl_sink.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_sink.cxx +// This is spl/filters/vidl_sink.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -14,21 +14,21 @@ //: Run the process on the current frame -vpro_signal +spl_signal vidl_sink::execute() { if(!ostream_) - return VPRO_VALID; + return SPL_VALID; assert(input_type_id(0) == typeid(vidl_frame_sptr)); vidl_frame_sptr frame = input(0); if(!frame) - return VPRO_INVALID; + return SPL_INVALID; if(!ostream_->write_frame(frame)) - return VPRO_INVALID; + return SPL_INVALID; - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vidl_sink.h b/spl/filters/vidl_sink.h similarity index 82% rename from vpro/filters/vidl_sink.h rename to spl/filters/vidl_sink.h index fe2837b..a493b16 100644 --- a/vpro/filters/vidl_sink.h +++ b/spl/filters/vidl_sink.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_sink.h +// This is spl/filters/vidl_sink.h #ifndef vidl_sink_h_ #define vidl_sink_h_ @@ -19,11 +19,11 @@ #include -#include +#include #include -//: Convert a vidl_ostream into a vpro_sink -class vidl_sink : public vpro_sink +//: Convert a vidl_ostream into a spl_sink +class vidl_sink : public spl_sink { public: @@ -40,7 +40,7 @@ class vidl_sink : public vpro_sink //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: vidl_ostream_sptr ostream_; diff --git a/vpro/filters/vidl_source.cxx b/spl/filters/vidl_source.cxx similarity index 80% rename from vpro/filters/vidl_source.cxx rename to spl/filters/vidl_source.cxx index 554918c..7d9aa2b 100644 --- a/vpro/filters/vidl_source.cxx +++ b/spl/filters/vidl_source.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_source.cxx +// This is spl/filters/vidl_source.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -13,20 +13,20 @@ //: Run the process on the current frame -vpro_signal +spl_signal vidl_source::execute() { if(!istream_->advance()){ - return VPRO_EOS; + return SPL_EOS; } vidl_frame_sptr frame = istream_->current_frame(); if(!frame) - return VPRO_INVALID; + return SPL_INVALID; output(0,frame); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vidl_source.h b/spl/filters/vidl_source.h similarity index 82% rename from vpro/filters/vidl_source.h rename to spl/filters/vidl_source.h index ad2b54e..d6d2ea8 100644 --- a/vpro/filters/vidl_source.h +++ b/spl/filters/vidl_source.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vidl_source.h +// This is spl/filters/vidl_source.h #ifndef vidl_source_h_ #define vidl_source_h_ @@ -19,11 +19,11 @@ #include -#include +#include #include -//: Convert a vidl_istream into a vpro_source -class vidl_source : public vpro_source +//: Convert a vidl_istream into a spl_source +class vidl_source : public spl_source { public: @@ -40,7 +40,7 @@ class vidl_source : public vpro_source vidl_istream_sptr stream() const { return istream_; } //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: vidl_istream_sptr istream_; diff --git a/vpro/filters/vil_convert_filters.h b/spl/filters/vil_convert_filters.h similarity index 82% rename from vpro/filters/vil_convert_filters.h rename to spl/filters/vil_convert_filters.h index b8edc63..8fb2512 100644 --- a/vpro/filters/vil_convert_filters.h +++ b/spl/filters/vil_convert_filters.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_convert_filters.h +// This is spl/filters/vil_convert_filters.h #ifndef vil_convert_filters_h_ #define vil_convert_filters_h_ @@ -19,32 +19,32 @@ #include #include -#include +#include //: Filter to cast the image to a new type template -class vil_convert_cast_filter : public vpro_filter +class vil_convert_cast_filter : public spl_filter { public: //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); output(0, vil_new_image_resource_of_view(*vil_convert_cast(outP(), in_img->get_view()))); - return VPRO_VALID; + return SPL_VALID; } }; //: Filter to cast the image to a new type template -class vil_convert_stretch_range_filter : public vpro_filter +class vil_convert_stretch_range_filter : public spl_filter { public: //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -52,7 +52,7 @@ class vil_convert_stretch_range_filter : public vpro_filter vil_image_view out; vil_convert_stretch_range(in, out); output(0, vil_new_image_resource_of_view(out)); - return VPRO_VALID; + return SPL_VALID; } }; diff --git a/vpro/filters/vil_diff_process.cxx b/spl/filters/vil_diff_process.cxx similarity index 80% rename from vpro/filters/vil_diff_process.cxx rename to spl/filters/vil_diff_process.cxx index 08cd3a9..f2c189f 100644 --- a/vpro/filters/vil_diff_process.cxx +++ b/spl/filters/vil_diff_process.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_diff_process.cxx +// This is spl/filters/vil_diff_process.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -9,8 +9,8 @@ // \file #include "vil_diff_process.h" -#include -#include +#include +#include #include #include #include @@ -18,25 +18,25 @@ //: Return the default set of parameters for the process -vpro_parameters_sptr +spl_parameters_sptr vil_diff_process::factory::default_params() const { // no parameters to add - vpro_parameters_sptr p = new vpro_parameters(); + spl_parameters_sptr p = new spl_parameters(); return p; } //: Construct a process from a set of parameters -vpro_process_sptr -vil_diff_process::factory::create(const vpro_parameters_sptr& params) const +spl_process_sptr +vil_diff_process::factory::create(const spl_parameters_sptr& params) const { return new vil_diff_process(); } //: Execute this process -vpro_signal +spl_signal vil_diff_process::execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); @@ -56,7 +56,7 @@ vil_diff_process::execute() vil_image_resource_sptr out_img = vil_new_image_resource_of_view(diff_img); output(0,out_img); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vil_diff_process.h b/spl/filters/vil_diff_process.h similarity index 72% rename from vpro/filters/vil_diff_process.h rename to spl/filters/vil_diff_process.h index e81cc24..0f14bdb 100644 --- a/vpro/filters/vil_diff_process.h +++ b/spl/filters/vil_diff_process.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_diff_process.h +// This is spl/filters/vil_diff_process.h #ifndef vil_diff_process_h_ #define vil_diff_process_h_ @@ -17,13 +17,13 @@ // Modifications // \endverbatim -#include -#include +#include +#include #include #include //: Process that computes absolute difference between images -class vil_diff_process : public vpro_filter { +class vil_diff_process : public spl_filter { public: //: Constructor @@ -31,14 +31,14 @@ class vil_diff_process : public vpro_filter { //: Destructor virtual ~vil_diff_process() {} - class factory : public vpro_process_factory + class factory : public spl_process_factory { public: //: Return the default set of parameters for the process - virtual vpro_parameters_sptr default_params() const; + virtual spl_parameters_sptr default_params() const; //: Construct a process from a set of parameters - virtual vpro_process_sptr create(const vpro_parameters_sptr& params) const; + virtual spl_process_sptr create(const spl_parameters_sptr& params) const; //: The name of the process virtual vcl_string name() const { return "Image Difference"; } @@ -48,7 +48,7 @@ class vil_diff_process : public vpro_filter { //: Execute this process - vpro_signal execute(); + spl_signal execute(); }; diff --git a/vpro/filters/vil_gauss_filter.h b/spl/filters/vil_gauss_filter.h similarity index 77% rename from vpro/filters/vil_gauss_filter.h rename to spl/filters/vil_gauss_filter.h index a7bed8b..884470b 100644 --- a/vpro/filters/vil_gauss_filter.h +++ b/spl/filters/vil_gauss_filter.h @@ -1,6 +1,6 @@ -// This is vpro/filters/vil_gauss_filter.h -#ifndef vil_vpro_gauss_filter_h_ -#define vil_vpro_gauss_filter_h_ +// This is spl/filters/vil_gauss_filter.h +#ifndef vil_spl_gauss_filter_h_ +#define vil_spl_gauss_filter_h_ //: // \file @@ -19,19 +19,19 @@ #include #include -#include +#include //: Filter to smooth with a Gaussian template -class vil_vpro_gauss_filter : public vpro_filter +class vil_spl_gauss_filter : public spl_filter { public: //: Constructor - vil_vpro_gauss_filter(double sigma=1.0, bool reuse_output=true) + vil_spl_gauss_filter(double sigma=1.0, bool reuse_output=true) : gp_(sigma), reuse_output_(reuse_output) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -41,7 +41,7 @@ class vil_vpro_gauss_filter : public vpro_filter smooth_ = vil_image_view(); vil_gauss_filter_5tap(image,smooth_,gp_,work_); output(0, vil_new_image_resource_of_view(smooth_)); - return VPRO_VALID; + return SPL_VALID; } vil_gauss_filter_5tap_params gp_; @@ -52,4 +52,4 @@ class vil_vpro_gauss_filter : public vpro_filter }; -#endif // vil_vpro_gauss_filter_h_ +#endif // vil_spl_gauss_filter_h_ diff --git a/vpro/filters/vil_gaussian_blur_process.cxx b/spl/filters/vil_gaussian_blur_process.cxx similarity index 83% rename from vpro/filters/vil_gaussian_blur_process.cxx rename to spl/filters/vil_gaussian_blur_process.cxx index 36b8184..a25c6ac 100644 --- a/vpro/filters/vil_gaussian_blur_process.cxx +++ b/spl/filters/vil_gaussian_blur_process.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_gaussian_blur_process.cxx +// This is spl/filters/vil_gaussian_blur_process.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -10,8 +10,8 @@ #include "vil_gaussian_blur_process.h" -#include -#include +#include +#include #include #include @@ -20,10 +20,10 @@ //: Return the default set of parameters for the process -vpro_parameters_sptr +spl_parameters_sptr vil_gaussian_blur_process::factory::default_params() const { - vpro_parameters_sptr p = new vpro_parameters(); + spl_parameters_sptr p = new spl_parameters(); if(p->add("Gaussian Blur Sigma" , "sigma" , 1.0f )) return p; @@ -33,8 +33,8 @@ vil_gaussian_blur_process::factory::default_params() const //: Construct a process from a set of parameters -vpro_process_sptr -vil_gaussian_blur_process::factory::create(const vpro_parameters_sptr& params) const +spl_process_sptr +vil_gaussian_blur_process::factory::create(const spl_parameters_sptr& params) const { float sigma=0; if( !params->get_value( "sigma" , sigma ) ){ @@ -46,7 +46,7 @@ vil_gaussian_blur_process::factory::create(const vpro_parameters_sptr& params) c //: Run the process on the current frame -vpro_signal +spl_signal vil_gaussian_blur_process::execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); @@ -67,7 +67,7 @@ vil_gaussian_blur_process::execute() output(0,out_img); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vil_gaussian_blur_process.h b/spl/filters/vil_gaussian_blur_process.h similarity index 72% rename from vpro/filters/vil_gaussian_blur_process.h rename to spl/filters/vil_gaussian_blur_process.h index 3e4a063..495e318 100644 --- a/vpro/filters/vil_gaussian_blur_process.h +++ b/spl/filters/vil_gaussian_blur_process.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_gaussian_blur_process.h +// This is spl/filters/vil_gaussian_blur_process.h #ifndef vil_gaussian_blur_process_h_ #define vil_gaussian_blur_process_h_ @@ -20,21 +20,21 @@ #include #include -#include -#include +#include +#include -class vil_gaussian_blur_process : public vpro_filter +class vil_gaussian_blur_process : public spl_filter { public: - class factory : public vpro_process_factory + class factory : public spl_process_factory { public: //: Return the default set of parameters for the process - virtual vpro_parameters_sptr default_params() const; + virtual spl_parameters_sptr default_params() const; //: Construct a process from a set of parameters - virtual vpro_process_sptr create(const vpro_parameters_sptr& params) const; + virtual spl_process_sptr create(const spl_parameters_sptr& params) const; //: The name of the process virtual vcl_string name() const { return "Gaussian Blur"; } @@ -50,7 +50,7 @@ class vil_gaussian_blur_process : public vpro_filter //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: float sigma_; diff --git a/vpro/filters/vil_grad_sqr_filter.h b/spl/filters/vil_grad_sqr_filter.h similarity index 92% rename from vpro/filters/vil_grad_sqr_filter.h rename to spl/filters/vil_grad_sqr_filter.h index 65cfbc9..5c32b53 100644 --- a/vpro/filters/vil_grad_sqr_filter.h +++ b/spl/filters/vil_grad_sqr_filter.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_grad_sqr_filter.h +// This is spl/filters/vil_grad_sqr_filter.h #ifndef vil_grad_sqr_filter_h_ #define vil_grad_sqr_filter_h_ @@ -20,7 +20,7 @@ #include #include #include -#include +#include //: Compute the squares and cross terms of gradient. @@ -28,7 +28,7 @@ // The input is a 2-plane image containing Ix and Iy // The output is a 3-plane image containing Ix^2, Iy^2, and Ix*Iy template -class vil_grad_sqr_filter : public vpro_filter +class vil_grad_sqr_filter : public spl_filter { public: //: Constructor @@ -42,7 +42,7 @@ class vil_grad_sqr_filter : public vpro_filter }; //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -63,7 +63,7 @@ class vil_grad_sqr_filter : public vpro_filter vil_math_image_product(grad_i,grad_j,grad_ij); output(0, vil_new_image_resource_of_view(grad_sqr_)); - return VPRO_VALID; + return SPL_VALID; } bool reuse_output_; diff --git a/vpro/filters/vil_math_filters.h b/spl/filters/vil_math_filters.h similarity index 85% rename from vpro/filters/vil_math_filters.h rename to spl/filters/vil_math_filters.h index b7f841a..249b1b5 100644 --- a/vpro/filters/vil_math_filters.h +++ b/spl/filters/vil_math_filters.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_math_filters.h +// This is spl/filters/vil_math_filters.h #ifndef vil_math_filters_h_ #define vil_math_filters_h_ @@ -19,25 +19,25 @@ #include #include -#include +#include //: Filter to cast the image to a new type // Warning this filter modifies the input data template -class vil_math_scale_filter : public vpro_filter +class vil_math_scale_filter : public spl_filter { public: //: Constructor vil_math_scale_filter(double scale) : scale_(scale) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); vil_image_view image = in_img->get_view(); vil_math_scale_values(image,scale_); output(0, in_img); - return VPRO_VALID; + return SPL_VALID; } private: double scale_; @@ -48,21 +48,21 @@ class vil_math_scale_filter : public vpro_filter //: Filter to cast the image to a new type // Warning this filter modifies the input data template -class vil_math_scale_and_offset_filter : public vpro_filter +class vil_math_scale_and_offset_filter : public spl_filter { public: //: Constructor vil_math_scale_and_offset_filter(double scale, double offset) : scale_(scale), offset_(offset) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); vil_image_view image = in_img->get_view(); vil_math_scale_and_offset_values(image,scale_,offset_); output(0, in_img); - return VPRO_VALID; + return SPL_VALID; } private: double scale_; diff --git a/vpro/filters/vil_monotone_process.cxx b/spl/filters/vil_monotone_process.cxx similarity index 82% rename from vpro/filters/vil_monotone_process.cxx rename to spl/filters/vil_monotone_process.cxx index 6f5cd4c..6cefe7a 100644 --- a/vpro/filters/vil_monotone_process.cxx +++ b/spl/filters/vil_monotone_process.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_monotone_process.cxx +// This is spl/filters/vil_monotone_process.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -9,8 +9,8 @@ // \file #include "vil_monotone_process.h" -#include -#include +#include +#include #include #include #include @@ -18,10 +18,10 @@ //: Return the default set of parameters for the process -vpro_parameters_sptr +spl_parameters_sptr vil_monotone_process::factory::default_params() const { - vpro_parameters_sptr p = new vpro_parameters(); + spl_parameters_sptr p = new spl_parameters(); if(p->add( "Red Weight" , "rw", 0.2125f ) && p->add( "Green Weight", "gw", 0.7154f ) && p->add( "Blue Weight", "bw", 0.0721f ) ) @@ -33,8 +33,8 @@ vil_monotone_process::factory::default_params() const //: Construct a process from a set of parameters -vpro_process_sptr -vil_monotone_process::factory::create(const vpro_parameters_sptr& params) const +spl_process_sptr +vil_monotone_process::factory::create(const spl_parameters_sptr& params) const { float rw=0,gw=0,bw=0; if( !params->get_value( "rw" , rw ) || @@ -49,7 +49,7 @@ vil_monotone_process::factory::create(const vpro_parameters_sptr& params) const //: Execute this process -vpro_signal +spl_signal vil_monotone_process::execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); @@ -61,6 +61,6 @@ vil_monotone_process::execute() output(0,out_img); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vil_monotone_process.h b/spl/filters/vil_monotone_process.h similarity index 76% rename from vpro/filters/vil_monotone_process.h rename to spl/filters/vil_monotone_process.h index a5415ed..996dfa5 100644 --- a/vpro/filters/vil_monotone_process.h +++ b/spl/filters/vil_monotone_process.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_monotone_process.h +// This is spl/filters/vil_monotone_process.h #ifndef vil_monotone_process_h_ #define vil_monotone_process_h_ @@ -19,11 +19,11 @@ #include #include -#include -#include +#include +#include //: Process that converts an image into monotone (grey-scale) -class vil_monotone_process : public vpro_filter +class vil_monotone_process : public spl_filter { public: //: Constructor @@ -32,14 +32,14 @@ class vil_monotone_process : public vpro_filter //: Destructor virtual ~vil_monotone_process() {} - class factory : public vpro_process_factory + class factory : public spl_process_factory { public: //: Return the default set of parameters for the process - virtual vpro_parameters_sptr default_params() const; + virtual spl_parameters_sptr default_params() const; //: Construct a process from a set of parameters - virtual vpro_process_sptr create(const vpro_parameters_sptr& params) const; + virtual spl_process_sptr create(const spl_parameters_sptr& params) const; //: The name of the process virtual vcl_string name() const { return "Convert to Monotone"; } @@ -48,7 +48,7 @@ class vil_monotone_process : public vpro_filter }; //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: //: The weights for combining color channels diff --git a/vpro/filters/vil_morphology_filters.cxx b/spl/filters/vil_morphology_filters.cxx similarity index 92% rename from vpro/filters/vil_morphology_filters.cxx rename to spl/filters/vil_morphology_filters.cxx index 4dba446..2dde735 100644 --- a/vpro/filters/vil_morphology_filters.cxx +++ b/spl/filters/vil_morphology_filters.cxx @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_morphology_filters.cxx +// This is spl/filters/vil_morphology_filters.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -17,7 +17,7 @@ //: Execute this process -vpro_signal +spl_signal vil_binary_erode_filter::execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); @@ -33,12 +33,12 @@ vil_binary_erode_filter::execute() vil_image_resource_sptr out_img = vil_new_image_resource_of_view(image_out); output(0,out_img); - return VPRO_VALID; + return SPL_VALID; } //: Execute this process -vpro_signal +spl_signal vil_binary_dilate_filter::execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); @@ -54,7 +54,7 @@ vil_binary_dilate_filter::execute() vil_image_resource_sptr out_img = vil_new_image_resource_of_view(image_out); output(0,out_img); - return VPRO_VALID; + return SPL_VALID; } diff --git a/vpro/filters/vil_morphology_filters.h b/spl/filters/vil_morphology_filters.h similarity index 82% rename from vpro/filters/vil_morphology_filters.h rename to spl/filters/vil_morphology_filters.h index 2d28b42..f9140fd 100644 --- a/vpro/filters/vil_morphology_filters.h +++ b/spl/filters/vil_morphology_filters.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_morphology_filters.h +// This is spl/filters/vil_morphology_filters.h #ifndef vil_morphology_filters_h_ #define vil_morphology_filters_h_ @@ -18,12 +18,12 @@ // \endverbatim -#include +#include #include //: Filter for binary erosion -class vil_binary_erode_filter : public vpro_filter +class vil_binary_erode_filter : public spl_filter { public: //: Constructor @@ -32,7 +32,7 @@ class vil_binary_erode_filter : public vpro_filter virtual ~vil_binary_erode_filter() {} //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: vil_structuring_element se_; @@ -41,7 +41,7 @@ class vil_binary_erode_filter : public vpro_filter //: Filter for binary dilation -class vil_binary_dilate_filter : public vpro_filter +class vil_binary_dilate_filter : public spl_filter { public: //: Constructor @@ -50,7 +50,7 @@ class vil_binary_dilate_filter : public vpro_filter virtual ~vil_binary_dilate_filter() {} //: Execute this process - vpro_signal execute(); + spl_signal execute(); private: vil_structuring_element se_; diff --git a/vpro/filters/vil_sobel_1x3_filter.h b/spl/filters/vil_sobel_1x3_filter.h similarity index 88% rename from vpro/filters/vil_sobel_1x3_filter.h rename to spl/filters/vil_sobel_1x3_filter.h index 2c7bca5..2216c06 100644 --- a/vpro/filters/vil_sobel_1x3_filter.h +++ b/spl/filters/vil_sobel_1x3_filter.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_sobel_1x3_filter.h +// This is spl/filters/vil_sobel_1x3_filter.h #ifndef vil_sobel_1x3_filter_h_ #define vil_sobel_1x3_filter_h_ @@ -19,12 +19,12 @@ #include #include -#include +#include //: A Sobel 1x3 filter to produce image gradients // The output is a 2-plane image containing Ix and Iy template -class vil_sobel_1x3_filter : public vpro_filter +class vil_sobel_1x3_filter : public spl_filter { public: //: Constructor @@ -32,7 +32,7 @@ class vil_sobel_1x3_filter : public vpro_filter : reuse_output_(reuse_output) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -42,7 +42,7 @@ class vil_sobel_1x3_filter : public vpro_filter grad_ij_ = vil_image_view(); vil_sobel_1x3(image,grad_ij_); output(0, vil_new_image_resource_of_view(grad_ij_)); - return VPRO_VALID; + return SPL_VALID; } bool reuse_output_; diff --git a/vpro/filters/vil_subpix_edge_filter.h b/spl/filters/vil_subpix_edge_filter.h similarity index 89% rename from vpro/filters/vil_subpix_edge_filter.h rename to spl/filters/vil_subpix_edge_filter.h index b775dcb..b562fcd 100644 --- a/vpro/filters/vil_subpix_edge_filter.h +++ b/spl/filters/vil_subpix_edge_filter.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_subpix_edge_filter.h +// This is spl/filters/vil_subpix_edge_filter.h #ifndef vil_subpix_edge_filter_h_ #define vil_subpix_edge_filter_h_ @@ -20,11 +20,11 @@ #include #include #include -#include +#include //: Suppress all non-maximal edges and estimate subpixel locations template -class vil_subpix_edge_filter : public vpro_filter +class vil_subpix_edge_filter : public spl_filter { public: //: Constructor @@ -32,7 +32,7 @@ class vil_subpix_edge_filter : public vpro_filter : mag_thresh_(mag_thresh), reuse_output_(reuse_output) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -44,7 +44,7 @@ class vil_subpix_edge_filter : public vpro_filter grad_moo_ = vil_image_view(); vil_suppress_non_max_edges_subpixel(grad_i,grad_j,mag_thresh_,grad_moo_); output(0, vil_new_image_resource_of_view(grad_moo_)); - return VPRO_VALID; + return SPL_VALID; } double mag_thresh_; diff --git a/vpro/filters/vil_transform3_1_filter.h b/spl/filters/vil_transform3_1_filter.h similarity index 92% rename from vpro/filters/vil_transform3_1_filter.h rename to spl/filters/vil_transform3_1_filter.h index 6305b68..3a08dd3 100644 --- a/vpro/filters/vil_transform3_1_filter.h +++ b/spl/filters/vil_transform3_1_filter.h @@ -1,4 +1,4 @@ -// This is vpro/filters/vil_transform3_1_filter.h +// This is spl/filters/vil_transform3_1_filter.h #ifndef vil_transform3_1_filter_h_ #define vil_transform3_1_filter_h_ @@ -18,11 +18,11 @@ // \endverbatim #include -#include +#include //: Apply a function of 3 variables to map 3 planes into 1 template -class vil_transform3_1_filter : public vpro_filter +class vil_transform3_1_filter : public spl_filter { public: //: Constructor @@ -30,7 +30,7 @@ class vil_transform3_1_filter : public vpro_filter : functor_(functor), reuse_output_(reuse_output) {} //: Execute this process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(vil_image_resource_sptr)); vil_image_resource_sptr in_img = input(0); @@ -63,7 +63,7 @@ class vil_transform3_1_filter : public vpro_filter } output(0, vil_new_image_resource_of_view(out_img_)); - return VPRO_VALID; + return SPL_VALID; } Op functor_; diff --git a/spl/introduction_doxy.txt b/spl/introduction_doxy.txt new file mode 100644 index 0000000..07b3210 --- /dev/null +++ b/spl/introduction_doxy.txt @@ -0,0 +1,15 @@ +// The following text is included in the main documentation page by doxygen +/*! \mainpage spl : Video Processing Library +* This library provides a set of base classes for process, storage, and parameters object. +* +* \section spl_overview Overview +* +* The spl_storage class is an abstract base class for +* derived storage classes that may store any type of data. The spl_process class +* is an abstract base class for derived process classes that execute various algorithms +* Thus, a spl_storage class is a wrapper around your data structures while a +* spl_process is a wrapper around your algorithm. Additional parameters to a +* process are managed by the spl_parameters class. +* +* +*/ diff --git a/vpro/vpro_basic_processes.h b/spl/spl_basic_processes.h similarity index 68% rename from vpro/vpro_basic_processes.h rename to spl/spl_basic_processes.h index a79a20a..0d5da76 100644 --- a/vpro/vpro_basic_processes.h +++ b/spl/spl_basic_processes.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_basic_processes.h -#ifndef vpro_basic_processes_h_ -#define vpro_basic_processes_h_ +// This is spl/spl_basic_processes.h +#ifndef spl_basic_processes_h_ +#define spl_basic_processes_h_ //-------------------------------------------------------------------------------- //: // \file @@ -21,7 +21,7 @@ //-------------------------------------------------------------------------------- -#include +#include #include //============================================================================= @@ -31,16 +31,16 @@ //: Wrap a function (or functor) with one argument template -class vpro_functor1_filter : public vpro_filter +class spl_functor1_filter : public spl_filter { public: - vpro_functor1_filter(const _functor& fun) : f(fun) {} + spl_functor1_filter(const _functor& fun) : f(fun) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T1)); output(0, f(input(0))); - return VPRO_VALID; + return SPL_VALID; } _functor f; }; @@ -48,17 +48,17 @@ class vpro_functor1_filter : public vpro_filter //: Wrap a function (or functor) with two arguments template -class vpro_functor2_filter : public vpro_filter +class spl_functor2_filter : public spl_filter { public: - vpro_functor2_filter(const _functor& fun) : f(fun) {} + spl_functor2_filter(const _functor& fun) : f(fun) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T1)); assert(input_type_id(1) == typeid(T2)); output(0, f(input(0),input(1))); - return VPRO_VALID; + return SPL_VALID; } _functor f; }; @@ -66,18 +66,18 @@ class vpro_functor2_filter : public vpro_filter //: Wrap a function (or functor) with three arguments template -class vpro_functor3_filter : public vpro_filter +class spl_functor3_filter : public spl_filter { public: - vpro_functor3_filter(const _functor& fun) : f(fun) {} + spl_functor3_filter(const _functor& fun) : f(fun) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T1)); assert(input_type_id(1) == typeid(T2)); assert(input_type_id(2) == typeid(T3)); output(0, f(input(0),input(1),input(2))); - return VPRO_VALID; + return SPL_VALID; } _functor f; }; @@ -85,15 +85,15 @@ class vpro_functor3_filter : public vpro_filter //: Static cast from \c inT to \c outT template -class vpro_static_cast_filter : public vpro_filter +class spl_static_cast_filter : public spl_filter { public: //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(inT)); output(0, static_cast(input(0))); - return VPRO_VALID; + return SPL_VALID; } }; @@ -106,16 +106,16 @@ class vpro_static_cast_filter : public vpro_filter //: Wrap a function (or functor) with no arguments template -class vpro_functor_source : public vpro_source +class spl_functor_source : public spl_source { public: - vpro_functor_source(const _functor& fun) : f(fun) {} + spl_functor_source(const _functor& fun) : f(fun) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { output(0, f()); - return VPRO_VALID; + return SPL_VALID; } _functor f; }; @@ -124,17 +124,17 @@ class vpro_functor_source : public vpro_source //: A source that always provides the same data // (unless modified explictly) template -class vpro_static_source : public vpro_source +class spl_static_source : public spl_source { public: - vpro_static_source() {} - vpro_static_source(const T& d) : data(d) {} + spl_static_source() {} + spl_static_source(const T& d) : data(d) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { output(0, data); - return VPRO_VALID; + return SPL_VALID; } T data; @@ -142,21 +142,21 @@ class vpro_static_source : public vpro_source template -class vpro_input_queue : public vpro_source +class spl_input_queue : public spl_source { public: - vpro_input_queue(const vcl_vector& d) : data(d) {} + spl_input_queue(const vcl_vector& d) : data(d) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { if(data.empty()){ - return VPRO_EOS; + return SPL_EOS; } output(0, data.back()); data.pop_back(); - return VPRO_VALID; + return SPL_VALID; } vcl_vector data; @@ -170,27 +170,27 @@ class vpro_input_queue : public vpro_source //: A sink that does nothing // helps pump data to other observers -class vpro_null_sink : public vpro_sink +class spl_null_sink : public spl_sink { public: //: Execute the process - vpro_signal execute() { return VPRO_VALID; } + spl_signal execute() { return SPL_VALID; } }; template -class vpro_output_queue : public vpro_sink +class spl_output_queue : public spl_sink { public: - vpro_output_queue() : data() {} + spl_output_queue() : data() {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T)); data.push_back(input(0)); - return VPRO_VALID; + return SPL_VALID; } vcl_vector data; @@ -198,4 +198,4 @@ class vpro_output_queue : public vpro_sink -#endif // vpro_basic_processes_h_ +#endif // spl_basic_processes_h_ diff --git a/vpro/vpro_config.h.in b/spl/spl_config.h.in similarity index 72% rename from vpro/vpro_config.h.in rename to spl/spl_config.h.in index 109d0a5..5f13862 100644 --- a/vpro/vpro_config.h.in +++ b/spl/spl_config.h.in @@ -1,5 +1,5 @@ -#ifndef vpro_config_h_ -#define vpro_config_h_ +#ifndef spl_config_h_ +#define spl_config_h_ // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -9,18 +9,18 @@ // If the suffix of this file is ".in", this is the source file used // to generate the actual configuration file. To examine the actual -// configuration of the library, look at the vpro_config.h file in +// configuration of the library, look at the spl_config.h file in // the _build_ tree. #cmakedefine CMAKE_USE_PTHREADS_INIT #ifdef CMAKE_USE_PTHREADS_INIT -#define VPRO_HAS_PTHREADS 1 +#define SPL_HAS_PTHREADS 1 #else -#define VPRO_HAS_PTHREADS 0 +#define SPL_HAS_PTHREADS 0 #endif #undef CMAKE_USE_PTHREADS_INIT -#endif //vpro_config_h_ +#endif //spl_config_h_ diff --git a/vpro/vpro_connector.cxx b/spl/spl_connector.cxx similarity index 63% rename from vpro/vpro_connector.cxx rename to spl/spl_connector.cxx index 9478c98..6d83d46 100644 --- a/vpro/vpro_connector.cxx +++ b/spl/spl_connector.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_connector.cxx +// This is spl/spl_connector.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,13 +8,13 @@ //: // \file -#include -#include +#include +#include //: Transmit the data to the input of a process bool -vpro_connector::notify(const vpro_storage_sptr& data, +spl_connector::notify(const spl_storage_sptr& data, unsigned long timestamp) { data_ = data; @@ -25,7 +25,7 @@ vpro_connector::notify(const vpro_storage_sptr& data, //: disconnect from a process output pin bool -vpro_connector::unlink() +spl_connector::unlink() { if(source_){ if(!source_->remove_output_observer(source_pin_,this)) @@ -38,7 +38,7 @@ vpro_connector::unlink() //: Connect this connector to the output of a process bool -vpro_connector::link(const vpro_process_sptr& process, unsigned int pin) +spl_connector::link(const spl_process_sptr& process, unsigned int pin) { if(!unlink() || !process ) return false; @@ -51,14 +51,14 @@ vpro_connector::link(const vpro_process_sptr& process, unsigned int pin) //: Make a request to the source for data -vpro_signal -vpro_connector::request_data(unsigned long timestamp, - vpro_debug_observer* const debug) const +spl_signal +spl_connector::request_data(unsigned long timestamp, + spl_debug_observer* const debug) const { if(!source_) - return VPRO_INVALID; - vpro_signal result = source_->run(timestamp,debug); - if(result == VPRO_VALID && !data_) - return VPRO_INVALID; + return SPL_INVALID; + spl_signal result = source_->run(timestamp,debug); + if(result == SPL_VALID && !data_) + return SPL_INVALID; return result; } diff --git a/vpro/vpro_connector.h b/spl/spl_connector.h similarity index 65% rename from vpro/vpro_connector.h rename to spl/spl_connector.h index 98e00a7..3712ebc 100644 --- a/vpro/vpro_connector.h +++ b/spl/spl_connector.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_connector.h -#ifndef vpro_connector_h_ -#define vpro_connector_h_ +// This is spl/spl_connector.h +#ifndef spl_connector_h_ +#define spl_connector_h_ //-------------------------------------------------------------------------------- //: // \file @@ -23,21 +23,21 @@ //-------------------------------------------------------------------------------- -#include -#include +#include +#include //: An observer that connects a process output to a process input -class vpro_connector : public vpro_observer +class spl_connector : public spl_observer { public: //: Constructor - vpro_connector() : data_(NULL), source_(NULL), source_pin_(0), timestamp_(0) {} + spl_connector() : data_(NULL), source_(NULL), source_pin_(0), timestamp_(0) {} //: Transmit the data to the input of a process - bool notify(const vpro_storage_sptr& data, unsigned long timestamp); + bool notify(const spl_storage_sptr& data, unsigned long timestamp); //: Access the data - vpro_storage_sptr data() const { return data_; } + spl_storage_sptr data() const { return data_; } //: Access the timestamp unsigned long timestamp() const { return timestamp_; } @@ -46,15 +46,15 @@ class vpro_connector : public vpro_observer bool unlink(); //: Make a request to the source for data - vpro_signal request_data(unsigned long timestamp, - vpro_debug_observer* const debug = NULL) const; + spl_signal request_data(unsigned long timestamp, + spl_debug_observer* const debug = NULL) const; //: Connect this connector to the output of a process - bool link(const vpro_process_sptr& process, unsigned int pin); + bool link(const spl_process_sptr& process, unsigned int pin); private: - vpro_storage_sptr data_; - vpro_process* source_; + spl_storage_sptr data_; + spl_process* source_; unsigned int source_pin_; unsigned long timestamp_; }; @@ -62,4 +62,4 @@ class vpro_connector : public vpro_observer -#endif // vpro_connector_h_ +#endif // spl_connector_h_ diff --git a/vpro/vpro_connector_sptr.h b/spl/spl_connector_sptr.h similarity index 66% rename from vpro/vpro_connector_sptr.h rename to spl/spl_connector_sptr.h index a31fb51..c0e4ef1 100644 --- a/vpro/vpro_connector_sptr.h +++ b/spl/spl_connector_sptr.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_connector_sptr.h -#ifndef vpro_connector_sptr_h -#define vpro_connector_sptr_h +// This is spl/spl_connector_sptr.h +#ifndef spl_connector_sptr_h +#define spl_connector_sptr_h //-------------------------------------------------------------------------------- //: // \file @@ -21,11 +21,11 @@ //-------------------------------------------------------------------------------- -class vpro_connector; +class spl_connector; -#include +#include -//: Smart-pointer to a vpro_connector. -typedef vpro_observer_sptr_t vpro_connector_sptr; +//: Smart-pointer to a spl_connector. +typedef spl_observer_sptr_t spl_connector_sptr; -#endif // vpro_connector_sptr_h +#endif // spl_connector_sptr_h diff --git a/vpro/vpro_delay.cxx b/spl/spl_delay.cxx similarity index 73% rename from vpro/vpro_delay.cxx rename to spl/spl_delay.cxx index 791a8c0..4ca9a4d 100644 --- a/vpro/vpro_delay.cxx +++ b/spl/spl_delay.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_delay.cxx +// This is spl/spl_delay.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,39 +8,39 @@ //: // \file -#include "vpro_delay.h" +#include "spl_delay.h" #include #include -#include -#if VPRO_HAS_PTHREADS +#include +#if SPL_HAS_PTHREADS #include #endif //: Constructor -vpro_delay::vpro_delay(unsigned int size) +spl_delay::spl_delay(unsigned int size) : max_size_(size), recieved_timestamp_(0), - recieved_signal_(VPRO_WAIT) + recieved_signal_(SPL_WAIT) { } //: Destructor -vpro_delay::~vpro_delay() +spl_delay::~spl_delay() { } -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS // helper code to launch and manage pthreads namespace{ struct pthread_data { - vpro_delay* delay; + spl_delay* delay; unsigned long timestamp; - vpro_debug_observer* debug; + spl_debug_observer* debug; }; void* pthread_launcher(void *arg) @@ -55,9 +55,9 @@ namespace{ //: Runs the filter -vpro_signal -vpro_delay::run(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_delay::run(unsigned long timestamp, + spl_debug_observer* const debug) { // notify the debugger if available if (debug) debug->notify_enter(this, timestamp); @@ -75,19 +75,19 @@ vpro_delay::run(unsigned long timestamp, } this->last_signal_ = this->recieved_signal_; - if(this->last_signal_ == VPRO_WAIT) - this->last_signal_ = VPRO_VALID; + if(this->last_signal_ == SPL_WAIT) + this->last_signal_ = SPL_VALID; for(unsigned int i=0; inotify_observers(VPRO_WAIT)) - this->last_signal_ = VPRO_WAIT; + if(!this->notify_observers(SPL_WAIT)) + this->last_signal_ = SPL_WAIT; queue_mutex_.unlock(); -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS // launch a thread to get the next round of data pthread_data* pd = new pthread_data(); pd->delay = this; @@ -116,22 +116,22 @@ vpro_delay::run(unsigned long timestamp, } //: Run the process on the current frame -vpro_signal -vpro_delay::execute() +spl_signal +spl_delay::execute() { - return VPRO_INVALID; + return SPL_INVALID; } //: Request data from dependents and shift the queue void -vpro_delay::shift_queue(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_delay::shift_queue(unsigned long timestamp, + spl_debug_observer* const debug) { queue_mutex_.lock(); this->recieved_signal_ = this->request_inputs(timestamp,debug); - if( this->recieved_signal_ == VPRO_VALID){ - vpro_connector_sptr connector = input_connectors_.begin()->second; + if( this->recieved_signal_ == SPL_VALID){ + spl_connector_sptr connector = input_connectors_.begin()->second; recieved_timestamp_ = connector->timestamp(); assert(recieved_timestamp_ == timestamp); queue_.push_front(connector->data()); diff --git a/vpro/vpro_delay.h b/spl/spl_delay.h similarity index 51% rename from vpro/vpro_delay.h rename to spl/spl_delay.h index 77819d1..bfb182a 100644 --- a/vpro/vpro_delay.h +++ b/spl/spl_delay.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_delay.h -#ifndef vpro_delay_h_ -#define vpro_delay_h_ +// This is spl/spl_delay.h +#ifndef spl_delay_h_ +#define spl_delay_h_ //: // \file @@ -18,52 +18,52 @@ // \endverbatim -#include -#include -#include +#include +#include +#include #include //: A process that intoduces a time delay -class vpro_delay : public vpro_process +class spl_delay : public spl_process { public: //: Constructor - vpro_delay(unsigned int size = 1); + spl_delay(unsigned int size = 1); //: Constructor template - vpro_delay(unsigned int size, const T& data) - : max_size_(size), recieved_timestamp_(0), recieved_signal_(VPRO_VALID), - queue_(size,new vpro_storage_type(data)) + spl_delay(unsigned int size, const T& data) + : max_size_(size), recieved_timestamp_(0), recieved_signal_(SPL_VALID), + queue_(size,new spl_storage_type(data)) { } //: Destructor - virtual ~vpro_delay(); + virtual ~spl_delay(); //: Runs the process - vpro_signal run(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal run(unsigned long timestamp, + spl_debug_observer* const debug = NULL); //: Execute this process - vpro_signal execute(); + spl_signal execute(); //: Request data from dependents and shift the queue void shift_queue(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_debug_observer* const debug = NULL); private: unsigned max_size_; unsigned long recieved_timestamp_; - vpro_signal recieved_signal_; - vcl_deque queue_; + spl_signal recieved_signal_; + vcl_deque queue_; //: mutex for updating the queue - vpro_mutex queue_mutex_; + spl_mutex queue_mutex_; }; -#endif // vpro_delay_h_ +#endif // spl_delay_h_ diff --git a/vpro/vpro_executive.cxx b/spl/spl_executive.cxx similarity index 62% rename from vpro/vpro_executive.cxx rename to spl/spl_executive.cxx index 9593438..4952331 100644 --- a/vpro/vpro_executive.cxx +++ b/spl/spl_executive.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_executive.cxx +// This is spl/spl_executive.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,11 +8,11 @@ //: // \file -#include "vpro_executive.h" -#include +#include "spl_executive.h" +#include -#include "vpro_delay.h" -#include "vpro_mutex.h" +#include "spl_delay.h" +#include "spl_mutex.h" #include #include #include @@ -21,29 +21,29 @@ namespace{ // anonymous namespace -vcl_ostream& operator<<(vcl_ostream& os, vpro_signal s){ +vcl_ostream& operator<<(vcl_ostream& os, spl_signal s){ switch(s){ - case VPRO_VALID: os << "VALID"; break; - case VPRO_INVALID: os << "INVALID"; break; - case VPRO_EOS: os << "EOS"; break; - case VPRO_WAIT: os << "WAIT"; break; + case SPL_VALID: os << "VALID"; break; + case SPL_INVALID: os << "INVALID"; break; + case SPL_EOS: os << "EOS"; break; + case SPL_WAIT: os << "WAIT"; break; } return os; } -class executive_debug: public vpro_debug_observer +class executive_debug: public spl_debug_observer { public: - executive_debug(vpro_executive* exec, vcl_ostream& os) : exec_(exec), os_(os) {} + executive_debug(spl_executive* exec, vcl_ostream& os) : exec_(exec), os_(os) {} virtual ~executive_debug(){} - virtual void notify_enter(const vpro_process* const pro, unsigned int timestamp) + virtual void notify_enter(const spl_process* const pro, unsigned int timestamp) { process_stack_.push_back(pro); vcl_string pname = exec_->process_name(pro); name_stack_.push_back(pname); display_mutex_.lock(); -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS os_ << pthread_self(); #endif @@ -54,12 +54,12 @@ class executive_debug: public vpro_debug_observer display_mutex_.unlock(); } - virtual void notify_exit(const vpro_process* const pro, unsigned int /*timestamp*/) + virtual void notify_exit(const spl_process* const pro, unsigned int /*timestamp*/) { assert(pro == process_stack_.back()); vcl_string pname = name_stack_.back(); display_mutex_.lock(); -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS os_ << pthread_self(); #endif for(unsigned i=0; i::iterator f = runtimes_.find(pro); + vcl_map::iterator f = runtimes_.find(pro); if( f == runtimes_.end() ) runtimes_[pro] = t; else @@ -98,40 +98,40 @@ class executive_debug: public vpro_debug_observer //: clone the debug observer // clones are made for each thread during a branch - virtual vpro_debug_observer* clone() const + virtual spl_debug_observer* clone() const { return new executive_debug(*this); } //: merge the data from another into this // clones are merged when threads are joined threads - virtual void merge(const vpro_debug_observer& /*other*/) + virtual void merge(const spl_debug_observer& /*other*/) { //const executive_debug& eother = dynamic_cast(other); //os_ << eother.os_.str(); } private: - vpro_executive* exec_; - vcl_vector process_stack_; + spl_executive* exec_; + vcl_vector process_stack_; vcl_vector name_stack_; - vcl_map runtimes_; + vcl_map runtimes_; vul_timer timer_; vcl_ostream& os_; - static vpro_mutex display_mutex_; + static spl_mutex display_mutex_; }; -vpro_mutex executive_debug::display_mutex_; +spl_mutex executive_debug::display_mutex_; }; //end anonymous namespace //: Find a process by name or return NULL -vpro_process_sptr -vpro_executive::find(const vcl_string& name) const +spl_process_sptr +spl_executive::find(const vcl_string& name) const { - typedef vcl_map::const_iterator Itr; + typedef vcl_map::const_iterator Itr; Itr result = pmap_.find(name); if(result == pmap_.end()) return NULL; @@ -140,26 +140,26 @@ vpro_executive::find(const vcl_string& name) const //: Run the entire graph and iterate until error or end of stream -vpro_signal -vpro_executive::run_all() const +spl_signal +spl_executive::run_all() const { - vpro_signal retval = VPRO_VALID; - while(retval == VPRO_VALID || retval == VPRO_WAIT) + spl_signal retval = SPL_VALID; + while(retval == SPL_VALID || retval == SPL_WAIT) retval = run_step(); return retval; } //: Run one step of the stream processing -vpro_signal -vpro_executive::run_step() const +spl_signal +spl_executive::run_step() const { ++time_; - vpro_signal retval = VPRO_VALID; - typedef vcl_set::const_iterator Itr; + spl_signal retval = SPL_VALID; + typedef vcl_set::const_iterator Itr; for(Itr i = sinks_.begin(); i != sinks_.end(); ++i){ - vpro_signal s = (*i)->run(time_,debug_); - if(s != VPRO_VALID) + spl_signal s = (*i)->run(time_,debug_); + if(s != SPL_VALID) retval = s; } return retval; @@ -169,15 +169,15 @@ vpro_executive::run_step() const //: Initialize the process graph //: Call this after adding processes but before running void -vpro_executive::init() +spl_executive::init() { - typedef vcl_map::const_iterator Itr; + typedef vcl_map::const_iterator Itr; time_ = 0; sinks_.clear(); for(Itr i = pmap_.begin(); i != pmap_.end(); ++i) - if(dynamic_cast(i->second.ptr())) + if(dynamic_cast(i->second.ptr())) sinks_.insert(i->second); #ifndef NDEBUG @@ -190,7 +190,7 @@ vpro_executive::init() //: enable debug statements void -vpro_executive::enable_debug() +spl_executive::enable_debug() { if(debug_) delete debug_; @@ -200,9 +200,9 @@ vpro_executive::enable_debug() //: Lookup a process name by process pointer vcl_string -vpro_executive::process_name(const vpro_process* const pro) const +spl_executive::process_name(const spl_process* const pro) const { - typedef vcl_map::const_iterator Itr; + typedef vcl_map::const_iterator Itr; for(Itr i = pmap_.begin(); i != pmap_.end(); ++i) if(pro == i->second.ptr()) return i->first; diff --git a/vpro/vpro_executive.h b/spl/spl_executive.h similarity index 58% rename from vpro/vpro_executive.h rename to spl/spl_executive.h index 729fa23..059c107 100644 --- a/vpro/vpro_executive.h +++ b/spl/spl_executive.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_executive.h -#ifndef vpro_executive_h_ -#define vpro_executive_h_ +// This is spl/spl_executive.h +#ifndef spl_executive_h_ +#define spl_executive_h_ //: // \file @@ -20,73 +20,73 @@ #include #include -#include +#include //: An object to contain and execute a process graph -class vpro_executive +class spl_executive { public: class proxy{ public: - friend class vpro_executive; + friend class spl_executive; //: Copy constructor proxy(const proxy& other) : exec(other.exec), name(other.name) {} - operator vpro_process_sptr() const { return exec.find(name); } - proxy& operator= (const vpro_process_sptr& p) + operator spl_process_sptr() const { return exec.find(name); } + proxy& operator= (const spl_process_sptr& p) { exec.pmap_[name] = p; return *this; } - vpro_process* operator->() { return exec.find(name).as_pointer(); } - vpro_process* ptr() { return exec.find(name).as_pointer(); } + spl_process* operator->() { return exec.find(name).as_pointer(); } + spl_process* ptr() { return exec.find(name).as_pointer(); } private: - proxy(vpro_executive& e, const vcl_string& n) + proxy(spl_executive& e, const vcl_string& n) : exec(e), name(n) {} - vpro_executive& exec; + spl_executive& exec; vcl_string name; }; //: Constructor - vpro_executive() : time_(0), debug_(NULL) {} + spl_executive() : time_(0), debug_(NULL) {} //: Destructor - ~vpro_executive() { delete debug_; } + ~spl_executive() { delete debug_; } //: Accessor for assignment proxy operator[](const vcl_string& name) { return proxy(*this,name); } //: Accessor for const access - vpro_process_sptr operator[](const vcl_string& name) const { return find(name); } + spl_process_sptr operator[](const vcl_string& name) const { return find(name); } //: Initialize the process graph //: Call this after adding processes but before running void init(); //: Run the entire graph and iterate until error or end of stream - vpro_signal run_all() const; + spl_signal run_all() const; //: Run one step of the stream processing - vpro_signal run_step() const; + spl_signal run_step() const; //: enable debug statements void enable_debug(); //: Lookup a process name by process pointer - vcl_string process_name(const vpro_process* const pro) const; + vcl_string process_name(const spl_process* const pro) const; private: //: Find a process by name or return NULL - vpro_process_sptr find(const vcl_string& name) const; + spl_process_sptr find(const vcl_string& name) const; //: Map from names to processes - vcl_map pmap_; + vcl_map pmap_; //: The set of sinks - vcl_set sinks_; + vcl_set sinks_; //: The current time mutable unsigned long time_; - vpro_debug_observer* debug_; + spl_debug_observer* debug_; }; -#endif // vpro_executive_h_ +#endif // spl_executive_h_ diff --git a/vpro/vpro_fwd.h b/spl/spl_fwd.h similarity index 70% rename from vpro/vpro_fwd.h rename to spl/spl_fwd.h index 30bfb64..8a3bd51 100644 --- a/vpro/vpro_fwd.h +++ b/spl/spl_fwd.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_fwd.h -#ifndef vpro_fwd_h_ -#define vpro_fwd_h_ +// This is spl/spl_fwd.h +#ifndef spl_fwd_h_ +#define spl_fwd_h_ //-------------------------------------------------------------------------------- //: // \file @@ -20,13 +20,13 @@ //-------------------------------------------------------------------------------- -enum vpro_signal { VPRO_VALID, VPRO_INVALID, VPRO_EOS, VPRO_WAIT }; +enum spl_signal { SPL_VALID, SPL_INVALID, SPL_EOS, SPL_WAIT }; -class vpro_process; -class vpro_storage; -class vpro_observer; -class vpro_connector; +class spl_process; +class spl_storage; +class spl_observer; +class spl_connector; -#endif // vpro_fwd_h_ +#endif // spl_fwd_h_ diff --git a/vpro/vpro_ios_processes.h b/spl/spl_ios_processes.h similarity index 74% rename from vpro/vpro_ios_processes.h rename to spl/spl_ios_processes.h index 5aaa100..88adb6b 100644 --- a/vpro/vpro_ios_processes.h +++ b/spl/spl_ios_processes.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_ios_processes.h -#ifndef vpro_ios_processes_h_ -#define vpro_ios_processes_h_ +// This is spl/spl_ios_processes.h +#ifndef spl_ios_processes_h_ +#define spl_ios_processes_h_ //-------------------------------------------------------------------------------- //: // \file @@ -20,7 +20,7 @@ //-------------------------------------------------------------------------------- -#include +#include #include #include #include @@ -37,28 +37,28 @@ //: Read data of type T from an istream template -class vpro_istream_source : public vpro_source +class spl_istream_source : public spl_source { public: - vpro_istream_source(const vcl_istream& istream) : is(istream) {} + spl_istream_source(const vcl_istream& istream) : is(istream) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { if(is.eof()){ - return VPRO_EOS; + return SPL_EOS; } T data; is >> data; output(0, data); - return VPRO_VALID; + return SPL_VALID; } vcl_istream is; }; //: Read data from an ifstream (base class) -class vpro_ifstream_source_base : public vpro_source +class spl_ifstream_source_base : public spl_source { public: virtual bool open(const vcl_string& filename) = 0; @@ -67,10 +67,10 @@ class vpro_ifstream_source_base : public vpro_source //: Read data of type T from an ifstream template -class vpro_ifstream_source : public vpro_ifstream_source_base +class spl_ifstream_source : public spl_ifstream_source_base { public: - vpro_ifstream_source(const vcl_string& filename) { open(filename.c_str()); } + spl_ifstream_source(const vcl_string& filename) { open(filename.c_str()); } bool open(const vcl_string& filename) { @@ -79,15 +79,15 @@ class vpro_ifstream_source : public vpro_ifstream_source_base } //: Execute the process - vpro_signal execute() + spl_signal execute() { if(ifs.eof()){ - return VPRO_EOS; + return SPL_EOS; } T data; ifs >> data; output(0, data); - return VPRO_VALID; + return SPL_VALID; } vcl_ifstream ifs; @@ -96,13 +96,13 @@ class vpro_ifstream_source : public vpro_ifstream_source_base //: Read data of type T using ifstream from a list of files template -class vpro_ifstream_list_source : public vpro_ifstream_source_base +class spl_ifstream_list_source : public spl_ifstream_source_base { public: - vpro_ifstream_list_source(const vcl_string& glob) + spl_ifstream_list_source(const vcl_string& glob) : index(0) { open(glob); } - vpro_ifstream_list_source(const vcl_vector& files) + spl_ifstream_list_source(const vcl_vector& files) : filenames(files), index(0) {} bool open(const vcl_string& glob) @@ -129,21 +129,21 @@ class vpro_ifstream_list_source : public vpro_ifstream_source_base } //: Execute the process - vpro_signal execute() + spl_signal execute() { if(index >= filenames.size()){ - return VPRO_EOS; + return SPL_EOS; } vcl_ifstream ifs(filenames[index++].c_str()); if(!ifs.is_open()){ - return VPRO_INVALID; + return SPL_INVALID; } T data; ifs >> data; ifs.close(); output(0, data); - return VPRO_VALID; + return SPL_VALID; } vcl_vector filenames; @@ -161,17 +161,17 @@ class vpro_ifstream_list_source : public vpro_ifstream_source_base //: Write data of type T to an ostream template -class vpro_ostream_sink : public vpro_sink +class spl_ostream_sink : public spl_sink { public: - vpro_ostream_sink(vcl_ostream& stream) : os(stream) {} + spl_ostream_sink(vcl_ostream& stream) : os(stream) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T)); os << input(0); - return VPRO_VALID; + return SPL_VALID; } vcl_ostream& os; }; @@ -179,4 +179,4 @@ class vpro_ostream_sink : public vpro_sink -#endif // vpro_ios_processes_h_ +#endif // spl_ios_processes_h_ diff --git a/vpro/vpro_mutex.cxx b/spl/spl_mutex.cxx similarity index 67% rename from vpro/vpro_mutex.cxx rename to spl/spl_mutex.cxx index 486d4c7..f04e6d2 100644 --- a/vpro/vpro_mutex.cxx +++ b/spl/spl_mutex.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_mutex.cxx +// This is spl/spl_mutex.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,64 +8,64 @@ //: // \file -#include +#include -#include -#if VPRO_HAS_PTHREADS +#include +#if SPL_HAS_PTHREADS #include #endif //: private implementation struct for thread data -struct vpro_mutex::pimpl +struct spl_mutex::pimpl { public: pimpl() { -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS pthread_mutex_init(&mutex_, NULL); #endif } ~pimpl() { -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS pthread_mutex_destroy(&mutex_); #endif } -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS pthread_mutex_t mutex_; #endif }; //: Default Constructor -vpro_mutex::vpro_mutex() +spl_mutex::spl_mutex() : data_(new pimpl()) { } //: Destructor -vpro_mutex::~vpro_mutex() +spl_mutex::~spl_mutex() { } //: Lock the mutex -void vpro_mutex::lock() +void spl_mutex::lock() { -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS pthread_mutex_lock(&data_->mutex_); #endif } //: Unlock the mutex -void vpro_mutex::unlock() +void spl_mutex::unlock() { -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS pthread_mutex_unlock(&data_->mutex_); #endif } diff --git a/vpro/vpro_mutex.h b/spl/spl_mutex.h similarity index 86% rename from vpro/vpro_mutex.h rename to spl/spl_mutex.h index 9e31c20..63d40b1 100644 --- a/vpro/vpro_mutex.h +++ b/spl/spl_mutex.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_mutex.h -#ifndef vpro_mutex_h_ -#define vpro_mutex_h_ +// This is spl/spl_mutex.h +#ifndef spl_mutex_h_ +#define spl_mutex_h_ //-------------------------------------------------------------------------------- //: // \file @@ -23,14 +23,14 @@ //: A mutex used if threads are enabled // If threads are not enabled, do nothing -class vpro_mutex +class spl_mutex { public: //: Default Constructor - vpro_mutex(); + spl_mutex(); //: Destructor - ~vpro_mutex(); + ~spl_mutex(); //: Lock the mutex void lock(); @@ -49,4 +49,4 @@ class vpro_mutex -#endif // vpro_mutex_h_ +#endif // spl_mutex_h_ diff --git a/vpro/vpro_observer.h b/spl/spl_observer.h similarity index 69% rename from vpro/vpro_observer.h rename to spl/spl_observer.h index 4d48392..6b6a703 100644 --- a/vpro/vpro_observer.h +++ b/spl/spl_observer.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_observer.h -#ifndef vpro_observer_h_ -#define vpro_observer_h_ +// This is spl/spl_observer.h +#ifndef spl_observer_h_ +#define spl_observer_h_ //-------------------------------------------------------------------------------- //: // \file @@ -24,31 +24,31 @@ #include -#include -#include -#include +#include +#include +#include //: This abstract class is the base class for observer objects -class vpro_observer : public vbl_ref_count +class spl_observer : public vbl_ref_count { public: //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) = 0; + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) = 0; //: Indicate that the observer will no longer be notified virtual bool unlink() { return true; } protected: //: Disable direct construction and destruction of the base class - vpro_observer(const vpro_observer& /*other*/) : vbl_ref_count() {} - vpro_observer(){} - virtual ~vpro_observer(){} + spl_observer(const spl_observer& /*other*/) : vbl_ref_count() {} + spl_observer(){} + virtual ~spl_observer(){} }; -#endif // vpro_observer_h_ +#endif // spl_observer_h_ diff --git a/vpro/vpro_observer_sptr.h b/spl/spl_observer_sptr.h similarity index 52% rename from vpro/vpro_observer_sptr.h rename to spl/spl_observer_sptr.h index d58197b..4fba7a1 100644 --- a/vpro/vpro_observer_sptr.h +++ b/spl/spl_observer_sptr.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_observer_sptr.h -#ifndef vpro_observer_sptr_h -#define vpro_observer_sptr_h +// This is spl/spl_observer_sptr.h +#ifndef spl_observer_sptr_h +#define spl_observer_sptr_h //-------------------------------------------------------------------------------- //: // \file @@ -20,30 +20,30 @@ // \endverbatim //-------------------------------------------------------------------------------- -class vpro_observer; +class spl_observer; #include -struct vpro_observer_sptr : public vbl_smart_ptr { - typedef vbl_smart_ptr base; +struct spl_observer_sptr : public vbl_smart_ptr { + typedef vbl_smart_ptr base; - vpro_observer_sptr() {} - vpro_observer_sptr(vpro_observer* p): base(p) {} - void vertical_cast(vpro_observer_sptr const& that) { *this = that; } - void vertical_cast(vpro_observer* t) { *this = t; } + spl_observer_sptr() {} + spl_observer_sptr(spl_observer* p): base(p) {} + void vertical_cast(spl_observer_sptr const& that) { *this = that; } + void vertical_cast(spl_observer* t) { *this = t; } }; // Stop doxygen documenting the B class #ifndef DOXYGEN_SHOULD_SKIP_THIS -template -struct vpro_observer_sptr_t : public B { - vpro_observer_sptr_t(): B() {} - vpro_observer_sptr_t(T* p): B(p) {} - vpro_observer_sptr_t(vpro_observer_sptr_t const& r): B(r) {} - void operator=(vpro_observer_sptr_t const& r) { B::operator=(r); } +template +struct spl_observer_sptr_t : public B { + spl_observer_sptr_t(): B() {} + spl_observer_sptr_t(T* p): B(p) {} + spl_observer_sptr_t(spl_observer_sptr_t const& r): B(r) {} + void operator=(spl_observer_sptr_t const& r) { B::operator=(r); } T* operator->() const { return (T*)this->as_pointer(); } T& operator*() const { return *((T*)this->as_pointer()); } }; #endif // DOXYGEN_SHOULD_SKIP_THIS -#endif // vpro_observer_sptr_h +#endif // spl_observer_sptr_h diff --git a/vpro/vpro_parameters.cxx b/spl/spl_parameters.cxx similarity index 56% rename from vpro/vpro_parameters.cxx rename to spl/spl_parameters.cxx index 808a2d9..e966534 100644 --- a/vpro/vpro_parameters.cxx +++ b/spl/spl_parameters.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_parameters.cxx +// This is spl/spl_parameters.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,15 +8,15 @@ //: // \file -#include +#include #include #include #include -//: Output stream operator for vpro_params -vcl_ostream& operator<<(vcl_ostream& os, const vpro_param& p) +//: Output stream operator for spl_params +vcl_ostream& operator<<(vcl_ostream& os, const spl_param& p) { os << "parameter{\n Description: " << p.description(); if(p.has_bounds()) @@ -30,15 +30,15 @@ vcl_ostream& operator<<(vcl_ostream& os, const vpro_param& p) //=========================================================================================== //: Constructor -vpro_parameters::vpro_parameters() +spl_parameters::spl_parameters() { } //: Destructor -vpro_parameters::~vpro_parameters() +spl_parameters::~spl_parameters() { - for( vcl_vector< vpro_param * >::iterator it = param_list_.begin(); + for( vcl_vector< spl_param * >::iterator it = param_list_.begin(); it != param_list_.end(); it++ ) { delete (*it); @@ -46,35 +46,35 @@ vpro_parameters::~vpro_parameters() } //: Deep copy constructor -vpro_parameters::vpro_parameters(const vpro_parameters_sptr& old_params) +spl_parameters::spl_parameters(const spl_parameters_sptr& old_params) { - for( vcl_vector< vpro_param * >::iterator it = old_params->param_list_.begin(); + for( vcl_vector< spl_param * >::iterator it = old_params->param_list_.begin(); it != old_params->param_list_.end(); it++ ) { //deep copy this param - vpro_param * new_param = (*it)->clone(); + spl_param * new_param = (*it)->clone(); param_list_.push_back( new_param ); - name_param_map_.insert( vcl_pair< vcl_string , vpro_param* >( new_param->name() , new_param ) ); + name_param_map_.insert( vcl_pair< vcl_string , spl_param* >( new_param->name() , new_param ) ); } } //: Returns true if a parameter exists with \p flag bool -vpro_parameters::valid_parameter( const vcl_string& name ) const +spl_parameters::valid_parameter( const vcl_string& name ) const { - vcl_map< vcl_string , vpro_param * >::const_iterator itr = name_param_map_.find( name ); + vcl_map< vcl_string , spl_param * >::const_iterator itr = name_param_map_.find( name ); return (itr != name_param_map_.end()); } //: Reset all parameters to their default values bool -vpro_parameters::reset_all() +spl_parameters::reset_all() { - for( vcl_vector< vpro_param * >::iterator it = param_list_.begin(); + for( vcl_vector< spl_param * >::iterator it = param_list_.begin(); it != param_list_.end(); it++ ) { (*it)->reset(); @@ -85,9 +85,9 @@ vpro_parameters::reset_all() //: Reset the parameter named \p name to its default value bool -vpro_parameters::reset( const vcl_string& name ) +spl_parameters::reset( const vcl_string& name ) { - vcl_map< vcl_string , vpro_param * >::iterator it = name_param_map_.find( name ); + vcl_map< vcl_string , spl_param * >::iterator it = name_param_map_.find( name ); if( it == name_param_map_.end() ) { return false; } @@ -99,8 +99,8 @@ vpro_parameters::reset( const vcl_string& name ) //: Return a vector of base class pointers to the parameters -vcl_vector< vpro_param* > -vpro_parameters::get_param_list() const +vcl_vector< spl_param* > +spl_parameters::get_param_list() const { return param_list_; } @@ -108,9 +108,9 @@ vpro_parameters::get_param_list() const //: Return the description of the parameter named \p name vcl_string -vpro_parameters::get_desc( const vcl_string& name ) const +spl_parameters::get_desc( const vcl_string& name ) const { - vcl_map< vcl_string , vpro_param * >::const_iterator it = name_param_map_.find( name ); + vcl_map< vcl_string , spl_param * >::const_iterator it = name_param_map_.find( name ); if( it == name_param_map_.end() ) { return ""; } @@ -120,9 +120,9 @@ vpro_parameters::get_desc( const vcl_string& name ) const //: Print all parameters to \p os void -vpro_parameters::print_all(vcl_ostream& os) const +spl_parameters::print_all(vcl_ostream& os) const { - for( vcl_vector< vpro_param * >::const_iterator it = param_list_.begin(); + for( vcl_vector< spl_param * >::const_iterator it = param_list_.begin(); it != param_list_.end(); it++ ) { os << *it; @@ -132,7 +132,7 @@ vpro_parameters::print_all(vcl_ostream& os) const //: Add parameter helper function bool -vpro_parameters::add( vpro_param* param ) +spl_parameters::add( spl_param* param ) { if( !param ) return false; @@ -145,28 +145,28 @@ vpro_parameters::add( vpro_param* param ) } param_list_.push_back( param ); - name_param_map_.insert( vcl_pair< vcl_string , vpro_param* >( name , param ) ); + name_param_map_.insert( vcl_pair< vcl_string , spl_param* >( name , param ) ); return true; } //=========================================================================================== -//: Less than operator for vpro_filepath objects -bool operator<( const vpro_filepath& lhs, const vpro_filepath& rhs ) +//: Less than operator for spl_filepath objects +bool operator<( const spl_filepath& lhs, const spl_filepath& rhs ) { return lhs.path < rhs.path; } -//: Output stream operator for vpro_filepath objects -vcl_ostream& operator<<( vcl_ostream& strm, const vpro_filepath& fp ) +//: Output stream operator for spl_filepath objects +vcl_ostream& operator<<( vcl_ostream& strm, const spl_filepath& fp ) { strm << fp.path << '\n' << fp.ext << vcl_ends; return strm; } -//: Input stream operator for vpro_filepath objects -vcl_istream& operator>>( vcl_istream& strm, const vpro_filepath& fp ) +//: Input stream operator for spl_filepath objects +vcl_istream& operator>>( vcl_istream& strm, const spl_filepath& fp ) { strm >> fp.path >> fp.ext; return strm; diff --git a/vpro/vpro_parameters.h b/spl/spl_parameters.h similarity index 76% rename from vpro/vpro_parameters.h rename to spl/spl_parameters.h index e160c1b..2378ce7 100644 --- a/vpro/vpro_parameters.h +++ b/spl/spl_parameters.h @@ -1,9 +1,9 @@ -// This is vpro/vpro_parameters.h -#ifndef vpro_parameters_h_ -#define vpro_parameters_h_ +// This is spl/spl_parameters.h +#ifndef spl_parameters_h_ +#define spl_parameters_h_ //: // \file -// \brief classes to represent parameters to vpro processes +// \brief classes to represent parameters to spl processes // \author Matt Leotta, (mleotta@lems.brown.edu) // \date 7/1/2004 // @@ -26,19 +26,19 @@ #include -#include +#include //: The abstract base class for a parameter -class vpro_param +class spl_param { public: //: Destructor - virtual ~vpro_param() {} + virtual ~spl_param() {} //: Clone this parameter - virtual vpro_param * clone() const = 0; + virtual spl_param * clone() const = 0; //: Return the parameter name vcl_string name() const { return name_; } @@ -66,7 +66,7 @@ class vpro_param protected: //: Constructor - vpro_param(bool has_bounds, const vcl_string& name, const vcl_string& desc) + spl_param(bool has_bounds, const vcl_string& name, const vcl_string& desc) : has_bounds_(has_bounds), name_(name), description_(desc) {} @@ -78,24 +78,24 @@ class vpro_param const vcl_string description_; }; -//: Output stream operator for vpro_params -vcl_ostream& operator<<(vcl_ostream& os, const vpro_param& p); +//: Output stream operator for spl_params +vcl_ostream& operator<<(vcl_ostream& os, const spl_param& p); //=========================================================================================== //: A Templated parameter class template< class T > -class vpro_param_type : public vpro_param +class spl_param_type : public spl_param { public: // Constructor - with bounds - vpro_param_type(const vcl_string& name, const vcl_string& desc, const T& dflt, const T& min, const T& max) - : vpro_param(true, name, desc), value_(dflt), default_(dflt), temp_value_(dflt), + spl_param_type(const vcl_string& name, const vcl_string& desc, const T& dflt, const T& min, const T& max) + : spl_param(true, name, desc), value_(dflt), default_(dflt), temp_value_(dflt), min_value_(min), max_value_(max) { assert( value_ < max_value_ && min_value_ < value_ ); } // Constructor - without bounds - vpro_param_type(const vcl_string& name, const vcl_string& desc, const T& dflt) - : vpro_param(false, name, desc), value_(dflt), default_(dflt), temp_value_(dflt), + spl_param_type(const vcl_string& name, const vcl_string& desc, const T& dflt) + : spl_param(false, name, desc), value_(dflt), default_(dflt), temp_value_(dflt), min_value_(dflt), max_value_(dflt) {} //: Accessor for the default value; @@ -118,7 +118,7 @@ class vpro_param_type : public vpro_param virtual void reset() { value_ = default_; } //: Clone the parameter - virtual vpro_param * clone() const { return new vpro_param_type(*this); } + virtual spl_param * clone() const { return new spl_param_type(*this); } //: Return a string representation of the current value virtual vcl_string value_str() const { return create_string(value_); } @@ -154,17 +154,17 @@ class vpro_param_type : public vpro_param //=========================================================================================== //: This class maintains all parameters for a process -class vpro_parameters : public vbl_ref_count +class spl_parameters : public vbl_ref_count { public: //: Constructor - vpro_parameters(); + spl_parameters(); //: Destructor - ~vpro_parameters(); + ~spl_parameters(); //: Deep psuedo copy constructor - vpro_parameters( const vpro_parameters_sptr& old_params); + spl_parameters( const spl_parameters_sptr& old_params); //: Returns true if a parameter exists with \p name bool valid_parameter( const vcl_string& name ) const; @@ -173,30 +173,30 @@ class vpro_parameters : public vbl_ref_count template bool valid_parameter_type( const vcl_string& name, const T&) const { - vcl_map< vcl_string, vpro_param* >::const_iterator + vcl_map< vcl_string, spl_param* >::const_iterator itr = name_param_map_.find( name ); if( itr == name_param_map_.end() ) { return false; // Not Found } - return (dynamic_cast *>(itr->second) != NULL); + return (dynamic_cast *>(itr->second) != NULL); } //: Add a new parameter with no bounds template bool add( const vcl_string& desc, const vcl_string& name, const T& default_val ) - { return add(new vpro_param_type(name, desc, default_val)); } + { return add(new spl_param_type(name, desc, default_val)); } //: Add a new parameter with bounds template bool add( const vcl_string& desc, const vcl_string& name, const T& default_val, const T& min_val, const T& max_val ) - { return add(new vpro_param_type(name, desc, default_val, min_val, max_val)); } + { return add(new spl_param_type(name, desc, default_val, min_val, max_val)); } //: Set the value of the existing parameter named \p name template bool set_value( const vcl_string& name , const T& value ) { - vpro_param_type * param = NULL; + spl_param_type * param = NULL; if( get_param(name, param) && param ){ return param->set_value(value); } @@ -207,7 +207,7 @@ class vpro_parameters : public vbl_ref_count template bool get_value( const vcl_string& name , T& value ) const { - vpro_param_type * param = NULL; + spl_param_type * param = NULL; if( get_param(name, param) && param ){ value = param->value(); return true; @@ -219,7 +219,7 @@ class vpro_parameters : public vbl_ref_count template bool get_default( const vcl_string& name , T& deflt ) const { - vpro_param_type * param = NULL; + spl_param_type * param = NULL; if( get_param(name, param) && param ){ deflt = param->default_value(); return true; @@ -231,7 +231,7 @@ class vpro_parameters : public vbl_ref_count template bool get_bounds( const vcl_string& name, T & min, T & max ) const { - vpro_param_type * param = NULL; + spl_param_type * param = NULL; if( get_param(name, param) && param ){ min = param->min_value(); max = param->max_value(); @@ -246,7 +246,7 @@ class vpro_parameters : public vbl_ref_count bool reset( const vcl_string& name ); //: Return a vector of base class pointers to the parameters - vcl_vector< vpro_param* > get_param_list() const; + vcl_vector< spl_param* > get_param_list() const; //: Return the description of the parameter named \p name vcl_string get_desc( const vcl_string& name ) const; //: Print all parameters to \p os @@ -254,18 +254,18 @@ class vpro_parameters : public vbl_ref_count private: //: Add parameter helper function - bool add( vpro_param* param ); + bool add( spl_param* param ); template bool get_param( const vcl_string& name, - vpro_param_type * ¶m) const + spl_param_type * ¶m) const { - vcl_map< vcl_string, vpro_param* >::const_iterator + vcl_map< vcl_string, spl_param* >::const_iterator itr = name_param_map_.find( name ); if( itr == name_param_map_.end() ) { return false; // Not Found } - param = dynamic_cast *>(itr->second); + param = dynamic_cast *>(itr->second); if( !param ) vcl_cerr << "WARNING: parameter \""<< name << "\" was found but has incorrect type" << vcl_endl; @@ -273,9 +273,9 @@ class vpro_parameters : public vbl_ref_count } //: The map from names to parameters - vcl_map< vcl_string , vpro_param* > name_param_map_; + vcl_map< vcl_string , spl_param* > name_param_map_; //: The vector of parameters in order of declaration - vcl_vector< vpro_param* > param_list_; + vcl_vector< spl_param* > param_list_; }; @@ -283,23 +283,23 @@ class vpro_parameters : public vbl_ref_count //: A simple class to represent a file (for use with parameters) -class vpro_filepath +class spl_filepath { public: //: Constructor - vpro_filepath(const vcl_string& p = "", const vcl_string& e = "*") + spl_filepath(const vcl_string& p = "", const vcl_string& e = "*") : path(p), ext(e) {} vcl_string path; vcl_string ext; }; -//: Less than operator for vpro_filepath objects -bool operator<( const vpro_filepath& lhs, const vpro_filepath& rhs ); -//: Output stream operator for vpro_filepath objects -vcl_ostream& operator<<( vcl_ostream& strm, const vpro_filepath& fp ); -//: Input stream operator for vpro_filepath objects -vcl_istream& operator>>( vcl_istream& strm, const vpro_filepath& fp ); +//: Less than operator for spl_filepath objects +bool operator<( const spl_filepath& lhs, const spl_filepath& rhs ); +//: Output stream operator for spl_filepath objects +vcl_ostream& operator<<( vcl_ostream& strm, const spl_filepath& fp ); +//: Input stream operator for spl_filepath objects +vcl_istream& operator>>( vcl_istream& strm, const spl_filepath& fp ); -#endif // vpro_parameters_h_ +#endif // spl_parameters_h_ diff --git a/vpro/vpro_parameters.txx b/spl/spl_parameters.txx similarity index 64% rename from vpro/vpro_parameters.txx rename to spl/spl_parameters.txx index 41920f1..a432493 100644 --- a/vpro/vpro_parameters.txx +++ b/spl/spl_parameters.txx @@ -1,9 +1,9 @@ -// This is vpro/vpro_parameters.txx -#ifndef vpro_parameters_txx_ -#define vpro_parameters_txx_ +// This is spl/spl_parameters.txx +#ifndef spl_parameters_txx_ +#define spl_parameters_txx_ //: // \file -// \brief Templated code for vpro parameters. +// \brief Templated code for spl parameters. // // \author Matt Leotta, (mleotta@lems.brown.edu) // \date 7/2/2004 @@ -15,7 +15,7 @@ // -#include "vpro_parameters.h" +#include "spl_parameters.h" #include #include @@ -23,7 +23,7 @@ //: Set the current value to \p val template bool -vpro_param_type::set_value( const T& val ) +spl_param_type::set_value( const T& val ) { if( has_bounds_ && (val < min_value_ || max_value_ < val) ) return false; @@ -36,7 +36,7 @@ vpro_param_type::set_value( const T& val ) //: Create a string representation of the value template vcl_string -vpro_param_type::create_string(const T& val) const +spl_param_type::create_string(const T& val) const { vcl_stringstream stm; stm << val; @@ -47,7 +47,7 @@ vpro_param_type::create_string(const T& val) const //: Parse a string representation of the value template T -vpro_param_type::parse_string(const vcl_string& input) const +spl_param_type::parse_string(const vcl_string& input) const { T val; vcl_istringstream strm(input); @@ -57,8 +57,8 @@ vpro_param_type::parse_string(const vcl_string& input) const //=========================================================================================== -//: Use this macro to instantiate vpro_parameters for each parameter type -#define VPRO_PARAMETERS_INSTANTIATE(T) \ -template class vpro_param_type< T >; +//: Use this macro to instantiate spl_parameters for each parameter type +#define SPL_PARAMETERS_INSTANTIATE(T) \ +template class spl_param_type< T >; -#endif // vpro_parameters_txx_ +#endif // spl_parameters_txx_ diff --git a/vpro/vpro_parameters_sptr.h b/spl/spl_parameters_sptr.h similarity index 73% rename from vpro/vpro_parameters_sptr.h rename to spl/spl_parameters_sptr.h index 521c04d..c7ded62 100644 --- a/vpro/vpro_parameters_sptr.h +++ b/spl/spl_parameters_sptr.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_parameters_sptr.h -#ifndef vpro_parameters_sptr_h -#define vpro_parameters_sptr_h +// This is spl/spl_parameters_sptr.h +#ifndef spl_parameters_sptr_h +#define spl_parameters_sptr_h //-------------------------------------------------------------------------------- //: // \file @@ -20,10 +20,10 @@ // \endverbatim //-------------------------------------------------------------------------------- -class vpro_parameters; +class spl_parameters; #include -typedef vbl_smart_ptr vpro_parameters_sptr; +typedef vbl_smart_ptr spl_parameters_sptr; -#endif // vpro_parameters_sptr_h +#endif // spl_parameters_sptr_h diff --git a/vpro/vpro_process.cxx b/spl/spl_process.cxx similarity index 64% rename from vpro/vpro_process.cxx rename to spl/spl_process.cxx index 931f4c1..96ba5c5 100644 --- a/vpro/vpro_process.cxx +++ b/spl/spl_process.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_process.cxx +// This is spl/spl_process.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,34 +8,34 @@ //: // \file -#include +#include #include #include -#include -#include -#include -#include +#include +#include +#include +#include -#include -#if VPRO_HAS_PTHREADS +#include +#if SPL_HAS_PTHREADS #include #endif //: Return the last signal -vpro_signal vpro_process::last_signal() const +spl_signal spl_process::last_signal() const { return this->last_signal_; } //: Runs the filter -vpro_signal -vpro_filter::run(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_filter::run(unsigned long timestamp, + spl_debug_observer* const debug) { // notify the debugger if available if (debug) debug->notify_enter(this, timestamp); @@ -45,7 +45,7 @@ vpro_filter::run(unsigned long timestamp, if(timestamp > this->timestamp_){ this->timestamp_ = timestamp; this->last_signal_ = this->request_inputs(timestamp,debug); - if(this->last_signal_ == VPRO_VALID){ + if(this->last_signal_ == SPL_VALID){ if (debug){ debug->notify_pre_exec(this); this->last_signal_ = this->execute(); @@ -68,9 +68,9 @@ vpro_filter::run(unsigned long timestamp, //: Runs the filter -vpro_signal -vpro_source::run(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_source::run(unsigned long timestamp, + spl_debug_observer* const debug) { // notify the debugger if available if (debug) debug->notify_enter(this, timestamp); @@ -79,7 +79,7 @@ vpro_source::run(unsigned long timestamp, if(timestamp > this->timestamp_){ this->timestamp_ = timestamp; - this->last_signal_ = VPRO_VALID; + this->last_signal_ = SPL_VALID; if (debug){ debug->notify_pre_exec(this); this->last_signal_ = this->execute(); @@ -100,9 +100,9 @@ vpro_source::run(unsigned long timestamp, //: Runs the filter -vpro_signal -vpro_sink::run(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_sink::run(unsigned long timestamp, + spl_debug_observer* const debug) { // notify the debugger if available if (debug) debug->notify_enter(this, timestamp); @@ -110,7 +110,7 @@ vpro_sink::run(unsigned long timestamp, if(!this->enabled()){ // notify the debugger if available if (debug) debug->notify_exit(this, timestamp); - return VPRO_VALID; + return SPL_VALID; } update_mutex_.lock(); @@ -118,7 +118,7 @@ vpro_sink::run(unsigned long timestamp, if(timestamp > this->timestamp_){ this->timestamp_ = timestamp; this->last_signal_ = this->request_inputs(timestamp,debug); - if(this->last_signal_ == VPRO_VALID){ + if(this->last_signal_ == SPL_VALID){ if (debug){ debug->notify_pre_exec(this); this->last_signal_ = this->execute(); @@ -140,28 +140,28 @@ vpro_sink::run(unsigned long timestamp, //: Constructor -vpro_process::vpro_process() +spl_process::spl_process() : timestamp_(0), input_request_active_(false), - last_signal_(VPRO_INVALID) + last_signal_(SPL_INVALID) { } //: Destructor -vpro_process::~vpro_process() +spl_process::~spl_process() { - typedef vcl_map::iterator Itr; + typedef vcl_map::iterator Itr; for(Itr i = input_connectors_.begin(); i != input_connectors_.end(); ++i) { i->second->unlink(); } - typedef vcl_map >::iterator OItr; + typedef vcl_map >::iterator OItr; for(OItr obs = output_observers_.begin(); obs != output_observers_.end(); ++obs) { - for( vcl_set::iterator ob = obs->second.begin(); + for( vcl_set::iterator ob = obs->second.begin(); ob != obs->second.end(); ++ob ) (*ob)->unlink(); } @@ -170,9 +170,9 @@ vpro_process::~vpro_process() //: Clear data sitting on the input connectors void -vpro_process::clear() +spl_process::clear() { - typedef vcl_map::iterator Itr; + typedef vcl_map::iterator Itr; for(Itr i = input_connectors_.begin(); i != input_connectors_.end(); ++i) { @@ -181,21 +181,21 @@ vpro_process::clear() } -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS // helper code to launch and manage pthreads namespace{ struct pthread_data { - vpro_connector_sptr connector; + spl_connector_sptr connector; unsigned long timestamp; - vpro_debug_observer* debug; + spl_debug_observer* debug; pthread_t thread; }; void* pthread_launcher(void *arg) { pthread_data *pd = reinterpret_cast(arg); - vpro_signal s = pd->connector->request_data(pd->timestamp,pd->debug); + spl_signal s = pd->connector->request_data(pd->timestamp,pd->debug); return reinterpret_cast(s); } } @@ -203,26 +203,26 @@ namespace{ //: Request any missing inputs -vpro_signal -vpro_process::request_inputs(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_process::request_inputs(unsigned long timestamp, + spl_debug_observer* const debug) { if(this->input_request_active_){ vcl_cerr << "Warning detected cycle in data flow" <input_request_active_ = true; - vpro_signal retval = VPRO_VALID; - typedef vcl_map::iterator Itr; + spl_signal retval = SPL_VALID; + typedef vcl_map::iterator Itr; -#if VPRO_HAS_PTHREADS +#if SPL_HAS_PTHREADS // the threaded version // find the processes that need to be run vcl_vector pd; for(Itr i = input_connectors_.begin(); i != input_connectors_.end(); ++i) { - vpro_connector_sptr connector = i->second; + spl_connector_sptr connector = i->second; if(!connector->data()){ pd.push_back(pthread_data()); pd.back().connector = connector; @@ -231,8 +231,8 @@ vpro_process::request_inputs(unsigned long timestamp, } else { - vpro_signal m = connector->data()->info(); - if(m != VPRO_VALID){ + spl_signal m = connector->data()->info(); + if(m != SPL_VALID){ retval = m; } } @@ -240,11 +240,11 @@ vpro_process::request_inputs(unsigned long timestamp, if(pd.size() == 1) // serial, no threads needed { delete pd[0].debug; - vpro_signal s = pd[0].connector->request_data(timestamp,debug); - if(s != VPRO_VALID) + spl_signal s = pd[0].connector->request_data(timestamp,debug); + if(s != SPL_VALID) retval = s; - vpro_signal m = pd[0].connector->data()->info(); - if(m != VPRO_VALID){ + spl_signal m = pd[0].connector->data()->info(); + if(m != SPL_VALID){ retval = m; } } @@ -269,16 +269,16 @@ vpro_process::request_inputs(unsigned long timestamp, debug->merge(*(pd[i].debug)); delete pd[i].debug; } - vpro_signal s = reinterpret_cast (status); + spl_signal s = reinterpret_cast (status); if(rc) { vcl_cerr << "Error joining pthread, return code: "<data()->info(); - if(m != VPRO_VALID) + spl_signal m = pd[i].connector->data()->info(); + if(m != SPL_VALID) retval = m; } } @@ -286,17 +286,17 @@ vpro_process::request_inputs(unsigned long timestamp, // the serial (non-threaded) version for(Itr i = input_connectors_.begin(); i != input_connectors_.end(); ++i) { - vpro_connector_sptr connector = i->second; + spl_connector_sptr connector = i->second; if(!connector->data()){ - vpro_signal s = connector->request_data(timestamp,debug); - if(s != VPRO_VALID) + spl_signal s = connector->request_data(timestamp,debug); + if(s != SPL_VALID) retval = s; - if(s == VPRO_INVALID) + if(s == SPL_INVALID) break; } - vpro_signal m = connector->data()->info(); - if(m != VPRO_VALID){ + spl_signal m = connector->data()->info(); + if(m != SPL_VALID){ retval = m; } } @@ -307,32 +307,32 @@ vpro_process::request_inputs(unsigned long timestamp, } //: Request any missing inputs -vpro_signal -vpro_process::request_inputs_serial(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_process::request_inputs_serial(unsigned long timestamp, + spl_debug_observer* const debug) { if(this->input_request_active_){ vcl_cerr << "Warning detected cycle in data flow" <input_request_active_ = true; - vpro_signal retval = VPRO_VALID; - typedef vcl_map::iterator Itr; + spl_signal retval = SPL_VALID; + typedef vcl_map::iterator Itr; // the serial (non-threaded) version for(Itr i = input_connectors_.begin(); i != input_connectors_.end(); ++i) { - vpro_connector_sptr connector = i->second; + spl_connector_sptr connector = i->second; if(!connector->data()){ - vpro_signal s = connector->request_data(timestamp,debug); - if(s != VPRO_VALID) + spl_signal s = connector->request_data(timestamp,debug); + if(s != SPL_VALID) retval = s; - if(s == VPRO_INVALID) + if(s == SPL_INVALID) break; } - vpro_signal m = connector->data()->info(); - if(m != VPRO_VALID){ + spl_signal m = connector->data()->info(); + if(m != SPL_VALID){ retval = m; } } @@ -344,13 +344,13 @@ vpro_process::request_inputs_serial(unsigned long timestamp, //: Notify the output observers bool -vpro_process::notify_observers(vpro_signal message) +spl_process::notify_observers(spl_signal message) { - typedef vcl_map::const_iterator DItr; - typedef vcl_map >::iterator OItr; - // Do not send the message VPRO_VALID unless the data is valid - if(message == VPRO_VALID) - message = VPRO_INVALID; + typedef vcl_map::const_iterator DItr; + typedef vcl_map >::iterator OItr; + // Do not send the message SPL_VALID unless the data is valid + if(message == SPL_VALID) + message = SPL_INVALID; bool retval = true; // for each output pin with observers attached for(OItr obs = output_observers_.begin(); @@ -360,17 +360,17 @@ vpro_process::notify_observers(vpro_signal message) continue; // find the output data produced for that pin (if any) DItr d = output_data_.find(obs->first); - vpro_storage_sptr data; + spl_storage_sptr data; if(d == output_data_.end()){ // if no data, notify with a signal storage class - data = new vpro_storage_signal(message); + data = new spl_storage_signal(message); retval = false; } else data = d->second; // notify all of the observers of this pin - for( vcl_set::iterator ob = obs->second.begin(); + for( vcl_set::iterator ob = obs->second.begin(); ob != obs->second.end(); ++ob ) (*ob)->notify(data,this->timestamp_); } @@ -381,15 +381,15 @@ vpro_process::notify_observers(vpro_signal message) //: Connect pin \p in_idx to the output pin \p out_idx of the process \p source void -vpro_process::connect_input(unsigned int in_idx, - const vpro_process_sptr& source, unsigned int out_idx) +spl_process::connect_input(unsigned int in_idx, + const spl_process_sptr& source, unsigned int out_idx) { - typedef vcl_map::iterator Itr; + typedef vcl_map::iterator Itr; assert(source); - vpro_connector_sptr connector; + spl_connector_sptr connector; Itr result = input_connectors_.find(in_idx); if(result == input_connectors_.end()){ - connector = new vpro_connector(); + connector = new spl_connector(); input_connectors_[in_idx] = connector; } else{ @@ -401,9 +401,9 @@ vpro_process::connect_input(unsigned int in_idx, //: Disconnect pin \p in_idx void -vpro_process::disconnect_input(unsigned int in_idx) +spl_process::disconnect_input(unsigned int in_idx) { - typedef vcl_map::iterator Itr; + typedef vcl_map::iterator Itr; Itr result = input_connectors_.find(in_idx); if(result != input_connectors_.end()){ result->second->unlink(); @@ -414,7 +414,7 @@ vpro_process::disconnect_input(unsigned int in_idx) //: Add an output observer on pin \p idx void -vpro_process::add_output_observer(unsigned int idx, const vpro_observer_sptr& obs) +spl_process::add_output_observer(unsigned int idx, const spl_observer_sptr& obs) { output_observers_[idx].insert(obs); } @@ -422,9 +422,9 @@ vpro_process::add_output_observer(unsigned int idx, const vpro_observer_sptr& ob //: Remove an output observer on pin \p idx if it exists bool -vpro_process::remove_output_observer(unsigned int idx, const vpro_observer_sptr& obs) +spl_process::remove_output_observer(unsigned int idx, const spl_observer_sptr& obs) { - typedef vcl_map >::iterator Itr; + typedef vcl_map >::iterator Itr; Itr result = output_observers_.find(idx); if(result == output_observers_.end()) return false; @@ -434,10 +434,10 @@ vpro_process::remove_output_observer(unsigned int idx, const vpro_observer_sptr& //: Access the storage class on the given input pin -vpro_storage_sptr -vpro_process::get_input(unsigned int idx) const +spl_storage_sptr +spl_process::get_input(unsigned int idx) const { - typedef vcl_map::const_iterator Itr; + typedef vcl_map::const_iterator Itr; Itr result = input_connectors_.find(idx); if(result == input_connectors_.end() || !result->second) return NULL; @@ -447,9 +447,9 @@ vpro_process::get_input(unsigned int idx) const //: Returns the typeinfo struct for the data type stored on the given pin const vcl_type_info& -vpro_process::input_type_id(unsigned int idx) const +spl_process::input_type_id(unsigned int idx) const { - vpro_storage_sptr ptr = get_input(idx); + spl_storage_sptr ptr = get_input(idx); if(!ptr) return typeid(void); return ptr->type_id(); @@ -459,7 +459,7 @@ vpro_process::input_type_id(unsigned int idx) const //: Set the output storage class on the given pin // all observers of this output are notified bool -vpro_process::set_output(unsigned int idx, const vpro_storage_sptr& data) +spl_process::set_output(unsigned int idx, const spl_storage_sptr& data) { output_data_[idx] = data; return true; @@ -468,9 +468,9 @@ vpro_process::set_output(unsigned int idx, const vpro_storage_sptr& data) //: Returns the number of observers of a particular output pin unsigned int -vpro_process::num_observers(unsigned int idx) const +spl_process::num_observers(unsigned int idx) const { - typedef vcl_map >::const_iterator Itr; + typedef vcl_map >::const_iterator Itr; Itr result = output_observers_.find(idx); if(result == output_observers_.end()) return 0; @@ -481,10 +481,10 @@ vpro_process::num_observers(unsigned int idx) const //: Returns the set of all pins that have observers vcl_set -vpro_process::observed_outputs() const +spl_process::observed_outputs() const { vcl_set observed; - typedef vcl_map >::const_iterator OItr; + typedef vcl_map >::const_iterator OItr; for(OItr obs = output_observers_.begin(); obs != output_observers_.end(); ++obs) observed.insert(obs->first); diff --git a/vpro/vpro_process.h b/spl/spl_process.h similarity index 61% rename from vpro/vpro_process.h rename to spl/spl_process.h index eac9272..7938c96 100644 --- a/vpro/vpro_process.h +++ b/spl/spl_process.h @@ -1,10 +1,10 @@ -// This is vpro/vpro_process.h -#ifndef vpro_process_h_ -#define vpro_process_h_ +// This is spl/spl_process.h +#ifndef spl_process_h_ +#define spl_process_h_ //-------------------------------------------------------------------------------- //: // \file -// \brief The vpro process base class +// \brief The spl process base class // // A process is an object that wraps an algorithm to create // standardized interface. @@ -27,32 +27,32 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include -class vpro_debug_observer +class spl_debug_observer { public: - virtual ~vpro_debug_observer(){} + virtual ~spl_debug_observer(){} //: called when first entering a process - virtual void notify_enter(const vpro_process* const pro, unsigned int timestamp) = 0; + virtual void notify_enter(const spl_process* const pro, unsigned int timestamp) = 0; //: called just before exiting a process - virtual void notify_exit(const vpro_process* const pro, unsigned int timestamp) = 0; + virtual void notify_exit(const spl_process* const pro, unsigned int timestamp) = 0; //: called just before executing the process (when all inputs are available) - virtual void notify_pre_exec(const vpro_process* const pro) = 0; + virtual void notify_pre_exec(const spl_process* const pro) = 0; //: called just after the execution finishes (before notifying observers) - virtual void notify_post_exec(const vpro_process* const pro) = 0; + virtual void notify_post_exec(const spl_process* const pro) = 0; //: clone the debug observer // clones are made for each thread during a branch - virtual vpro_debug_observer* clone() const = 0; + virtual spl_debug_observer* clone() const = 0; //: merge the data from another into this // clones are merged when threads are joined threads - virtual void merge(const vpro_debug_observer& other) = 0; + virtual void merge(const spl_debug_observer& other) = 0; }; @@ -67,56 +67,56 @@ class vpro_debug_observer // A filter process modifies one or more input streams to produce one or // more output streams. A sink process accepts an input stream but produces // no output stream. To create a new process derive a new class from -// vpro_source, vpro_filter, or vpro_sink and implement the execute() method. +// spl_source, spl_filter, or spl_sink and implement the execute() method. // -class vpro_process : public vbl_ref_count +class spl_process : public vbl_ref_count { public: //: Connect pin \p in_idx to the output pin \p out_idx of the process \p source void connect_input(unsigned int in_idx, - const vpro_process_sptr& source, unsigned int out_idx); + const spl_process_sptr& source, unsigned int out_idx); //: Disconnect pin \p in_idx void disconnect_input(unsigned int in_idx); //: Add an output observer on pin \p idx - void add_output_observer(unsigned int idx, const vpro_observer_sptr& obs); + void add_output_observer(unsigned int idx, const spl_observer_sptr& obs); //: Remove an output observer on pin \p idx if it exists - bool remove_output_observer(unsigned int idx, const vpro_observer_sptr& obs); + bool remove_output_observer(unsigned int idx, const spl_observer_sptr& obs); //: Runs the process - virtual vpro_signal run(unsigned long timestamp, - vpro_debug_observer* const debug = NULL) = 0; + virtual spl_signal run(unsigned long timestamp, + spl_debug_observer* const debug = NULL) = 0; //: Execute the process // derived classes should implement this - virtual vpro_signal execute() = 0; + virtual spl_signal execute() = 0; //: Return the last signal - vpro_signal last_signal() const; + spl_signal last_signal() const; protected: //: Disable direct construction and destruction of the base class - vpro_process(const vpro_process& other); - vpro_process(); - virtual ~vpro_process(); + spl_process(const spl_process& other); + spl_process(); + virtual ~spl_process(); //: Clear data sitting on the input connectors void clear(); //: Request any missing inputs - vpro_signal request_inputs(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal request_inputs(unsigned long timestamp, + spl_debug_observer* const debug = NULL); //: Request any missing inputs. Guaranteed to be serial (non-threaded). - vpro_signal request_inputs_serial(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal request_inputs_serial(unsigned long timestamp, + spl_debug_observer* const debug = NULL); //: Notify the output observers // \param message is the default signal sent when data is missing // return false if data is not available for all observers - bool notify_observers(vpro_signal message = VPRO_INVALID); + bool notify_observers(spl_signal message = SPL_INVALID); //: Extract the data from an input pin assuming it exists with the correct type // This should be called from the derived class execute call @@ -135,7 +135,7 @@ class vpro_process : public vbl_ref_count template bool output(unsigned int idx, const T& data) { - return set_output(idx,new vpro_storage_type(data)); + return set_output(idx,new spl_storage_type(data)); } //: Returns the number of observers of a particular output pin @@ -145,83 +145,83 @@ class vpro_process : public vbl_ref_count vcl_set observed_outputs() const; //: Access the storage class on the given input pin - vpro_storage_sptr get_input(unsigned int idx) const; + spl_storage_sptr get_input(unsigned int idx) const; //: Set the output storage class on the given pin // all observers of this output are notified - bool set_output(unsigned int idx, const vpro_storage_sptr& data); + bool set_output(unsigned int idx, const spl_storage_sptr& data); - vcl_map input_connectors_; - vcl_map output_data_; - vcl_map > output_observers_; + vcl_map input_connectors_; + vcl_map output_data_; + vcl_map > output_observers_; //: the current timestamp unsigned long timestamp_; //: detects loops in data flow bool input_request_active_; //: the last signal returned - vpro_signal last_signal_; + spl_signal last_signal_; //: The mutex for updating (if using threads) - vpro_mutex update_mutex_; + spl_mutex update_mutex_; }; //: Abstract base class for a filter process // A filter has both input and output -class vpro_filter : public vpro_process +class spl_filter : public spl_process { public: //: Runs the process - vpro_signal run(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal run(unsigned long timestamp, + spl_debug_observer* const debug = NULL); protected: //: Disable direct construction and destruction of the base class - vpro_filter(const vpro_process& other); - vpro_filter(){} - virtual ~vpro_filter(){} + spl_filter(const spl_process& other); + spl_filter(){} + virtual ~spl_filter(){} }; //: Abstract base class for a source process // A source provides output without any input -class vpro_source : public vpro_process +class spl_source : public spl_process { public: //: Runs the process - vpro_signal run(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal run(unsigned long timestamp, + spl_debug_observer* const debug = NULL); protected: //: Disable direct construction and destruction of the base class - vpro_source(const vpro_source& other); - vpro_source(){} - virtual ~vpro_source(){} + spl_source(const spl_source& other); + spl_source(){} + virtual ~spl_source(){} }; //: Abstract base class for a sink process // A sink accepts input without producing output -class vpro_sink : public vpro_process +class spl_sink : public spl_process { public: //: Runs the process - vpro_signal run(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal run(unsigned long timestamp, + spl_debug_observer* const debug = NULL); //: The process will only run if this function returns true virtual bool enabled() const { return true; } protected: //: Disable direct construction and destruction of the base class - vpro_sink(const vpro_sink& other); - vpro_sink(){} - virtual ~vpro_sink(){} + spl_sink(const spl_sink& other); + spl_sink(){} + virtual ~spl_sink(){} }; -#endif // vpro_process_h_ +#endif // spl_process_h_ diff --git a/vpro/vpro_process_factory.cxx b/spl/spl_process_factory.cxx similarity index 65% rename from vpro/vpro_process_factory.cxx rename to spl/spl_process_factory.cxx index be4d624..9b6dd43 100644 --- a/vpro/vpro_process_factory.cxx +++ b/spl/spl_process_factory.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_process_factory.cxx +// This is spl/spl_process_factory.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,14 +8,14 @@ //: // \file -#include +#include #include //: Return a reference to the global registry of storage classes -vpro_process_factory::Reg_Type & -vpro_process_factory::mut_registry() +spl_process_factory::Reg_Type & +spl_process_factory::mut_registry() { static Reg_Type reg; return reg; @@ -23,11 +23,11 @@ vpro_process_factory::mut_registry() //: The Constructor for this struct registers an exemplar storage object with the base class -vpro_process_factory::registrar::registrar(const vpro_process_factory* example) +spl_process_factory::registrar::registrar(const spl_process_factory* example) { vcl_string name = example->name(); // register with the base class - Reg_Type& reg = vpro_process_factory::mut_registry(); + Reg_Type& reg = spl_process_factory::mut_registry(); Reg_Type::iterator result = reg.find(name); if(result != reg.end()){ delete result->second; @@ -39,10 +39,10 @@ vpro_process_factory::registrar::registrar(const vpro_process_factory* example) //: Return the default parameters for a process with the given name -vpro_parameters_sptr -vpro_process_factory::default_params(const vcl_string& name) +spl_parameters_sptr +spl_process_factory::default_params(const vcl_string& name) { - const Reg_Type& reg = vpro_process_factory::registry(); + const Reg_Type& reg = spl_process_factory::registry(); Reg_Type::const_iterator result = reg.find(name); if(result == reg.end()) return NULL; @@ -52,11 +52,11 @@ vpro_process_factory::default_params(const vcl_string& name) //: Construct a process with the given name and parameters -vpro_process_sptr -vpro_process_factory::create(const vcl_string& name, - const vpro_parameters_sptr& params) +spl_process_sptr +spl_process_factory::create(const vcl_string& name, + const spl_parameters_sptr& params) { - const Reg_Type& reg = vpro_process_factory::registry(); + const Reg_Type& reg = spl_process_factory::registry(); Reg_Type::const_iterator result = reg.find(name); if(result == reg.end()) return NULL; diff --git a/vpro/vpro_process_factory.h b/spl/spl_process_factory.h similarity index 64% rename from vpro/vpro_process_factory.h rename to spl/spl_process_factory.h index 75dbb4d..d94d0fa 100644 --- a/vpro/vpro_process_factory.h +++ b/spl/spl_process_factory.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_process_factory.h -#ifndef vpro_process_factory_h_ -#define vpro_process_factory_h_ +// This is spl/spl_process_factory.h +#ifndef spl_process_factory_h_ +#define spl_process_factory_h_ //-------------------------------------------------------------------------------- //: // \file @@ -24,38 +24,38 @@ #include #include -#include -#include +#include +#include //: A factory for creating processes from names and params -class vpro_process_factory +class spl_process_factory { public: //: Return the default set of parameters for the process - virtual vpro_parameters_sptr default_params() const = 0; + virtual spl_parameters_sptr default_params() const = 0; //: Construct a process from a set of parameters - virtual vpro_process_sptr create(const vpro_parameters_sptr& params) const = 0; + virtual spl_process_sptr create(const spl_parameters_sptr& params) const = 0; //: The name of the process virtual vcl_string name() const = 0; - typedef vcl_map Reg_Type; + typedef vcl_map Reg_Type; //: Return a const reference to the global registry of storage classes static Reg_Type const & registry() { return mut_registry(); } //: Return the default parameters for a process with the given name - static vpro_parameters_sptr default_params(const vcl_string& name); + static spl_parameters_sptr default_params(const vcl_string& name); //: Construct a process with the given name and parameters - static vpro_process_sptr create(const vcl_string& name, - const vpro_parameters_sptr& params); + static spl_process_sptr create(const vcl_string& name, + const spl_parameters_sptr& params); //: Create static instances of this struct to register a storage class struct registrar{ - registrar(const vpro_process_factory* example); + registrar(const spl_process_factory* example); }; friend struct registrar; @@ -67,11 +67,11 @@ class vpro_process_factory protected: //: Copy Constructor - vpro_process_factory(const vpro_process_factory& /*other*/) {} - vpro_process_factory() {} - virtual ~vpro_process_factory() {} + spl_process_factory(const spl_process_factory& /*other*/) {} + spl_process_factory() {} + virtual ~spl_process_factory() {} }; -#endif // vpro_process_factory_h_ +#endif // spl_process_factory_h_ diff --git a/vpro/vpro_process_sptr.h b/spl/spl_process_sptr.h similarity index 75% rename from vpro/vpro_process_sptr.h rename to spl/spl_process_sptr.h index af530a6..ec92ca4 100644 --- a/vpro/vpro_process_sptr.h +++ b/spl/spl_process_sptr.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_process_sptr.h -#ifndef vpro_process_sptr_h -#define vpro_process_sptr_h +// This is spl/spl_process_sptr.h +#ifndef spl_process_sptr_h +#define spl_process_sptr_h //-------------------------------------------------------------------------------- //: // \file @@ -20,10 +20,10 @@ // \endverbatim //-------------------------------------------------------------------------------- -class vpro_process; +class spl_process; #include -typedef vbl_smart_ptr vpro_process_sptr; +typedef vbl_smart_ptr spl_process_sptr; -#endif // vpro_process_sptr_h +#endif // spl_process_sptr_h diff --git a/vpro/vpro_storage.h b/spl/spl_storage.h similarity index 61% rename from vpro/vpro_storage.h rename to spl/spl_storage.h index a356886..3b6e2fb 100644 --- a/vpro/vpro_storage.h +++ b/spl/spl_storage.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_storage.h -#ifndef vpro_storage_h_ -#define vpro_storage_h_ +// This is spl/spl_storage.h +#ifndef spl_storage_h_ +#define spl_storage_h_ //: // \file @@ -21,23 +21,23 @@ #include #include #include -#include "vpro_fwd.h" -#include "vpro_storage_sptr.h" +#include "spl_fwd.h" +#include "spl_storage_sptr.h" -template< class T > class vpro_storage_type; +template< class T > class spl_storage_type; //: This abstract class is the base class for storage objects -class vpro_storage : public vbl_ref_count +class spl_storage : public vbl_ref_count { public: //: Constructor - vpro_storage() {} + spl_storage() {} //: Destructor - virtual ~vpro_storage() {} + virtual ~spl_storage() {} - //: Return a signal (VPRO_VALID for valid data) - virtual vpro_signal info() const = 0; + //: Return a signal (SPL_VALID for valid data) + virtual spl_signal info() const = 0; //: Return the type of the stored data virtual const vcl_type_info& type_id() const = 0; @@ -46,11 +46,11 @@ class vpro_storage : public vbl_ref_count template const T& data() const { - return static_cast*>(this)->data(); + return static_cast*>(this)->data(); } private: - vpro_storage(const vpro_storage& other); + spl_storage(const spl_storage& other); }; @@ -60,18 +60,18 @@ class vpro_storage : public vbl_ref_count //: A Templated parameter class template< class T > -class vpro_storage_type : public vpro_storage +class spl_storage_type : public spl_storage { public: //: Default Constructor - vpro_storage_type() {} + spl_storage_type() {} //: Constructor - vpro_storage_type(const T& data) + spl_storage_type(const T& data) : data_(data) {} //: Return a message flag - vpro_signal info() const { return VPRO_VALID; } + spl_signal info() const { return SPL_VALID; } //: Return a const reference to the data const T& data() const { return data_; } @@ -87,26 +87,26 @@ class vpro_storage_type : public vpro_storage //============================================================================= -typedef vpro_storage_type vpro_storage_signal; +typedef spl_storage_type spl_storage_signal; //: A storage class that contains only a message VCL_DEFINE_SPECIALIZATION -class vpro_storage_type : public vpro_storage +class spl_storage_type : public spl_storage { public: //: Default Constructor - vpro_storage_type(vpro_signal info=VPRO_INVALID) : info_(info) {} + spl_storage_type(spl_signal info=SPL_INVALID) : info_(info) {} //: Return a message flag - vpro_signal info() const { return info_; } + spl_signal info() const { return info_; } //: Return the type of the stored data - const vcl_type_info& type_id() const { return typeid(vpro_signal); } + const vcl_type_info& type_id() const { return typeid(spl_signal); } private: //: The message - vpro_signal info_; + spl_signal info_; }; -#endif // vpro_storage_h_ +#endif // spl_storage_h_ diff --git a/vpro/vpro_storage_sptr.h b/spl/spl_storage_sptr.h similarity index 75% rename from vpro/vpro_storage_sptr.h rename to spl/spl_storage_sptr.h index 80ccfaa..b5a001c 100644 --- a/vpro/vpro_storage_sptr.h +++ b/spl/spl_storage_sptr.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_storage_sptr.h -#ifndef vpro_storage_sptr_h -#define vpro_storage_sptr_h +// This is spl/spl_storage_sptr.h +#ifndef spl_storage_sptr_h +#define spl_storage_sptr_h ///-------------------------------------------------------------------------------- //: // \file @@ -20,11 +20,11 @@ // \endverbatim //-------------------------------------------------------------------------------- -class vpro_storage; +class spl_storage; #include -typedef vbl_smart_ptr vpro_storage_sptr; +typedef vbl_smart_ptr spl_storage_sptr; -#endif // vpro_storage_sptr_h +#endif // spl_storage_sptr_h diff --git a/vpro/vpro_try_option.cxx b/spl/spl_try_option.cxx similarity index 68% rename from vpro/vpro_try_option.cxx rename to spl/spl_try_option.cxx index f25cef7..63aea56 100644 --- a/vpro/vpro_try_option.cxx +++ b/spl/spl_try_option.cxx @@ -1,4 +1,4 @@ -// This is vpro/vpro_try_option.cxx +// This is spl/spl_try_option.cxx // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -8,14 +8,14 @@ //: // \file -#include "vpro_try_option.h" -#include "vpro_connector.h" +#include "spl_try_option.h" +#include "spl_connector.h" #include //: Runs the filter -vpro_signal -vpro_try_option::run(unsigned long timestamp, - vpro_debug_observer* const debug) +spl_signal +spl_try_option::run(unsigned long timestamp, + spl_debug_observer* const debug) { // notify the debugger if available if (debug) debug->notify_enter(this, timestamp); @@ -28,22 +28,22 @@ vpro_try_option::run(unsigned long timestamp, if(this->input_request_active_){ vcl_cerr << "Warning detected cycle in data flow" <input_request_active_ = true; - vpro_signal retval = VPRO_INVALID; - typedef vcl_map::iterator Itr; + spl_signal retval = SPL_INVALID; + typedef vcl_map::iterator Itr; for(Itr i = input_connectors_.begin(); i != input_connectors_.end(); ++i) { - vpro_connector_sptr connector = i->second; + spl_connector_sptr connector = i->second; if(!connector->data()){ retval = connector->request_data(timestamp,debug); - if(retval == VPRO_INVALID) + if(retval == SPL_INVALID) continue; } - vpro_signal m = connector->data()->info(); - if(m == VPRO_INVALID){ + spl_signal m = connector->data()->info(); + if(m == SPL_INVALID){ retval = m; continue; } @@ -69,10 +69,10 @@ vpro_try_option::run(unsigned long timestamp, } //: Run the process on the current frame -vpro_signal -vpro_try_option::execute() +spl_signal +spl_try_option::execute() { - return VPRO_INVALID; + return SPL_INVALID; } diff --git a/vpro/vpro_try_option.h b/spl/spl_try_option.h similarity index 72% rename from vpro/vpro_try_option.h rename to spl/spl_try_option.h index f4b5990..6a31067 100644 --- a/vpro/vpro_try_option.h +++ b/spl/spl_try_option.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_try_option.h -#ifndef vpro_try_option_h_ -#define vpro_try_option_h_ +// This is spl/spl_try_option.h +#ifndef spl_try_option_h_ +#define spl_try_option_h_ //: // \file @@ -18,7 +18,7 @@ // \endverbatim -#include +#include #include @@ -29,24 +29,24 @@ // the output from this pin is forwarded to output pin 0. No further // input requests are made on the remaining pins. The output of this // filter is invalid only if all inputs are invalid. -class vpro_try_option : public vpro_process +class spl_try_option : public spl_process { public: //: Constructor - vpro_try_option() {} + spl_try_option() {} //: Destructor - virtual ~vpro_try_option() {} + virtual ~spl_try_option() {} //: Runs the process - vpro_signal run(unsigned long timestamp, - vpro_debug_observer* const debug = NULL); + spl_signal run(unsigned long timestamp, + spl_debug_observer* const debug = NULL); //: Execute this process - vpro_signal execute(); + spl_signal execute(); }; -#endif // vpro_try_option_h_ +#endif // spl_try_option_h_ diff --git a/vpro/vpro_vsl_processes.h b/spl/spl_vsl_processes.h similarity index 70% rename from vpro/vpro_vsl_processes.h rename to spl/spl_vsl_processes.h index d431d89..67c6c45 100644 --- a/vpro/vpro_vsl_processes.h +++ b/spl/spl_vsl_processes.h @@ -1,6 +1,6 @@ -// This is vpro/vpro_vsl_processes.h -#ifndef vpro_vsl_processes_h_ -#define vpro_vsl_processes_h_ +// This is spl/spl_vsl_processes.h +#ifndef spl_vsl_processes_h_ +#define spl_vsl_processes_h_ //-------------------------------------------------------------------------------- //: // \file @@ -20,7 +20,7 @@ //-------------------------------------------------------------------------------- -#include +#include #include #include #include @@ -33,19 +33,19 @@ //: Read data from a (vsl) binary istream (base class) -class vpro_b_istream_source_base : public vpro_source +class spl_b_istream_source_base : public spl_source { public: - vpro_b_istream_source_base(const vcl_string& filename) + spl_b_istream_source_base(const vcl_string& filename) : is(new vsl_b_ifstream(filename)) {} void open(const vcl_string& filename) { is = vcl_auto_ptr(new vsl_b_ifstream(filename)); } //: Execute the process - vpro_signal execute() + spl_signal execute() { - return VPRO_INVALID; + return SPL_INVALID; } vcl_auto_ptr is; }; @@ -53,22 +53,22 @@ class vpro_b_istream_source_base : public vpro_source //: Read data of type T from a (vsl) binary istream template -class vpro_b_istream_source : public vpro_b_istream_source_base +class spl_b_istream_source : public spl_b_istream_source_base { public: - vpro_b_istream_source(const vcl_string& filename) - : vpro_b_istream_source_base(filename) {} + spl_b_istream_source(const vcl_string& filename) + : spl_b_istream_source_base(filename) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { if(is->is().eof()){ - return VPRO_EOS; + return SPL_EOS; } T data; vsl_b_read(*is.get(),data); output(0, data); - return VPRO_VALID; + return SPL_VALID; } }; @@ -80,10 +80,10 @@ class vpro_b_istream_source : public vpro_b_istream_source_base //: Write data to a (vsl) binary ostream (base class) -class vpro_b_ostream_sink_base : public vpro_sink +class spl_b_ostream_sink_base : public spl_sink { public: - vpro_b_ostream_sink_base(const vcl_string& filename) + spl_b_ostream_sink_base(const vcl_string& filename) : os(new vsl_b_ofstream(filename)) {} void open(const vcl_string& filename) @@ -92,9 +92,9 @@ class vpro_b_ostream_sink_base : public vpro_sink bool enabled() const { return (os.get() != NULL && os->os().good()); } //: Execute the process - vpro_signal execute() + spl_signal execute() { - return VPRO_INVALID; + return SPL_INVALID; } vcl_auto_ptr os; }; @@ -102,18 +102,18 @@ class vpro_b_ostream_sink_base : public vpro_sink //: Write data of type T to a (vsl) binary ostream template -class vpro_b_ostream_sink : public vpro_b_ostream_sink_base +class spl_b_ostream_sink : public spl_b_ostream_sink_base { public: - vpro_b_ostream_sink(const vcl_string& filename) - : vpro_b_ostream_sink_base(filename) {} + spl_b_ostream_sink(const vcl_string& filename) + : spl_b_ostream_sink_base(filename) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T)); vsl_b_write(*os.get(), input(0)); - return VPRO_VALID; + return SPL_VALID; } }; @@ -121,4 +121,4 @@ class vpro_b_ostream_sink : public vpro_b_ostream_sink_base -#endif // vpro_vsl_processes_h_ +#endif // spl_vsl_processes_h_ diff --git a/spl/tests/CMakeLists.txt b/spl/tests/CMakeLists.txt new file mode 100644 index 0000000..6642ff7 --- /dev/null +++ b/spl/tests/CMakeLists.txt @@ -0,0 +1,28 @@ + +# Copyright Matthew Leotta 2006 - 2010. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file ../../LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +# spl/tests/CMakeLists.txt + + +ADD_EXECUTABLE( spl_test_all + test_driver.cxx + test_process.cxx + test_process_factory.cxx + test_delay_filter.cxx + test_storage.cxx + spl_sample_processes.cxx +) + +TARGET_LINK_LIBRARIES( spl_test_all spl testlib ) + +ADD_TEST( spl_test_process ${EXECUTABLE_OUTPUT_PATH}/spl_test_all test_process ) +ADD_TEST( spl_test_process_factory ${EXECUTABLE_OUTPUT_PATH}/spl_test_all test_process_factory ) +ADD_TEST( spl_test_delay_filter ${EXECUTABLE_OUTPUT_PATH}/spl_test_all test_delay_filter ) +ADD_TEST( spl_test_storage ${EXECUTABLE_OUTPUT_PATH}/spl_test_all test_storage ) + + +ADD_EXECUTABLE( spl_test_include test_include.cxx ) +TARGET_LINK_LIBRARIES( spl_test_include spl) diff --git a/spl/tests/spl_sample_processes.cxx b/spl/tests/spl_sample_processes.cxx new file mode 100644 index 0000000..12861a9 --- /dev/null +++ b/spl/tests/spl_sample_processes.cxx @@ -0,0 +1,44 @@ +// This is spl/tests/spl_sample_processes.cxx + +// Copyright Matthew Leotta 2006 - 2010. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file ../../LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +//: +// \file + +#include "spl_sample_processes.h" +#include +#include +#include + + + +//: Return the default set of parameters for the process +template +spl_parameters_sptr +spl_sum_factory::default_params() const +{ + // no parameters to add + spl_parameters_sptr p = new spl_parameters(); + return p; +} + + +//: Construct a process from a set of parameters +template +spl_process_sptr +spl_sum_factory::create(const spl_parameters_sptr& params) const +{ + return new spl_sum; +} + + +spl_process_factory::registrar sample_reglist[] = +{ + new spl_sum_factory, + new spl_sum_factory, + new spl_sum_factory, + new spl_sum_factory +}; diff --git a/vpro/tests/vpro_sample_processes.h b/spl/tests/spl_sample_processes.h similarity index 71% rename from vpro/tests/vpro_sample_processes.h rename to spl/tests/spl_sample_processes.h index 9cec5fc..6065bfb 100644 --- a/vpro/tests/vpro_sample_processes.h +++ b/spl/tests/spl_sample_processes.h @@ -1,6 +1,6 @@ -// This is vpro/tests/vpro_sample_processes.h -#ifndef vpro_sample_processes_h_ -#define vpro_sample_processes_h_ +// This is spl/tests/spl_sample_processes.h +#ifndef spl_sample_processes_h_ +#define spl_sample_processes_h_ //-------------------------------------------------------------------------------- //: // \file @@ -20,8 +20,8 @@ //-------------------------------------------------------------------------------- -#include -#include +#include +#include #include #include @@ -30,63 +30,63 @@ //============================================================================= template -class vpro_sum : public vpro_filter +class spl_sum : public spl_filter { public: //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T)); assert(input_type_id(1) == typeid(T)); T val1 = input(0); T val2 = input(1); output(0, T(val1+val2)); - return VPRO_VALID; + return SPL_VALID; } }; template -class vpro_diff : public vpro_filter +class spl_diff : public spl_filter { public: //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T)); assert(input_type_id(1) == typeid(T)); T val1 = input(0); T val2 = input(1); output(0, T(val1-val2)); - return VPRO_VALID; + return SPL_VALID; } }; template -class vpro_static_cast : public vpro_filter +class spl_static_cast : public spl_filter { public: //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(inT)); output(0, static_cast(input(0))); - return VPRO_VALID; + return SPL_VALID; } }; -class vpro_sqrt : public vpro_filter +class spl_sqrt : public spl_filter { public: //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(double)); output(0, vcl_sqrt(input(0))); - return VPRO_VALID; + return SPL_VALID; } }; @@ -97,22 +97,22 @@ class vpro_sqrt : public vpro_filter template -class vpro_input_queue : public vpro_source +class spl_input_queue : public spl_source { public: - vpro_input_queue(const vcl_vector& d) : data(d) {} + spl_input_queue(const vcl_vector& d) : data(d) {} //: Execute the process - vpro_signal execute() + spl_signal execute() { if(data.empty()){ - output(0, VPRO_EOS); - return VPRO_EOS; + output(0, SPL_EOS); + return SPL_EOS; } output(0, data.back()); data.pop_back(); - return VPRO_VALID; + return SPL_VALID; } vcl_vector data; @@ -125,17 +125,17 @@ class vpro_input_queue : public vpro_source template -class vpro_output_queue : public vpro_sink +class spl_output_queue : public spl_sink { public: - vpro_output_queue() : data() {} + spl_output_queue() : data() {} //: Execute the process - vpro_signal execute() + spl_signal execute() { assert(input_type_id(0) == typeid(T)); data.push_back(input(0)); - return VPRO_VALID; + return SPL_VALID; } vcl_vector data; @@ -147,19 +147,19 @@ class vpro_output_queue : public vpro_sink //============================================================================= template -class vpro_sum_factory : public vpro_process_factory +class spl_sum_factory : public spl_process_factory { public: //: Return the default set of parameters for the process - virtual vpro_parameters_sptr default_params() const; + virtual spl_parameters_sptr default_params() const; //: Construct a process from a set of parameters - virtual vpro_process_sptr create(const vpro_parameters_sptr& params) const; + virtual spl_process_sptr create(const spl_parameters_sptr& params) const; //: The name of the process virtual vcl_string name() const { return vcl_string("Sum<")+typeid(T).name()+">"; } - virtual ~vpro_sum_factory() {} + virtual ~spl_sum_factory() {} }; -#endif // vpro_sample_processes_h_ +#endif // spl_sample_processes_h_ diff --git a/vpro/tests/test_delay_filter.cxx b/spl/tests/test_delay_filter.cxx similarity index 64% rename from vpro/tests/test_delay_filter.cxx rename to spl/tests/test_delay_filter.cxx index 0e9ddbe..9144bd1 100644 --- a/vpro/tests/test_delay_filter.cxx +++ b/spl/tests/test_delay_filter.cxx @@ -4,9 +4,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include -#include "vpro_sample_processes.h" +#include +#include +#include "spl_sample_processes.h" #include @@ -16,12 +16,12 @@ MAIN( test_delay_filter ) START ("delay_filter"); - vpro_process_sptr delay = new vpro_delay(2,1.0); + spl_process_sptr delay = new spl_delay(2,1.0); - vpro_output_queue* oq_ptr = new vpro_output_queue; - vpro_process_sptr oq(oq_ptr); + spl_output_queue* oq_ptr = new spl_output_queue; + spl_process_sptr oq(oq_ptr); - vpro_process_sptr sum = new vpro_sum; + spl_process_sptr sum = new spl_sum; oq->connect_input(0,delay,1); @@ -31,13 +31,13 @@ MAIN( test_delay_filter ) for(unsigned int count = 0; count<10; ++count){ - vpro_signal s1 = oq->run(count); - vpro_signal s2 = delay->run(count); - if(s1 == VPRO_INVALID || s2 == VPRO_INVALID){ + spl_signal s1 = oq->run(count); + spl_signal s2 = delay->run(count); + if(s1 == SPL_INVALID || s2 == SPL_INVALID){ vcl_cerr << "Error stream failure" << vcl_endl; break; } - if(s1 == VPRO_EOS || s2 == VPRO_EOS){ + if(s1 == SPL_EOS || s2 == SPL_EOS){ break; } } diff --git a/vpro/tests/test_driver.cxx b/spl/tests/test_driver.cxx similarity index 100% rename from vpro/tests/test_driver.cxx rename to spl/tests/test_driver.cxx diff --git a/spl/tests/test_include.cxx b/spl/tests/test_include.cxx new file mode 100644 index 0000000..dd84830 --- /dev/null +++ b/spl/tests/test_include.cxx @@ -0,0 +1,26 @@ +// Copyright Matthew Leotta 2006 - 2010. +// Distributed under the Boost Software License, Version 1.0. +// (See accompanying file ../../LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +int main() +{ + return 0; +} diff --git a/vpro/tests/test_process.cxx b/spl/tests/test_process.cxx similarity index 60% rename from vpro/tests/test_process.cxx rename to spl/tests/test_process.cxx index 9bf16eb..738c02f 100644 --- a/vpro/tests/test_process.cxx +++ b/spl/tests/test_process.cxx @@ -4,21 +4,21 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include -#include "vpro_sample_processes.h" +#include +#include "spl_sample_processes.h" #include -#include +#include //: Print a message when notified template -class vpro_message : public vpro_observer +class spl_message : public spl_observer { public: //: Transmit the data to the input of a process - bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + bool notify(const spl_storage_sptr& data, unsigned long timestamp) { - if(data->info() == VPRO_VALID) + if(data->info() == SPL_VALID) vcl_cout << "Received: "<< data->template data() <<" at time "<(data); + spl_process_sptr iq = new spl_input_queue(data); - vpro_output_queue* oq1_ptr = new vpro_output_queue; - vpro_output_queue* oq2_ptr = new vpro_output_queue; - vpro_process_sptr oq1(oq1_ptr); - vpro_process_sptr oq2(oq2_ptr); + spl_output_queue* oq1_ptr = new spl_output_queue; + spl_output_queue* oq2_ptr = new spl_output_queue; + spl_process_sptr oq1(oq1_ptr); + spl_process_sptr oq2(oq2_ptr); - vpro_process_sptr conv = new vpro_static_cast; - vpro_process_sptr root = new vpro_sqrt; - vpro_process_sptr sum = new vpro_sum; + spl_process_sptr conv = new spl_static_cast; + spl_process_sptr root = new spl_sqrt; + spl_process_sptr sum = new spl_sum; - vpro_process_sptr conv2 = new vpro_static_cast; + spl_process_sptr conv2 = new spl_static_cast; oq1->connect_input(0,sum,0); root->connect_input(0,conv,0); @@ -58,11 +58,11 @@ MAIN( test_process ) conv2->connect_input(0,root,0); oq2->connect_input(0,conv2,0); - conv->add_output_observer(0,new vpro_message); + conv->add_output_observer(0,new spl_message); unsigned int count = 0; - for(; count<100 && oq1->run(count+1) == VPRO_VALID - && oq2->run(count+1) == VPRO_VALID; ++count); + for(; count<100 && oq1->run(count+1) == SPL_VALID + && oq2->run(count+1) == SPL_VALID; ++count); TEST("number of iterations", count, data.size()); diff --git a/vpro/tests/test_process_factory.cxx b/spl/tests/test_process_factory.cxx similarity index 76% rename from vpro/tests/test_process_factory.cxx rename to spl/tests/test_process_factory.cxx index 296212b..699d033 100644 --- a/vpro/tests/test_process_factory.cxx +++ b/spl/tests/test_process_factory.cxx @@ -4,9 +4,9 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include "vpro_sample_processes.h" +#include "spl_sample_processes.h" #include -#include +#include @@ -18,8 +18,8 @@ MAIN( test_process_factory ) //TEST("number of iterations", count, data.size()); - typedef vpro_process_factory::Reg_Type Reg_Type; - const Reg_Type& reg = vpro_process_factory::registry(); + typedef spl_process_factory::Reg_Type Reg_Type; + const Reg_Type& reg = spl_process_factory::registry(); vcl_cout << "Registered processes" << vcl_endl; for (Reg_Type::const_iterator i = reg.begin(); i != reg.end(); ++i) vcl_cout << i->first << vcl_endl; diff --git a/vpro/tests/test_storage.cxx b/spl/tests/test_storage.cxx similarity index 82% rename from vpro/tests/test_storage.cxx rename to spl/tests/test_storage.cxx index 00cee91..c411423 100644 --- a/vpro/tests/test_storage.cxx +++ b/spl/tests/test_storage.cxx @@ -4,7 +4,7 @@ // http://www.boost.org/LICENSE_1_0.txt) #include -#include +#include #include @@ -12,7 +12,7 @@ MAIN( test_storage ) { START ("storage"); - vpro_storage_sptr ds_int = new vpro_storage_type(10); + spl_storage_sptr ds_int = new spl_storage_type(10); int test = ds_int->data(); diff --git a/vpro/vis/CMakeLists.txt b/spl/vis/CMakeLists.txt similarity index 50% rename from vpro/vis/CMakeLists.txt rename to spl/vis/CMakeLists.txt index b0d9459..3596e30 100644 --- a/vpro/vis/CMakeLists.txt +++ b/spl/vis/CMakeLists.txt @@ -4,17 +4,17 @@ # (See accompanying file ../../LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) -# vpro/vis/CMakeLists.txt +# spl/vis/CMakeLists.txt if (VXL_VGUI_FOUND) - set(vpro_vis_sources - vpro_run_tableau.cxx vpro_run_tableau.h vpro_run_tableau_sptr.h - vpro_basic_gui_observers.h + set(spl_vis_sources + spl_run_tableau.cxx spl_run_tableau.h spl_run_tableau_sptr.h + spl_basic_gui_observers.h ) - add_library(vpro_vis ${vpro_vis_sources}) + add_library(spl_vis ${spl_vis_sources}) - target_link_libraries(vpro_vis vpro vgui) + target_link_libraries(spl_vis spl vgui) endif () diff --git a/vpro/vis/vpro_basic_gui_observers.h b/spl/vis/spl_basic_gui_observers.h similarity index 66% rename from vpro/vis/vpro_basic_gui_observers.h rename to spl/vis/spl_basic_gui_observers.h index 98993d3..5e80a50 100644 --- a/vpro/vis/vpro_basic_gui_observers.h +++ b/spl/vis/spl_basic_gui_observers.h @@ -1,9 +1,9 @@ -// This is vpro/vis/vpro_basic_gui_observers.h -#ifndef vpro_basic_gui_observers_h_ -#define vpro_basic_gui_observers_h_ +// This is spl/vis/spl_basic_gui_observers.h +#ifndef spl_basic_gui_observers_h_ +#define spl_basic_gui_observers_h_ //: // \file -// \brief Commonly used vpro_observers that update vgui_tableau +// \brief Commonly used spl_observers that update vgui_tableau // \author Matthew Leotta (mleotta@brown.lems.edu) // \date April 22, 2009 // @@ -16,23 +16,23 @@ // Modifications // \endverbatim -#include +#include #include #include //: update a vgui_image_tableau with a vil_image_resource_sptr -class vpro_image_observer: public vpro_observer +class spl_image_observer: public spl_observer { public: - vpro_image_observer(const vgui_image_tableau_sptr& itab) + spl_image_observer(const vgui_image_tableau_sptr& itab) : image_tab(itab) {} //: Called by the process when the data is ready - virtual bool notify(const vpro_storage_sptr& data, unsigned long timestamp) + virtual bool notify(const spl_storage_sptr& data, unsigned long timestamp) { assert(image_tab); assert(data); - if(data->info() != VPRO_VALID) + if(data->info() != SPL_VALID) image_tab->set_image_resource(NULL); else{ assert(data->type_id() == typeid(vil_image_resource_sptr)); @@ -45,4 +45,4 @@ class vpro_image_observer: public vpro_observer }; -#endif // vpro_basic_gui_observers_h_ +#endif // spl_basic_gui_observers_h_ diff --git a/vpro/vis/vpro_run_tableau.cxx b/spl/vis/spl_run_tableau.cxx similarity index 73% rename from vpro/vis/vpro_run_tableau.cxx rename to spl/vis/spl_run_tableau.cxx index 91353c8..6873c8c 100644 --- a/vpro/vis/vpro_run_tableau.cxx +++ b/spl/vis/spl_run_tableau.cxx @@ -1,10 +1,10 @@ -// This is vpro/vis/vpro_run_tableau.cxx -#include +// This is spl/vis/spl_run_tableau.cxx +#include //: // \file // \author Matthew Leotta // \date July 14, 2006 -// \brief See vpro_run_tableau.h for a description of this file. +// \brief See spl_run_tableau.h for a description of this file. // // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -22,8 +22,8 @@ #include //---------------------------------------------------------------------------- -//: Constructor - don't use this, use vpro_run_tableau_new. -vpro_run_tableau::vpro_run_tableau(const vpro_executive& g) +//: Constructor - don't use this, use spl_run_tableau_new. +spl_run_tableau::spl_run_tableau(const spl_executive& g) : graph_(g), fps_(0.0), display_(false), running_(false) { graph_.init(); @@ -32,7 +32,7 @@ vpro_run_tableau::vpro_run_tableau(const vpro_executive& g) //---------------------------------------------------------------------------- //: Handle events -bool vpro_run_tableau::handle(const vgui_event& e) +bool spl_run_tableau::handle(const vgui_event& e) { if (display_ && e.type == vgui_DRAW) { @@ -72,7 +72,7 @@ bool vpro_run_tableau::handle(const vgui_event& e) //---------------------------------------------------------------------------- //: Handle keypress -bool vpro_run_tableau::key_press (int x, int y, vgui_key key, vgui_modifier) +bool spl_run_tableau::key_press (int x, int y, vgui_key key, vgui_modifier) { switch(key){ case ' ': @@ -93,7 +93,7 @@ bool vpro_run_tableau::key_press (int x, int y, vgui_key key, vgui_modifier) //---------------------------------------------------------------------------- //: Enable idle events (start the processing) -void vpro_run_tableau::enable_idle() +void spl_run_tableau::enable_idle() { this->post_idle_request(); running_ = true; @@ -102,7 +102,7 @@ void vpro_run_tableau::enable_idle() //---------------------------------------------------------------------------- //: Enable idle events for one iteration -void vpro_run_tableau::enable_idle_once() +void spl_run_tableau::enable_idle_once() { run_step(); running_ = false; @@ -111,7 +111,7 @@ void vpro_run_tableau::enable_idle_once() //---------------------------------------------------------------------------- //: Toggle the text display -void vpro_run_tableau::toggle_display() +void spl_run_tableau::toggle_display() { this->display_ = !this->display_; } @@ -119,13 +119,13 @@ void vpro_run_tableau::toggle_display() //---------------------------------------------------------------------------- //: Builds a popup menu -void vpro_run_tableau::get_popup(const vgui_popup_params& params, +void spl_run_tableau::get_popup(const vgui_popup_params& params, vgui_menu &menu) { vgui_menu submenu; - submenu.add("start processing",new vgui_command_simple(this,&vpro_run_tableau::enable_idle)); - submenu.add("process once",new vgui_command_simple(this,&vpro_run_tableau::enable_idle_once)); - submenu.add("toggle display",new vgui_command_simple(this,&vpro_run_tableau::toggle_display)); + submenu.add("start processing",new vgui_command_simple(this,&spl_run_tableau::enable_idle)); + submenu.add("process once",new vgui_command_simple(this,&spl_run_tableau::enable_idle_once)); + submenu.add("toggle display",new vgui_command_simple(this,&spl_run_tableau::toggle_display)); menu.add("Process Control",submenu); } @@ -133,7 +133,7 @@ void vpro_run_tableau::get_popup(const vgui_popup_params& params, //---------------------------------------------------------------------------- //: Handle idle events -bool vpro_run_tableau::idle() +bool spl_run_tableau::idle() { if((++count_)%10 == 0){ fps_ = 10000.0/time_.real(); @@ -150,17 +150,17 @@ bool vpro_run_tableau::idle() //---------------------------------------------------------------------------- //: Run one step of the processing -bool vpro_run_tableau::run_step() +bool spl_run_tableau::run_step() { static bool semaphore = false; if(semaphore) return true; semaphore = true; - vpro_signal s = graph_.run_step(); + spl_signal s = graph_.run_step(); vgui::run_till_idle(); semaphore = false; - assert(s != VPRO_INVALID); - return (s == VPRO_VALID || s == VPRO_WAIT); + assert(s != SPL_INVALID); + return (s == SPL_VALID || s == SPL_WAIT); } diff --git a/vpro/vis/vpro_run_tableau.h b/spl/vis/spl_run_tableau.h similarity index 62% rename from vpro/vis/vpro_run_tableau.h rename to spl/vis/spl_run_tableau.h index ac514fa..7aaf667 100644 --- a/vpro/vis/vpro_run_tableau.h +++ b/spl/vis/spl_run_tableau.h @@ -1,9 +1,9 @@ -// This is vpro/vis/vpro_run_tableau.h -#ifndef vpro_run_tableau_h_ -#define vpro_run_tableau_h_ +// This is spl/vis/spl_run_tableau.h +#ifndef spl_run_tableau_h_ +#define spl_run_tableau_h_ //: // \file -// \brief Tableau that runs a vpro process graph in its idle handler +// \brief Tableau that runs a spl process graph in its idle handler // \author Matthew Leotta (mleotta@brown.lems.edu) // \date July 14, 2006 // @@ -17,18 +17,18 @@ // \endverbatim -#include -#include +#include +#include #include #include -//: Tableau that runs a vpro process graph in its idle handler -class vpro_run_tableau: public vgui_tableau +//: Tableau that runs a spl process graph in its idle handler +class spl_run_tableau: public vgui_tableau { public: //: Constructor - vpro_run_tableau(const vpro_executive& g); + spl_run_tableau(const spl_executive& g); //: Enable idle events (start the processing) void enable_idle(); @@ -56,7 +56,7 @@ class vpro_run_tableau: public vgui_tableau bool idle(); private: - vpro_executive graph_; + spl_executive graph_; vul_timer time_; double fps_; unsigned int count_; @@ -65,14 +65,14 @@ class vpro_run_tableau: public vgui_tableau }; -//: Creates a smart-pointer to a vpro_run_tableau tableau. -struct vpro_run_tableau_new : public vpro_run_tableau_sptr +//: Creates a smart-pointer to a spl_run_tableau tableau. +struct spl_run_tableau_new : public spl_run_tableau_sptr { - typedef vpro_run_tableau_sptr base; + typedef spl_run_tableau_sptr base; //: Constructor - vpro_run_tableau_new(const vpro_executive& g) - : base(new vpro_run_tableau(g)) {} + spl_run_tableau_new(const spl_executive& g) + : base(new spl_run_tableau(g)) {} }; -#endif // vpro_run_tableau_h_ +#endif // spl_run_tableau_h_ diff --git a/vpro/vis/vpro_run_tableau_sptr.h b/spl/vis/spl_run_tableau_sptr.h similarity index 53% rename from vpro/vis/vpro_run_tableau_sptr.h rename to spl/vis/spl_run_tableau_sptr.h index 3e2090a..0dbec1c 100644 --- a/vpro/vis/vpro_run_tableau_sptr.h +++ b/spl/vis/spl_run_tableau_sptr.h @@ -1,10 +1,10 @@ -// This is vpro/vis/vpro_run_tableau_sptr.h -#ifndef vpro_run_tableau_sptr_h_ -#define vpro_run_tableau_sptr_h_ +// This is spl/vis/spl_run_tableau_sptr.h +#ifndef spl_run_tableau_sptr_h_ +#define spl_run_tableau_sptr_h_ //: // \file // \author Matthew Leotta (mleotta@lems.brown.edu) -// \brief Smart-pointer to a vpro_run_tableau tableau. +// \brief Smart-pointer to a spl_run_tableau tableau. // // Copyright Matthew Leotta 2006 - 2010. // Distributed under the Boost Software License, Version 1.0. @@ -14,7 +14,7 @@ #include -class vpro_run_tableau; -typedef vgui_tableau_sptr_t vpro_run_tableau_sptr; +class spl_run_tableau; +typedef vgui_tableau_sptr_t spl_run_tableau_sptr; -#endif // vpro_run_tableau_sptr_h_ +#endif // spl_run_tableau_sptr_h_ diff --git a/vpro/CMakeLists.txt b/vpro/CMakeLists.txt deleted file mode 100644 index 03d51e2..0000000 --- a/vpro/CMakeLists.txt +++ /dev/null @@ -1,58 +0,0 @@ - -# Copyright Matthew Leotta 2006 - 2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# vpro/CMakeLists.txt - -project(vpro) - -include_directories( ${VXL_BRL_INCLUDE_DIR} ) - -find_package( Threads ) - -configure_file( ${CMAKE_CURRENT_SOURCE_DIR}/vpro_config.h.in - ${CMAKE_CURRENT_BINARY_DIR}/vpro_config.h ) - - -set(vpro_sources - vpro_mutex.cxx vpro_mutex.h - vpro_parameters.cxx vpro_parameters.h vpro_parameters_sptr.h - vpro_parameters.txx - vpro_process.cxx vpro_process.h vpro_process_sptr.h - vpro_basic_processes.h - vpro_vsl_processes.h - vpro_ios_processes.h - vpro_process_factory.cxx vpro_process_factory.h - vpro_storage.h vpro_storage_sptr.h - vpro_observer.h vpro_observer_sptr.h - vpro_connector.cxx vpro_connector.h vpro_connector_sptr.h - vpro_delay.cxx vpro_delay.h - vpro_try_option.cxx vpro_try_option.h - vpro_executive.cxx vpro_executive.h -) - - - -aux_source_directory(Templates vpro_sources) - -add_library(vpro ${vpro_sources}) - - -target_link_libraries(vpro vul vbl) - -if( CMAKE_USE_PTHREADS_INIT ) - set_target_properties(vpro PROPERTIES COMPILE_FLAGS -pthread) - target_link_libraries(vpro pthread) -endif() - - -add_subdirectory( vis ) - -add_subdirectory( filters ) - - -if(BUILD_TESTING) - add_subdirectory(tests) -endif() diff --git a/vpro/introduction_doxy.txt b/vpro/introduction_doxy.txt deleted file mode 100644 index c92d71c..0000000 --- a/vpro/introduction_doxy.txt +++ /dev/null @@ -1,15 +0,0 @@ -// The following text is included in the main documentation page by doxygen -/*! \mainpage vpro : Video Processing Library -* This library provides a set of base classes for process, storage, and parameters object. -* -* \section vpro_overview Overview -* -* The vpro_storage class is an abstract base class for -* derived storage classes that may store any type of data. The vpro_process class -* is an abstract base class for derived process classes that execute various algorithms -* Thus, a vpro_storage class is a wrapper around your data structures while a -* vpro_process is a wrapper around your algorithm. Additional parameters to a -* process are managed by the vpro_parameters class. -* -* -*/ diff --git a/vpro/tests/CMakeLists.txt b/vpro/tests/CMakeLists.txt deleted file mode 100644 index f93c418..0000000 --- a/vpro/tests/CMakeLists.txt +++ /dev/null @@ -1,28 +0,0 @@ - -# Copyright Matthew Leotta 2006 - 2010. -# Distributed under the Boost Software License, Version 1.0. -# (See accompanying file ../../LICENSE_1_0.txt or copy at -# http://www.boost.org/LICENSE_1_0.txt) - -# vpro/tests/CMakeLists.txt - - -ADD_EXECUTABLE( vpro_test_all - test_driver.cxx - test_process.cxx - test_process_factory.cxx - test_delay_filter.cxx - test_storage.cxx - vpro_sample_processes.cxx -) - -TARGET_LINK_LIBRARIES( vpro_test_all vpro testlib ) - -ADD_TEST( vpro_test_process ${EXECUTABLE_OUTPUT_PATH}/vpro_test_all test_process ) -ADD_TEST( vpro_test_process_factory ${EXECUTABLE_OUTPUT_PATH}/vpro_test_all test_process_factory ) -ADD_TEST( vpro_test_delay_filter ${EXECUTABLE_OUTPUT_PATH}/vpro_test_all test_delay_filter ) -ADD_TEST( vpro_test_storage ${EXECUTABLE_OUTPUT_PATH}/vpro_test_all test_storage ) - - -ADD_EXECUTABLE( vpro_test_include test_include.cxx ) -TARGET_LINK_LIBRARIES( vpro_test_include vpro) diff --git a/vpro/tests/test_include.cxx b/vpro/tests/test_include.cxx deleted file mode 100644 index 28cc02e..0000000 --- a/vpro/tests/test_include.cxx +++ /dev/null @@ -1,26 +0,0 @@ -// Copyright Matthew Leotta 2006 - 2010. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file ../../LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -int main() -{ - return 0; -} diff --git a/vpro/tests/vpro_sample_processes.cxx b/vpro/tests/vpro_sample_processes.cxx deleted file mode 100644 index 6dcca5b..0000000 --- a/vpro/tests/vpro_sample_processes.cxx +++ /dev/null @@ -1,44 +0,0 @@ -// This is vpro/tests/vpro_sample_processes.cxx - -// Copyright Matthew Leotta 2006 - 2010. -// Distributed under the Boost Software License, Version 1.0. -// (See accompanying file ../../LICENSE_1_0.txt or copy at -// http://www.boost.org/LICENSE_1_0.txt) - -//: -// \file - -#include "vpro_sample_processes.h" -#include -#include -#include - - - -//: Return the default set of parameters for the process -template -vpro_parameters_sptr -vpro_sum_factory::default_params() const -{ - // no parameters to add - vpro_parameters_sptr p = new vpro_parameters(); - return p; -} - - -//: Construct a process from a set of parameters -template -vpro_process_sptr -vpro_sum_factory::create(const vpro_parameters_sptr& params) const -{ - return new vpro_sum; -} - - -vpro_process_factory::registrar sample_reglist[] = -{ - new vpro_sum_factory, - new vpro_sum_factory, - new vpro_sum_factory, - new vpro_sum_factory -};