#include <genesis/utils/formats/bmp/writer.hpp>
Write Bitmap image files.
Definition at line 60 of file utils/formats/bmp/writer.hpp.
Public Member Functions | |
BmpWriter ()=default | |
Default constructor. More... | |
BmpWriter (BmpWriter &&)=default | |
Default move constructor. More... | |
BmpWriter (BmpWriter const &)=default | |
Default copy constructor. More... | |
~BmpWriter ()=default | |
Default destructor. More... | |
BmpWriter & | operator= (BmpWriter &&)=default |
Default move assignemnt. More... | |
BmpWriter & | operator= (BmpWriter const &)=default |
Default copy assignemnt. More... | |
void | write (Matrix< Color > const &image, std::shared_ptr< utils::BaseOutputTarget > target) const |
Write a full 24bit RGB Color image to an output target. More... | |
void | write (Matrix< unsigned char > const &image, std::shared_ptr< utils::BaseOutputTarget > target) const |
Write an 8 bit grayscale image to an output target. More... | |
void | write (Matrix< unsigned char > const &image, std::vector< Color > const &palette, std::shared_ptr< utils::BaseOutputTarget > target) const |
Write an 8 bit image with a Color palette to an output target. More... | |
Classes | |
struct | BitmapFileheader |
Bitmap File Header. More... | |
struct | BitmapInfo |
Bitmap info that describes dimensions and color information. More... | |
struct | BitmapInfoheader |
Bitmap Info Header. More... | |
struct | RgbQuad |
Palette entry that describes an RGB Color. More... | |
|
default |
Default constructor.
|
default |
Default destructor.
void write | ( | Matrix< Color > const & | image, |
std::shared_ptr< utils::BaseOutputTarget > | target | ||
) | const |
Write a full 24bit RGB Color image to an output target.
The target needs to have been opened in binary mode (std::ios_base::openmode
); unfortunately, we cannot assert this once the stream is opened, so this is up to the user to ensure.
Definition at line 53 of file utils/formats/bmp/writer.cpp.
void write | ( | Matrix< unsigned char > const & | image, |
std::shared_ptr< utils::BaseOutputTarget > | target | ||
) | const |
Write an 8 bit grayscale image to an output target.
The entries of the given Matrix are simply translated into a grayscale image, where 0
gives black and 255
gives white pixels.
The target needs to have been opened in binary mode (std::ios_base::openmode
); unfortunately, we cannot assert this once the stream is opened, so this is up to the user to ensure.
Definition at line 129 of file utils/formats/bmp/writer.cpp.
void write | ( | Matrix< unsigned char > const & | image, |
std::vector< Color > const & | palette, | ||
std::shared_ptr< utils::BaseOutputTarget > | target | ||
) | const |
Write an 8 bit image with a Color palette to an output target.
The given palette
needs to contain exaclty 256 Color entries. The values of the given image
Matrix are then mapped to the palette entries, e.g., the value at image( 2, 3 ) == 5
maps to the Color palette[ 5 ]
.
The target needs to have been opened in binary mode (std::ios_base::openmode
); unfortunately, we cannot assert this once the stream is opened, so this is up to the user to ensure.
Definition at line 147 of file utils/formats/bmp/writer.cpp.