MGD::PROFILE Class Reference

In-memory representataion of an ICM profile. More...

#include <mi32/mg2cms.h>

List of all members.

Classes

class  LISTENTRY
 PROFILE::LISTENTRY used to retrieve a list of PROFILES available on the current system. More...
struct  PRIMARIES
 Predefined primaries for custom RGB profiles. More...
struct  WHITEPOINT
 Standard Whitepoints Call EnumerateWhitePoints() to retrieve a list of pre-defined white points. More...

Public Types

enum  BUILTIN_PROFILE {
  PROFILE_NONE = -1, PROFILE_sRGB = 0, PROFILE_XYZ, PROFILE_LAB,
  PROFILE_AdobeRGB_1998, PROFILE_AppleRGB
}
enum  CLASS {
  CLASS_Unspecified = 0, CLASS_Input = 0x73636E72L, CLASS_Display = 0x6D6E7472L, CLASS_Output = 0x70727472L,
  CLASS_Link = 0x6C696E6BL, CLASS_Abstract = 0x61627374L, CLASS_ColorSpace = 0x73706163L, CLASS_NamedColor = 0x6e6d636cL
}
enum  ICMCOLORSPACE {
  ICMCOLORSPACE_XYZ = 0x58595A20L, ICMCOLORSPACE_Lab = 0x4C616220L, ICMCOLORSPACE_Luv = 0x4C757620L, ICMCOLORSPACE_YCbCr = 0x59436272L,
  ICMCOLORSPACE_Yxy = 0x59787920L, ICMCOLORSPACE_RGB = 0x52474220L, ICMCOLORSPACE_Gray = 0x47524159L, ICMCOLORSPACE_HSV = 0x48535620L,
  ICMCOLORSPACE_HLS = 0x484C5320L, ICMCOLORSPACE_CMYK = 0x434D594BL, ICMCOLORSPACE_CMY = 0x434D5920L, ICMCOLORSPACE_2Color = 0x32434C52L,
  ICMCOLORSPACE_3Color = 0x33434C52L, ICMCOLORSPACE_4Color = 0x34434C52L, ICMCOLORSPACE_5Color = 0x35434C52L, ICMCOLORSPACE_6Color = 0x36434C52L,
  ICMCOLORSPACE_7Color = 0x37434C52L, ICMCOLORSPACE_8Color = 0x38434C52L
}
enum  INTENT { INTENT_Perceptual = 0, INTENT_RelativeColorimetric = 1, INTENT_Saturation = 2, INTENT_AbsoluteColorimetric = 3 }
enum  TAG {
  TAG_AToB0 = 0x41324230L, TAG_AToB1 = 0x41324231L, TAG_AToB2 = 0x41324232L, TAG_BlueColorant = 0x6258595AL,
  TAG_BlueTRC = 0x62545243L, TAG_BToA0 = 0x42324130L, TAG_BToA1 = 0x42324131L, TAG_BToA2 = 0x42324132L,
  TAG_CalibrationDateTime = 0x63616C74L, TAG_CharTarget = 0x74617267L, TAG_Copyright = 0x63707274L, TAG_CrdInfo = 0x63726469L,
  TAG_DeviceMfgDesc = 0x646D6E64L, TAG_DeviceModelDesc = 0x646D6464L, TAG_Gamut = 0x67616D74L, TAG_GrayTRC = 0x6b545243L,
  TAG_GreenColorant = 0x6758595AL, TAG_GreenTRC = 0x67545243L, TAG_Luminance = 0x6C756d69L, TAG_Measurement = 0x6D656173L,
  TAG_MediaBlackPoint = 0x626B7074L, TAG_MediaWhitePoint = 0x77747074L, TAG_NamedColor = 0x6E636f6CL, TAG_NamedColor2 = 0x6E636C32L,
  TAG_Preview0 = 0x70726530L, TAG_Preview1 = 0x70726531L, TAG_Preview2 = 0x70726532L, TAG_ProfileDescription = 0x64657363L,
  TAG_ProfileSequenceDesc = 0x70736571L, TAG_Ps2CRD0 = 0x70736430L, TAG_Ps2CRD1 = 0x70736431L, TAG_Ps2CRD2 = 0x70736432L,
  TAG_Ps2CRD3 = 0x70736433L, TAG_Ps2CSA = 0x70733273L, TAG_RenderingIntent = 0x70733269L, TAG_RedColorant = 0x7258595AL,
  TAG_RedTRC = 0x72545243L, TAG_ScreeningDesc = 0x73637264L, TAG_Screening = 0x7363726EL, TAG_Technology = 0x74656368L,
  TAG_UcrBg = 0x62666420L, TAG_ViewingCondDesc = 0x76756564L, TAG_ViewingConditions = 0x76696577L
}
enum  USAGE { USAGE_Input = 0, USAGE_Output = 1, USAGE_Proof = 2 }

