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)
29 #if defined(HDI_CORE_AIP_MODE)
57 #if defined(HDI_CORE_AIP_MODE)
59 TypeNamedRGB = 1 << 10,
60 TypeNamedCMYK = 1 << 11,
61 TypeNamedLab = 1 << 12,
64 TypePattern = 1 << 20,
65 TypeGradient = 1 << 21,
70 AnonymousTypes = (TypeGray | TypeRGB | TypeCMYK | TypeLab | TypeHSB),
72 #
if defined(HDI_CORE_AIP_MODE)
73 NamedTypes = (TypeNamedRGB | TypeNamedCMYK | TypeNamedLab)
77 #if defined(HDI_CORE_AIP_MODE)
84 SpotColorFlag = 1 << 0,
85 RegistrationColorFlag = 1 << 1
142 (
RGB)(
const double r_,
const double g_,
const double b_);
183 typedef std::unique_ptr<RGB> RGBUP;
184 typedef std::shared_ptr<RGB> RGBSP;
185 typedef std::weak_ptr<RGB> RGBWP;
238 (
CMYK)(
const double c_,
const double m_,
const double y_,
const double k_);
279 typedef std::unique_ptr<CMYK> CMYKUP;
280 typedef std::shared_ptr<CMYK> CMYKSP;
281 typedef std::weak_ptr<CMYK> CMYKWP;
328 Lab(
const double l_,
const double a_,
const double b_);
369 typedef std::unique_ptr<Lab> LabUP;
370 typedef std::shared_ptr<Lab> LabSP;
371 typedef std::weak_ptr<Lab> LabWP;
418 HSB(
const Angle& h_,
const double s_,
const double b_);
459 typedef std::unique_ptr<HSB> HSBUP;
460 typedef std::shared_ptr<HSB> HSBSP;
461 typedef std::weak_ptr<HSB> HSBWP;
551 typedef std::unique_ptr<Channels> ChannelsUP;
552 typedef std::shared_ptr<Channels> ChannelsSP;
553 typedef std::weak_ptr<Channels> ChannelsWP;
555 #if defined(HDI_CORE_AIP_MODE)
644 const double length_,
647 const double hiliteLength_
669 typedef std::unique_ptr<GradientStyle> GradientStyleUP;
670 typedef std::shared_ptr<GradientStyle> GradientStyleSP;
671 typedef std::weak_ptr<GradientStyle> GradientStyleWP;
772 const double shiftDist_,
774 const double scaleX_,
775 const double scaleY_,
803 typedef std::unique_ptr<PatternStyle> PatternStyleUP;
804 typedef std::shared_ptr<PatternStyle> PatternStyleSP;
805 typedef std::weak_ptr<PatternStyle> PatternStyleWP;
836 ArtColor(
const double rVal_,
const double gVal_,
const double bVal_);
848 ArtColor(
const double cVal_,
const double mVal_,
const double yVal_,
const double kVal_);
850 #if defined(HDI_CORE_AIP_MODE)
912 #if defined(HDI_CORE_PSP_MODE)
920 virtual bool isEmpty()
const;
933 #if defined(HDI_CORE_AIP_MODE)
941 virtual std::string
name()
const;
1015 #if defined(HDI_CORE_AIP_MODE)
1054 const std::string& name_,
1055 const double tint_ = 0.0,
1213 #if defined(HDI_CORE_PSP_MODE)
1247 static bool fastConvert8(
1293 static bool fastConvert16(
1295 const uint16_t in1_,
1296 const uint16_t in2_,
1297 const uint16_t in3_,
1298 const uint16_t in4_,
1328 static bool fastConvertBitmap8(
1331 uint32_t*
const bitmap__,
1332 const uint32_t nPixels_
1357 static bool fastConvertBitmap16(
1360 uint64_t*
const bitmap__,
1361 const uint32_t nPixels_
1368 #if defined(HDI_CORE_AIP_MODE)
1369 friend aip::ArtColor* __accessImpl(
const ArtColor&);
1370 friend ArtColor __accessCtor(
const aip::ArtColor&);
1375 aip::ArtColor* __impl;
1383 #elif defined(HDI_CORE_PSP_MODE)
1391 typedef std::unique_ptr<ArtColor> ArtColorUP;
1392 typedef std::shared_ptr<ArtColor> ArtColorSP;
1393 typedef std::weak_ptr<ArtColor> ArtColorWP;
1395 #if defined(HDI_CORE_AIP_MODE)
1396 extern aip::ArtColor* __accessImpl(
const ArtColor&);
1397 extern ArtColor __accessCtor(
const aip::ArtColor&);
1403#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:95
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:483
virtual ~Channels()
Destructs a Channels object.
Lab lab
Stores the Lab channels.
Definition: hdicoreArtColor.h:488
Type master
Stores the "master" type of channel data stored in the target object. The gray, rgb,...
Definition: hdicoreArtColor.h:468
double gray
Stores the grayscale color gray channel (0.0 is white, 1.0 is black)
Definition: hdicoreArtColor.h:473
HSB hsb
Stores the HSB channels.
Definition: hdicoreArtColor.h:493
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:478
Describes a gradient that has been applied to some art.
Definition: hdicoreArtColor.h:560
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:603
core::Gradient * gradient
Gradient to which the style applies. The lifetime of the object is only as long as the GradientStyle ...
Definition: hdicoreArtColor.h:567
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:588
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:597
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:581
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:573
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:609
Describes a pattern that has been applied to some art.
Definition: hdicoreArtColor.h:677
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:735
core::Angle reflectAngle
Axis around which to reflect.
Definition: hdicoreArtColor.h:720
virtual ~PatternStyle()
Destructs a PatternStyle object.
core::Angle shearAxis
Axis to shear with respect to.
Definition: hdicoreArtColor.h:730
core::Angle shearAngle
Angle to slant the shear by.
Definition: hdicoreArtColor.h:725
core::Angle rotation
Angle to rotate the prototype before filling.
Definition: hdicoreArtColor.h:710
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:715
double scaleY
Fraction to scale the prototype along the y-axis before filling.
Definition: hdicoreArtColor.h:705
double scaleX
Fraction to scale the prototype along the x-axis before filling.
Definition: hdicoreArtColor.h:700
double shiftDistance
Distance to translate the unscaled prototype before filling, measured from the ruler origin.
Definition: hdicoreArtColor.h:690
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:684
core::Angle shiftAngle
Angle to translate the unscaled prototype before filling.
Definition: hdicoreArtColor.h:695
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:40
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:82
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:46
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....
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
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:191
double black
Stores the CMYK color black channel, in the range [0.0,1.0].
Definition: hdicoreArtColor.h:210
() CMYK()
Constructs a CMYK object with default values.
virtual ~CMYK()
Destructs a CMYK object.
double cyan
Stores the CMYK color cyan channel, in the range [0.0,1.0].
Definition: hdicoreArtColor.h:195
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:200
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:205
Describes a set of HSB channels.
Definition: hdicoreArtColor.h:377
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:381
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:386
double brightness
Stores the HSB color brightness channel, in the range [0.0,1.0].
Definition: hdicoreArtColor.h:391
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:287
double a
Stores the Lab color a-dimension channel, in the range [-1.0,1.0].
Definition: hdicoreArtColor.h:296
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:291
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:301
Lab()
Constructs a Lab object with default values.
Describes a set of RGB channels.
Definition: hdicoreArtColor.h:101
double red
Stores the RGB color red channel, in the range [0.0,1.0].
Definition: hdicoreArtColor.h:105
bool operator!=(const RGB &rhs_) const
Tests whether a given RGB object is not the same as another.
virtual ~RGB()
Destructs an RGB object.
double blue
Stores the RGB color blue channel, in the range [0.0,1.0].
Definition: hdicoreArtColor.h:115
RGB & operator=(const RGB &rhs_)
RGB assignment operator.
() RGB()
Constructs an RGB object with default values.
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:110