walberla::geometry::RGBAImage Class Reference

Detailed Description

A gray scale image.

Can be loaded from png files

#include <RGBAImage.h>

Classes

struct  pixel_t
 
struct  RGBAColor
 

Public Types

enum  Channel { R = 0, G = 1, B = 2, A = 3 }
 

Public Member Functions

 RGBAImage (uint_t _width, uint_t _height)
 
 RGBAImage (const std::string &pngFilename)
 
void save (const std::string &pngFilename)
 
RGBAImage getResizedImage (uint_t newWidth, uint_t newHeight, bool bilinear=true) const
 
uint_t width () const
 
uint_t height () const
 
uint_t size (uint_t coord) const
 
void setToWhite ()
 
real_t operator() (cell_idx_t x, cell_idx_t y, Channel c) const
 
void setElement (cell_idx_t x, cell_idx_t y, Channel c, real_t val)
 
unsigned char & getElement (cell_idx_t x, cell_idx_t y, RGBAImage::Channel c)
 
const unsigned char & getElement (cell_idx_t x, cell_idx_t y, RGBAImage::Channel c) const
 
pixel_tgetElement (cell_idx_t x, cell_idx_t y)
 
const pixel_tgetElement (cell_idx_t x, cell_idx_t y) const
 

Static Public Member Functions

static pixel_t pixelValueFromString (const std::string &str)
 

Protected Member Functions

 RGBAImage ()=default
 

Protected Attributes

uint_t size_ [2]
 
std::vector< unsigned char > image_
 

Member Enumeration Documentation

◆ Channel

Enumerator

Constructor & Destructor Documentation

◆ RGBAImage() [1/3]

walberla::geometry::RGBAImage::RGBAImage ( uint_t  _width,
uint_t  _height 
)

◆ RGBAImage() [2/3]

walberla::geometry::RGBAImage::RGBAImage ( const std::string &  pngFilename)

◆ RGBAImage() [3/3]

walberla::geometry::RGBAImage::RGBAImage ( )
protecteddefault

Member Function Documentation

◆ getElement() [1/4]

RGBAImage::pixel_t & walberla::geometry::RGBAImage::getElement ( cell_idx_t  x,
cell_idx_t  y 
)
inline

◆ getElement() [2/4]

const RGBAImage::pixel_t & walberla::geometry::RGBAImage::getElement ( cell_idx_t  x,
cell_idx_t  y 
) const
inline

◆ getElement() [3/4]

unsigned char & walberla::geometry::RGBAImage::getElement ( cell_idx_t  x,
cell_idx_t  y,
RGBAImage::Channel  c 
)
inline

◆ getElement() [4/4]

const unsigned char & walberla::geometry::RGBAImage::getElement ( cell_idx_t  x,
cell_idx_t  y,
RGBAImage::Channel  c 
) const
inline

◆ getResizedImage()

RGBAImage walberla::geometry::RGBAImage::getResizedImage ( uint_t  newWidth,
uint_t  newHeight,
bool  bilinear = true 
) const

◆ height()

uint_t walberla::geometry::RGBAImage::height ( ) const
inline

◆ operator()()

real_t walberla::geometry::RGBAImage::operator() ( cell_idx_t  x,
cell_idx_t  y,
RGBAImage::Channel  c 
) const

◆ pixelValueFromString()

RGBAImage::pixel_t walberla::geometry::RGBAImage::pixelValueFromString ( const std::string &  str)
static

◆ save()

void walberla::geometry::RGBAImage::save ( const std::string &  pngFilename)

◆ setElement()

void walberla::geometry::RGBAImage::setElement ( cell_idx_t  x,
cell_idx_t  y,
RGBAImage::Channel  c,
real_t  val 
)

◆ setToWhite()

void walberla::geometry::RGBAImage::setToWhite ( )
inline

◆ size()

uint_t walberla::geometry::RGBAImage::size ( uint_t  coord) const
inline

◆ width()

uint_t walberla::geometry::RGBAImage::width ( ) const
inline

Member Data Documentation

◆ image_

std::vector<unsigned char> walberla::geometry::RGBAImage::image_
protected

◆ size_

uint_t walberla::geometry::RGBAImage::size_[2]
protected

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