Public Member Functions

 PROFILE (const PROFILE &rhs)
 PROFILE (BUILTIN_PROFILE builtin)
 PROFILE ()
 ~PROFILE ()
ERRVALUE Create (const PROFILEPARMS_PRINTER &parms)
ERRVALUE Create (const PROFILEPARMS_RGB &parms)
ERRVALUE CreateBuiltInProfile (BUILTIN_PROFILE profile)
ERRVALUE CreateDeviceLinkProfile (TRANSFORM &transform, UINT32 flags)
ERRVALUE CreateGrayProfile (const COLORxyY &WhitePoint, const GAMMA &TransferFunction)
ERRVALUE CreateInkLimitingProfile (double limit, COLORSPACE ColorSpace)
ERRVALUE CreateRGBProfile (const COLORxyY &WhitePoint, const PRIMARIES &Primaries, const GAMMA &TransferFunctionRed, const GAMMA &TransferFunctionGreen, const GAMMA &TransferFunctionBlue)
void Free ()
bool GetColorants (COLORXYZ &red, COLORXYZ &green, COLORXYZ &blue) const
ICMCOLORSPACE GetColorSpace () const
void GetDesc (MISTRING &) const
CLASS GetDeviceClass () const
bool GetIluminant (COLORXYZ &illuminant) const
bool GetMediaBlackPoint (COLORXYZ &blackpoint) const
bool GetMediaWhitePoint (COLORXYZ &whitepoint) const
void GetName (MISTRING &) const
ICMCOLORSPACE GetPCS () const
INTENT GetRenderingIntent () const
bool HasTag (TAG sig) const
bool IsEmpty () const
bool operator!= (const PROFILE &rhs) const
PROFILEoperator= (const PROFILE &rhs)
bool operator== (const PROFILE &rhs) const
ERRVALUE Read (const FILEPATH &path)
ERRVALUE ReadFromMemory (const void *buf, int size)
bool SupportsIntent (INTENT intent, USAGE use) const

Static Public Member Functions

static ERRVALUE EnumeratePrimaries (MILIST< PRIMARIES > &List)
static ERRVALUE EnumerateProfiles (CLASS ProfileClass, MILIST< LISTENTRY > &List)
static ERRVALUE EnumerateWhitePoints (MILIST< WHITEPOINT > &List)
static bool WhitePointFromTemp (int tempK, COLORxyY &WhitePoint)

Detailed Description

In-memory representataion of an ICM profile.


Member Enumeration Documentation

Profiles which can be hard-coded without the need for a file.

Enumerator:
PROFILE_NONE 

so we can initialize to "not set"

PROFILE_sRGB 
PROFILE_XYZ 
PROFILE_LAB 
PROFILE_AdobeRGB_1998 
PROFILE_AppleRGB 

Profile class.

Enumerator:
CLASS_Unspecified 
CLASS_Input 

'scnr'

CLASS_Display 

'mntr'

CLASS_Output 

'prtr'

CLASS_Link 

'link'

CLASS_Abstract 

'abst'

CLASS_ColorSpace 

'spac'

CLASS_NamedColor 

'nmcl'

Enumerator:
ICMCOLORSPACE_XYZ 

'XYZ '

ICMCOLORSPACE_Lab 

'Lab '

ICMCOLORSPACE_Luv 

'Luv '

ICMCOLORSPACE_YCbCr 

'YCbr'

ICMCOLORSPACE_Yxy 

'Yxy '

ICMCOLORSPACE_RGB 

'RGB '

ICMCOLORSPACE_Gray 

'GRAY'

ICMCOLORSPACE_HSV 

'HSV '

ICMCOLORSPACE_HLS 

'HLS '

ICMCOLORSPACE_CMYK 

'CMYK'

ICMCOLORSPACE_CMY 

'CMY '

ICMCOLORSPACE_2Color 

'2CLR'

ICMCOLORSPACE_3Color 

'3CLR'

ICMCOLORSPACE_4Color 

'4CLR'

ICMCOLORSPACE_5Color 

