3ds Max C++ API Reference
|
Class for image input and output. More...
#include <bitmap.h>
Public Member Functions | |
BitmapManager * | Manager () |
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 BitmapIO * | FindOutput (BitmapInfo *bi) |
BMMExport PAVIFILE | GetPaviFile (BitmapInfo *bi) |
void * | GetVFBData () |
void | SetVFBData (void *vfb) |
int | Put16Gray (int x, int y, int pixels, WORD *ptr) |
void * | GetStoragePtr (int *type) |
void * | GetAlphaPtr (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=nullptr) |
BMMExport void | FilmGrain (float grain, BOOL mask, PBITMAP_FX_CALLBACK callback=nullptr, void *param=nullptr) |
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 () const |
void | SetModifyID (DWORD m) |
BMMExport void | IncrModifyID () |
Memory Deallocation | |
BMMExport void | DeleteThis () |
Flag Access | |
DWORD | Flags () const |
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 () const |
int | Height () const |
float | Aspect () const |
float | Gamma () const |
int | Paletted () const |
int | IsDithered () const |
int | PreMultipliedAlpha () const |
int | HasAlpha () const |
int | IsHighDynamicRange () const |
int | MaxRGBLevel () const |
int | MaxAlphaLevel () const |
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=nullptr) |
int | CopyImage (Bitmap *from, int operation, int fillindex) |
BMMExport PBITMAPINFO | ToDib (int depth=24, UWORD *gam=nullptr, 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 | |
void * | GetChannel (ULONG channelID, ULONG &chanType) |
GBuffer * | GetGBuffer () |
ULONG | CreateChannels (ULONG channelIDs) |
void | DeleteChannels (ULONG channelIDs) |
ULONG | ChannelsPresent () |
RenderInfo * | GetRenderInfo () |
RenderInfo * | AllocRenderInfo () |
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 () |
BitmapFilter * | Filter () |
BMMExport int | SetStorage (BitmapStorage *pstorage) |
BitmapStorage * | Storage () |
void | NullStorage () |
Display (Virtual Frame Buffer) Methods | |
| |
BMMExport int | Display (const MCHAR *title=nullptr, int position=BMM_CN, BOOL autonomous=FALSE, BOOL savebutton=TRUE, CropCallback *crop=nullptr, Bitmap *cloneMyVFB=nullptr) |
BMMExport int | UnDisplay () |
BMMExport HWND | GetWindow () |
BMMExport void | RefreshWindow (RECT *rect=nullptr) |
BMMExport void | SetWindowTitle (const MCHAR *title) |
BMMExport void | SetCroppingValues (float u, float v, float w, float h, BOOL placeImage) |
BMMExport BOOL | IsAutonomousVFB () const |
Handy built-in functions | |
BMMExport int | Fill (int r, int g, int b, int alpha) |
BMMExport void | Print (bool silent=false) |
Print the bitmap (if supported by the host app) | |
BMMExport void | ShowProgressLine (int y) |
Storage Change Notification | |
| |
BMMExport void | SetNotify (BitmapNotify *bmnot=nullptr) |
BitmapNotify * | GetNotify () |
Generic Expansion Method | |
BMMExport INT_PTR | Execute (int cmd, ULONG_PTR arg1=0, ULONG_PTR arg2=0, ULONG_PTR arg3=0) |
![]() | |
UtilExport BaseInterface * | GetInterface (Interface_ID id) override |
virtual UtilExport int | NumInterfaces () const |
virtual UtilExport BaseInterface * | GetInterfaceAt (int i) const |
virtual UtilExport | ~BaseInterfaceServer () |
![]() | |
virtual UtilExport | ~InterfaceServer () |
Destructor. | |
virtual UtilExport BaseInterface * | GetInterface (Interface_ID id) |
template<class InterfaceType > | |
InterfaceType * | GetTypedInterface () |
Friends | |
class | BitmapManagerImp |
LRESULT CALLBACK | InputWndProc (HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) |
Output / Writing / Closing Methods | |
void | UseScaleColors (int on) |
int | ScaleColors () const |
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. | |
BMMExport BMMRES | Write (BitmapInfo *bi, int frame=BMM_SINGLEFRAME) |
Write the image from BitmapStorage to disk. | |
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 UtilExport void * | operator new (size_t size) |
Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator new[] (size_t size) |
New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator new[] (size_t size, int block_type, const char *filename, int line) |
New operator used to allocate arrays of objects. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
static UtilExport void * | operator 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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
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. | |
static UtilExport void * | operator new (size_t size, void *placement_ptr) |
Placement new operator. | |
static UtilExport void | operator delete (void *ptr, void *placement_ptr) |
Placement delete operator. | |
static UtilExport void * | aligned_malloc (size_t size, size_t alignment) |
Allocates memory on a specified alignment boundary. | |
static UtilExport void * | aligned_realloc (void *ptr, size_t size, size_t alignment) |
Reallocates memory on a specified alignment boundary. | |
static UtilExport void | aligned_free (void *ptr) |
Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. | |
![]() | |
Tab< BaseInterface * > | interfaces |
Class for image input and output.
\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: \code BitmapInfo bi; \endcode Then define the output file or device: \code bi.SetName("file.tga"); \endcode or use the BitmapManager: \code BitmapManager::SelectFileOutput( ... &bi ...) \endcode Then define your parameters for the Bitmap: \code bi.SetWidth(x) bi.SetHeight(y) etc... \endcode Then create the Bitmap: \code Bitmap* map = BitmapManager::Create(&bi); \endcode Then do something with the bitmap: \code map->Fill({0,0,0}); \endcode Then you actually open, write and close the bitmap: \code map->OpenOutput(&bi); map->Write(&bi); map->Close(&bi); map->DeleteThis(); \endcode \par To write a multi-frame file, just keep doing something different to the Bitmap and keep writing. \par To write a sequence of images to a file/device. Create BitmapInfo class \code BitmapInfo bi; \endcode Define the output file/device, either directly \code bi.SetName(_T("E:\Renders\file.tga")); \endcode or using the user interface. \code BitmapManager::SelectFileOutput( ... &bi ...); \endcode The customize or define the BitmapInfo: \code bi.SetWidth(x) bi.SetHeight(y) bi.SetFirstFrame(0) bi.SetLastFrame(29) etc... \endcode Then create the Bitmap \code Bitmap* map = BitmapManager::Create(&bi); \endcode Then open the Bitmap for writing \code map->OpenOutput(&bi); for (int x = 0; x < 29; x++) { ## Do something to image... map->Write(&bi,x); } map->Close(&bi); map->DeleteThis(); \endcode \par 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. \par 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(). \par It is ok to use WriteAll() and CloseAll() if you have just one output defined.
|
inline |
BMMExport int Create | ( | BitmapInfo * | bi | ) |
BMMExport BOOL FixDeviceName | ( | BitmapInfo * | bi | ) |
|
inline |
BMMExport BitmapIO * FindOutput | ( | BitmapInfo * | bi | ) |
BMMExport PAVIFILE GetPaviFile | ( | BitmapInfo * | bi | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
BMMExport BMMRES GoTo | ( | BitmapInfo * | bi | ) |
|
inline |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inlinestatic |
|
inline |
|
inline |
|
inline |
|
inline |
BMMExport void FilmGrain | ( | float | grain, |
BOOL | mask, | ||
PBITMAP_FX_CALLBACK | callback = nullptr , |
||
void * | param = nullptr |
||
) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
BMMExport BOOL PrepareGChannels | ( | BitmapInfo * | bi | ) |
BMMExport BOOL PrepareGChannels | ( | DWORD | channels | ) |
|
inline |
|
inline |
BMMExport int SetStorage | ( | BitmapStorage * | pstorage | ) |
|
inline |
|
inline |
BMMExport PBITMAPINFO ToDib | ( | int | depth = 24 , |
UWORD * | gam = nullptr , |
||
BOOL | doDither = FALSE , |
||
BOOL | displayGamma = FALSE |
||
) |
BMMExport BOOL FromDib | ( | PBITMAPINFO | pbmi | ) |
BMMExport BMMRES OpenOutput | ( | BitmapInfo * | bi | ) |
Opens the image for output.
bi | - Contains the name of the image or device to open for output. |
BMMExport BMMRES Write | ( | BitmapInfo * | bi, |
int | frame = BMM_SINGLEFRAME |
||
) |
Write the image from BitmapStorage to disk.
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. |
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 | ) |
BMMExport int Display | ( | const MCHAR * | title = nullptr , |
int | position = BMM_CN , |
||
BOOL | autonomous = FALSE , |
||
BOOL | savebutton = TRUE , |
||
CropCallback * | crop = nullptr , |
||
Bitmap * | cloneMyVFB = nullptr |
||
) |
BMMExport HWND GetWindow | ( | ) |
BMMExport void SetNotify | ( | BitmapNotify * | bmnot = nullptr | ) |
|
inline |
BMMExport BOOL IsAutonomousVFB | ( | ) | const |
|
inline |
|
inline |
|
friend |
|
friend |