Geogram  Version 1.9.1
A programming library of geometric algorithms
GEO::ImageSerializer_xpm Class Reference
Inheritance diagram for GEO::ImageSerializer_xpm:
GEO::ImageSerializer GEO::Counted

Public Member Functions

Imageserialize_read (std::istream &stream) override
 reads an image from a stream. More...
 
bool read_supported () const override
 Tests whether reading is implemented. More...
 
bool binary () const override
 Tests whether the file format is binary or ASCII. More...
 
- Public Member Functions inherited from GEO::ImageSerializer
virtual Imageserialize_read (const std::string &file_name)
 reads an image from a file. More...
 
virtual bool serialize_write (const std::string &file_name, const Image *image)
 writes an image into a file. More...
 
virtual bool serialize_write (std::ostream &stream, const Image *image)
 writes an image into a stream. More...
 
virtual bool streams_supported () const
 Tests whether the functions that use streams are supported. More...
 
virtual bool write_supported () const
 Tests whether writing is implemented. More...
 
- Public Member Functions inherited from GEO::Counted
void ref () const
 Increments the reference count. More...
 
void unref () const
 Decrements the reference count. More...
 
bool is_shared () const
 Check if the object is shared. More...
 
int nb_refs () const
 Gets the number of references that point to this object. More...
 

Static Public Member Functions

static Imagecreate_image_from_xpm_data (const char *s)
 Creates an image from XPM data. More...
 
- Static Public Member Functions inherited from GEO::Counted
static void ref (const Counted *counted)
 Increments the reference count. More...
 
static void unref (const Counted *counted)
 Decrements the reference count. More...
 

Static Protected Member Functions

static Imageserialize_read_static (std::istream &stream)
 
static Imageread_xpm_1_byte_per_pixel (int width, int height, int num_colors, std::istream &input)
 
static Imageread_xpm_2_bytes_per_pixel (int width, int height, int num_colors, std::istream &input)
 
static char * next_xpm_data (std::istream &input)
 

Additional Inherited Members

- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Detailed Description

Definition at line 50 of file image_serializer_xpm.h.

Member Function Documentation

◆ binary()

bool GEO::ImageSerializer_xpm::binary ( ) const
overridevirtual

Tests whether the file format is binary or ASCII.

It is used to determine whether a stream should be opened in ASCII or binary mode for loading image files. Default implementation in base class returns true.

Return values
trueif the file format is binary
falseif the file format is ASCII

Reimplemented from GEO::ImageSerializer.

◆ create_image_from_xpm_data()

static Image* GEO::ImageSerializer_xpm::create_image_from_xpm_data ( const char *  s)
static

Creates an image from XPM data.

Parameters
[in]sthe string with the XPM data.
Returns
the created image.

◆ read_supported()

bool GEO::ImageSerializer_xpm::read_supported ( ) const
overridevirtual

Tests whether reading is implemented.

Some serializers implement only reading or only writing. Default implementation returns false

Return values
trueif reading is supported
falseotherwise

Reimplemented from GEO::ImageSerializer.

◆ serialize_read()

Image* GEO::ImageSerializer_xpm::serialize_read ( std::istream &  stream)
overridevirtual

reads an image from a stream.

Parameters
[in,out]streamthe stream where the image should be read from
Returns
a pointer to the loaded image or nil if the image could not be loaded
Note
the loaded image can be stored in an Image_var

Reimplemented from GEO::ImageSerializer.


The documentation for this class was generated from the following file: