Hot Door CORE 0.8.3
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreGradient.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_GRADIENT__
8#define __HDI_CORE_GRADIENT__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include "hdicoreArtColor.h"
13
14namespace hdi
15{
16 namespace aip
17 {
18 class Gradient;
19 }
20
21 namespace core
22 {
27 {
28 public:
32 enum Type
33 {
34 UnknownGradientType = 0,
35 LinearGradientType = 10,
36 RadialGradientType = 20
37 };
38
42 class Stop
43 {
44 public:
51 double midPoint;
52
58 double rampPoint;
59
64
69 double opacity;
70
77
85 Stop(const Stop& s_);
86
98 const double midPt_,
99 const double rampPt_,
100 const ArtColor& color_,
101 const double opacity_
102 );
103
109 virtual ~Stop();
110
119 Stop& operator=(const Stop& rhs_);
120 };
121
122 typedef std::unique_ptr<Stop> StopUP;
123 typedef std::shared_ptr<Stop> StopSP;
124 typedef std::weak_ptr<Stop> StopWP;
125
138
146 Gradient(const Gradient& grad_);
147
155 static Gradient create();
156
162 virtual ~Gradient();
163
173 virtual Gradient& operator=(const Gradient& rhs_);
174
185 virtual bool dispose();
186
198 virtual AIGradientHandle aiGradientHandle() const;
199
207 virtual bool isEmpty() const;
208
216 virtual bool valid() const;
217
225 virtual Type gradientType() const;
226
234 virtual void setGradientType(const Type type_);
235
244 virtual bool operator==(const Gradient& rhs_) const;
245
254 virtual bool operator!=(const Gradient& rhs_) const;
255
263 virtual std::string name() const;
264
272 virtual void setName(const std::string& name_);
273
281 virtual int16_t stopCount() const;
282
291 virtual std::unique_ptr<Stop> stopAtIndex(const int16_t index_);
292
302 virtual bool setStopAtIndex(const int16_t index_, const Stop& stop_);
303
316 virtual bool insertStopAtIndex(const int16_t index_, Stop& stop__);
317
327 virtual bool removeStopAtIndex(const int16_t index_, Stop& stop__);
328
341 virtual bool colorAtPosition(const double tVal_, ArtColor& color__);
342
343
344 protected:
348 void* _data;
349
355 void* _impl() const;
356
357
358 private:
359 friend aip::Gradient* __accessImpl(const Gradient&);
360 friend Gradient __accessCtor(aip::Gradient*&);
361
367 Gradient(aip::Gradient*&);
368 };
369
370 typedef std::unique_ptr<Gradient> GradientUP;
371 typedef std::shared_ptr<Gradient> GradientSP;
372 typedef std::weak_ptr<Gradient> GradientWP;
373
374 extern aip::Gradient* __accessImpl(const Gradient&);
375 extern Gradient __accessCtor(aip::Gradient*&);
376 }
377}
378
379#endif
380// HDI_CORE_AIP_MODE
381
382#endif
383// __HDI_CORE_GRADIENT__
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:40
Describes the attributes of a gradient stop.
Definition: hdicoreGradient.h:43
double opacity
The opacity value for the gradient stop, in the range [0,1]. 0 is completely transparent and 1 is com...
Definition: hdicoreGradient.h:69
Stop(const double midPt_, const double rampPt_, const ArtColor &color_, const double opacity_)
Constructs a new Stop object with the given values.
double midPoint
The location between two ramp points where there is an equal mix of this color and the color of the n...
Definition: hdicoreGradient.h:51
ArtColor color
The color for the target gradient stop.
Definition: hdicoreGradient.h:63
double rampPoint
The position on the blend ramp where this color begins, in the range [0,1]. The first point does not ...
Definition: hdicoreGradient.h:58
Stop()
Constructs a new Stop object with default values.
Stop & operator=(const Stop &rhs_)
Overloaded assignment operator to copy values from one Stop object to another.
virtual ~Stop()
Destructs a Stop object.
Stop(const Stop &s_)
Constructs a new Stop object with values from an existing Stop.
Handles general gradient-related functionality.
Definition: hdicoreGradient.h:27
void * _data
Private implementation data.
Definition: hdicoreGradient.h:348
virtual bool operator!=(const Gradient &rhs_) const
Tests whether a given Gradient object is not the same as another.
virtual bool operator==(const Gradient &rhs_) const
Tests whether a given Gradient object is the same as another.
virtual void setName(const std::string &name_)
Sets the name of the gradient.
virtual bool setStopAtIndex(const int16_t index_, const Stop &stop_)
Sets a gradient stop at the given index.
void * _impl() const
Internal use only.
virtual Gradient & operator=(const Gradient &rhs_)
Assigns one Gradient object to another.
static Gradient create()
Creates a new Gradient object (and Illustrator gradient)
Gradient(const Gradient &grad_)
Constructs a new Gradient object from an existing Gradient object (copy constructor)
virtual AIGradientHandle aiGradientHandle() const
Gets the gradient handle around which the target object is wrapped.
virtual bool colorAtPosition(const double tVal_, ArtColor &color__)
Gets the color at a given "t-value" (position) on a gradient ramp.
Gradient()
Constructs an empty Gradient object.
virtual bool removeStopAtIndex(const int16_t index_, Stop &stop__)
Removes a gradient stop at the given index.
virtual void setGradientType(const Type type_)
Sets the type of gradient the target object is representing.
Type
Indicates the type of "gradient" an object is representing.
Definition: hdicoreGradient.h:33
virtual Type gradientType() const
Gets the type of gradient the target object is representing.
virtual bool dispose()
Removes the gradient from its document.
virtual ~Gradient()
Gradient object destructor.
virtual int16_t stopCount() const
Gets the number of stops (color transition or ramp points) in the target gradient.
virtual bool insertStopAtIndex(const int16_t index_, Stop &stop__)
Inserts a gradient stop at the given index.
virtual std::unique_ptr< Stop > stopAtIndex(const int16_t index_)
Gets a gradient stop at the given index.
virtual bool isEmpty() const
Gets whether the target Gradient object is empty (constructed with the default ctor)
virtual bool valid() const
Tests the validity of the target gradient by searching for it in the document.
virtual std::string name() const
Gets the name of the gradient.
Header file for art color manipulation.