Loads and saves images.
More...
#include <geogram/image/image_serializer.h>
Loads and saves images.
Definition at line 65 of file image_serializer.h.
◆ binary()
virtual bool GEO::ImageSerializer::binary |
( |
| ) |
const |
|
virtual |
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
-
true | if the file format is binary |
false | if the file format is ASCII |
Reimplemented in GEO::ImageSerializer_xpm, GEO::ImageSerializerSTB, and GEO::ImageSerializer_pgm.
◆ read_supported()
virtual bool GEO::ImageSerializer::read_supported |
( |
| ) |
const |
|
virtual |
◆ serialize_read() [1/2]
virtual Image* GEO::ImageSerializer::serialize_read |
( |
const std::string & |
file_name | ) |
|
|
virtual |
reads an image from a file.
- Parameters
-
[in] | file_name | the name of the file |
- 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 in GEO::ImageSerializerSTB, and GEO::ImageSerializer_pgm.
◆ serialize_read() [2/2]
virtual Image* GEO::ImageSerializer::serialize_read |
( |
std::istream & |
stream | ) |
|
|
virtual |
reads an image from a stream.
- Parameters
-
[in,out] | stream | the 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 in GEO::ImageSerializer_xpm.
◆ serialize_write() [1/2]
virtual bool GEO::ImageSerializer::serialize_write |
( |
const std::string & |
file_name, |
|
|
const Image * |
image |
|
) |
| |
|
virtual |
writes an image into a file.
- Parameters
-
[in] | file_name | the name of the file |
[in] | image | a pointer to the image to be saved |
- Return values
-
true | if the image could be saved |
false | otherwise |
Reimplemented in GEO::ImageSerializerSTB.
◆ serialize_write() [2/2]
virtual bool GEO::ImageSerializer::serialize_write |
( |
std::ostream & |
stream, |
|
|
const Image * |
image |
|
) |
| |
|
virtual |
writes an image into a stream.
- Parameters
-
[in,out] | stream | the stream where the image should be written |
[in] | image | a pointer to the image to be saved |
- Return values
-
true | if the image could be saved |
false | otherwise |
◆ streams_supported()
virtual bool GEO::ImageSerializer::streams_supported |
( |
| ) |
const |
|
virtual |
Tests whether the functions that use streams are supported.
Default implementation in base class returns true.
- Return values
-
true | if the functions that use streams are supported |
false | otherwise |
Reimplemented in GEO::ImageSerializerSTB.
◆ write_supported()
virtual bool GEO::ImageSerializer::write_supported |
( |
| ) |
const |
|
virtual |
Tests whether writing is implemented.
Some serializers implement only reading or only writing. Default implementation returns false
- Return values
-
true | if writing is supported |
false | otherwise |
Reimplemented in GEO::ImageSerializerSTB.
The documentation for this class was generated from the following file: