Bitmap Class Reference

#include <bitmap.h>

Class Description

Class for image input and output.

Description:
The Bitmap class is the bitmap itself. All image access is done through this class. The Bitmap class has methods to retrieve properties of the bitmap such as image width, height, whether it is dithered, has an alpha channel, etc. There are methods to retrieve and store pixels from the image. Additional methods allow a developer to copy bitmaps. This class also has methods to open outputs and write multi-frame files. All methods of this class are implemented by the system.
\par Examples 
The following is some examples of how to write some files out to disk:
To write a single image to a file/device, first create the Create BitmapInfo class: 
Then define the output file or device:
bi.SetName("file.tga");
or use the BitmapManager: Then define your parameters for the Bitmap:
bi.SetHeight(y)
etc...
Then create the Bitmap: Then do something with the bitmap:
map->Fill({0,0,0});
Then you actually open, write and close the bitmap:
map->OpenOutput(&bi);
map->Write(&bi);
map->Close(&bi);
map->DeleteThis();
To write a multi-frame file, just keep doing something different to the Bitmap and keep writing.
To write a sequence of images to a file/device. Create BitmapInfo class Define the output file/device, either directly
bi.SetName(_T("E:\Renders\file.tga"));
or using the user interface. The customize or define the BitmapInfo:
bi.SetHeight(y)
etc...
Then create the Bitmap Then open the Bitmap for writing
map->OpenOutput(&bi);
for (int x = 0; x < 29; x++)
{
## Do something to image...
map->Write(&bi,x);
}
map->Close(&bi);
map->DeleteThis();
Note that in a localized environment there is no need to call BitmapInfo::SetDevice. This is because calling Bitmap::OpenOutput will automatically determine the device type or BitmapIO type based off of the extension of the filename. Another alternative to manually setting the device type that even works in a localized environment is to call BitmapInfo::FixDeviceName which will find the correct BitmapIO type based off of the extension.
Note: You can add any number of outputs to a bitmap. Just keep calling map->OpenInput() with different outputs (Targa file AND Frame Buffer for instance). To write or close a specific output, use Write() and Close(). To write and close them all at once, use WriteAll() and CloseAll().
It is ok to use WriteAll() and CloseAll() if you have just one output defined.
See also
Class BitmapManager, Class BitmapInfo, Class BitmapStorage, Class GBuffer, Working with Bitmaps.

+ Inheritance diagram for Bitmap:

Public Member Functions

BitmapManagerManager ()
 
BMMExport int Create (BitmapInfo *bi)
 
BMMExport BOOL FixDeviceName (BitmapInfo *bi)
 
int MapReady ()
 
BMMExport void AddOutput (BitmapIO *out)
 
BMMExport void RemoveOutput (BitmapIO *out, BOOL deleteOutput=TRUE)
 
BMMExport BitmapIOFindOutput (BitmapInfo *bi)
 
BMMExport PAVIFILE GetPaviFile (BitmapInfo *bi)
 
voidGetVFBData ()
 
void SetVFBData (void *vfb)
 
int Put16Gray (int x, int y, int pixels, WORD *ptr)
 
voidGetStoragePtr (int *type)
 
voidGetAlphaPtr (int *type)
 
int Get16Gray (int x, int y, int pixels, WORD *ptr)
 
int GetPixels (int x, int y, int pixels, BMM_Color_64 *ptr)
 
BMMExport int PutPixels (int x, int y, int pixels, BMM_Color_64 *ptr)
 
int GetLinearPixels (int x, int y, int pixels, BMM_Color_fl *ptr)
 
int CropImage (int width, int height, BMM_Color_64 fillcolor)
 
int CropImage (int width, int height, BMM_Color_fl fillcolor)
 
int CropImage (int width, int height, int fillindex)
 
int CopyImage (Bitmap *from, int operation, BMM_Color_fl fillcolor, BitmapInfo *bi=NULL)
 
BMMExport void FilmGrain (float grain, BOOL mask, PBITMAP_FX_CALLBACK callback=NULL, void *param=NULL)
 
BMMExport BOOL PrepareGChannels (DWORD channels)
 
BMMExport int GetFiltered (float u, float v, float du, float dv, BMM_Color_64 *ptr)
 
BMMExport int Fill (const BMM_Color_fl &fillColor)
 
BMMExport int Fill (const BMM_Color_64 &fillColor)
 
DWORD GetModifyID ()
 
void SetModifyID (DWORD m)
 
BMMExport void IncrModifyID ()
 
Memory Deallocation
BMMExport void DeleteThis ()
 
Flag Access
DWORD Flags ()
 
void SetFlag (DWORD flag)
 
void ToggleFlag (DWORD flag)
 
void ClearFlag (DWORD flag)
 
Bitmap Properties

The following methods return properties of the bitmap.

When these methods are called, they are passed to the BitmapStorage instance maintained by the Bitmap. The BitmapStorage implements these methods by returning the properties of the BitmapInfo instance maintained by the storage. Therefore, the values returned from the methods represent what is returned from the BitmapInfo instance associated with the Bitmap.

int Width ()
 
int Height ()
 
float Aspect ()
 
float Gamma ()
 
int Paletted ()
 
int IsDithered ()
 
int PreMultipliedAlpha ()
 
int HasAlpha ()
 
int IsHighDynamicRange ()
 
int MaxRGBLevel ()
 
int MaxAlphaLevel ()
 
BMMExport BMMRES GoTo (BitmapInfo *bi)
 
BitmapInfo GetBitmapInfo ()
 
Standard Pixel Access Methods

The following methods access pixel data one scanline at a time.

Thus, x + pixels must be less than the bitmap width.

int Put16Gray (int x, int y, int pixels, float *ptr)
 
int Get16Gray (int x, int y, int pixels, float *ptr)
 
int GetPixels (int x, int y, int pixels, BMM_Color_fl *ptr)
 
BMMExport int PutPixels (int x, int y, int pixels, BMM_Color_fl *ptr)
 
int GetLinearPixels (int x, int y, int pixels, BMM_Color_64 *ptr)
 
int GetIndexPixels (int x, int y, int pixels, BYTE *ptr)
 
int PutIndexPixels (int x, int y, int pixels, BYTE *ptr)
 
