# TMCPixelBucket Class Reference
[MCCore]

Inheritance diagram for TMCPixelBucket:

List of all members.

## Public Member Functions
int32 | Width () const
int32 | Height () const
int32 | Depth () const
int32 | Stride () const
int32 | Planes () const
int32 | RightSideUp () const
PixelBucketType | Type () const
void * | Reserved () const
int32 | Width1 () const
int32 | Height1 () const
boolean | DepthStrideEqual () const
boolean | ByteStrideAligned () const
boolean | WordStrideAligned () const
boolean | LongStrideAligned () const
int32 | Int16Aligned () const
int32 | Int32Aligned () const
int32 | ByteStride () const
int32 | RowPaddingBytes () const
int32 | RowPixelBytes () const
void | Rect (TMCRect *r) const
void | Rect (TMCRect &r) const
TMCRect | Rect (void) const
boolean | IsValid () const
| TMCPixelBucket ()
| TMCPixelBucket (uint8 *baseAddressParam, int32 rowBytesParam, int32 widthParam, int32 heightParam, int32 depthParam, int32 planesParam, boolean rightSideUpParam, PixelBucketType type=eDefault)
| TMCPixelBucket (uint8 *baseAddressParam, int32 rowBytesParam, int32 widthParam, int32 heightParam, int32 depthParam, int32 pixelStride, int32 planesParam, boolean rightSideUpParam, PixelBucketType type=eDefault)
| TMCPixelBucket (TMCPixelBucket *pixelBucket)
| TMCPixelBucket (TMCPixelBucket &pixelBucket, const TMCRect &subRect)
void | BuildCore (uint8 *baseAddressParam, int32 rowBytesParam, int32 widthParam, int32 heightParam, int32 depthParam, int32 planesParam, boolean rightSideUpParam, PixelBucketType type=eDefault)
void | BuildCore (uint8 *baseAddressParam, int32 rowBytesParam, int32 widthParam, int32 heightParam, int32 depthParam, int32 pixelStride, int32 planesParam, boolean rightSideUpParam, PixelBucketType type)
void | BuildFromPixelBucket (const TMCPixelBucket &pixelBucket, const TMCRect &subRect)
void | Invalidate ()
boolean | operator== (const TMCPixelBucket &other) const
void | SetBaseAddress (void *baseAddress)
void | SetRowBytes (int32 rowBytes)
void | SetWidth (int32 width)
void | SetHeight (int32 height)
void | SetDepth (int32 depth)
void | SetPlanes (int32 planes)
void | SetRightSideUp (boolean rightSide)
void | SetStride (int32 stride)
void | SetType (PixelBucketType type)
void | SetBaseAddressNoCache (void *baseAddress)
void | SetRowBytesNoCache (int32 rowBytes)
void | SetWidthNoCache (int32 width)
void | SetHeightNoCache (int32 height)
void | SetDepthNoCache (int32 depth)
void | SetPlanesNoCache (int32 planes)
void | SetRightSideUpNoCache (boolean rightSide)
void | SetTypeNoCache (PixelBucketType type)
void | SetStrideNoCache (int32 stride)
void | BuildCache ()
uint8 * | BaseAddress () const
uint16 * | BaseAddress16 () const
uint32 * | BaseAddress32 () const
int32 | RowBytes () const
int16 | RowBytes16 () const
int32 | RowBytes32 () const
uint8 * | RowPtr (int32 row) const
uint16 * | RowPtr16 (int32 row) const
uint32 * | RowPtr32 (int32 row) const
uint8 * | PixelPtr (int32 x, int32 y) const
uint16 * | PixelPtr16 (int32 x, int32 y) const
uint32 * | PixelPtr32 (int32 x, int32 y) const
int32 | RowInc () const
int32 | RowInc16 () const
int32 | RowInc32 () const
int32 | ColInc () const
int32 | ColInc16 () const
int32 | ColInc32 () const
int32 | PaddingInc () const
int32 | Padding16Inc () const
int32 | Padding32Inc () const
boolean | FlipRows ()
## Protected Attributes
uint8 * | fBaseAddress
| pointer to base address as a byte
int32 | fRowBytes
| length of each scanline in bytes
int32 | fWidth
| horizontal pixels
int32 | fHeight
| vertical pixels
int32 | fDepth
| bitdepth 8,24,32, etc.
int32 | fStride
| stride in bits, typically equally to fDepth
int32 | fPlanes
| fDepth/8, ie 1,3,4, etc.
int32 | fRightSideUp
| true if fBaseAddress points to first scanline
int32 | fRowPaddingBytes
| (bytes), padding at end of a scanline
int32 | fRowPixelBytes
| (bytes), the fWidth of a row (fRowBytes - fRowPaddingBytes)
int32 | fRowInc
| (bytes), to next sequential scanline
int32 | fPaddingInc
| (bytes), from end of scanline to next sequential scanline
PixelBucketType | fType
| type of pixel bucket.
boolean | fValid
| true if constructed properly
## Private Attributes
void * | fReserved
| DO NOT TOUCH THIS ON PENALTY OF DEATH!!!!
## Friends
class | TMCOffscreen

