54 auto image = make_image_(
set );
56 writer.to_stream( image, outstream );
61 auto image = make_image_(
set );
63 writer.to_file( image, filename );
75 set.size() * pixel_height_,
76 max_line * pixel_width_,
81 for(
size_t r = 0; r <
set.size(); ++r ) {
82 auto const& seq =
set[r];
85 for(
size_t c = 0; c < seq.length(); ++c ) {
89 auto color_it = color_map_.find( seq[c] );
90 if( color_it != color_map_.end() ) {
91 pixel = color_it->second;
95 for(
size_t ph = 0; ph < pixel_height_; ++ph ) {
98 for(
size_t pw = 0; pw < pixel_width_; ++pw ) {
99 image( r * pixel_height_ + ph, c * pixel_width_ + pw ) = pixel;
126 throw std::invalid_argument(
"Pixel height has to be 1 or more." );
128 pixel_height_ = value;
134 return pixel_height_;
140 throw std::invalid_argument(
"Pixel width has to be 1 or more." );
142 pixel_width_ = value;
void to_file(SequenceSet const &set, std::string const &filename) const
Print the sites of a SequenceSet as pixels in a bitmap.
size_t longest_sequence_length(SequenceSet const &set)
Return the length of the longest Sequence in the SequenceSet.
Write Bitmap image files.
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
size_t pixel_height_per_char() const
size_t pixel_width_per_char() const
Store a set of Sequences.
std::map< char, utils::Color > const & color_map() const
Get the currently set list of Colors for each Sequence character.
void to_stream(SequenceSet const &set, std::ostream &outstream) const