'5CLR'

ICMCOLORSPACE_6Color 

'6CLR'

ICMCOLORSPACE_7Color 

'7CLR'

ICMCOLORSPACE_8Color 

'8CLR'

Rendering Intent.

Enumerator:
INTENT_Perceptual 

The default.

INTENT_RelativeColorimetric 
INTENT_Saturation 
INTENT_AbsoluteColorimetric 

ICM Profile tags.

These are only used to see if a profile has a given tag, and eventually to retrieve data for specific tags

Enumerator:
TAG_AToB0 

'A2B0'

TAG_AToB1 

'A2B1'

TAG_AToB2 

'A2B2'

TAG_BlueColorant 

'bXYZ'

TAG_BlueTRC 

'bTRC'

TAG_BToA0 

'B2A0'

TAG_BToA1 

'B2A1'

TAG_BToA2 

'B2A2'

TAG_CalibrationDateTime 

'calt'

TAG_CharTarget 

'targ'

TAG_Copyright 

'cprt'

TAG_CrdInfo 

'crdi'

TAG_DeviceMfgDesc 

'dmnd'

TAG_DeviceModelDesc 

'dmdd'

TAG_Gamut 

'gamt '

TAG_GrayTRC 

'kTRC'

TAG_GreenColorant 

'gXYZ'

TAG_GreenTRC 

'gTRC'

TAG_Luminance 

'lumi'

TAG_Measurement 

'meas'

TAG_MediaBlackPoint 

'bkpt'

TAG_MediaWhitePoint 

'wtpt'

TAG_NamedColor 
TAG_NamedColor2 

'ncl2'

TAG_Preview0 

'pre0'

TAG_Preview1 

'pre1'

TAG_Preview2 

'pre2'

TAG_ProfileDescription 

'desc'

TAG_ProfileSequenceDesc 

'pseq'

TAG_Ps2CRD0 

'psd0'

TAG_Ps2CRD1 

'psd1'

TAG_Ps2CRD2 

'psd2'

TAG_Ps2CRD3 

'psd3'

TAG_Ps2CSA 

'ps2s'

TAG_RenderingIntent 

'ps2i'

TAG_RedColorant 

'rXYZ'

TAG_RedTRC 

'rTRC'

TAG_ScreeningDesc 

'scrd'

TAG_Screening 

'scrn'

TAG_Technology 

'tech'

TAG_UcrBg 

'bfd '

TAG_ViewingCondDesc 

'vued'

TAG_ViewingConditions 

'view'

Profile usage. Used as a parameter to SupportsIntent().

Enumerator:
USAGE_Input 
USAGE_Output 
USAGE_Proof 

Constructor & Destructor Documentation

MGD::PROFILE::PROFILE (  )  [inline]

Default constructor Empty profile until Open or something els/PRIM is called.

MGD::PROFILE::PROFILE ( BUILTIN_PROFILE  builtin  )  [inline]
MGD::PROFILE::PROFILE ( const PROFILE rhs  ) 

Copy constructor Copy is "cheap" as the actual data is refcounted.

MGD::PROFILE::~PROFILE (  ) 

Destructor (note: not virtual.

No derived classes)


Member Function Documentation

ERRVALUE MGD::PROFILE::Create ( const PROFILEPARMS_PRINTER parms  ) 
ERRVALUE MGD::PROFILE::Create ( const PROFILEPARMS_RGB parms  ) 
ERRVALUE MGD::PROFILE::CreateBuiltInProfile ( BUILTIN_PROFILE  profile  ) 

Create an sRGB or LAB profile, which can be hard-coded.

ERRVALUE MGD::PROFILE::CreateDeviceLinkProfile ( TRANSFORM transform,
UINT32  flags 
)

Create a profile which combines all the profiles in a transform into a single profile.

Parameters:
flags XXX Define enum for whatever flags it wants
ERRVALUE MGD::PROFILE::CreateGrayProfile ( const COLORxyY WhitePoint,
const GAMMA TransferFunction 
)
ERRVALUE MGD::PROFILE::CreateInkLimitingProfile ( double  limit,
COLORSPACE  ColorSpace 
)

cmsTransfor2DeviceLink(transform, dwFlags) flags: cmsFLAGS_HIGHRESPRECALC cmsFLAGS_LOWRESPRECALD

Create an ink-limiting device link profile.

