3ds Max C++ API Reference
|
Information about an image file or in-memory bitmap, including settings for loading/saving, gamma, etc. More...
#include <bitmap.h>
Public Member Functions | |
BMMExport | BitmapInfo () |
BMMExport | BitmapInfo (const MCHAR *n) |
BMMExport | BitmapInfo (const MaxSDK::AssetManagement::AssetUser &asset) |
BMMExport | BitmapInfo (const BitmapInfo &bi) |
BMMExport | ~BitmapInfo () |
BMMExport MaxSDK::Util::Path | GetPathEx () const |
Returns the currently set path of the image file. | |
BMMExport void | CopyImageInfo (const BitmapInfo *from) |
BMMExport void | SetPath (const MaxSDK::Util::Path &path) |
Set the path to the image file. | |
BMMExport const MaxSDK::AssetManagement::AssetUser & | GetAsset () const |
returns this bitmap's asset | |
BMMExport void | SetAsset (const MaxSDK::AssetManagement::AssetUser &assetUser) |
sets this bitmap's asset | |
BMMExport void * | GetPiData () |
Returns the plugin data stored on the BitmapInfo. | |
BMMExport void | SetPiData (void *ptr) |
Sets the plugin data stored on the BitmapInfo. | |
BMMExport DWORD | GetPiDataSize () const |
Returns the size of the plugin data stored on the BitmapInfo. | |
BMMExport void | SetPiDataSize (DWORD s) |
Sets the reported size of the plugin data stored on the BitmapInfo. | |
BMMExport void | ResetPiData () |
Resets the plugin data stored on the BitmapInfo. | |
BMMExport BOOL | AllocPiData (DWORD size) |
Allocates the plugin data memory and set the plugin data size. | |
BMMExport BitmapInfo * | GetProxySubject (BOOL create=FALSE) |
Returns the subject info of the proxy. When create is TRUE, the subject info will be allocated if it was null. | |
BMMExport void | ResetProxySubject () |
Deletes the subject info and sets it to null. | |
BMMExport BOOL | AllocProxySubject () |
Creates the subject info. | |
BMMExport void * | CreateFmtSpecBlock () |
BMMExport void | Copy (const BitmapInfo *from, BOOL copyProxySubject=TRUE) |
Assignment function. The data members of the specified BitmapInfo are copied to this BitmapInfo, with option to also copy the proxySubject info. | |
BMMExport IOResult | Save (ISave *isave) |
BMMExport IOResult | Load (ILoad *iload) |
BMMExport void | EnumAuxFiles (AssetEnumCallback &assetEnum, DWORD vflags) |
BMMExport BOOL | Validate () |
BMMExport HWND | GetUpdateWindow () |
BMMExport void | SetUpdateWindow (HWND hwnd) |
BMMExport DWORD | GetGChannels () |
BMMExport DWORD | GetDeviceFlags () |
BMMExport BOOL | FixDeviceName () |
Sets the appropriate device name, as derived from the filename. | |
Flag Access | |
BMMExport DWORD | Flags () const |
BMMExport DWORD | SetFlags (DWORD f) |
BMMExport DWORD | ResetFlags (DWORD f) |
BMMExport BOOL | TestFlags (DWORD f) const |
Frame Ranges | |
BMMExport int | FirstFrame () const |
BMMExport int | LastFrame () const |
BMMExport int | NumberFrames () const |
BMMExport int | CurrentFrame () const |
BMMExport WORD | SequenceOutBound () const |
BMMExport int | SetFirstFrame (int m) |
BMMExport int | SetLastFrame (int s) |
BMMExport int | SetCurrentFrame (int v) |
BMMExport WORD | SetSequenceOutBound (WORD c) |
Name/Device Access | |
BMMExport const MCHAR * | Name () const |
Returns the currently set path of the image file. | |
BMMExport const MCHAR * | Filename () |
BMMExport const MCHAR * | Device () const |
BMMExport BOOL | CompareName (const BitmapInfo *bi) const |
BMMExport const MCHAR * | SetName (const MCHAR *n) |
Set the path to the image file. | |
BMMExport const MCHAR * | SetDevice (const MCHAR *d) |
Sets the device name. | |
Custom Input Processing | |
BMMExport WORD | CustWidth () const |
BMMExport WORD | CustHeight () const |
BMMExport void | SetCustWidth (WORD w) |
BMMExport void | SetCustHeight (WORD h) |
BMMExport int | StartFrame () const |
BMMExport int | EndFrame () const |
BMMExport void | SetStartFrame (int s) |
BMMExport void | SetEndFrame (int e) |
BMMExport void | SetCustomX (int x) |
BMMExport void | SetCustomY (int y) |
BMMExport int | GetCustomX () const |
BMMExport int | GetCustomY () const |
BMMExport void | SetCustomGamma (float g) |
BMMExport float | GetCustomGamma () const |
BMMExport float | GetEffectiveGamma () const |
BMMExport void | SetCustomStep (int s) |
BMMExport int | GetCustomStep () const |
BMMExport void | SetPresetAlignment (int p) |
BMMExport int | GetPresetAlignment () const |
Custom Input Flags | |
BMMExport DWORD | GetCustomFlags () const |
BMMExport void | SetCustomFlag (DWORD f) |
BMMExport void | ResetCustomFlag (DWORD f) |
BMMExport BOOL | TestCustomFlags (DWORD f) const |
Operators | |
BMMExport BitmapInfo & | operator= (const BitmapInfo &from) |
Get/Set Bitmap Properties | |
enum class | OutputColorConversionType : uint8_t { NoConversion = 0u , ColorSpaceConversion , DisplayViewTransform , Automatic } |
BMMExport WORD | Width () const |
BMMExport WORD | Height () const |
BMMExport float | Gamma () const |
BMMExport MSTR | ColorSpace () const |
Returns the name of the color space that's assigned to the bitmap. | |
BMMExport MaxSDK::ColorManagement::ColSpaceSource | ColorSpaceSource () const |
Returns color space assignment source. | |
BMMExport MaxSDK::ColorManagement::ColSpaceStatus | ColorSpaceStatus () const |
Returns the status of the color space assignment. | |
BMMExport MSTR | ColorSpaceRule () const |
Returns the input rule that's used for color space assignment. | |
BMMExport OutputColorConversionType | OutputColorConversion () const |
Returns the color conversion specified for an Bitmap output. | |
BMMExport MaxSDK::ColorManagement::ColSpaceStatus | SetOutputColorConversion (OutputColorConversionType outputConversion, const MSTR &colorSpaceOrDisplayRequested=MSTR(), const MSTR &viewTransformRequested=MSTR()) |
Sets the OutputColorConversion. | |
BMMExport MSTR | OutputColorSpace (MaxSDK::ColorManagement::ColSpaceStatus *status=nullptr, MSTR *colorSpaceRequested=nullptr) const |
Returns the assigned output color space. | |
BMMExport MSTR | OutputDisplay (MaxSDK::ColorManagement::ColSpaceStatus *status=nullptr, MSTR *displayRequested=nullptr) const |
Returns the assigned output display color space. | |
BMMExport MSTR | OutputViewTransform (MaxSDK::ColorManagement::ColSpaceStatus *status=nullptr, MSTR *viewTransformRequested=nullptr) const |
Returns the assigned output view transform. | |
BMMExport float | Aspect () const |
BMMExport int | Type () const |
BMMExport WORD | SetWidth (WORD s) |
BMMExport WORD | SetHeight (WORD u) |
BMMExport float | SetGamma (float c) |
BMMExport MSTR | GetRequestedColorSpace () const |
Returns the requested color space. | |
BMMExport MaxSDK::ColorManagement::ColSpaceStatus | SetRequestedColorSpace (const MSTR &colorSpaceName, MaxSDK::ColorManagement::ColSpaceSource requestSource) |
Sets the requested color space. | |
BMMExport MaxSDK::ColorManagement::ColSpaceSource | GetRequestedColorSpaceSource () const |
Returns the source of the color space request. | |
BMMExport MaxSDK::ColorManagement::ColSpaceStatus | ValidateColorSpace () |
Checks and validates the assigned color space against the currently available color spaces. | |
BMMExport void | ResetColorSpaceInfo () |
Clears all the color space information (including the requested and assigned color space data) to uninitialized state. | |
BMMExport float | SetAspect (float k) |
BMMExport int | SetType (int s) |
Additional Inherited Members | |
Static Public Member Functions inherited from MaxHeapOperators | |
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. | |
Information about an image file or in-memory bitmap, including settings for loading/saving, gamma, etc.
|
strong |
Enumerator | |
---|---|
NoConversion | |
ColorSpaceConversion | |
DisplayViewTransform | |
Automatic |
BMMExport BitmapInfo | ( | ) |
BMMExport BitmapInfo | ( | const MCHAR * | n | ) |
BMMExport BitmapInfo | ( | const MaxSDK::AssetManagement::AssetUser & | asset | ) |
BMMExport BitmapInfo | ( | const BitmapInfo & | bi | ) |
BMMExport ~BitmapInfo | ( | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the name of the color space that's assigned to the bitmap.
You can not directly set the color space of a bitmap, but you can request a color space via the SetRequestedColorSpace function. The system will assign a color space based on the available and requested color spaces. Based on the color space availability the assigned color space may be different from the requested color space. If no color space is requested, system will use input rules and/or other system heuristics to assign a suitable color space.
BMMExport MaxSDK::ColorManagement::ColSpaceSource ColorSpaceSource | ( | ) | const |
Returns color space assignment source.
This value indicates how the current color space is assigned to this bitmap (user request, rules etc).
BMMExport MaxSDK::ColorManagement::ColSpaceStatus ColorSpaceStatus | ( | ) | const |
Returns the status of the color space assignment.
Returns the input rule that's used for color space assignment.
BMMExport OutputColorConversionType OutputColorConversion | ( | ) | const |
Returns the color conversion specified for an Bitmap output.
BMMExport MaxSDK::ColorManagement::ColSpaceStatus SetOutputColorConversion | ( | OutputColorConversionType | outputConversion, |
const MSTR & | colorSpaceOrDisplayRequested = MSTR() , |
||
const MSTR & | viewTransformRequested = MSTR() |
||
) |
Sets the OutputColorConversion.
[in] | outputConversion | The OutputConversion to be used. If set to Automatic or NoConversion, no other parameter has to be present. |
[in] | colorSpaceOrDisplayRequested | If outputConversion is set to ColorSpaceConversion, pass the requested color space in here. If outputConversion is set to DisplayViewTransform, pass the requested Display in here. |
[in] | viewTransformRequested | If outputConversion is set to DisplayViewTransform, an optional view transform can be passed in here. |
BMMExport MSTR OutputColorSpace | ( | MaxSDK::ColorManagement::ColSpaceStatus * | status = nullptr , |
MSTR * | colorSpaceRequested = nullptr |
||
) | const |
Returns the assigned output color space.
If OutputColorConversion is set to ColorSpaceConversion, this function returns the assigned output color space, into that the image is converted during saving. Note that this can be different than what was requested, as not all color spaces may be available in the currently used OCIO config.
[out] | status | If this is passed in by the caller, it will receive the status of the output color space. |
[out] | colorSpaceRequested | If present, this will receive the output color space that was originally requested. |
BMMExport MSTR OutputDisplay | ( | MaxSDK::ColorManagement::ColSpaceStatus * | status = nullptr , |
MSTR * | displayRequested = nullptr |
||
) | const |
Returns the assigned output display color space.
If OutputColorConversion is set to DisplayViewTransform, this function returns the assigned display color space, into that the image is converted during saving, along with some optional view transform. Note that this can be different than what was requested, as not all display color spaces may be available in the currently used OCIO config.
[out] | status | If this is passed in by the caller, it will receive the status of the output display color space. |
[out] | displayRequested | If present, this will receive the output display that was originally requested. |
BMMExport MSTR OutputViewTransform | ( | MaxSDK::ColorManagement::ColSpaceStatus * | status = nullptr , |
MSTR * | viewTransformRequested = nullptr |
||
) | const |
Returns the assigned output view transform.
If OutputColorConversion is set to DisplayViewTransform, this function returns the assigned view transform, that is applied to the image during saving along with the conversion into the assigned display color space. Note that this can be different than what was requested, as not all view transforms may be available for the assigned display in the currently used OCIO config.
[out] | status | If this is passed in by the caller, it will receive the status of the output view transform. |
[out] | viewTransformRequested | If present, this will receive the output view transform that was originally requested. |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the requested color space.
Color space of a bitmap can not be directly set but can be requested either by the user or by the input rules. The system will assign a color space based on this request and the currently available color space. This function will return the requested color space. See ColorSpace for the currently assigned space.
BMMExport MaxSDK::ColorManagement::ColSpaceStatus SetRequestedColorSpace | ( | const MSTR & | colorSpaceName, |
MaxSDK::ColorManagement::ColSpaceSource | requestSource | ||
) |
Sets the requested color space.
The actual color space assigned may differ if the requested color space is not available. This function internally calls ValidateColorSpace to assign a color space based on the availability of the requested color space. Actually assigned color space may differ from the requested color space.
colorSpaceName | Name of the requested color space that's being requested. This is either based on the user selection or input rules. See IModSettings::GetNumFileIOColorSpaces for list of currently available spaces. |
requestSource | one of the ColSpaceSource enum values indicating why this color space is being requested. |
BMMExport MaxSDK::ColorManagement::ColSpaceSource GetRequestedColorSpaceSource | ( | ) | const |
Returns the source of the color space request.
BMMExport MaxSDK::ColorManagement::ColSpaceStatus ValidateColorSpace | ( | ) |
Checks and validates the assigned color space against the currently available color spaces.
If the assigned color space is missing or not available in the current setup, then it assigns a valid color space based on the requested color space, file input rules and other settings and/or heuristics.
Clears all the color space information (including the requested and assigned color space data) to uninitialized state.
After this function is called, the bitmap won't have any color space assigned to it before ValidateColorSpace or SetRequestedColorSpace is called. Various functions of the Bitmap class or other internal functions working on bitmaps may validate and auto assign a color space if the color space is in unassigned state.
|
inline |
|
inline |
|
inline |
Returns the currently set path of the image file.
BMMExport BOOL CompareName | ( | const BitmapInfo * | bi | ) | const |
Set the path to the image file.
This is a convenience method and calls SetPath under the hood.
n | New path for the bitmap. |
Sets the device name.
d | - The name to set. |
BMMExport MaxSDK::Util::Path GetPathEx | ( | ) | const |
Returns the currently set path of the image file.
BMMExport void CopyImageInfo | ( | const BitmapInfo * | from | ) |
from | The bitmap whose information will be copied. |
BMMExport void SetPath | ( | const MaxSDK::Util::Path & | path | ) |
Set the path to the image file.
path | New path for the bitmap. |
BMMExport const MaxSDK::AssetManagement::AssetUser & GetAsset | ( | ) | const |
returns this bitmap's asset
BMMExport void SetAsset | ( | const MaxSDK::AssetManagement::AssetUser & | assetUser | ) |
sets this bitmap's asset
param[in] assetUser the new asset
|
inline |
|
inline |
|
inline |
BMMExport float GetEffectiveGamma | ( | ) | const |
|
inline |
|
inline |
Returns the plugin data stored on the BitmapInfo.
The plugin data is set by BitmapIO class responsible for producing this image. The BitmapIO class stores its image specific data in the plugin data. For example, the avi BitmapIO class stores the compressor name, quality, and keyframe in the plugin data. The BitmapInfo owns the memory associated with the plugin data and will free the memory when deleted.
Sets the plugin data stored on the BitmapInfo.
This method is not normally called, rather a BitmapIO instance will call AllocPiData(), which will allocate the plugin data memory and set the plugin data size. The BitmapIO will then acquire the pointer to the plugin data memory via GetPiData()
[in] | ptr | Pointer to the plugin data. |
|
inline |
Returns the size of the plugin data stored on the BitmapInfo.
Sets the reported size of the plugin data stored on the BitmapInfo.
This method is not normally called, rather a BitmapIO instance will call AllocPiData(), which will allocate the plugin data memory and set the plugin data size. The BitmapIO will then acquire the pointer to the plugin data memory via GetPiData()
[in] | s | Reported size of the plugin data. |
Resets the plugin data stored on the BitmapInfo.
Frees existing plugin data memory and sets plugin data size to zero.
BMMExport BOOL AllocPiData | ( | DWORD | size | ) |
Allocates the plugin data memory and set the plugin data size.
Acquire the pointer to the plugin data memory via GetPiData()
[in] | size | Requested size of the plugin data. |
BMMExport void Copy | ( | const BitmapInfo * | from, |
BOOL | copyProxySubject = TRUE |
||
) |
Assignment function. The data members of the specified BitmapInfo are copied to this BitmapInfo, with option to also copy the proxySubject info.
BMMExport BitmapInfo & operator= | ( | const BitmapInfo & | from | ) |
BMMExport void EnumAuxFiles | ( | AssetEnumCallback & | assetEnum, |
DWORD | vflags | ||
) |
BMMExport BOOL Validate | ( | ) |
|
inline |
BMMExport DWORD GetGChannels | ( | ) |
BMMExport DWORD GetDeviceFlags | ( | ) |
BMMExport BOOL FixDeviceName | ( | ) |
Sets the appropriate device name, as derived from the filename.