A library for working with phylogenetic and population genetic data.
v0.32.0
BmpWriter Class Reference

#include <genesis/utils/formats/bmp/writer.hpp>

Detailed Description

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...
 
BmpWriteroperator= (BmpWriter &&)=default
 Default move assignemnt. More...
 
BmpWriteroperator= (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...
 

Constructor & Destructor Documentation

◆ BmpWriter() [1/3]

BmpWriter ( )
default

Default constructor.

◆ ~BmpWriter()

~BmpWriter ( )
default

Default destructor.

◆ BmpWriter() [2/3]

BmpWriter ( BmpWriter const &  )
default

Default copy constructor.

◆ BmpWriter() [3/3]

BmpWriter ( BmpWriter &&  )
default

Default move constructor.

Member Function Documentation

◆ operator=() [1/2]

BmpWriter& operator= ( BmpWriter &&  )
default

Default move assignemnt.

◆ operator=() [2/2]

BmpWriter& operator= ( BmpWriter const &  )
default

Default copy assignemnt.

◆ write() [1/3]

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.

◆ write() [2/3]

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.

◆ write() [3/3]

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.


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