Copying / Cropping Methods
int ResizeImage (int width, int height, int newpalette)
 
int CopyImage (Bitmap *from, int operation, BMM_Color_64 fillcolor, BitmapInfo *bi=NULL)
 
int CopyImage (Bitmap *from, int operation, int fillindex)
 
BMMExport PBITMAPINFO ToDib (int depth=24, UWORD *gam=NULL, BOOL doDither=FALSE, BOOL displayGamma=FALSE)
 
BMMExport BOOL FromDib (PBITMAPINFO pbmi)
 
Palette Access
int GetPalette (int start, int count, BMM_Color_48 *ptr)
 
int SetPalette (int start, int count, BMM_Color_48 *ptr)
 
Channel Access
voidGetChannel (ULONG channelID, ULONG &chanType)
 
GBufferGetGBuffer ()
 
ULONG CreateChannels (ULONG channelIDs)
 
void DeleteChannels (ULONG channelIDs)
 
ULONG ChannelsPresent ()
 
RenderInfoGetRenderInfo ()
 
RenderInfoAllocRenderInfo ()
 
BMMExport BOOL PrepareGChannels (BitmapInfo *bi)
 
Filtering / Dithering Methods
BMMExport int GetFiltered (float u, float v, float du, float dv, BMM_Color_fl *ptr)
 
BMMExport int SetDither (UINT nDitherType)
 
BMMExport int SetFilter (UINT nFilterType)
 
int HasFilter ()
 
BitmapFilterFilter ()
 
BMMExport int SetStorage (BitmapStorage *pstorage)
 
BitmapStorageStorage ()
 
void NullStorage ()
 
Display (Virtual Frame Buffer) Methods
 
BMMExport int Display (const MCHAR *title=NULL, int position=BMM_CN, BOOL autonomous=FALSE, BOOL savebutton=TRUE, CropCallback *crop=NULL, Bitmap *cloneMyVFB=NULL)
 
BMMExport int UnDisplay ()
 
BMMExport HWND GetWindow ()
 
BMMExport void RefreshWindow (RECT *rect=NULL)
 
BMMExport void SetWindowTitle (const MCHAR *title)
 
BMMExport void SetCroppingValues (float u, float v, float w, float h, BOOL placeImage)
 
BMMExport BOOL IsAutonomousVFB ()
 
Handy built-in functions
BMMExport int Fill (int r, int g, int b, int alpha)
 
BMMExport void Print (bool silent=false)
 
BMMExport void ShowProgressLine (int y)
 
Storage Change Notification
 
BMMExport void SetNotify (BitmapNotify *bmnot=NULL)
 
BitmapNotifyGetNotify ()
 
Generic Expansion Method
BMMExport INT_PTR Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0)
 
- Public Member Functions inherited from BaseInterfaceServer
virtual UtilExport BaseInterfaceGetInterface (Interface_ID id)
 
virtual UtilExport int NumInterfaces () const
 
virtual UtilExport BaseInterfaceGetInterfaceAt (int i) const
 
virtual UtilExport ~BaseInterfaceServer ()
 
- Public Member Functions inherited from InterfaceServer
virtual UtilExport ~InterfaceServer ()
 Destructor. More...
 

Friends

class BitmapManagerImp
 
LRESULT CALLBACK InputWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
 

Output / Writing / Closing Methods

void UseScaleColors (int on)
 
int ScaleColors ()
 
void ClampScaleColor (BMM_Color_64 &out, const BMM_Color_fl &in)
 
void ClampScaleColorA (BMM_Color_64 &out, const BMM_Color_fl &in)
 
BMMExport BMMRES OpenOutput (BitmapInfo *bi)
 Opens the image for output. More...
 
BMMExport BMMRES Write (BitmapInfo *bi, int frame=BMM_SINGLEFRAME)
 Write the image from BitmapStorage to disk. More...
 
BMMExport BMMRES WriteAll (int frame=BMM_SINGLEFRAME)
 
BMMExport int Close (BitmapInfo *bi, int flag=BMM_CLOSE_COMPLETE)
 
BMMExport int CloseAll (int flag=BMM_CLOSE_COMPLETE)
 
static void ClampColor (BMM_Color_64 &out, const BMM_Color_fl &in)
 
static void ClampColorA (BMM_Color_64 &out, const BMM_Color_fl &in)
 
static void ScaleColor (BMM_Color_64 &out, const BMM_Color_fl &in)
 
static void ScaleColorA (BMM_Color_64 &out, const BMM_Color_fl &in)
 

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...
 
- Protected Attributes inherited from BaseInterfaceServer
Tab< BaseInterface * > interfaces
 

Member Function Documentation

BitmapManager* Manager ( )
inline
Remarks
Returns a pointer to the bitmap manager being used.
3833 { return manager; };
BMMExport int Create ( BitmapInfo bi)
BMMExport BOOL FixDeviceName ( BitmapInfo bi)
int MapReady ( )
inline
3839 { if (storage) return storage->MapReady(); return 0; };
virtual BMMExport int MapReady()=0
BMMExport void AddOutput ( BitmapIO out)
BMMExport void RemoveOutput ( BitmapIO out,
BOOL  deleteOutput = TRUE 
)
BMMExport BitmapIO* FindOutput ( BitmapInfo bi)
BMMExport PAVIFILE GetPaviFile ( BitmapInfo bi)
void* GetVFBData ( )
inline
3846 { return vfbData; }
void SetVFBData ( void vfb)
inline
3847 { vfbData = vfb; }
BMMExport void DeleteThis ( )
Remarks
This method should be called to free the Bitmap. Note that you should not invoke ~Bitmap() directly by calling delete on the Bitmap as was done in 3ds Max1.x. An assert will be raised if you call delete on a Bitmap directly. Instead use this method.
DWORD Flags ( )
inline
Remarks
Returns the state of the bitmap flags. These flags describe properties of the bitmap such as if the bitmap is flipped horizontally or inverted vertically, is paletted, is dithered, etc. See Bitmap Flags.
3866 { return flags; };
void SetFlag ( DWORD  flag)
inline
Remarks
Sets the specified flag bit(s).
Parameters:
DWORD flag

The flag(s) to set. See Bitmap Flags.
3871 { flags |= flag; };
void ToggleFlag ( DWORD  flag)
inline
Remarks
Toggles the specified flag bit(s) on/off.
Parameters:
DWORD flag

