1#include "image_writer.h"
2#include <cgv/base/register.h>
17 static std::vector<base_ptr>& ref_writers()
19 static std::vector<base_ptr> writers;
24 return "image_writer_listener";
29 ref_writers().push_back(
object);
33 for (
unsigned int i=0; i<ref_writers().size(); ++i) {
34 if (
object == ref_writers()[i]) {
35 ref_writers().erase(ref_writers().begin()+i);
52 std::string::size_type pos =
file_name.find_last_of(
'.');
53 if (pos == std::string::npos) {
54 last_error =
"file name without extension specified";
58 std::vector<base_ptr>& writers = writer_listener::ref_writers();
59 for (
unsigned int i=0; i<writers.size(); ++i) {
67 last_error =
"no image image_writer found for extension: ";
74 static std::string exts;
76 std::vector<base_ptr>& writers = writer_listener::ref_writers();
77 for (
unsigned int i=0; i<writers.size(); ++i) {
90 std::string text =
"Image Files (";
91 std::string exts =
"*.";
103 return wr->is_format_supported(cf, palette_formats);
112 return wr->get_last_error();
140 return wr->write_image(dv, palettes, duration);
150 return wr->supports_multiple_images();
158 return wr->get_type_name();
159 return "cmi::image_writer";
165 return wr->get_property_declarations();
173 return wr->set_void(property,
type, value);
180 return wr->get_void(property,
type, value);
base class for all classes that can be registered with support for dynamic properties (see also secti...
virtual std::string get_property_declarations()
return a semicolon separated list of property declarations
T * get_interface()
use dynamic type cast to check for the given interface
virtual bool set_void(const std::string &property, const std::string &value_type, const void *value_ptr)
abstract interface for the setter of a dynamic property.
virtual bool get_void(const std::string &property, const std::string &value_type, void *value_ptr)
abstract interface for the getter of a dynamic property.
The const_data_view has the functionality of the data_view but uses a const pointer and therefore doe...
the base namespace holds the base hierarchy, support for plugin registration and signals
data::ref_ptr< base, true > base_ptr
ref counted pointer to base
namespace for data management components
namespace for compile time type information
namespace that holds tools that dont fit any other namespace
unsigned int replace(std::string &s, char c1, char c2)
replace char c1 with c2 in the given string _s and return number of replacements
char to_lower(char c)
convert char to lower case
bool is_element(char c, const std::string &s)
check if char c arises in string s
this header is dependency free
Helper functions to process strings.
convenience class to register an object of the given class type
interfaces that allows to listen to registration events.
interfaces that add provides very basic functionality.