## Detailed Description

TMCPixelBucket is an abstraction used to manipulate a block of pixels (bitmap). The block is generally padded for alignment, so you must use BaseAddress() + rowIndex * RowBytes() to find the begining of a row.

TMCPixelBucket does NOT own its memory. It is generally used in conjunction with a TMCOffscreen, or with a memory bloc that was allocated for it (and that you need to delete).

Note:

- fStride may be less than fDepth, though the default case is fStride==fDepth
- fWidth*fBytesStride <= fRowBytes

- Int32Aligned() true if row is int32 aligned
- ByteStrideAligned() true if pixelstride in bits can be expressed accurately in bytes
- DepthStrideEqual() true if fStride==fDepth

- PixelPtrX() functions may fail if ByteStrideAligned() is false
- PixelPtrX() functions may fail if fStride is not a multiple of fDepth increments
- PixelPtrX() functions ARE SLOW... they are provided only for convenience

- Rectangles and other Coordinates for pixel buckets are in pixels

## Constructor & Destructor Documentation

TMCPixelBucket::TMCPixelBucket | ( | void |  | ) | `[inline]`

TMCPixelBucket::TMCPixelBucket | ( | uint8 * | baseAddressParam,
|  | int32 | rowBytesParam,
|  | int32 | widthParam,
|  | int32 | heightParam,
|  | int32 | depthParam,
|  | int32 | planesParam,
|  | boolean | rightSideUpParam,
|  | PixelBucketType | type = `eDefault` |
| ) |  |  | `[inline]`

TMCPixelBucket::TMCPixelBucket | ( | uint8 * | baseAddressParam,
|  | int32 | rowBytesParam,
|  | int32 | widthParam,
|  | int32 | heightParam,
|  | int32 | depthParam,
|  | int32 | pixelStride,
|  | int32 | planesParam,
|  | boolean | rightSideUpParam,
|  | PixelBucketType | type = `eDefault` |
| ) |  |  | `[inline]`

TMCPixelBucket::TMCPixelBucket | ( | TMCPixelBucket * | pixelBucket | ) | `[inline, explicit]`

TMCPixelBucket::TMCPixelBucket | ( | TMCPixelBucket & | pixelBucket,
|  | const TMCRect & | subRect |
| ) |  |  | `[inline]`

## Member Function Documentation

uint8* TMCPixelBucket::BaseAddress | ( | void |  | ) | const`[inline]`

uint16* TMCPixelBucket::BaseAddress16 | ( |  | ) | const`[inline]`

uint32* TMCPixelBucket::BaseAddress32 | ( |  | ) | const`[inline]`

void TMCPixelBucket::BuildCache | ( |  | ) | `[inline]`

void TMCPixelBucket::BuildCore | ( | uint8 * | baseAddressParam,
|  | int32 | rowBytesParam,
|  | int32 | widthParam,
|  | int32 | heightParam,
|  | int32 | depthParam,
|  | int32 | pixelStride,
|  | int32 | planesParam,
|  | boolean | rightSideUpParam,
|  | PixelBucketType | type |
| ) |  |  | `[inline]`

void TMCPixelBucket::BuildCore | ( | uint8 * | baseAddressParam,
|  | int32 | rowBytesParam,
|  | int32 | widthParam,
|  | int32 | heightParam,
|  | int32 | depthParam,
|  | int32 | planesParam,
|  | boolean | rightSideUpParam,
|  | PixelBucketType | type = `eDefault` |
| ) |  |  | `[inline]`

void TMCPixelBucket::BuildFromPixelBucket | ( | const TMCPixelBucket & | pixelBucket,
|  | const TMCRect & | subRect |
| ) |  |  | `[inline]`

int32 TMCPixelBucket::ByteStride | ( |  | ) | const`[inline]`

boolean TMCPixelBucket::ByteStrideAligned | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::ColInc | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::ColInc16 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::ColInc32 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Depth | ( |  | ) | const`[inline]`

boolean TMCPixelBucket::DepthStrideEqual | ( |  | ) | const`[inline]`

boolean TMCPixelBucket::FlipRows | ( |  | ) | `[inline]`

int32 TMCPixelBucket::Height | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Height1 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Int16Aligned | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Int32Aligned | ( |  | ) | const`[inline]`

void TMCPixelBucket::Invalidate | ( |  | ) | `[inline]`

boolean TMCPixelBucket::IsValid | ( | void |  | ) | const`[inline]`

boolean TMCPixelBucket::LongStrideAligned | ( |  | ) | const`[inline]`

boolean TMCPixelBucket::operator== | ( | const TMCPixelBucket & | other | ) | const`[inline]`

int32 TMCPixelBucket::Padding16Inc | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Padding32Inc | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::PaddingInc | ( |  | ) | const`[inline]`

uint8 * TMCPixelBucket::PixelPtr | ( | int32 | x,
|  | int32 | y |
| ) |  |  | const`[inline]`

uint16 * TMCPixelBucket::PixelPtr16 | ( | int32 | x,
|  | int32 | y |
| ) |  |  | const`[inline]`

