27 #ifndef IMG_RASTER_IMAGE_H
28 #define IMG_RASTER_IMAGE_H
34 namespace ost {
namespace img {
61 typedef unsigned char uchar;
74 Pixel(uchar rr,uchar gg,uchar bb): r(rr), g(gg), b(bb) {}
76 Pixel(uchar rgb[3]) {r=rgb[0]; g=rgb[1]; b=rgb[2];}
83 RasterImage(
unsigned int width,
unsigned int height, uchar *dptr);
107 Mode mode=
GREY,
bool fast_low_mag_flag=
true,
bool fast_high_mag_flag=
true);
109 Mode mode,
bool fast_low_mag_flag,
bool fast_high_mag_flag,
int x1,
int y1,
int x2,
int y2);
113 unsigned int width_,height_;
117 int wh2i(
int w,
int h)
const {
return h*width_+w;}
Abstract base class for data.
uchar * ReleaseDataPtr()
Release data pointer.
unsigned int GetHeight() const
Pixel GetPixel(unsigned int x, unsigned int y) const
Get pixel at specified point (no boundary check is performed!)
unsigned int GetWidth() const
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
uchar * GetDataPtr() const
Get raw data pointer (consecutive unsigned char triplets)
void SetPixel(unsigned int x, unsigned int y, const Pixel &p)
Set pixel at specified point (no boundary check is performed!)
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)
RasterImage(unsigned int width, unsigned int height, uchar *dptr)
RasterImage(unsigned int width, unsigned int height)
Initialization must specify size.
#define DLLEXPORT_OST_IMG_BASE
boost::shared_ptr< NormalizerImpl > NormalizerPtr
Pixel()
default constructor
Pixel(uchar rgb[3])
initialize with array
Pixel(const Pixel &p)
copy-constructor
Pixel(uchar rr, uchar gg, uchar bb)
initialize with three uchar