A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BmpWriter Class Reference

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

Detailed Description

Write Bitmap image files.

Definition at line 58 of file utils/formats/bmp/writer.hpp.

Public Member Functions

 BmpWriter ()=default
 Default constructor. More...
 
 BmpWriter (BmpWriter const &)=default
 Default copy constructor. More...
 
 BmpWriter (BmpWriter &&)=default
 Default move constructor. More...
 
 ~BmpWriter ()=default
 Default destructor. More...
 
BmpWriteroperator= (BmpWriter const &)=default
 Default copy assignemnt. More...
 
BmpWriteroperator= (BmpWriter &&)=default
 Default move assignemnt. More...
 
void to_file (Matrix< Color > const &image, std::string const &filename) const
 Write a full 24bit RGB Color image to a file. More...
 
void to_file (Matrix< unsigned char > const &image, std::string const &filename) const
 Write an 8 bit grayscale image to a file. More...
 
void to_file (Matrix< unsigned char > const &image, std::vector< Color > const &palette, std::string const &filename) const
 Write an 8 bit image with a Color palette to a file. More...
 
void to_stream (Matrix< Color > const &image, std::ostream &outstream) const
 Write a full 24bit RGB Color image to a stream. More...
 
void to_stream (Matrix< unsigned char > const &image, std::ostream &outstream) const
 Write an 8 bit grayscale image to a stream. More...
 
void to_stream (Matrix< unsigned char > const &image, std::vector< Color > const &palette, std::ostream &outstream) const
 Write an 8 bit image with a Color palette to a stream. 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 ( )
default

Default constructor.

~BmpWriter ( )
default

Default destructor.

BmpWriter ( BmpWriter const &  )
default

Default copy constructor.

BmpWriter ( BmpWriter &&  )
default

Default move constructor.

Member Function Documentation

BmpWriter& operator= ( BmpWriter const &  )
default

Default copy assignemnt.

BmpWriter& operator= ( BmpWriter &&  )
default

Default move assignemnt.

void to_file ( Matrix< Color > const &  image,
std::string const &  filename 
) const

Write a full 24bit RGB Color image to a file.

Definition at line 118 of file utils/formats/bmp/writer.cpp.

void to_file ( Matrix< unsigned char > const &  image,
std::string const &  filename 
) const

Write an 8 bit grayscale image to a file.

The entries of the given Matrix are simply translated into a grayscale image, where 0 gives black and 255 gives white pixels.

Definition at line 141 of file utils/formats/bmp/writer.cpp.

void to_file ( Matrix< unsigned char > const &  image,
std::vector< Color > const &  palette,
std::string const &  filename 
) const

Write an 8 bit image with a Color palette to a file.

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 ].

Definition at line 226 of file utils/formats/bmp/writer.cpp.

void to_stream ( Matrix< Color > const &  image,
std::ostream &  outstream 
) const

Write a full 24bit RGB Color image to a stream.

Definition at line 53 of file utils/formats/bmp/writer.cpp.

void to_stream ( Matrix< unsigned char > const &  image,
std::ostream &  outstream 
) const

Write an 8 bit grayscale image to a stream.

The entries of the given Matrix are simply translated into a grayscale image, where 0 gives black and 255 gives white pixels.

Definition at line 129 of file utils/formats/bmp/writer.cpp.

void to_stream ( Matrix< unsigned char > const &  image,
std::vector< Color > const &  palette,
std::ostream &  outstream 
) const

Write an 8 bit image with a Color palette to a stream.

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 ].

Definition at line 152 of file utils/formats/bmp/writer.cpp.


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