libpromeki main
PROfessional MEdia toolKIt
 
Loading...
Searching...
No Matches
imagefile.h
Go to the documentation of this file.
1
8#pragma once
9
11#include <promeki/core/string.h>
12#include <promeki/core/error.h>
13#include <promeki/proav/image.h>
14
16
17class ImageFileIO;
18
27class ImageFile {
28 public:
30 enum ID {
31 Invalid = 0,
32 PNG
33 };
34
39 ImageFile(int id = 0);
40
45 const String &filename() const {
46 return _filename;
47 }
48
53 void setFilename(const String &val) {
54 _filename = val;
55 return;
56 }
57
62 const Image &image() const {
63 return _image;
64 }
65
70 void setImage(const Image &val) {
71 _image = val;
72 return;
73 }
74
80
86
87 private:
88 String _filename;
89 Image _image;
90 const ImageFileIO *_io;
91};
92
94
95
Lightweight error code wrapper for the promeki library.
Definition error.h:39
Abstract backend for image file format I/O.
Definition imagefileio.h:35
Image file loader and saver.
Definition imagefile.h:27
void setFilename(const String &val)
Sets the filename for loading or saving.
Definition imagefile.h:53
ImageFile(int id=0)
Constructs an ImageFile for the given format.
Error save()
Saves the image to the file specified by filename().
const Image & image() const
Returns the image data.
Definition imagefile.h:62
Error load()
Loads an image from the file specified by filename().
void setImage(const Image &val)
Sets the image data for saving.
Definition imagefile.h:70
const String & filename() const
Returns the filename associated with this image file.
Definition imagefile.h:45
ID
Identifiers for supported image file formats.
Definition imagefile.h:30
@ PNG
PNG image format.
Definition imagefile.h:32
@ Invalid
No format / invalid.
Definition imagefile.h:31
Raster image with pixel format, planes, and metadata.
Definition image.h:48
Dynamic array container wrapping std::vector.
Definition list.h:40
Encoding-aware string class with copy-on-write semantics.
Definition string.h:35
#define PROMEKI_NAMESPACE_BEGIN
Starts a promeki namespace block.
Definition namespace.h:14
#define PROMEKI_NAMESPACE_END
Ends a promeki namespace block.
Definition namespace.h:19