The flag(s) to toggle. See Bitmap Flags.
3876 { flags ^= flag; };
void ClearFlag ( DWORD  flag)
inline
Remarks
Clears the specified flag bit(s) (sets them to zero).
Parameters:
DWORD flag

The flag(s) to clear. See Bitmap Flags.
3881 { flags &= (~flag); };
int Width ( )
inline
Remarks
Returns the width of the bitmap (the horizontal dimension).
Returns
If storage has been allocated the width of the bitmap; otherwise 0.
3894 { if (storage) return storage->Width(); return 0; };
int Width()
Definition: bitmap.h:2268
int Height ( )
inline
Remarks
Returns the height (vertical dimension) of the bitmap.
Returns
If storage has been allocated the height of the bitmap; otherwise 0.
3898 { if (storage) return storage->Height(); return 0; };
int Height()
Definition: bitmap.h:2272
float Aspect ( )
inline
Remarks
Returns the aspect ratio of the bitmap.
Returns
If storage has been allocated the aspect ratio of the bitmap; otherwise 0.0f.
3902 { if (storage) return storage->Aspect(); return (float)0.0; };
float Aspect()
Definition: bitmap.h:2276
float Gamma ( )
inline
Remarks
Returns the gamma value for the bitmap.
Returns
If storage has been allocated the gamma of the bitmap; otherwise 0.0f.
3906 { if (storage) return storage->Gamma(); return (float)0.0; };
float Gamma()
Definition: bitmap.h:2280
int Paletted ( )
inline
Remarks
Returns whether the bitmap uses a palette (is not true color).
Returns
If storage has been allocated returns nonzero if the bitmap uses a palette (returns the number of palette slots used); otherwise 0.
3911 { if (storage) return storage->Paletted(); return 0; };
int Paletted()
Definition: bitmap.h:2285
int IsDithered ( )
inline
Remarks
Returns whether the bitmap is dithered or not.
Returns
If storage has been allocated returns nonzero if the bitmap is dithered; otherwise 0.
3915 { if (storage) return storage->IsDithered(); return 0; };
int IsDithered()
Definition: bitmap.h:2289
int PreMultipliedAlpha ( )
inline
Remarks
Returns whether the bitmap uses pre-multiplied alpha.
Returns
If storage has been allocated returns nonzero if the bitmap uses pre-multiplied alpha; otherwise 0.
3919 { if (storage) return storage->PreMultipliedAlpha(); return 0; };
int PreMultipliedAlpha()
Definition: bitmap.h:2293
int HasAlpha ( )
inline
Remarks
Returns whether the bitmap has an alpha channel.
Returns
If storage has been allocated returns nonzero if the bitmap has an alpha channel; otherwise 0.
3923 { if (storage) return storage->HasAlpha(); return 0; };
int HasAlpha()
Definition: bitmap.h:2297
int IsHighDynamicRange ( )
inline
Remarks
Returns nonzero if this is a bitmap that supports high dynamic range data; zero if it doesn't.
3926 { if (storage) return storage->IsHighDynamicRange(); return 0; };
virtual BMMExport int IsHighDynamicRange()=0
int MaxRGBLevel ( )
inline
Remarks
This method returns the number of bits per pixel for each color component. For example a 24-bit TARGA has a MaxRGBLevel() of
3930 { if (storage) return storage->MaxRGBLevel(); return 0; };
virtual BMMExport int MaxRGBLevel()=0
int MaxAlphaLevel ( )
inline
Remarks
Implemented by the System.

Returns the number of bits per pixel in the alpha channel.
Returns
If storage has not been allocated returns 0.
3934 { if (storage) return storage->MaxAlphaLevel(); return 0; };
virtual BMMExport int MaxAlphaLevel()=0
BMMExport BMMRES GoTo ( BitmapInfo bi)
Remarks
This method is used with multi-frame bitmaps (FLI's, AVI's, DDR devices, etc.). It is used to load a frame to replace a previously saved image. To define the desired frame, use:

bi->SetCurrentFrame(frame);
Parameters:
BitmapInfo *bi

A pointer to the BitmapInfo. The frame number information is passed here.
Returns
If used with single frame drivers or if the driver doesn't support this function, it returns BMMRES_SINGLEFRAME. If the return value is BMMRES_SUCCESS, a new frame has been loaded into the given bitmap.
BitmapInfo GetBitmapInfo ( )
inline
Remarks
Implemented by the System.

Returns a copy of the BitmapInfo instance maintained by the storage.
Returns
If the BitmapInfo instance maintained by the storage.
3966 { if (storage) return storage->bi; return BitmapInfo(); };
BitmapInfo bi
Definition: bitmap.h:2229
Information about an image file or in-memory bitmap, including settings for loading/saving, gamma, etc.
Definition: bitmap.h:718
void UseScaleColors ( int  on)
inline
Remarks
Implemented by the System.

Set whether colors are scaled (on) or clamped (off) when converting from BMM_Color_fl to BMM_Color_64. If storage is not allocated, does nothing.
3976 { if (storage) storage->UseScaleColors(on); };
void UseScaleColors(int on)
Definition: bitmap.h:2301
int ScaleColors ( )
inline
Remarks
Implemented by the System.

Returns the last value set by UseScaleColors. If storage is not allocated, returns 0.
3980 { if (storage) return storage->ScaleColors(); return 0; };
int ScaleColors()
Definition: bitmap.h:2304
static void ClampColor ( BMM_Color_64 out,
const BMM_Color_fl in 
)
inlinestatic
Remarks
Implemented by the System.

Converts in to out clamping the RGB components to 0 to 65535. The alpha component is not copied.
Parameters:
BMM_Color_64& out

The result of the conversion.

BMM_Color_fl& in

