ColorProfileInterface Class Reference

#include <gfx_image_colorprofile.h>

Detailed Description

This class allows to deal with color profiles. Color profiles are used to map colors from a given color space (e.g. image color space) into a destination color space (e.g. calibrated monitor).

Public Member Functions

MAXON_METHOD Bool IsEqual (const ColorProfileInterface *other) const
 
MAXON_METHOD Result< void > WriteProfileToMemory (WritableArrayInterface< Char > &mem) const
 
MAXON_METHOD Result< void > WriteProfileToFile (const Url &fn) const
 
MAXON_METHOD String GetInfo (COLORPROFILEINFO info) const
 
MAXON_METHOD UInt32 GetCrc () const
 
MAXON_METHOD Bool HasProfile () const
 
MAXON_METHOD Bool CheckCompatiblePixelFormat (const PixelFormat &pixelFormat) const
 
MAXON_METHOD Bool IsMonitorProfileMode () const
 
MAXON_METHOD HashInt GetHashCode () const
 
MAXON_METHOD ColorSpace GetColorSpace () const
 
MAXON_METHOD String ToString (const FormatStatement *formatStatement=nullptr) const
 

Static Public Member Functions

static MAXON_METHOD Result< ColorProfileOpenProfileFromFile (const Url &fn)
 
static MAXON_METHOD Result< ColorProfileOpenProfileFromMemory (const Block< const Byte > &mem)
 

Private Member Functions

 MAXON_INTERFACE_NONVIRTUAL (ColorProfileInterface, MAXON_REFERENCE_ALWAYS_COPY_ON_WRITE, "net.maxon.image.interface.colorprofile")
 

Member Function Documentation

◆ MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( ColorProfileInterface  ,
MAXON_REFERENCE_ALWAYS_COPY_ON_WRITE  ,
"net.maxon.image.interface.colorprofile"   
)
private

◆ IsEqual()

MAXON_METHOD Bool IsEqual ( const ColorProfileInterface other) const

◆ OpenProfileFromFile()

static MAXON_METHOD Result<ColorProfile> OpenProfileFromFile ( const Url fn)
static

Create a color profile from a Url.

Parameters
[in]fnUrl of the preset. This could be an icc file from the hard drive.
Returns
A valid color profile if the operation was successful.

◆ OpenProfileFromMemory()

static MAXON_METHOD Result<ColorProfile> OpenProfileFromMemory ( const Block< const Byte > &  mem)
static

Create a color profile from a memory block. This can be used to read the color profiles within images.

Parameters
[in]memMemory block representing the icc color profile.
Returns
A valid color profile if the operation was successful.

◆ WriteProfileToMemory()

MAXON_METHOD Result<void> WriteProfileToMemory ( WritableArrayInterface< Char > &  mem) const

Write the current profile to memory.

Parameters
[out]memArray which receives the memory.
Returns
True if the function operates successful.

◆ WriteProfileToFile()

MAXON_METHOD Result<void> WriteProfileToFile ( const Url fn) const

Write the current profile to a file stream.

Parameters
[in]fnName of the file/stream.
Returns
True if the function operates successful.

◆ GetInfo()

MAXON_METHOD String GetInfo ( COLORPROFILEINFO  info) const

Returns additional informations to the color profile.

Parameters
[in]infoRequested information. See COLORPROFILEINFO.
Returns
String with the information stored in the color profile.

◆ GetCrc()

MAXON_METHOD UInt32 GetCrc ( ) const

Returns the crc representing this color profile.

◆ HasProfile()

MAXON_METHOD Bool HasProfile ( ) const

Returns whether this object contains a valid color profile.

◆ CheckCompatiblePixelFormat()

MAXON_METHOD Bool CheckCompatiblePixelFormat ( const PixelFormat &  pixelFormat) const

Check the color profile if it's compatible with the given pixel format. 8e.g. if gray scale matches)

Returns
True if the pixel format is compatible with the color profile.

◆ IsMonitorProfileMode()

MAXON_METHOD Bool IsMonitorProfileMode ( ) const

Returns whether the color profile is linked to a color profile of a monitor.

◆ GetHashCode()

MAXON_METHOD HashInt GetHashCode ( ) const

Returns the hash code of the object.

◆ GetColorSpace()

MAXON_METHOD ColorSpace GetColorSpace ( ) const

Returns the color space for which the profile is valid.

◆ ToString()

MAXON_METHOD String ToString ( const FormatStatement formatStatement = nullptr) const

Returns a readable string of the content.

Parameters
[in]formatStatementNullptr or additional formatting instruction. Currently no additional formatting instructions are supported.
Returns
The converted result. By default, this is the name of the class, followed by @, followed by the hexadecimal memory address of this object.