ColorProfile Class Reference

#include <c4d_basebitmap.h>

Inheritance diagram for ColorProfile:

Detailed Description

Color Profile custom data type.

Note
Has to be created with Alloc() and destroyed with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Public Types

enum  COLORPROFILEINFO {
  COLORPROFILEINFO_DESCRIPTION ,
  COLORPROFILEINFO_MANUFACTURER ,
  COLORPROFILEINFO_MODEL ,
  COLORPROFILEINFO_COPYRIGHT ,
  COLORPROFILEINFO_NAME
}
 

Private Member Functions

 ColorProfile ()
 
 ~ColorProfile ()
 
 ColorProfile (const ColorProfile &src)
 

Alloc/Free

static ColorProfileAlloc ()
 
static void Free (ColorProfile *&profile)
 

Default Color Profiles

static const ColorProfileGetDefaultSRGB ()
 
static const ColorProfileGetDefaultLinearRGB ()
 
static const ColorProfileGetDefaultSGray ()
 
static const ColorProfileGetDefaultLinearGray ()
 
const maxon::ColorProfile & GetInternalProfile () const
 
void SetInternalProfile (const maxon::ColorProfile &profile)
 

Operators

ColorProfileoperator= (const ColorProfile &src)
 
Bool operator== (const ColorProfile &src) const
 
Bool operator!= (const ColorProfile &src) const
 

Open/Write from File/Memory

Bool OpenProfileFromFile (const Filename &fn)
 
Bool OpenProfileFromMemory (const void *mem, Int64 memsize)
 
Bool WriteProfileToFile (const Filename &fn) const
 
Bool WriteProfileToMemory (void *&mem, Int64 &memsize) const
 

Monitor Color Profile

Bool IsMonitorProfileMode () const
 
Bool SetMonitorProfileMode (Bool on)
 

Miscellaneous

Bool CheckColorMode (COLORMODE colormode) const
 
Bool CreateDefaultWindow (GeDialog *dlg)
 
String GetInfo (COLORPROFILEINFO info) const
 
Bool HasProfile () const
 

Constructor & Destructor Documentation

◆ ColorProfile() [1/2]

ColorProfile ( )
private

◆ ~ColorProfile()

~ColorProfile ( )
private

◆ ColorProfile() [2/2]

ColorProfile ( const ColorProfile src)
private

Member Function Documentation

◆ Alloc()

static ColorProfile* Alloc ( )
static

Allocates a color profile data. Destroy the allocated color profile data with Free(). Use AutoAlloc to automate the allocation and destruction based on scope.

Returns
The allocated color profile data, or nullptr if the allocation failed.

◆ Free()

static void Free ( ColorProfile *&  profile)
static

Destructs color profile data allocated with Alloc(). Use AutoAlloc to automate the allocation and destruction based on scope.

Parameters
[in]profileThe color profile data to destruct. If the pointer is nullptr nothing happens. The pointer is assigned nullptr afterwards.

◆ operator=()

ColorProfile& operator= ( const ColorProfile src)

Assigns src to the color profile.

Parameters
[in]srcThe source color profile.
Returns
*this color profile.

◆ operator==()

Bool operator== ( const ColorProfile src) const

Checks if *this and src color profiles are identical.

Parameters
[in]srcThe source color profile to compare with.
Returns
true if the color profiles are identical, otherwise false.

◆ operator!=()

Bool operator!= ( const ColorProfile src) const

Checks if *this and src color profiles are not identical.

Parameters
[in]srcThe source color profile to compare with.
Returns
true if the color profiles are not identical, otherwise false.

◆ OpenProfileFromFile()

Bool OpenProfileFromFile ( const Filename fn)

Loads the color profile data from the given file.

Parameters
[in]fnThe filename of the color profile file.
Returns
true if successful, otherwise false.

◆ OpenProfileFromMemory()

Bool OpenProfileFromMemory ( const void *  mem,
Int64  memsize 
)

Loads the color profile from the memory location mem.

Parameters
[in]memThe pointer to the memory buffer containing the color profile. The caller owns the pointed memory buffer.
[in]memsizeThe size of the memory buffer mem.
Returns
true if successful, otherwise false.

◆ WriteProfileToFile()

Bool WriteProfileToFile ( const Filename fn) const

Writes the color profile data to the given file.

Parameters
[in]fnThe filename of the color profile file.
Returns
true if successful, otherwise false.

◆ WriteProfileToMemory()

Bool WriteProfileToMemory ( void *&  mem,
Int64 memsize 
) const

Writes the color profile to memory location mem.

Parameters
[out]memAssigned a pointer to the color profile. The caller owns the pointed memory buffer.
[out]memsizeAssigned the size of the written memory buffer mem.
Returns
true if successful, otherwise false.

◆ IsMonitorProfileMode()

Bool IsMonitorProfileMode ( ) const

Checks if the color profile is linked to the monitor color profile.

Returns
true if the color profile is linked to the monitor color profile, otherwise false.

◆ SetMonitorProfileMode()

Bool SetMonitorProfileMode ( Bool  on)

Links the color profile to the monitor color profile.

Parameters
[in]ontrue to link the color profile to the monitor profile, otherwise false.
Returns
true if successful, otherwise false.

◆ CheckColorMode()

Bool CheckColorMode ( COLORMODE  colormode) const

Checks if the color profile is compatible with the passed color mode.

Parameters
[in]colormodeThe color mode to check: COLORMODE
Returns
true if the color profile is compatible with the passed color mode, otherwise false.

◆ CreateDefaultWindow()

Bool CreateDefaultWindow ( GeDialog dlg)

Retrieves the monitor color profile of the passed dialog window.

Parameters
[in]dlgThe dialog window to obtain the monitor color profile for. The caller owns the pointed dialog.
Returns
true successful, otherwise false.

◆ GetInfo()

String GetInfo ( COLORPROFILEINFO  info) const

Retrieves information about the color profile.

Parameters
[in]infoThe type of information: COLORPROFILEINFO
Returns
The information string.

◆ HasProfile()

Bool HasProfile ( ) const

Checks if the color profile exists.

Returns
true if the object contains a color profile, otherwise false.

◆ GetDefaultSRGB()

static const ColorProfile* GetDefaultSRGB ( )
static

Retrieves Cinema 4D's default sRGB color profile.

Returns
The default sRGB color profile. Cinema 4D owns the pointed ColorProfile.

◆ GetDefaultLinearRGB()

static const ColorProfile* GetDefaultLinearRGB ( )
static

Retrieves Cinema 4D's default linear color profile.

Returns
The default linear color profile. Cinema 4D owns the pointed ColorProfile.

◆ GetDefaultSGray()

static const ColorProfile* GetDefaultSGray ( )
static

Retrieves Cinema 4D's default sRGB grayscale color profile.

Returns
The default sRGB grayscale color profile. Cinema 4D owns the pointed ColorProfile.

◆ GetDefaultLinearGray()

static const ColorProfile* GetDefaultLinearGray ( )
static

Retrieves Cinema 4D's default linear grayscale color profile.

Returns
The default linear grayscale color profile. Cinema 4D owns the pointed ColorProfile.

◆ GetInternalProfile()

const maxon::ColorProfile& GetInternalProfile ( ) const

Retrieves the internal color profile. Private.

Since
R19
Returns
The internal color profile.

◆ SetInternalProfile()

void SetInternalProfile ( const maxon::ColorProfile &  profile)

Sets the internal color profile. Private.

Since
R2023
Parameters
[in]profileThe new profile.