|
Graphite Version 3
An experimental 3D geometry processing program
|
Manages the ImageSerializer repository and the named images. More...
#include <geogram/image/image_library.h>
Public Member Functions | |
| bool | bind_image_serializer (const std::string &extension, ImageSerializer *serializer) |
| Binds an ImageSerializer. | |
| ImageSerializer * | resolve_image_serializer (const std::string &extension) const |
| Finds an ImageSerializer by extension. | |
| bool | bind_image (const std::string &name, Image *image) |
| Binds an image with a name. | |
| bool | unbind_image (const std::string &name) |
| Unbinds a named image. | |
| Image * | resolve_image (const std::string &name) const |
| Finds an image by name. | |
| Image * | load_image (const std::string &file_name) |
| Loads an image from a file. | |
| bool | save_image (const std::string &file_name, Image *image) |
| Saves an image into a file. | |
| void | copy_image_to_clipboard (Image *image) |
| Copies an image to the clipboard of the operating system. | |
| bool | get_local_value (const std::string &name, std::string &value) const override |
| Retrieves a variable value locally. | |
| bool | set_local_value (const std::string &name, const std::string &value) override |
| Sets a variable value locally. | |
Public Member Functions inherited from GEO::Environment | |
| virtual bool | add_environment (Environment *env) |
| Adds a child environment. | |
| bool | has_value (const std::string &name) const |
| Tests if a variable exists. | |
| virtual bool | get_value (const std::string &name, std::string &value) const |
| Retrieves the value of a variable. | |
| std::string | get_value (const std::string &name) const |
| Retrieves the value of a variable. | |
| virtual bool | set_value (const std::string &name, const std::string &value) |
| Sets a variable value. | |
| virtual Environment * | find_environment (const std::string &name) |
| Finds the environment that declares a variable as a local name. | |
| virtual bool | add_observer (const std::string &name, VariableObserver *observer) |
| Attaches an observer to a variable. | |
| virtual bool | remove_observer (const std::string &name, VariableObserver *observer) |
| Detaches an observer from a variable. | |
| virtual bool | notify_observers (const std::string &name, bool recursive=false) |
| Notifies observers. | |
Public Member Functions inherited from GEO::Counted | |
| void | ref () const |
| Increments the reference count. | |
| void | unref () const |
| Decrements the reference count. | |
| bool | is_shared () const |
| Check if the object is shared. | |
| int | nb_refs () const |
| Gets the number of references that point to this object. | |
Static Public Member Functions | |
| static ImageLibrary * | instance () |
| Gets the instance. | |
| static void | initialize () |
| Initializes the ImageLibrary instance. | |
| static void | terminate () |
| Terminates the ImageLibrary instance. | |
Static Public Member Functions inherited from GEO::Environment | |
| static Environment * | instance () |
| Gets the root environment. | |
| static void | terminate () |
| Cleans up the environment. | |
Static Public Member Functions inherited from GEO::Counted | |
| static void | ref (const Counted *counted) |
| Increments the reference count. | |
| static void | unref (const Counted *counted) |
| Decrements the reference count. | |
Friends | |
| class | World |
Additional Inherited Members | |
Protected Member Functions inherited from GEO::Environment | |
| ~Environment () override | |
| Environment destructor. | |
| bool | notify_observers (const std::string &name, const std::string &value, bool recursive) |
| Notifies observers. | |
| bool | notify_local_observers (const std::string &name, const std::string &value) |
| Notifies local observers. | |
Protected Member Functions inherited from GEO::Counted | |
| Counted () | |
| Creates a reference counted object. | |
| virtual | ~Counted () |
| Destroys a reference counted object. | |
Manages the ImageSerializer repository and the named images.
Definition at line 68 of file image_library.h.
| bool GEO::ImageLibrary::bind_image | ( | const std::string & | name, |
| Image * | image | ||
| ) |
Binds an image with a name.
| [in] | name | the name of the image |
| [in] | image | a pointer to the image to be bound. Ownership is transferred to this ImageLibrary. |
| bool GEO::ImageLibrary::bind_image_serializer | ( | const std::string & | extension, |
| ImageSerializer * | serializer | ||
| ) |
Binds an ImageSerializer.
| [in] | extension | the file extension without the "." |
| [in] | serializer | a pointer to an ImageSerializer. Ownership is transferred to this ImageLibrary |
| true | if the ImageSerializer could be successfully bound |
| false | otherwise (i.e. if there was already a serializer with the same name). |
| void GEO::ImageLibrary::copy_image_to_clipboard | ( | Image * | image | ) |
Copies an image to the clipboard of the operating system.
| [in] | image | the image to be copied to the clipboard. |
|
overridevirtual |
Retrieves a variable value locally.
This function is used internally. It searches variable name locally and stores its value in the output string value.
| [in] | name | the name of the variable |
| [out] | value | is set the variable value if it was found locally. |
| true | if the variable was found |
| false | if not |
Provides the following environment variables:
Implements GEO::Environment.
|
static |
Initializes the ImageLibrary instance.
This function is automatically called during Geogram startup. It should not be called by client code.
|
static |
Gets the instance.
| Image * GEO::ImageLibrary::load_image | ( | const std::string & | file_name | ) |
Loads an image from a file.
| [in] | file_name | the name of the file that contains the image |
| Image * GEO::ImageLibrary::resolve_image | ( | const std::string & | name | ) | const |
Finds an image by name.
| [in] | name | the name of the image |
| ImageSerializer * GEO::ImageLibrary::resolve_image_serializer | ( | const std::string & | extension | ) | const |
Finds an ImageSerializer by extension.
| [in] | extension | the file extension without the "." |
| bool GEO::ImageLibrary::save_image | ( | const std::string & | file_name, |
| Image * | image | ||
| ) |
Saves an image into a file.
| [in] | file_name | the name of the file that will receive the image |
| [in] | image | a pointer to the Image to be saved |
| true | if the image could be successfully saved |
| false | otherwise |
|
overridevirtual |
Sets a variable value locally.
This function is used internally. It sets the variable named name to the given value locally.
| [in] | name | the name of the variable |
| [in] | value | the value of the variable |
| true | if the variable was successfully added locally |
| false | otherwise |
Implements GEO::Environment.
|
static |
Terminates the ImageLibrary instance.
This function is automatically called during Geogram shutdown. It should not be called by client code.
| bool GEO::ImageLibrary::unbind_image | ( | const std::string & | name | ) |
|
friend |
Definition at line 192 of file image_library.h.