A library for working with phylogenetic and population genetic data.
v0.27.0
PrinterBitmap Class Reference

#include <genesis/sequence/printers/bitmap.hpp>

Detailed Description

Print the sites of a SequenceSet as pixels in a bitmap.

By default, no colors are set, thus, the image will be completely black. You have to set the color_map() first, for example using the colors defined in nucleic_acid_colors() or amino_acid_colors().

Definition at line 75 of file bitmap.hpp.

Public Member Functions

 PrinterBitmap ()=default
 
 PrinterBitmap (PrinterBitmap &&)=default
 
 PrinterBitmap (PrinterBitmap const &)=default
 
 ~PrinterBitmap ()=default
 
std::map< char, utils::Color > const & color_map () const
 Get the currently set list of Colors for each Sequence character. More...
 
PrinterBitmapcolor_map (std::map< char, utils::Color > const &value)
 Set the list of Colors to use for the Sequence charaters. More...
 
PrinterBitmapoperator= (PrinterBitmap &&)=default
 
PrinterBitmapoperator= (PrinterBitmap const &)=default
 
size_t pixel_height_per_char () const
 
PrinterBitmappixel_height_per_char (size_t value)
 
size_t pixel_width_per_char () const
 
PrinterBitmappixel_width_per_char (size_t value)
 
void write (SequenceSet const &set, std::shared_ptr< utils::BaseOutputTarget > target) const
 

Constructor & Destructor Documentation

◆ PrinterBitmap() [1/3]

PrinterBitmap ( )
default

◆ ~PrinterBitmap()

~PrinterBitmap ( )
default

◆ PrinterBitmap() [2/3]

PrinterBitmap ( PrinterBitmap const &  )
default

◆ PrinterBitmap() [3/3]

PrinterBitmap ( PrinterBitmap &&  )
default

Member Function Documentation

◆ color_map() [1/2]

std::map< char, utils::Color > const & color_map ( ) const

Get the currently set list of Colors for each Sequence character.

See the setter for details.

Definition at line 112 of file bitmap.cpp.

◆ color_map() [2/2]

PrinterBitmap & color_map ( std::map< char, utils::Color > const &  value)

Set the list of Colors to use for the Sequence charaters.

The provided map sets the colors for each Sequence character. The presettings nucleic_acid_colors() and amino_acid_colors() for default sequence types can be used as input for this parameter. If the colors map does not contain a key for one of the chars in the sequence, the char is printed in black.

Definition at line 106 of file bitmap.cpp.

◆ operator=() [1/2]

PrinterBitmap& operator= ( PrinterBitmap &&  )
default

◆ operator=() [2/2]

PrinterBitmap& operator= ( PrinterBitmap const &  )
default

◆ pixel_height_per_char() [1/2]

size_t pixel_height_per_char ( ) const

Definition at line 126 of file bitmap.cpp.

◆ pixel_height_per_char() [2/2]

PrinterBitmap & pixel_height_per_char ( size_t  value)

Definition at line 117 of file bitmap.cpp.

◆ pixel_width_per_char() [1/2]

size_t pixel_width_per_char ( ) const

Definition at line 140 of file bitmap.cpp.

◆ pixel_width_per_char() [2/2]

PrinterBitmap & pixel_width_per_char ( size_t  value)

Definition at line 131 of file bitmap.cpp.

◆ write()

void write ( SequenceSet const &  set,
std::shared_ptr< utils::BaseOutputTarget target 
) const

Definition at line 52 of file bitmap.cpp.


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