Template Class PixelBufT

3DS Max Plug-In SDK

Template Class PixelBufT

See Also: Structure BMM_Color_24, Structure BMM_Color_32, Structure BMM_Color_48, Structure BMM_Color_64.

template <Structure T> Structure PixelBufT

Description:

These templated classes allow you to set up a buffer for pixels that will automatically deallocate the buffer when they goes out of scope. All methods of this class are implemented by the system.

Note the following typedefs set up for the standard pixel storage formats.

typedef PixelBufT<UBYTE> PixelBuf8;

typedef PixelBufT<USHORT> PixelBuf16;

typedef PixelBufT<BMM_Color_24> PixelBuf24;

typedef PixelBufT<BMM_Color_32> PixelBuf32;

typedef PixelBufT<BMM_Color_48> PixelBuf48;

typedef PixelBufT<BMM_Color_64> PixelBuf64;

Methods:

Prototype:

inline PixelBufT(int width);

Remarks:

Constructor. This allocates the pixel buffer using the specified width.

Parameters:

int width

The number of pixels to allocate for the buffer.

Prototype:

inline ~PixelBufT();

Remarks:

Destructor. The pixel buffer is deallocated.

Prototype:

inline T* Ptr();

Remarks:

Returns the address of the pixel buffer.

Prototype:

int Fill(int start, int count, T color)

Remarks:

Fills the specified portion of the pixel buffer with the specified color.

Parameters:

int start

The start location for the fill.

int count

The number of pixels to fill.

T color

The color to use as the fill.

Return Value:

Nonzero if filled; otherwise 0.

Operators:

Prototype:

inline T& operator[](int i);

Remarks:

Array operator. This allows access to the pixel buffer using the [ ] operator.

Parameters:

int i

The index to access.