uint32 * TMCPixelBucket::PixelPtr32 | ( | int32 | x,
|  | int32 | y |
| ) |  |  | const`[inline]`

int32 TMCPixelBucket::Planes | ( |  | ) | const`[inline]`

TMCRect TMCPixelBucket::Rect | ( | void |  | ) | const`[inline]`

void TMCPixelBucket::Rect | ( | TMCRect & | r | ) | const`[inline]`

void TMCPixelBucket::Rect | ( | TMCRect * | r | ) | const`[inline]`

void* TMCPixelBucket::Reserved | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RightSideUp | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowBytes | ( |  | ) | const`[inline]`

int16 TMCPixelBucket::RowBytes16 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowBytes32 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowInc | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowInc16 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowInc32 | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowPaddingBytes | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::RowPixelBytes | ( |  | ) | const`[inline]`

uint8 * TMCPixelBucket::RowPtr | ( | int32 | row | ) | const`[inline]`

uint16 * TMCPixelBucket::RowPtr16 | ( | int32 | row | ) | const`[inline]`

uint32 * TMCPixelBucket::RowPtr32 | ( | int32 | row | ) | const`[inline]`

void TMCPixelBucket::SetBaseAddress | ( | void * | baseAddress | ) | `[inline]`

void TMCPixelBucket::SetBaseAddressNoCache | ( | void * | baseAddress | ) | `[inline]`

void TMCPixelBucket::SetDepth | ( | int32 | depth | ) | `[inline]`

void TMCPixelBucket::SetDepthNoCache | ( | int32 | depth | ) | `[inline]`

void TMCPixelBucket::SetHeight | ( | int32 | height | ) | `[inline]`

void TMCPixelBucket::SetHeightNoCache | ( | int32 | height | ) | `[inline]`

void TMCPixelBucket::SetPlanes | ( | int32 | planes | ) | `[inline]`

void TMCPixelBucket::SetPlanesNoCache | ( | int32 | planes | ) | `[inline]`

void TMCPixelBucket::SetRightSideUp | ( | boolean | rightSide | ) | `[inline]`

void TMCPixelBucket::SetRightSideUpNoCache | ( | boolean | rightSide | ) | `[inline]`

void TMCPixelBucket::SetRowBytes | ( | int32 | rowBytes | ) | `[inline]`

void TMCPixelBucket::SetRowBytesNoCache | ( | int32 | rowBytes | ) | `[inline]`

void TMCPixelBucket::SetStride | ( | int32 | stride | ) | `[inline]`

void TMCPixelBucket::SetStrideNoCache | ( | int32 | stride | ) | `[inline]`

void TMCPixelBucket::SetType | ( | PixelBucketType | type | ) | `[inline]`

void TMCPixelBucket::SetTypeNoCache | ( | PixelBucketType | type | ) | `[inline]`

void TMCPixelBucket::SetWidth | ( | int32 | width | ) | `[inline]`

void TMCPixelBucket::SetWidthNoCache | ( | int32 | width | ) | `[inline]`

int32 TMCPixelBucket::Stride | ( |  | ) | const`[inline]`

PixelBucketType TMCPixelBucket::Type | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Width | ( |  | ) | const`[inline]`

int32 TMCPixelBucket::Width1 | ( |  | ) | const`[inline]`

boolean TMCPixelBucket::WordStrideAligned | ( |  | ) | const`[inline]`

## Friends And Related Function Documentation

friend class TMCOffscreen`[friend]`

## Member Data Documentation

uint8* TMCPixelBucket::fBaseAddress`[protected]`

pointer to base address as a byte

int32 TMCPixelBucket::fDepth`[protected]`

bitdepth 8,24,32, etc.

int32 TMCPixelBucket::fHeight`[protected]`

vertical pixels

int32 TMCPixelBucket::fPaddingInc`[protected]`

(bytes), from end of scanline to next sequential scanline

int32 TMCPixelBucket::fPlanes`[protected]`

fDepth/8, ie 1,3,4, etc.

void* TMCPixelBucket::fReserved`[private]`

DO NOT TOUCH THIS ON PENALTY OF DEATH!!!!

int32 TMCPixelBucket::fRightSideUp`[protected]`

true if fBaseAddress points to first scanline

int32 TMCPixelBucket::fRowBytes`[protected]`

length of each scanline in bytes

int32 TMCPixelBucket::fRowInc`[protected]`

(bytes), to next sequential scanline

int32 TMCPixelBucket::fRowPaddingBytes`[protected]`

(bytes), padding at end of a scanline

int32 TMCPixelBucket::fRowPixelBytes`[protected]`

(bytes), the fWidth of a row (fRowBytes - fRowPaddingBytes)

int32 TMCPixelBucket::fStride`[protected]`

stride in bits, typically equally to fDepth

PixelBucketType TMCPixelBucket::fType`[protected]`

type of pixel bucket.

boolean TMCPixelBucket::fValid`[protected]`

true if constructed properly

int32 TMCPixelBucket::fWidth`[protected]`

horizontal pixels

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

- MCPixelBucket.h