Parameters:
limit Ink limit (0 to 400%)
ColorSpace XXX default to CMYK
ERRVALUE MGD::PROFILE::CreateRGBProfile ( const COLORxyY WhitePoint,
const PRIMARIES Primaries,
const GAMMA TransferFunctionRed,
const GAMMA TransferFunctionGreen,
const GAMMA TransferFunctionBlue 
)

Create an RGB profile from a whitepoint, 3 primaries and 3 gamma tables.

Some common primaries can be found using the function EnumeratePrimaries()

static ERRVALUE MGD::PROFILE::EnumeratePrimaries ( MILIST< PRIMARIES > &  List  )  [static]

Return a list of RGB primaries for custom RGB spaces.

The order of entries in this list may change. Do not depend on position within the list. The COLORxyY values may change if more accurate values are found. The names and numeric IDs will not change for a given entry and may be safely written to a file to record which entry was selected. The numeric ID is also useful for populating ComboBoxes

static ERRVALUE MGD::PROFILE::EnumerateProfiles ( CLASS  ProfileClass,
MILIST< LISTENTRY > &  List 
) [static]

Return a list of profiles for a given device class.

static ERRVALUE MGD::PROFILE::EnumerateWhitePoints ( MILIST< WHITEPOINT > &  List  )  [static]

Return the list of standard White points.

The order of entries in this list may change. Do not depend on position within the list. The COLORxyY values may change if more accurate values are found. The names and numeric IDs will not change for a given entry and may be safely written to a file to record which entry was selected.

For WhitePoints which are temperatures in degrees Kelvin, the numeric ID is actually the temperature. For the others, (Illuminant A, etc), they're just arbitrary numbers.

void MGD::PROFILE::Free (  ) 
bool MGD::PROFILE::GetColorants ( COLORXYZ red,
COLORXYZ green,
COLORXYZ blue 
) const

Get the CIEXYZ values of R,G,and B.

ICMCOLORSPACE MGD::PROFILE::GetColorSpace (  )  const
void MGD::PROFILE::GetDesc ( MISTRING  )  const

Return the description of the profile.

CLASS MGD::PROFILE::GetDeviceClass (  )  const

cmsGetColorSpace

Return the device class (input, output, whatever)

bool MGD::PROFILE::GetIluminant ( COLORXYZ illuminant  )  const

Get the Iluminant.

bool MGD::PROFILE::GetMediaBlackPoint ( COLORXYZ blackpoint  )  const

Get the media Black Point.

bool MGD::PROFILE::GetMediaWhitePoint ( COLORXYZ whitepoint  )  const

Get the media White Point.

void MGD::PROFILE::GetName ( MISTRING  )  const

Return the name of the profile.

ICMCOLORSPACE MGD::PROFILE::GetPCS (  )  const

Get the PCS color space XXX (What is the PCS color space and how is it different from cmsGetColorSpace()?

INTENT MGD::PROFILE::GetRenderingIntent (  )  const

Return the default rendering intent.

bool MGD::PROFILE::HasTag ( TAG  sig  )  const

Return true if the profile contains the specified ICM tag.

bool MGD::PROFILE::IsEmpty (  )  const [inline]
bool MGD::PROFILE::operator!= ( const PROFILE rhs  )  const [inline]
PROFILE& MGD::PROFILE::operator= ( const PROFILE rhs  ) 

Assignment operator.

Assignment is "cheap" as the actual data is refcounted

bool MGD::PROFILE::operator== ( const PROFILE rhs  )  const

Comparison operator.

ERRVALUE MGD::PROFILE::Read ( const FILEPATH path  ) 

Open an ICM profile file.

ERRVALUE MGD::PROFILE::ReadFromMemory ( const void *  buf,
int  size 
)

Actual implementation will call cmsOpenProfileFromFile(filaname, "r");.

Parameters:
buf XXX Actual cmsOpenProfileFromMem takes non-const but makes a copy
bool MGD::PROFILE::SupportsIntent ( INTENT  intent,
USAGE  use 
) const

returns true if the profile supports the given intent.

static bool MGD::PROFILE::WhitePointFromTemp ( int  tempK,
COLORxyY WhitePoint 
) [static]

Convert a tempature to a CIExyY color.

Returns true if the whitepoint could be computed, or false if the tempeture is not valid.

Parameters:
tempK Temperature in degrees Kelvin
WhitePoint Color returned

The documentation for this class was generated from the following file:

Generated on Sun Oct 7 21:35:20 2012 for TNTsdk 2012 by  doxygen 1.6.1