The value to convert.
3989 { BitmapStorage::ClampColor(out, in); }
static void ClampColor(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:2313
static void ClampColorA ( BMM_Color_64 out,
const BMM_Color_fl in 
)
inlinestatic
Remarks
Implemented by the System.

Converts in to out clamping the RGB components to 0 to 65535.
Parameters:
BMM_Color_64& out

The result of the conversion.

BMM_Color_fl& in

The value to convert.
3997 { BitmapStorage::ClampColorA(out, in); }
static void ClampColorA(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:2321
static void ScaleColor ( BMM_Color_64 out,
const BMM_Color_fl in 
)
inlinestatic
Remarks
Implemented by the System.

Converts in to out clamping the RGB components to 0 to 65535. The alpha component is not copied.
Parameters:
BMM_Color_64& out

The result of the conversion.

BMM_Color_fl& in

The value to convert.
4007 { BitmapStorage::ScaleColor(out, in);}
static BMMExport void ScaleColor(BMM_Color_64 &out, BMM_Color_fl in)
static void ScaleColorA ( BMM_Color_64 out,
const BMM_Color_fl in 
)
inlinestatic
Remarks
Implemented by the System.

Converts in to out clamping the RGB components to 0 to 65535.
Parameters:
BMM_Color_64& out

The result of the conversion.

BMM_Color_fl& in

The value to convert.
4015 { BitmapStorage::ScaleColorA(out, in);}
static void ScaleColorA(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:2338
void ClampScaleColor ( BMM_Color_64 out,
const BMM_Color_fl in 
)
inline
Remarks
Implemented by the System.

Converts in to out, using the value of ScaleColors() to determine the clamping or scaling. The alpha component is not copied. If the storage is not allocated, the clamping is performed.
Parameters:
BMM_Color_64& out

The result of the conversion.

BMM_Color_fl& in

The value to convert.
4025 { if (storage) storage->ClampScaleColor(out, in); else ClampColor(out, in); }
static void ClampColor(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:3989
void ClampScaleColor(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:2347
void ClampScaleColorA ( BMM_Color_64 out,
const BMM_Color_fl in 
)
inline
Remarks
Implemented by the System.

Converts in to out, using the value of ScaleColors() to determine the clamping or scaling. If the storage is not allocated, the clamping is performed.
Parameters:
BMM_Color_64& out

The result of the conversion.

BMM_Color_fl& in

The value to convert.
4035 { if (storage) storage->ClampScaleColorA(out, in); else ClampColorA(out, in); }
static void ClampColorA(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:3997
void ClampScaleColorA(BMM_Color_64 &out, const BMM_Color_fl &in)
Definition: bitmap.h:2356
int Put16Gray ( int  x,
int  y,
int  pixels,
WORD *  ptr 
)
inline
4039  { if (storage) return storage->Put16Gray(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int Put16Gray(int x, int y, int pixels, WORD *ptr)=0
int Put16Gray ( int  x,
int  y,
int  pixels,
float *  ptr 
)
inline
Remarks
Stores the specified 16-bit pixel values into the bitmap. The pixel value pointer you pass to this method may be freed or reused as soon as the function returns. Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Destination x location.

int y

Destination y location.

int pixels

Number of pixels to store.

float *ptr

Pixel values to store.
Returns
Returns nonzero if pixels were stored; otherwise 0. If storage has not been allocated 0 is returned.
4062  { if (storage) return storage->Put16Gray(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int Put16Gray(int x, int y, int pixels, WORD *ptr)=0
int Get16Gray ( int  x,
int  y,
int  pixels,
float *  ptr 
)
inline
Remarks
Retrieves the specified 16-bit pixel values from the bitmap. Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Source x location.

int y

Source y location.

int pixels

Number of pixels to retrieve.

float *ptr

Pointer to storage for the retrieved pixel values.
Returns
Returns nonzero if pixels were retrieved; otherwise 0. If storage has not been allocated 0 is returned.
4079  { if (storage) return storage->Get16Gray(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int Get16Gray(int x, int y, int pixels, WORD *ptr)=0
int GetPixels ( int  x,
int  y,
int  pixels,
BMM_Color_fl ptr 
)
inline
Remarks
Retrieves the specified 64-bit pixel values from the bitmap. Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Source x location.

int y

Source y location.

int pixels

Number of pixels to retrieve.

BMM_Color_fl *ptr

Pointer to storage for the retrieved pixel values. See Structure BMM_Color_fl.
Returns
Returns nonzero if pixels were retrieved; otherwise 0. If storage has not been allocated 0 is returned.
4097  { if (storage) return storage->GetPixels(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int GetPixels(int x, int y, int pixels, BMM_Color_64 *ptr)=0
BMMExport int PutPixels ( int  x,
int  y,
int  pixels,
BMM_Color_fl ptr 
)
Remarks
Stores the specified 64-bit pixel values into the bitmap's own local storage. The pointer you pass to this method may be freed or reused as soon as the function returns. Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Destination x location.

int y

Destination y location.

int pixels

Number of pixels to store.

BMM_Color_fl *ptr

Pixel values to store. See Structure BMM_Color_fl.
Returns
Returns nonzero if pixels were stored; otherwise 0. If storage has not been allocated 0 is returned.
int GetLinearPixels ( int  x,
int  y,
int  pixels,
BMM_Color_64 ptr 
)
inline
Remarks
Retrieves the specified 64-bit pixel values from the bitmap. These pixels are NOT gamma corrected (i.e. they have linear gamma
  • 1.0). Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Source x location.

int y

Source y location.

int pixels

Number of pixels to retrieve.

BMM_Color_64 *ptr

Pointer to storage for the retrieved pixel values. See Structure BMM_Color_64.
Returns
Returns nonzero if pixels were retrieved; otherwise 0. If storage has not been allocated 0 is returned.
4134  { if (storage) return storage->GetLinearPixels(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int GetLinearPixels(int x, int y, int pixels, BMM_Color_64 *ptr)=0
int GetIndexPixels ( int  x,
int  y,
int  pixels,
BYTE *  ptr 
)
inline
Remarks
Retrieves the specified pixels from the paletted bitmap. The palette for the image may be accessed using GetPalette(). Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Source x location.

int y

Source y location.

int pixels

Number of pixels to retrieve.

BYTE *ptr

Pointer to storage for the pixel values.
Returns
Returns nonzero if pixels were retrieved; otherwise 0. If storage has not been allocated 0 is returned.
4151  { if (storage) return storage->GetIndexPixels(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int GetIndexPixels(int x, int y, int pixels, unsigned char *ptr)=0
int PutIndexPixels ( int  x,
int  y,
int  pixels,
BYTE *  ptr 
)
inline
Remarks
Stores the pixels into the specified location of the paletted bitmap. The pixel value pointer you pass to this method may be freed or reused as soon as the function returns. Note: This method provides access to pixel data one scanline at a time.
Parameters:
int x

Destination x location.

int y

Destination y location.

int pixels

Number of pixels to store.

BYTE *ptr

Pixels to store.
Returns
Returns nonzero if pixels were stored; otherwise 0. If storage has not been allocated 0 is returned.

4170  { if (storage) return storage->PutIndexPixels(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int PutIndexPixels(int x, int y, int pixels, unsigned char *ptr)=0
void* GetStoragePtr ( int type)
inline
4174  { if (storage) return storage->GetStoragePtr(type); return NULL; };
#define NULL
Definition: autoptr.h:18
virtual BMMExport void * GetStoragePtr(int *bmmType)
Definition: bitmap.h:2396
void* GetAlphaPtr ( int type)
inline
4176  { if (storage) return storage->GetAlphaPtr(type); return NULL; };
#define NULL
Definition: autoptr.h:18
virtual BMMExport void * GetAlphaPtr(int *bmmType)
Definition: bitmap.h:2410
int Get16Gray ( int  x,
int  y,
int  pixels,
WORD *  ptr 
)
inline
4178  { if (storage) return storage->Get16Gray(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int Get16Gray(int x, int y, int pixels, WORD *ptr)=0
int GetPixels ( int  x,
int  y,
int  pixels,
BMM_Color_64 ptr 
)
inline
4180  { if (storage) return storage->GetPixels(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int GetPixels(int x, int y, int pixels, BMM_Color_64 *ptr)=0
BMMExport int PutPixels ( int  x,
int  y,
int  pixels,
BMM_Color_64 ptr 
)
int GetLinearPixels ( int  x,
int  y,
int  pixels,
BMM_Color_fl ptr 
)
inline
4183  { if (storage) return storage->GetLinearPixels(x,y,pixels,ptr); return 0; };
controller mat max min numsubs x z controller keys x z controller keys x
Definition: generics.inl:211
virtual BMMExport int GetLinearPixels(int x, int y, int pixels, BMM_Color_64 *ptr)=0
int CropImage ( int  width,
int  height,
BMM_Color_64  fillcolor 
)
inline
4186  { if (storage) return storage->CropImage(width,height,fillcolor); return 0; };
virtual BMMExport int CropImage(int width, int height, BMM_Color_64 fillcolor)=0
int CropImage ( int  width,
int  height,
BMM_Color_fl  fillcolor 
)
inline
4188  { if (storage) return storage->CropImage(width,height,fillcolor); return 0; };
virtual BMMExport int CropImage(int width, int height, BMM_Color_64 fillcolor)=0
int CropImage ( int  width,
int  height,
int  fillindex 
)
inline
4190  { if (storage) return storage->CropImage(width,height,fillindex); return 0; };
virtual BMMExport int CropImage(int width, int height, BMM_Color_64 fillcolor)=0
int ResizeImage ( int  width,
int  height,
int  newpalette 
)
inline
Remarks
This method is not currently implemented.
4196  { if (storage) return storage->ResizeImage(width,height,newpalette);return 0; };
virtual BMMExport int ResizeImage(int width, int height, int newpalette)=0
int CopyImage ( Bitmap from,
int  operation,
BMM_Color_64  fillcolor,
BitmapInfo bi = NULL 
)
inline
4199  { if (storage) return storage->CopyImage(from,operation,fillcolor,bi); return 0; };
virtual BMMExport int CopyImage(Bitmap *from, int operation, BMM_Color_64 fillcolor, BitmapInfo *bmInfo=NULL)=0
int CopyImage ( Bitmap from,
int  operation,
int  fillindex 
)
inline
Remarks
Copies the specified bitmap to this bitmap.
Parameters:
Bitmap *from

The source bitmap.

int operation

The type of copy to perform. See Copy Image Operations.

int fillindex

Vacant areas of the bitmap are filled with fillindex pixels if the operation specified is COPY_IMAGE_CROP and one of the source bitmap dimensions is less than the size of this bitmap.
Returns
Nonzero if the copy was performed; otherwise 0.
4213  { if (storage) return storage->CopyImage(from,operation,fillindex); return 0; };
virtual BMMExport int CopyImage(Bitmap *from, int operation, BMM_Color_64 fillcolor, BitmapInfo *bmInfo=NULL)=0
int CopyImage ( Bitmap from,
int  operation,
BMM_Color_fl  fillcolor,
BitmapInfo bi = NULL 
)
inline
Remarks
Copies the specified bitmap to this bitmap.
Parameters:
Bitmap *from

The source bitmap.

int operation

The type of copy to perform:

COPY_IMAGE_CROP

Copy image to current map size using cropping if necessary.

COPY_IMAGE_RESIZE_LO_QUALITY

Resize the source image to the destination map size (draft quality).

COPY_IMAGE_RESIZE_HI_QUALITY

Resize source image to the destination map size (final quality).

COPY_IMAGE_USE_CUSTOM

Resize based on the Image Input Options (BitmapInfo *).

BMM_Color_fl fillcolor

Vacant areas of the bitmap are filled with fillcolor pixels if the operation specified is COPY_IMAGE_CROP and one of the source bitmap dimensions is less than the size of this bitmap. See Structure BMM_Color_fl.

BitmapInfo *bi = NULL

When using custom options (resize to fit, positioning, etc.) this is how the flags are passed down to the Bitmap Manager. This is an optional argument – for simple copy operations, *bi can default to NULL. If present, the code checks the option flags and acts accordingly.
Returns
Nonzero if the copy was performed; otherwise 0.
4241  { if (storage) return storage->CopyImage(from,operation,fillcolor,bi); return 0; };
virtual BMMExport int CopyImage(Bitmap *from, int operation, BMM_Color_64 fillcolor, BitmapInfo *bmInfo=NULL)=0
int GetPalette ( int  start,
int  count,
BMM_Color_48 ptr 
)
inline
Remarks
Retrieves a portion of the palette from the bitmap.
Parameters:
int start

The index into the palette of where to begin retrieving palette entries.

int count

The number of palette entries to retrieve.

BMM_Color_48 *ptr

Storage for the palette entries. See Structure BMM_Color_48.
Returns
Nonzero if the palette entries were retrieved; otherwise 0.
4258  { if (storage) return storage->GetPalette(start,count,ptr); return 0; };
virtual BMMExport int GetPalette(int start, int count, BMM_Color_48 *ptr)=0
int SetPalette ( int  start,
int  count,
BMM_Color_48 ptr 
)
inline
Remarks
Sets the specified portion of the palette of this bitmap.
Parameters:
int start

The index into the palette of where to begin storing palette entries.

int count

The number of palette entries to store.

BMM_Color_48 *ptr

The palette entries to store. See Structure BMM_Color_48.
Returns
Nonzero if the palette entries were stored; otherwise 0.
4271  { if (storage) return storage->SetPalette(start,count,ptr); return 0; };
virtual BMMExport int SetPalette(int start, int count, BMM_Color_48 *ptr)=0
BMMExport void FilmGrain ( float  grain,
BOOL  mask,
PBITMAP_FX_CALLBACK  callback = NULL,
void param = NULL 
)
void* GetChannel ( ULONG  channelID,
ULONG &  chanType 
)
inline
Remarks
Returns a pointer to the specified channel of the bitmap, and determines its type in terms of bits per pixel.
Parameters:
ULONG channelID

The channel to return a pointer to. See Image (G-Buffer) Channels.

ULONG& chanType

The type of the returned channel. One of the following values:

BMM_CHAN_TYPE_UNKNOWN

Channel not of a known type.

BMM_CHAN_TYPE_8

1 byte per pixel

BMM_CHAN_TYPE_16

1 word per pixel

BMM_CHAN_TYPE_32

2 words per pixel

BMM_CHAN_TYPE_48

3 words per pixel

BMM_CHAN_TYPE_64

4 words per pixel

BMM_CHAN_TYPE_96

6 words per pixel
4308  { if (storage) return storage->GetChannel(channelID, chanType); return NULL; }
virtual BMMExport void * GetChannel(ULONG channelID, ULONG &chanType)
Definition: bitmap.h:2896
#define NULL
Definition: autoptr.h:18
GBuffer* GetGBuffer ( )
inline
Remarks
Returns a pointer to the GBuffer for the bitmap (or NULL if none).
4311 { return storage? storage->GetGBuffer(): NULL; }
GBuffer * GetGBuffer()
Definition: bitmap.h:2900
#define NULL
Definition: autoptr.h:18
ULONG CreateChannels ( ULONG  channelIDs)
inline
Remarks
This method creates the specified channels. After creation, these may be accessed using void *GetChannel().
Parameters:
ULONG channelIDs

Specifies the channels to create. See Image (G-Buffer) Channels.
Returns
The channels that are present.
4320  { if (storage) return storage->CreateChannels(channelIDs); return 0; }
virtual BMMExport ULONG CreateChannels(ULONG channelIDs)
void DeleteChannels ( ULONG  channelIDs)
inline
Remarks
Delete the specified channels.
Parameters:
ULONG channelIDs

Specifies the channels to delete. See Image (G-Buffer) Channels.
4327  { if (storage) storage->DeleteChannels(channelIDs); }
virtual BMMExport void DeleteChannels(ULONG channelIDs)
Definition: bitmap.h:2917
ULONG ChannelsPresent ( )
inline
Remarks
Returns the channels that are present. See Image (G-Buffer) Channels.
4331  { if (storage) return storage->ChannelsPresent(); return 0; }
virtual BMMExport ULONG ChannelsPresent()
Definition: bitmap.h:2923
RenderInfo* GetRenderInfo ( )
inline
Remarks
This is used internally. It returns a pointer to the RenderInfo associated with the storage if available; otherwise NULL. See Class RenderInfo.
4335 { if (storage) return storage->GetRenderInfo(); return NULL; }
#define NULL
Definition: autoptr.h:18
BMMExport RenderInfo * GetRenderInfo()
RenderInfo* AllocRenderInfo ( )
inline
Remarks
This is used internally. It returns a pointer to the RenderInfo instance allocated by the storage. If this could not be allocated NULL is returned. See Class RenderInfo.
4340 { if (storage) return storage->AllocRenderInfo(); return NULL; }
#define NULL
Definition: autoptr.h:18
BMMExport RenderInfo * AllocRenderInfo()
BMMExport BOOL PrepareGChannels ( BitmapInfo bi)
Remarks
This method is used internally. This method will check with the plug-in (file or device) defined in the given BitmapInfo and prepare (create) the proper channels. If a given channel already exists, no new channel will be created. After creating a bitmap, use this function to define the optional channels that may be required by the given handler.
Parameters:
BitmapInfo *bi

Points to an instance of BitmapInfo that defines the properties of the image.
Returns
TRUE if the channels were created; otherwise FALSE.
BMMExport BOOL PrepareGChannels ( DWORD  channels)
BMMExport int GetFiltered ( float  u,
float  v,
float  du,
float  dv,
BMM_Color_64 ptr 
)
BMMExport int GetFiltered ( float  u,
float  v,
float  du,
float  dv,
BMM_Color_fl ptr 
)
Remarks
This method uses summed area table or pyramidal filtering to compute an averaged color over the specified area. You must have a filter plugged in for this to work. See SetFilter() below.
Parameters:
float u, float v

The location in the bitmap to filter. These values go from 0.0 to 1.0 across the size of the bitmap.

float du, float dv

The size of the rectangle to sample. These values go from 0.0 to 1.0 across the size of the bitmap.

BMM_Color_fl *ptr

The result is returned here – the average over the specified area. See Structure BMM_Color_fl.
\remarks This method uses summed area table or pyramidal filtering
to compute an averaged color over the specified area. You must have a filter plugged in for this to work. See SetFilter() below.
Parameters:
float u, float v

The location in the bitmap to filter. These values go from 0.0 to 1.0 across the size of the bitmap.

float du, float dv

The size of the rectangle to sample. These values go from 0.0 to 1.0 across the size of the bitmap.

BMM_Color_fl *ptr

The result is returned here – the average over the specified area.
BMMExport int SetDither ( UINT  nDitherType)
Remarks
Sets the type of dithering used on the bitmap.
Parameters:
UINT nDitherType

The type of dither to perform.

BMM_DITHER_NONE

Specifies no dithering is to be performed.

BMM_DITHER_FLOYD

Specifies the Floyd-Steinberg dithering algorithm.
Returns
Nonzero if the bitmap dithering was set; otherwise 0.
BMMExport int SetFilter ( UINT  nFilterType)
Remarks
Establishes a filtering algorithm to be used by the bitmap.
Parameters:
UINT nFilterType

See Bitmap Filter Types.
Returns
Nonzero if the bitmap filtering was set; otherwise 0.
int HasFilter ( )
inline
Remarks
Determines if the bitmap has a filter.
Returns
Returns nonzero if the bitmap has a filter; otherwise 0.
4415 { return (filter) ? 1:0; };
BitmapFilter* Filter ( )
inline
Remarks
This method is used internally. It returns a pointer to the bitmap filter used by the bitmap.
4418 { return filter; };
BMMExport int SetStorage ( BitmapStorage pstorage)
Remarks
Establishes a bitmap storage to manage this bitmap.
Parameters:
BitmapStorage *pstorage

The storage to manage the bitmap.
Returns
Nonzero if the storage was assigned; otherwise 0.
BitmapStorage* Storage ( )
inline
Remarks
Returns the storage that is managing this bitmap.
Returns
A pointer to the storage.
4427 { return storage; };
void NullStorage ( )
inline
Remarks
Sets the storage pointer to NULL.
4429 { storage = NULL; };
#define NULL
Definition: autoptr.h:18
BMMExport PBITMAPINFO ToDib ( int  depth = 24,
UWORD gam = NULL,
BOOL  doDither = FALSE,
BOOL  displayGamma = FALSE 
)
Remarks
Creates a new Windows Device Independent Bitmap (DIB) and returns a pointer to it. The DIB bitmap is created from this Bitmap. The DIB is allocated using LocalAlloc(). The pseudo-code below show how one may be created and freed. Note that the DIB is never used or accessed inside 3ds Max (the call to ToDib() is the first and last time that 3ds Max sees this pointer):

PBITMAPINFO pDib;
pDib = bitmap-\>ToDib();
...
When you are done using the DIB call:

LocalFree(pDib);
Parameters:
int depth = 24

The bitmap depth; either 24 (BGR) or 32 (BGRO). If not specified the default is 24.

UWORD *gam=NULL

Specifies a pointer to an optional gamma table that is used to apply gamma correction to the color components as part of the conversion to a DIB. The table has RCOLN entries.

BOOL doDither=FALSE

Specifies if a random dither is applied when reducing the color components from 16 bits per channel to 8 bits per channel (to reduce banding effects).

BOOL displayGamma=FALSE

Specifies whether the output should be color corrected for screen display. If so, the gamma table parameter is ignored, and the DIB is color corrected using display gamma or LUT, as necessary.
BMMExport BOOL FromDib ( PBITMAPINFO  pbmi)
Remarks
Converts the DIB to this bitmap's storage type. This bitmap's storage must already be allocated or the call will fail. The source must be 16, 24 or 32 bit. You cannot use an 8 bit DIB.
Parameters:
PBITMAPINFO pbmi

The source bitmap.
Returns
TRUE if the conversion was performed; otherwise FALSE.
BMMExport BMMRES OpenOutput ( BitmapInfo bi)

Opens the image for output.

Remarks
This method will open the image for output. This allows the image to be written to. Note that you can pass a BitmapInfo to this method on which you simply set the file name 'by hand' (bi->SetName(_T("D:\renders\output.jpg"))). This will work and the correct driver (i.e. BitmapIO) will be selected based on the filename extension. This will work even in a localized environment, therefore there is no need to manually call BitmapInfo::SetDevice on the BitmapInfo that is passed to this function. However you won't be able to set any driver specific settings (such as compression settings for JPEGs). The alternative way is to use the BitmapManger methods.
Parameters
bi- Contains the name of the image or device to open for output.
Returns
BMMRES_SUCCESS - Indicates success.

BMMRES_ERRORTAKENCARE - Indicates that 3ds Max could not find a device to handle the image.

BMMRES_INTERNALERROR - Indicates the IO module handling the image could not be opened for writing.
BMMExport BMMRES Write ( BitmapInfo bi,
int  frame = BMM_SINGLEFRAME 
)

Write the image from BitmapStorage to disk.

Remarks
Write the image from the BitmapStorage to disk. Note that you must pass the same BitmapInfo used when the file was first "Opened for Output". The main reason is that any device specific settings are kept in the BitmapInfo object. Also, the custom options such as gamma value, optional channels, etc (if any) are kept in this BitmapInfo instance. These are assigned when the bitmap is first opened (for either read or write).
Parameters
bi- Contains the name of the file or device to write to.
frame- Specifies the frame number to write. If this is a single image, allow frame to default to single frame. This argument determines if the file will have the frame number appended to it. If you want the file to have a normal name (no frame number attached to it), you must set the frame argument to BMM_SINGLEFRAME (the default). Any other value is considered to be a frame number and it will be appended to the given filename.
Returns
BMMRES_SUCCESS - Indicates success.

BMMRES_ERRORTAKENCARE - Indicates that 3ds Max could not find a device to handle the image.

BMMRES_INTERNALERROR - Indicates the IO module handling the image could not be opened for writing.
BMMExport BMMRES WriteAll ( int  frame = BMM_SINGLEFRAME)
Remarks
Write the image to all the open outputs.
Parameters:
DWORD frame = BMM_SINGLEFRAME

Specifies the frame number to write. If this is a single image, allow frame to default to single frame.
Returns
BMMRES_SUCCESS

Indicates success.

BMMRES_ERRORTAKENCARE

Indicates that 3ds Max could not find a device to handle the image.

BMMRES_INTERNALERROR

Indicates the IO module handling the image could not be opened for writing.
BMMExport int Close ( BitmapInfo bi,
int  flag = BMM_CLOSE_COMPLETE 
)
Remarks
Close the bitmap. This means the bitmap is no longer open for writing.
Parameters:
BitmapInfo *bi

Identifies the bitmap to close.

int flag = BMM_CLOSE_COMPLETE

See Bitmap Close Types.
Returns
Nonzero if the image output was closed without error; otherwise 0.
BMMExport int CloseAll ( int  flag = BMM_CLOSE_COMPLETE)
Remarks
Closes all the open outputs.
Parameters:
int flag = BMM_CLOSE_COMPLETE

See Bitmap Close Types.
Returns
Nonzero if the image outputs were closed without error; otherwise 0.
BMMExport int Display ( const MCHAR title = NULL,
int  position = BMM_CN,
BOOL  autonomous = FALSE,
BOOL  savebutton = TRUE,
CropCallback crop = NULL,
Bitmap cloneMyVFB = NULL 
)
Remarks
This method creates a window for the display of this bitmap and displays it.
Parameters:
MCHAR *title = NULL

The title to display in the title bar of the window.

int position = BMM_CN

Specifies how the bitmap should be positioned. One of the following values:

BMM_UL - Upper Left

BMM_LL - Lower Left

BMM_UR - Upper Right

BMM_LR - Lower Right

BMM_CN - Center

BMM_RND - Used internally. Renderer location.

BMM_VPP - Used internally. Video Post Primary location.

BMM_VPS - Used internally. Video Post Secondary location.

BOOL autonomous = FALSE

This is reserved for internal use, always let it default to FALSE.

BOOL savebutton = TRUE

This is reserved for internal use, always let it default to TRUE.

CropCallback *crop=NULL

This parameter is available in release 2.0 and later only.

When non-NULL this will cause the VFB to display, instead of its normal toolbar, a set of sliders for adjusting cropping and also will allow interactive adjustment of the cropping rectangle in the image window. See Class CropCallback.

Bitmap *cloneMyVFB = NULL

This parameter is available in release 4.0 and later only.

A pointer to a bitmap to clone the VFB to.
Returns
Nonzero if the bitmap was displayed; otherwise 0.
BMMExport int UnDisplay ( )
Remarks
Close the display window associated with this bitmap (if any).
Returns
Always returns nonzero.
BMMExport HWND GetWindow ( )
Remarks
Get the window handle for the displayed bitmap.
Returns
Returns the window handle, or NULL if it's not displayed in a window.
BMMExport void RefreshWindow ( RECT *  rect = NULL)
Remarks
Refreshes the interior of the display window with the bitmap contents. In release 3.0 and later this method respects the Bitmap::ShowProgressLine() setting. See that method for more details.
Parameters:
RECT *rect = NULL

The region of the display window to refresh (specified in image coordinates). If the pointer is NULL the entire window is refreshed.
BMMExport void SetWindowTitle ( const MCHAR title)
Remarks
Sets the title displayed in the display window's title bar.
Parameters:
MCHAR *title

The title to display.
BMMExport void SetCroppingValues ( float  u,
float  v,
float  w,
float  h,
BOOL  placeImage 
)
Remarks
This method is used when the VFB is being displayed and you want to change the cropping rectangle from your plug-in. An example of this is available in /MAXSDK/SAMPLES/MATERIALS/BMTEX.CPP.
Parameters:
float u

The U value to set.

float v

The U value to set.

float w

The U value to set.

float h

The U value to set.

BOOL placeImage

TRUE for place mode; FALSE for crop.
BMMExport int Fill ( int  r,
int  g,
int  b,
int  alpha 
)
Remarks
Sets every pixel of the bitmap to the specified color and alpha value.
Parameters:
int r

Specifies the red value to fill with.

int g

Specifies the green value to fill with.

int b

Specifies the blue value to fill with.

int alpha

Specifies the alpha value to fill with.
Returns
Nonzero if the operation succeeded; otherwise FALSE.
BMMExport int Fill ( const BMM_Color_fl fillColor)
Remarks
Used by Maxscript.
Parameters:
fillColor

BMMExport int Fill ( const BMM_Color_64 fillColor)
Remarks
Used by Maxscript.
Parameters:
fillColor
BMMExport void SetNotify ( BitmapNotify bmnot = NULL)
Remarks
This method is used to set a callback to allow the developer to get notified if the storage for the Bitmap has changed.
Parameters:
BitmapNotify *bmnot=NULL

The pointer to the callback object implemented by the developer used to provide notification when the Bitmap's storage changes. See Class BitmapNotify.
BitmapNotify* GetNotify ( )
inline
Remarks
Returns a pointer to the callback used to notify a developer when the Bitmap's storage changes.
Default Implementation:
{ return bmNotify; };
4680 { return bmNotify; }
BMMExport BOOL IsAutonomousVFB ( )
Remarks
Returns TRUE if the virtual frame buffer (VFB) is autonomous; otherwise FALSE. For instance, Video Post has an associated VFB. When Video Post is closed so is its VFB since it belongs to it. In that case the VFB is not autonomous. If the user does a View File command, that VFB is autonomous.
BMMExport INT_PTR Execute ( int  cmd,
ULONG_PTR  arg1 = 0,
ULONG_PTR  arg2 = 0,
ULONG_PTR  arg3 = 0 
)
Remarks
This is a general purpose function that allows the API to be extended in the future. The 3ds Max development team can assign new cmd numbers and continue to add functionality to this class without having to 'break' the API.
Parameters:
int cmd

The index of the command to execute.

ULONG arg1=0

Optional argument 1. See the documentation where the cmd option is discussed for more details on these parameters.

ULONG arg2=0

Optional argument 2.

ULONG arg3=0

Optional argument 3.
Returns
An integer return value. See the documentation where the cmd option is discussed for more details on the meaning of this value.
DWORD GetModifyID ( )
inline
4714 { return modifyID; }
void SetModifyID ( DWORD  m)
inline
4715 { modifyID = m; }
BMMExport void IncrModifyID ( )
BMMExport void Print ( bool  silent = false)
BMMExport void ShowProgressLine ( int  y)
Remarks
This method is used for showing a moving scanline in a virtual frame buffer displaying this bitmap. Here's how it works. If you call ShowProgressLine(y), it clears any previously set white line, and sets an internal counter: you have to call Bitmap::RefreshWindow() to get the new white line to show up. From then that line will be displayed as white. To Clear it call ShowProgressLine(-1).
Parameters:
int y

The scanline to display as white (the count begins at zero). Use a value of -1 to hide the line.

Friends And Related Function Documentation

friend class BitmapManagerImp
friend
LRESULT CALLBACK InputWndProc ( HWND  hWnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam 
)
friend