walberla::geometry::GrayScaleImage Class Reference

Detailed Description

A gray scale image.

Can be loaded from png files

#include <GrayScaleImage.h>

Public Types

using pixel_t = unsigned char
 

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 ()=default
 

Protected Attributes

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

Member Typedef Documentation

◆ pixel_t

Constructor & Destructor Documentation

◆ GrayScaleImage() [1/3]

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

◆ GrayScaleImage() [2/3]

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

◆ GrayScaleImage() [3/3]

walberla::geometry::GrayScaleImage::GrayScaleImage ( )
protecteddefault

Member Function Documentation

◆ getElement() [1/2]

unsigned char & walberla::geometry::GrayScaleImage::getElement ( cell_idx_t  x,
cell_idx_t  y 
)
inline

◆ getElement() [2/2]

unsigned char walberla::geometry::GrayScaleImage::getElement ( cell_idx_t  x,
cell_idx_t  y 
) const
inline

◆ getResizedImage()

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

◆ height()

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

◆ operator()()

real_t walberla::geometry::GrayScaleImage::operator() ( cell_idx_t  x,
cell_idx_t  y 
) const

◆ pixelValueFromString()

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

◆ save()

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

◆ setElement()

void walberla::geometry::GrayScaleImage::setElement ( cell_idx_t  x,
cell_idx_t  y,
real_t  val 
)

◆ size()

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

◆ width()

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

Member Data Documentation

◆ image_

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

◆ size_

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

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