7#ifndef __HDI_CORE_ART_COLOR__
8#define __HDI_CORE_ART_COLOR__
13#if defined(HDI_CORE_AIP_MODE)
20 #if defined(HDI_CORE_AIP_MODE)
31 #if defined(HDI_CORE_AIP_MODE)
59 #if defined(HDI_CORE_AIP_MODE)
61 TypeNamedRGB = 1 << 10,
62 TypeNamedCMYK = 1 << 11,
63 TypeNamedLab = 1 << 12,
66 TypePattern = 1 << 20,
67 TypeGradient = 1 << 21,
72 AnonymousTypes = (TypeGray | TypeRGB | TypeCMYK | TypeLab | TypeHSB),
74 #
if defined(HDI_CORE_AIP_MODE)
75 NamedTypes = (TypeNamedRGB | TypeNamedCMYK | TypeNamedLab)
79 #if defined(HDI_CORE_AIP_MODE)
86 SpotColorFlag = 1 << 0,
87 RegistrationColorFlag = 1 << 1
144 (
RGB)(
const double r_,
const double g_,
const double b_);
185 typedef std::unique_ptr<RGB> RGBUP;
186 typedef std::shared_ptr<RGB> RGBSP;
187 typedef std::weak_ptr<RGB> RGBWP;
240 (
CMYK)(
const double c_,
const double m_,
const double y_,
const double k_);
281 typedef std::unique_ptr<CMYK> CMYKUP;
282 typedef std::shared_ptr<CMYK> CMYKSP;
283 typedef std::weak_ptr<CMYK> CMYKWP;
330 Lab(
const double l_,
const double a_,
const double b_);
371 typedef std::unique_ptr<Lab> LabUP;
372 typedef std::shared_ptr<Lab> LabSP;
373 typedef std::weak_ptr<Lab> LabWP;
420 HSB(
const Angle& h_,
const double s_,
const double b_);
461 typedef std::unique_ptr<HSB> HSBUP;
462 typedef std::shared_ptr<HSB> HSBSP;
463 typedef std::weak_ptr<HSB> HSBWP;
553 typedef std::unique_ptr<Channels> ChannelsUP;
554 typedef std::shared_ptr<Channels> ChannelsSP;
555 typedef std::weak_ptr<Channels> ChannelsWP;
557 #if defined(HDI_CORE_AIP_MODE)
646 const double length_,
649 const double hiliteLength_
671 typedef std::unique_ptr<GradientStyle> GradientStyleUP;
672 typedef std::shared_ptr<GradientStyle> GradientStyleSP;
673 typedef std::weak_ptr<GradientStyle> GradientStyleWP;
774 const double shiftDist_,
776 const double scaleX_,
777 const double scaleY_,
805 typedef std::unique_ptr<PatternStyle> PatternStyleUP;
806 typedef std::shared_ptr<PatternStyle> PatternStyleSP;
807 typedef std::weak_ptr<PatternStyle> PatternStyleWP;
849 ArtColor(
const double rVal_,
const double gVal_,
const double bVal_);
861 ArtColor(
const double cVal_,
const double mVal_,
const double yVal_,
const double kVal_);
863 #if defined(HDI_CORE_AIP_MODE)
926 #if defined(HDI_CORE_PSP_MODE)
934 virtual bool isEmpty()
const;
947 #if defined(HDI_CORE_AIP_MODE)
955 virtual std::string
name()
const;
1029 #if defined(HDI_CORE_AIP_MODE)
1068 const std::string& name_,
1069 const double tint_ = 0.0,
1255 #if defined(HDI_CORE_PSP_MODE)
1289 static bool fastConvert8(
1335 static bool fastConvert16(
1337 const uint16_t in1_,
1338 const uint16_t in2_,
1339 const uint16_t in3_,
1340 const uint16_t in4_,
1370 static bool fastConvertBitmap8(
1373 uint32_t*
const bitmap__,
1374 const uint32_t nPixels_
1399 static bool fastConvertBitmap16(
1402 uint64_t*
const bitmap__,
1403 const uint32_t nPixels_
1410 #if defined(HDI_CORE_AIP_MODE)
1411 friend aip::ArtColor* __accessImpl(
const ArtColor&);
1412 friend ArtColor __accessCtor(
const aip::ArtColor&);
1417 aip::ArtColor* __impl;
1425 #elif defined(HDI_CORE_PSP_MODE)
1433 typedef std::unique_ptr<ArtColor> ArtColorUP;
1434 typedef std::shared_ptr<ArtColor> ArtColorSP;
1435 typedef std::weak_ptr<ArtColor> ArtColorWP;
1437 #if defined(HDI_CORE_AIP_MODE)
1438 extern aip::ArtColor* __accessImpl(
const ArtColor&);
1439 extern ArtColor __accessCtor(
const aip::ArtColor&);
1445#if defined(HDI_CORE_AIP_MODE)
Describes an angle, and allows for easy conversion between various units.
Definition hdicoreAngle.h:26
Stores all the possible representations of a color-based ArtColor in all supported color models; the ...
Definition hdicoreArtColor.h:97
Channels & operator=(const Channels &rhs_)
Channels assignment operator.
Channels()
Constructs a new Channels object with default values.
CMYK cmyk
Stores the CMYK channels.
Definition hdicoreArtColor.h:485
virtual ~Channels()
Destructs a Channels object.
Lab lab
Stores the Lab channels.
Definition hdicoreArtColor.h:490
Type master
Stores the "master" type of channel data stored in the target object. The gray, rgb,...
Definition hdicoreArtColor.h:470
double gray
Stores the grayscale color gray channel (0.0 is white, 1.0 is black).
Definition hdicoreArtColor.h:475
HSB hsb
Stores the HSB channels.
Definition hdicoreArtColor.h:495
Channels(const Type master_, const double gray_, const RGB &rgb_, const CMYK &cmyk_, const Lab &lab_, const HSB &hsb_)
Constructs a new Channels object with the given values.
Channels(const Channels &obj_)
Constructs a new Channels object from an existing Channels.
RGB rgb
Stores the RGB channels.
Definition hdicoreArtColor.h:480
Describes a gradient that has been applied to some art.
Definition hdicoreArtColor.h:562
GradientStyle & operator=(const GradientStyle &rhs_)
GradientStyle assignment operator.
core::Angle highlightAngle
For a radial gradient, the angle to the blend highlight point. Not used for linear gradients.
Definition hdicoreArtColor.h:605
core::Gradient * gradient
Gradient to which the style applies. The lifetime of the object is only as long as the GradientStyle ...
Definition hdicoreArtColor.h:569
GradientStyle(const core::Gradient &gradient_, const core::ArtboardPoint &origin_, const core::Angle &angle_, const double length_, const core::TransformMatrix &matrix_, const core::Angle &hiliteAngle_, const double hiliteLength_)
Constructs a new GradientStyle object with the given values.
double length
For a linear gradient, the distance in points over which the gradient ramp is applied....
Definition hdicoreArtColor.h:590
GradientStyle(const GradientStyle &grad_)
Constructs a new GradientStyle object from an existing GradientStyle.
GradientStyle()
Constructs a new GradientStyle object with default values.
core::TransformMatrix matrix
The accumulated transformations of the gradient. It is not necessarily the same as the transformation...
Definition hdicoreArtColor.h:599
core::Angle angle
For a linear gradient, the angle of the gradient in degrees from the X axis. The ramp extends from th...
Definition hdicoreArtColor.h:583
core::ArtboardPoint origin
For a linear gradient, the origin of the gradient in page coordinates, which is 0 on the gradient ram...
Definition hdicoreArtColor.h:575
virtual ~GradientStyle()
Destructs a GradientStyle object.
double highlightLength
For a radial gradient, the distance of the hilight from the origin expressed as a fraction of the rad...
Definition hdicoreArtColor.h:611
Describes a pattern that has been applied to some art.
Definition hdicoreArtColor.h:679
PatternStyle(const PatternStyle &patt_)
Constructs a new PatternStyle object from an existing PatternStyle.
core::TransformMatrix transform
Additional transformation arising from manipulating the path.
Definition hdicoreArtColor.h:737
core::Angle reflectAngle
Axis around which to reflect.
Definition hdicoreArtColor.h:722
virtual ~PatternStyle()
Destructs a PatternStyle object.
core::Angle shearAxis
Axis to shear with respect to.
Definition hdicoreArtColor.h:732
core::Angle shearAngle
Angle to slant the shear by.
Definition hdicoreArtColor.h:727
core::Angle rotation
Angle to rotate the prototype before filling.
Definition hdicoreArtColor.h:712
PatternStyle(const core::Pattern &pattern_, const double shiftDist_, const core::Angle &shiftAngle_, const double scaleX_, const double scaleY_, const core::Angle &rotation_, const bool reflect_, const core::Angle &reflectAngle_, const core::Angle &shearAngle_, const core::Angle &shearAxis_, const core::TransformMatrix &transform_)
Constructs a new PatternStyle object with the given values.
PatternStyle()
Constructs a new PatternStyle object with default values.
bool reflect
When true, the prototype is reflected before filling.
Definition hdicoreArtColor.h:717
double scaleY
Fraction to scale the prototype along the y-axis before filling.
Definition hdicoreArtColor.h:707
double scaleX
Fraction to scale the prototype along the x-axis before filling.
Definition hdicoreArtColor.h:702
double shiftDistance
Distance to translate the unscaled prototype before filling, measured from the ruler origin.
Definition hdicoreArtColor.h:692
PatternStyle & operator=(const PatternStyle &rhs_)
PatternStyle assignment operator.
core::Pattern * pattern
Pattern to which the style applies. The lifetime of the object is only as long as the PatternStyle wh...
Definition hdicoreArtColor.h:686
core::Angle shiftAngle
Angle to translate the unscaled prototype before filling.
Definition hdicoreArtColor.h:697
Describes the color of art on the artboard.
Definition hdicoreArtColor.h:42
static ArtColor purple()
Static accessor to return an ArtColor object for pure purple.
virtual bool operator==(const ArtColor &rhs_) const
Allows two ArtColor objects to be compared with the == operator.
virtual GradientStyle gradient() const
Gets the underlying gradient style for the target ArtColor.
NamedFlags
Option flags for use when creating a named color.
Definition hdicoreArtColor.h:84
virtual ArtColor & operator=(const ArtColor &rhs_)
Allows one ArtColor object to be assigned from another.
static ArtColor cyan()
Static accessor to return an ArtColor object for pure cyan.
virtual ArtColor asGray() const
Gets the target ArtColor object in a grayscale format.
static ArtColor FromHSB(const Angle &hVal_, const double sVal_, const double bVal_)
Constructs a HSB ArtColor object from its color components.
virtual std::string name() const
Gets the name of a custom color.
virtual ArtColor asCMYK() const
Gets the target ArtColor object in a CMYK format.
static ArtColor red()
Static accessor to return an ArtColor object for pure red.
Type
Describes the format/type of an ArtColor object.
Definition hdicoreArtColor.h:48
static ArtColor darkGray()
Static accessor to return an ArtColor object for pure white (75% black).
static ArtColor FromLab(const double lVal_, const double aVal_, const double bVal_)
Constructs a Lab ArtColor object from its color components.
virtual NamedFlags namedFlags() const
Gets the flags for a "named" color, if any.
virtual bool makeNamed(const std::string &name_, const double tint_=0.0, const NamedFlags flags_=SpotColorFlag)
Converts an "anonymous" color to a "named" color.
static ArtColor none()
Static accessor to return an ArtColor object for "none".
virtual ArtColor asRGB() const
Gets the target ArtColor object in an RGB format.
ArtColor(const ArtColor &c_)
Constructs an ArtColor object from an existing ArtColor object (copy constructor).
virtual ~ArtColor()
Destructs an ArtColor object.
static ArtColor yellow()
Static accessor to return an ArtColor object for pure yellow.
ArtColor()
Constructs an ArtColor object that hasn't been assigned.
ArtColor(const double cVal_, const double mVal_, const double yVal_, const double kVal_)
Constructs a CMYK ArtColor object from four color components in the range [0.0,1.0].
static ArtColor blue()
Static accessor to return an ArtColor object for pure blue.
static ArtColor black()
Static accessor to return an ArtColor object for pure white (100% black).
ArtColor(const double rVal_, const double gVal_, const double bVal_)
Constructs an RGB ArtColor object from three color components in the range [0.0,1....
ArtColor(const Color &c_)
Constructs an ArtColor object from an existing Color object.
virtual ArtColor asLab() const
Gets the target ArtColor object in a Lab format.
virtual double namedTint() const
Gets the tint for a "named" color, if any.
static ArtColor magenta()
Static accessor to return an ArtColor object for pure magenta.
static ArtColor gray()
Static accessor to return an ArtColor object for pure white (50% black).
static ArtColor lightGray()
Static accessor to return an ArtColor object for pure white (25% black).
virtual Type colorType() const
Gets the type/format of the color.
static ArtColor green()
Static accessor to return an ArtColor object for pure green.
ArtColor(const double grayVal_)
Constructs a grayscale ArtColor object from a single color component in the range [0....
virtual PatternStyle pattern() const
Gets the underlying pattern for the target ArtColor.
virtual bool operator!=(const ArtColor &rhs_) const
Allows two ArtColor objects to be compared with the != operator.
static ArtColor white()
Static accessor to return an ArtColor object for pure white (0% black).
ArtColor(const PatternStyle &ps_)
Constructs an ArtColor object from a PatternStyle.
virtual ArtColor asHSB() const
Gets the target ArtColor object in a HSB format.
static ArtColor orange()
Static accessor to return an ArtColor object for pure orange.
ArtColor(const GradientStyle &gs_)
Constructs an ArtColor object from a GradientStyle.
virtual Channels channels() const
Gets the underlying channel data for the target ArtColor.
Describes a point on the Illustrator artboard.
Definition hdicoreArtboardPoint.h:31
Describes an RGB color, with opacity, typically for UI purposes.
Definition hdicoreColor.h:34
Handles general gradient-related functionality.
Definition hdicoreGradient.h:27
Handles general pattern-related functionality.
Definition hdicorePattern.h:30
Header file for describing angles.
Header file for geometric point manipulation on the Illustrator artboard.
Header file for describing 2D dimensions (width and height).
Describes a set of CMYK channels.
Definition hdicoreArtColor.h:193
CMYK()
Constructs a CMYK object with default values.
double black
Stores the CMYK color black channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:212
double cyan
Stores the CMYK color cyan channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:197
bool operator==(const CMYK &rhs_) const
Tests whether a given CMYK object is the same as another.
double magenta
Stores the CMYK color magenta channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:202
CMYK & operator=(const CMYK &rhs_)
CMYK assignment operator.
bool operator!=(const CMYK &rhs_) const
Tests whether a given CMYK object is not the same as another.
double yellow
Stores the CMYK color yellow channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:207
Describes a set of HSB channels.
Definition hdicoreArtColor.h:379
virtual ~HSB()
Destructs a HSB object.
HSB & operator=(const HSB &rhs_)
HSB assignment operator.
Angle hue
Stores the HSB color hue channel.
Definition hdicoreArtColor.h:383
bool operator==(const HSB &rhs_) const
Tests whether a given HSB object is the same as another.
HSB()
Constructs a HSB object with default values.
bool operator!=(const HSB &rhs_) const
Tests whether a given HSB object is not the same as another.
double saturation
Stores the HSB color saturation channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:388
double brightness
Stores the HSB color brightness channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:393
HSB(const HSB &obj_)
Constructs a new HSB object from an existing HSB.
HSB(const Angle &h_, const double s_, const double b_)
Constructs a new HSB object with the given values.
Describes a set of Lab channels.
Definition hdicoreArtColor.h:289
double a
Stores the Lab color a-dimension channel, in the range [-1.0,1.0].
Definition hdicoreArtColor.h:298
Lab(const double l_, const double a_, const double b_)
Constructs a new Lab object with the given values.
bool operator==(const Lab &rhs_) const
Tests whether a given Lab object is the same as another.
double lightness
Stores the Lab color lightness channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:293
bool operator!=(const Lab &rhs_) const
Tests whether a given Lab object is not the same as another.
Lab & operator=(const Lab &rhs_)
Lab assignment operator.
Lab(const Lab &obj_)
Constructs a new Lab object from an existing Lab.
virtual ~Lab()
Destructs a Lab object.
double b
Stores the Lab color b-dimension channel, in the range [-1.0,1.0].
Definition hdicoreArtColor.h:303
Lab()
Constructs a Lab object with default values.
Describes a set of RGB channels.
Definition hdicoreArtColor.h:103
double red
Stores the RGB color red channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:107
bool operator!=(const RGB &rhs_) const
Tests whether a given RGB object is not the same as another.
RGB()
Constructs an RGB object with default values.
double blue
Stores the RGB color blue channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:117
RGB & operator=(const RGB &rhs_)
RGB assignment operator.
bool operator==(const RGB &rhs_) const
Tests whether a given RGB object is the same as another.
double green
Stores the RGB color green channel, in the range [0.0,1.0].
Definition hdicoreArtColor.h:112