OpenStructure
Data Structures | Public Types | Public Member Functions
RasterImage Class Reference

#include <raster_image.hh>

Data Structures

struct  Pixel
 

Public Types

enum  Mode { GREY =1 , PHASECOLOR , SIGNCOLOR }
 

Public Member Functions

 RasterImage (unsigned int width, unsigned int height)
 
 RasterImage (unsigned int width, unsigned int height, uchar *dptr)
 
 ~RasterImage ()
 
unsigned int GetWidth () const
 
unsigned int GetHeight () const
 
void SetPixel (unsigned int x, unsigned int y, const Pixel &p)
 
Pixel GetPixel (unsigned int x, unsigned int y) const
 
uchar * GetDataPtr () const
 
uchar * ReleaseDataPtr ()
 
void Fill (const Data &d, int logscale, const Vec3 &offset, int z, const NormalizerPtr &norm, Mode mode=GREY, bool fast_low_mag_flag=true, bool fast_high_mag_flag=true)
 
void Fill (const Data &d, int logscale, const Vec3 &offset, int z, const NormalizerPtr &norm, Mode mode, bool fast_low_mag_flag, bool fast_high_mag_flag, int x1, int y1, int x2, int y2)
 

Detailed Description

Generic raster image.

RasterImage serves as a conversion class between img and external libs, such as wxWidgets. The underlying representation is always RGB mode, saved consecutively in 3-byte triplets.

Definition at line 60 of file raster_image.hh.

Member Enumeration Documentation

◆ Mode

enum Mode

coloring mode

Enumerator
GREY 
PHASECOLOR 
SIGNCOLOR 

Definition at line 64 of file raster_image.hh.

Constructor & Destructor Documentation

◆ RasterImage() [1/2]

RasterImage ( unsigned int  width,
unsigned int  height 
)

Initialization must specify size.

◆ RasterImage() [2/2]

RasterImage ( unsigned int  width,
unsigned int  height,
uchar *  dptr 
)

◆ ~RasterImage()

Member Function Documentation

◆ Fill() [1/2]

void Fill ( const Data d,
int  logscale,
const Vec3 &  offset,
int  z,
const NormalizerPtr norm,
Mode  mode,
bool  fast_low_mag_flag,
bool  fast_high_mag_flag,
int  x1,
int  y1,
int  x2,
int  y2 
)

◆ Fill() [2/2]

void Fill ( const Data d,
int  logscale,
const Vec3 &  offset,
int  z,
const NormalizerPtr norm,
Mode  mode = GREY,
bool  fast_low_mag_flag = true,
bool  fast_high_mag_flag = true 
)

fill with image data

◆ GetDataPtr()

uchar* GetDataPtr ( ) const
inline

Get raw data pointer (consecutive unsigned char triplets)

Definition at line 96 of file raster_image.hh.

◆ GetHeight()

unsigned int GetHeight ( ) const
inline

Definition at line 88 of file raster_image.hh.

◆ GetPixel()

Pixel GetPixel ( unsigned int  x,
unsigned int  y 
) const

Get pixel at specified point (no boundary check is performed!)

◆ GetWidth()

unsigned int GetWidth ( ) const
inline

Definition at line 87 of file raster_image.hh.

◆ ReleaseDataPtr()

uchar* ReleaseDataPtr ( )
inline

Release data pointer.

Internally allocated storage will no longer be freed upon RasterImage deletion

Definition at line 103 of file raster_image.hh.

◆ SetPixel()

void SetPixel ( unsigned int  x,
unsigned int  y,
const Pixel p 
)

Set pixel at specified point (no boundary check is performed!)


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