walberla::geometry::GrayScaleImage Class Reference

Detailed Description

A gray scale image.

Can be loaded from png files

#include <GrayScaleImage.h>

Public Types

typedef unsigned char pixel_t
 

Public Member Functions

 GrayScaleImage (uint_t _width, uint_t _height)
 
 GrayScaleImage (const std::string &pngFilename)
 
void save (const std::string &pngFilename)
 
GrayScaleImage 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
 
real_t operator() (cell_idx_t x, cell_idx_t y) const
 
void setElement (cell_idx_t x, cell_idx_t y, real_t val)
 
unsigned char & getElement (cell_idx_t x, cell_idx_t y)
 
unsigned char getElement (cell_idx_t x, cell_idx_t y) const
 

Static Public Member Functions

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

Protected Member Functions

 GrayScaleImage ()
 

Protected Attributes

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

Member Typedef Documentation

Constructor & Destructor Documentation

walberla::geometry::GrayScaleImage::GrayScaleImage ( uint_t  _width,
uint_t  _height 
)
walberla::geometry::GrayScaleImage::GrayScaleImage ( const std::string &  pngFilename)
walberla::geometry::GrayScaleImage::GrayScaleImage ( )
inlineprotected

Member Function Documentation

unsigned char & walberla::geometry::GrayScaleImage::getElement ( cell_idx_t  x,
cell_idx_t  y 
)
inline
unsigned char walberla::geometry::GrayScaleImage::getElement ( cell_idx_t  x,
cell_idx_t  y 
) const
inline
GrayScaleImage walberla::geometry::GrayScaleImage::getResizedImage ( uint_t  newWidth,
uint_t  newHeight,
bool  bilinear = true 
) const
uint_t walberla::geometry::GrayScaleImage::height ( ) const
inline
real_t walberla::geometry::GrayScaleImage::operator() ( cell_idx_t  x,
cell_idx_t  y 
) const
GrayScaleImage::pixel_t walberla::geometry::GrayScaleImage::pixelValueFromString ( const std::string &  str)
static
void walberla::geometry::GrayScaleImage::save ( const std::string &  pngFilename)
void walberla::geometry::GrayScaleImage::setElement ( cell_idx_t  x,
cell_idx_t  y,
real_t  val 
)
uint_t walberla::geometry::GrayScaleImage::size ( uint_t  coord) const
inline
uint_t walberla::geometry::GrayScaleImage::width ( ) const
inline

Member Data Documentation

std::vector<unsigned char> walberla::geometry::GrayScaleImage::image_
protected
uint_t walberla::geometry::GrayScaleImage::size_[2]
protected

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