Geogram  Version 1.9.1-rc
A programming library of geometric algorithms
GEO::ImageSerializerSTB Class Reference

Loads and saves images. More...

#include <geogram/image/image_serializer_stb.h>

Inheritance diagram for GEO::ImageSerializerSTB:
GEO::ImageSerializer GEO::Counted GEO::ImageSerializerSTBRead GEO::ImageSerializerSTBReadWrite

Public Member Functions

 ImageSerializerSTB (bool read, bool write)
 ImageSerializerSTB constructor. More...
 
Imageserialize_read (const std::string &file_name) override
 
bool serialize_write (const std::string &file_name, const Image *image) override
 
bool binary () const override
 Tests whether the file format is binary or ASCII. More...
 
bool streams_supported () const override
 Tests whether the functions that use streams are supported. More...
 
bool read_supported () const override
 Tests whether reading is implemented. More...
 
bool write_supported () const override
 Tests whether writing is implemented. More...
 
- Public Member Functions inherited from GEO::ImageSerializer
virtual Imageserialize_read (std::istream &stream)
 reads an image from a stream. More...
 
virtual bool serialize_write (std::ostream &stream, const Image *image)
 writes an image into a stream. 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...
 

Additional Inherited Members

- 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...
 
- Protected Member Functions inherited from GEO::Counted
 Counted ()
 Creates a reference counted object. More...
 
virtual ~Counted ()
 Destroys a reference counted object. More...
 

Detailed Description

Loads and saves images.

Definition at line 62 of file image_serializer_stb.h.

Constructor & Destructor Documentation

◆ ImageSerializerSTB()

GEO::ImageSerializerSTB::ImageSerializerSTB ( bool  read,
bool  write 
)

ImageSerializerSTB constructor.

Parameters
[in]readtrue if reading is supported
[in]writetrue if writing is supported

Member Function Documentation

◆ binary()

bool GEO::ImageSerializerSTB::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.

◆ read_supported()

bool GEO::ImageSerializerSTB::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::ImageSerializerSTB::serialize_read ( const std::string &  file_name)
overridevirtual

Reimplemented from GEO::ImageSerializer.

◆ serialize_write()

bool GEO::ImageSerializerSTB::serialize_write ( const std::string &  file_name,
const Image image 
)
overridevirtual

Reimplemented from GEO::ImageSerializer.

◆ streams_supported()

bool GEO::ImageSerializerSTB::streams_supported ( ) const
overridevirtual

Tests whether the functions that use streams are supported.

Default implementation in base class returns true.

Return values
trueif the functions that use streams are supported
falseotherwise

This version returns false

Reimplemented from GEO::ImageSerializer.

◆ write_supported()

bool GEO::ImageSerializerSTB::write_supported ( ) const
overridevirtual

Tests whether writing is implemented.

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

Return values
trueif writing is supported
falseotherwise

Reimplemented from GEO::ImageSerializer.


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