Aurelon Open API 8.1.1
Loading...
Searching...
No Matches
AOI_Bitmap.cpp
1#include "./AOI_Bitmap.h"
2#include "../GBitmap.h"
3
4using namespace aur;
5using namespace aur::PDF;
6
21void AOI_Object_Bitmap::GetBitmapData( AOI_Bitmap& inBit ) const
22{
23 const BitmapT* bit = BitmapPtr(this)->GetBitmap();
24 inBit.width = bit->width;
25 inBit.height = bit->height;
26 inBit.components = bit->components;
27 inBit.bits = bit->bits;
28 inBit.space = (AOI_ColorSpace*)bit->space;
29 inBit.rowBytes = bit->CalcRowBytes();
30}
31
42void AOI_Object_Bitmap::GetMaskRange( uint16_t min[ MAX_CHANNELS ], uint16_t max[ MAX_CHANNELS ] ) const
43{
44 BitmapPtr(this)->GetMaskRange( min, max );
45}
46
58
64AOI_Object_Bitmap::MaskType AOI_Object_Bitmap::GetMaskType() const
65{
66 return (AOI_Object_Bitmap::MaskType)BitmapPtr(this)->GetMaskType();
67}
68
79uint16_t AOI_Object_Bitmap::GetMaskMin( uint16_t idx ) const
80{
81 return BitmapPtr(this)->GetMaskMin( idx );
82}
83
94uint16_t AOI_Object_Bitmap::GetMaskMax( uint16_t idx ) const
95{
96 return BitmapPtr(this)->GetMaskMax( idx );
97}
98
103{
104 BitmapPtr(this)->SetMaskNone();
105}
106
112AOI_ColorSpacePtr AOI_Object_Bitmap::GetColorSpace() const
113{
114 return (AOI_ColorSpacePtr)BitmapPtr(this)->GetColorSpace();
115}
116
125{
126 BitmapPtr(this)->Open( NULL );
127}
128
137{
138 BitmapPtr(this)->Close();
139}
140
151float AOI_Object_Bitmap::GetPixel( int32_t x, int32_t y, AOI_Color& color ) const
152{
153 return BitmapPtr(this)->GetPixel( x, y, *(Color*)&color );
154}
155
156#define kTilePixels 128
157
170bool AOI_Object_Bitmap::GetImageData( uint32_t startLine, uint32_t count, void* outData ) const
171{
172 AOI_Bitmap bm;
173 GetBitmapData( bm );
174 char* p = (char*)outData;
175 int32_t dsFull = ( kTilePixels * bm.components * bm.bits ) >> 3;
176 int32_t dsEnd = ( ( bm.width % kTilePixels ) * bm.components * bm.bits + 7 ) >> 3;
177 while( count )
178 {
179 // fill p
180 char* q = p;
181
182 for( int32_t x = 0; x < bm.width; x += kTilePixels )
183 {
184 const uint8_t* d = BitmapPtr(this)->GetPixelPtr( x , startLine );
185 ::memcpy( q, d, bm.width - x < kTilePixels ? dsEnd : dsFull );
186 q += dsFull;
187 }
188 p += bm.rowBytes;
189 ++startLine;
190 --count;
191 }
192 return true;
193}
194
BitmapT container.
Definition AOI_Bitmap.h:23
MaskType GetMaskType() const
uint16_t GetMaskMin(uint16_t) const
void GetBitmapData(AOI_Bitmap &) const
AOI_Object_Bitmap * GetMaskImage() const
void CloseImageData() const
void OpenImageData() const
uint16_t GetMaskMax(uint16_t) const
void GetMaskRange(uint16_t[MAX_CHANNELS], uint16_t[MAX_CHANNELS]) const
bool GetImageData(uint32_t startLine, uint32_t count, void *outData) const
AOI_ColorSpacePtr GetColorSpace() const
float GetPixel(int32_t, int32_t, AOI_Color &) const