TexHandleMaker Class Reference

#include <TexHandle.h>

Class Description

See also
Class TexHandle, Class Bitmap, Class BitmapInfo.

Description:
This class provides several ways to create a texture handle. The handle may be created from a 3ds Max bitmap or a Windows Device Independent Bitmap. This class also provides methods to determine the desired size of the bitmap.
+ Inheritance diagram for TexHandleMaker:

Public Member Functions

virtual ~TexHandleMaker ()
 
virtual TexHandleCreateHandle (Bitmap *bm, int symflags=0, int extraFlags=0)=0
 
virtual TexHandleCreateHandle (BITMAPINFO *bminf, int symflags=0, int extraFlags=0)=0
 
virtual BITMAPINFO * BitmapToDIB (Bitmap *bm, int symflags, int extraFlags, BOOL forceW=0, BOOL forceH=0)=0
 
virtual TexHandleMakeHandle (BITMAPINFO *bminf)=0
 
virtual BOOL UseClosestPowerOf2 ()=0
 
virtual int Size ()=0
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Constructor & Destructor Documentation

virtual ~TexHandleMaker ( )
inlinevirtual
Remarks
Destructor.
47 {;}

Member Function Documentation

virtual TexHandle* CreateHandle ( Bitmap bm,
int  symflags = 0,
int  extraFlags = 0 
)
pure virtual
Remarks
Implemented by the System

This method is called to create a texture handle from a 3ds Max bitmap.
Parameters:
Bitmap *bm

The bitmap to create a handle to.

int symflags=0

See Texture Symmetry Flags.

int extraFlags=0;

One of the following values:

EX_MULT_ALPHA

Set this flag if alpha is not pre-multiplied in the Bitmap.

EX_RGB_FROM_ALPHA

Set this flag to make the map using the alpha channel of the bitmap to define the gray level.

EX_OPAQUE_ALPHA

Specifies to make the map using opaque alpha.

EX_ALPHA_FROM_RGB

Specifies to make alpha from the intensity of the map.
Returns
A pointer to the texture handle.
virtual TexHandle* CreateHandle ( BITMAPINFO *  bminf,
int  symflags = 0,
int  extraFlags = 0 
)
pure virtual
Remarks
Implemented by the System

This method is called to create a texture handle from a 32 bit Windows Device Independent Bitmap.
Parameters:
BITMAPINFO *bminf

The bitmap to create a handle to.

int symflags=0

See Texture Symmetry Flags.

int extraFlags=0;

One of the following values:

EX_MULT_ALPHA

Set this flag if alpha is not pre-multiplied in the Bitmap.

EX_RGB_FROM_ALPHA

Set this flag to make the map using the alpha channel of the bitmap to define the gray level.

EX_OPAQUE_ALPHA

Specifies to make the map using opaque alpha.

EX_ALPHA_FROM_RGB

Specifies to make alpha from the intensity of the map.
Returns
A pointer to the texture handle.
virtual BITMAPINFO* BitmapToDIB ( Bitmap bm,
int  symflags,
int  extraFlags,
BOOL  forceW = 0,
BOOL  forceH = 0 
)
pure virtual
Remarks
This method creates a 32 bit Windows Device Independent Bitmap with the specified symflags and extraflags already incorporated and returns a pointer to the associated BitmapInfo.
Parameters:
Bitmap *bm

Points to the bitmap to create the handle to.

int symflags

See Texture Symmetry Flags.

int extraFlags

One of the following values:

EX_MULT_ALPHA

Set this flag if alpha is not pre-multiplied in the Bitmap.

EX_RGB_FROM_ALPHA

Set this flag to make the map using the alpha channel of the bitmap to define the gray level.

EX_OPAQUE_ALPHA

Specifies to make the map using opaque alpha.

EX_ALPHA_FROM_RGB

Specifies to make alpha from the intensity of the map.

BOOL forceW=0

If this parameter is non-zero it is used as the width of the final DIB.

BOOL forceH=0

If this parameter is non-zero it is used as the height of the final DIB
virtual TexHandle* MakeHandle ( BITMAPINFO *  bminf)
pure virtual
Remarks
Returns a texture handle made from a 32 bit DIB that has the symflags, and extraflags already incorporated. This takes ownership of the BITMAPINFO*.
Parameters:
BITMAPINFO* bminf

Points to the BitmapInfo for the DIB.
virtual BOOL UseClosestPowerOf2 ( )
pure virtual
Remarks
Returns TRUE if the bitmap does not need to be square and FALSE if it does need to be square.
virtual int Size ( )
pure virtual
Remarks
Implemented by the System.

This method may be called to determine the desired size for the bitmap. The system ultimately needs a square bitmap that is a power of 2 in width and height. If you already have a bitmap around, just pass it in to CreateHandle() and it will be converted. If you are creating a bitmap from scratch (i.e. a procedural texture), then you should make it Size() in width in height, and save the system an extra step. In either case you own your bitmap, and are responsible for ultimately freeing it.
Returns
The size of the desired bitmap.