Mako 8.2.0 API
MakoCore SDK API Documentation
Loading...
Searching...
No Matches
idomcolor.h
Go to the documentation of this file.
1/*
2* Copyright (C) 2007-2025 Global Graphics Software Ltd. All rights reserved.
3*/
4
5#ifndef EDLIDOMCOLOR_H
6#define EDLIDOMCOLOR_H
7
10#include <edl/edltypes.h>
11#include <edl/iedlobject.h>
12#include <edl/icolormanager.h>
13#include <edl/idomcolorspace.h>
14#include <edl/idomresources.h>
15#include <edl/idomhashable.h>
16#include <edl/edlvector.h>
17
19
20class IDOMColor;
22
23
39class IDOMColor : public IEDLObject, public IDOMHashable
40{
41#define IDOMColorClassID 0x4a33f930, 0xc5d64967, 0xaa600a12, 0x78eb3212
42 public:
43
44 virtual ~IDOMColor ()
45 {}
46
54 static IDOMColorPtr createSolidGray(IEDLClassFactory *pFactory, float gray = 0.0f)
55 {
56 return IDOMColor::create(pFactory, IDOMColorSpaceDeviceGray::create(pFactory), 1.0f, gray);
57 }
58
68 static IDOMColorPtr createSolidRgb(IEDLClassFactory *pFactory, float r = 0.0f, float g = 0.0f, float b = 0.0f)
69 {
70 return IDOMColor::create(pFactory, IDOMColorSpaceDeviceRGB::create(pFactory), 1.0f, r, g, b);
71 }
72
83 static IDOMColorPtr createSolidCmyk(IEDLClassFactory *pFactory, float c = 0.0f, float m = 0.0f, float y = 0.0f, float k = 0.0f)
84 {
85 return IDOMColor::create(pFactory, IDOMColorSpaceDeviceCMYK::create(pFactory), 1.0f, c, m, y, k);
86 }
87
97 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component);
98
109 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2);
110
122 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3);
123
136 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4);
137
151 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5);
152
167 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5, double component6);
168
210 static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha,
211 double component1, double component2, double component3, double component4, double component5,
212 double component6, double component7, double component8 = 0.0, double component9 = 0.0, double component10 = 0.0,
213 double component11 = 0.0, double component12 = 0.0, double component13 = 0.0, double component14 = 0.0, double component15 = 0.0,
214 double component16 = 0.0, double component17 = 0.0, double component18 = 0.0, double component19 = 0.0, double component20 = 0.0,
215 double component21 = 0.0, double component22 = 0.0, double component23 = 0.0, double component24 = 0.0, double component25 = 0.0,
216 double component26 = 0.0, double component27 = 0.0, double component28 = 0.0, double component29 = 0.0, double component30 = 0.0,
217 double component31 = 0.0, double component32 = 0.0
218 );
219
230 static EDL_API IDOMColorPtr createFromVect(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, float alpha, const CEDLVector<float> &components);
231
232#ifdef SWIG
233#if SWIGJAVA
234 %apply float[] { const float *components };
235#endif
236#if SWIGCSHARP
237 %apply float INPUT [] { const float *components };
238#endif
239#endif
250 static EDL_API IDOMColorPtr createFromArray(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, float alpha, const float *components);
251#ifdef SWIG
252 %clear const float *components;
253#endif
254
259 static const CClassID &classID()
260 {
261 static CClassID id(IDOMColorClassID);
262 return id;
263 };
264
275 virtual float getAlpha() const = 0;
276
281 virtual void setAlpha(float a) = 0;
282
295 virtual IDOMColorSpacePtr getColorSpace () = 0;
296
308 virtual void setColorSpace(const IDOMColorSpacePtr &colorSpace, bool setDefaultColor = true) = 0;
309
333 virtual void setColorSpace(const IDOMColorSpacePtr &colorSpace,
334 eRenderingIntent intent,
336 IEDLClassFactory *pFactory,
337 const CColorManagerConfigPtr &overrideConfig = CColorManagerConfigPtr()) = 0;
338
344 virtual float getComponentValue(uint32 component) = 0;
345
352 virtual void setComponentValue(uint32 component, float value) = 0;
353
375 virtual bool testGamut(IEDLClassFactory *pFactory,
376 const IDOMColorSpacePtr &colorSpace,
377 eRenderingIntent intent,
379 const CColorManagerConfigPtr &overrideConfig = CColorManagerConfigPtr()) = 0;
380
381};
382#define edlobj2IDOMColor(src) edl_cast((IDOMColor *)NULL, src)
383
384
386
387#endif /* __EDLIDOMCOLOR_H__ */
An object to represent a 128-bit globally unique ID.
Definition objclassid.h:29
Definition edlvector.h:30
Holds a single color value. The color values themselves are held as floating point values for all col...
Definition idomcolor.h:40
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4)
Simplified color creation routine for color spaces that take four components. Throws an IEDLError on ...
virtual void setAlpha(float a)=0
Sets the alpha channel value.
virtual void setComponentValue(uint32 component, float value)=0
Sets a component value. The value will be clipped to the range of the color space,...
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2)
Simplified color creation routine for color spaces using two components. Throws an IEDLError on failu...
static const CClassID & classID()
Retrieves the class id of IDOMColor.
Definition idomcolor.h:259
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5, double component6, double component7, double component8=0.0, double component9=0.0, double component10=0.0, double component11=0.0, double component12=0.0, double component13=0.0, double component14=0.0, double component15=0.0, double component16=0.0, double component17=0.0, double component18=0.0, double component19=0.0, double component20=0.0, double component21=0.0, double component22=0.0, double component23=0.0, double component24=0.0, double component25=0.0, double component26=0.0, double component27=0.0, double component28=0.0, double component29=0.0, double component30=0.0, double component31=0.0, double component32=0.0)
Simplified color creation routine for color spaces that take any number of components from 7 through ...
static IDOMColorPtr createSolidGray(IEDLClassFactory *pFactory, float gray=0.0f)
Simplified color creation for DeviceGray colors. Default parameters will yield an opaque DeviceGray b...
Definition idomcolor.h:54
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5)
Simplified color creation routine for color spaces that take five components. Throws an IEDLError on ...
static EDL_API IDOMColorPtr createFromArray(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, float alpha, const float *components)
Simplified color creation routine. Throws an IEDLError on failure.
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3)
Simplified color creation routine for color spaces using three components. Throws an IEDLError on fai...
static IDOMColorPtr createSolidCmyk(IEDLClassFactory *pFactory, float c=0.0f, float m=0.0f, float y=0.0f, float k=0.0f)
Simplified color creation for DeviceCMYK colors. Default parameters will yield an opaque DeviceCMYK w...
Definition idomcolor.h:83
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component1, double component2, double component3, double component4, double component5, double component6)
Simplified color creation routine for color spaces that take six components. Throws an IEDLError on f...
virtual void setColorSpace(const IDOMColorSpacePtr &colorSpace, eRenderingIntent intent, eBlackPointCompensation bpc, IEDLClassFactory *pFactory, const CColorManagerConfigPtr &overrideConfig=CColorManagerConfigPtr())=0
Set the color space, converting color values from the previous color space to the new.
virtual bool testGamut(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &colorSpace, eRenderingIntent intent, eBlackPointCompensation bpc, const CColorManagerConfigPtr &overrideConfig=CColorManagerConfigPtr())=0
Tests the color is within the color gamut for the given color space.
virtual float getComponentValue(uint32 component)=0
Retrieves the value of a component.
virtual IDOMColorSpacePtr getColorSpace()=0
Retrieves the color space.
virtual ~IDOMColor()
Definition idomcolor.h:44
static EDL_API IDOMColorPtr createFromVect(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, float alpha, const CEDLVector< float > &components)
Simplified color creation routine. Throws an IEDLError on failure.
virtual void setColorSpace(const IDOMColorSpacePtr &colorSpace, bool setDefaultColor=true)=0
Set the color space.
static EDL_API IDOMColorPtr create(IEDLClassFactory *pFactory, const IDOMColorSpacePtr &space, double alpha, double component)
Simplified color creation routine for color spaces using a single component. Throws an IEDLError on f...
virtual float getAlpha() const =0
Retrieves the alpha channel value. The alpha channel value specifies the transparency of the color.
static IDOMColorPtr createSolidRgb(IEDLClassFactory *pFactory, float r=0.0f, float g=0.0f, float b=0.0f)
Simplified color creation for DeviceRGB colors. Default parameters will yield an opaque DeviceRGB bla...
Definition idomcolor.h:68
static EDL_API IDOMColorSpaceDeviceCMYKPtr create(IEDLClassFactory *pFactory)
Create a DeviceCMYK Color Space. Throws an IEDLError on failure.
static EDL_API IDOMColorSpaceDeviceGrayPtr create(IEDLClassFactory *pFactory)
Create a DeviceGray Color Space. Throws an IEDLError on failure.
static EDL_API IDOMColorSpaceDeviceRGBPtr create(IEDLClassFactory *pFactory)
Create a DeviceRGB Color Space. Throws an IEDLError on failure.
Abstract interface for objects that can be hashed.
Definition idomhashable.h:28
EDL Factory Interface allows one part of the EDL infrastructure to register class creation methods id...
Definition iedlfactory.h:31
IEDLObject is an abstract base class that is used by all classes that are intended to be created via ...
Definition iedlobject.h:53
#define _END_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:110
#define _BEGIN_EDL_DOM_NAMESPACE
Definition edlnamespaces.h:109
EDL "standard" types including known bit-length signed and unsigned integer type[def]s and definition...
unsigned int uint32
Definition edltypes.h:34
#define EDL_API
Definition edltypes.h:86
Simple template vector class for general use.
eBlackPointCompensation
Black point compensation enumeration.
Definition edlblackpointcompensation.h:17
eRenderingIntent
Rendering intent enumeration.
Definition edlrenderingintent.h:17
#define IDOMColorClassID
Definition idomcolor.h:41
IDOMResources interface.
#define DECL_SMART_PTR(cls)
Definition smartptr.h:211