Hot Door CORE  0.7.0
Adobe® Illustrator® Plug-in Library
hdicoreGradient.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_GRADIENT__
8 #define __HDI_CORE_GRADIENT__
9 
10 #include "hdicoreArtColor.h"
11 
12 namespace hdi
13 {
14  namespace plugin
15  {
16  class Gradient;
17  }
18 
19  namespace core
20  {
24  class Gradient
25  {
26  public:
30  enum Type
31  {
32  UnknownGradientType = 0,
33  LinearGradientType = 10,
34  RadialGradientType = 20
35  };
36 
40  class Stop
41  {
42  public:
49  double midPoint;
50 
56  double rampPoint;
57 
62 
67  double opacity;
68 
74  Stop();
75 
83  Stop(const Stop& s_);
84 
95  Stop(
96  const double midPt_,
97  const double rampPt_,
98  const ArtColor& color_,
99  const double opacity_
100  );
101 
107  virtual ~Stop();
108 
117  Stop& operator=(const Stop& rhs_);
118  };
119 
120  typedef std::auto_ptr<Stop> StopAP;
121 
133  Gradient();
134 
142  Gradient(const Gradient& grad_);
143 
151  static Gradient create();
152 
158  virtual ~Gradient();
159 
169  virtual Gradient& operator=(const Gradient& rhs_);
170 
181  virtual bool dispose();
182 
194  virtual AIGradientHandle aiGradientHandle() const;
195 
203  virtual bool isEmpty() const;
204 
212  virtual bool valid() const;
213 
221  virtual Type gradientType() const;
222 
230  virtual void setGradientType(const Type type_);
231 
240  virtual bool operator==(const Gradient& rhs_) const;
241 
250  virtual bool operator!=(const Gradient& rhs_) const;
251 
259  virtual std::string name() const;
260 
268  virtual void setName(const std::string& name_);
269 
277  virtual int16_t stopCount() const;
278 
287  virtual std::auto_ptr<Stop> stopAtIndex(const int16_t index_);
288 
298  virtual bool setStopAtIndex(const int16_t index_, const Stop& stop_);
299 
312  virtual bool insertStopAtIndex(const int16_t index_, Stop& stop__);
313 
323  virtual bool removeStopAtIndex(const int16_t index_, Stop& stop__);
324 
337  virtual bool colorAtPosition(const double tVal_, ArtColor& color__);
338 
339 
340  protected:
344  void* _data;
345 
351  void* _impl() const;
352 
353 
354  private:
355  friend plugin::Gradient* __accessImpl(const Gradient&);
356  friend Gradient __accessCtor(plugin::Gradient*&);
357 
363  Gradient(plugin::Gradient*&);
364  };
365 
366  typedef std::auto_ptr<Gradient> GradientAP;
367 
368  extern plugin::Gradient* __accessImpl(const Gradient&);
369  extern Gradient __accessCtor(plugin::Gradient*&);
370  }
371 }
372 
373 #endif
374 // __HDI_CORE_GRADIENT__
Stop & operator=(const Stop &rhs_)
Overloaded assignment operator to copy values from one Stop object to another.
static Gradient create()
Creates a new Gradient object (and Illustrator gradient)
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:49
Header file for Illustrator art color manipulation.
virtual bool colorAtPosition(const double tVal_, ArtColor &color__)
Gets the color at a given "t-value" (position) on a gradient ramp.
virtual bool operator!=(const Gradient &rhs_) const
Tests whether a given Gradient object is not the same as another.
virtual std::string name() const
Gets the name of the gradient.
virtual bool isEmpty() const
Gets whether the target Gradient object is empty (constructed with the default ctor) ...
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.
virtual int16_t stopCount() const
Gets the number of stops (color transition or ramp points) in the target gradient.
virtual Type gradientType() const
Gets the type of gradient the target object is representing.
Stop()
Constructs a new Stop object with default values.
void * _data
Private implementation data.
Definition: hdicoreGradient.h:344
Describes the attributes of a gradient stop.
Definition: hdicoreGradient.h:40
virtual std::auto_ptr< Stop > stopAtIndex(const int16_t index_)
Gets a gradient stop at the given index.
ArtColor color
The color for the target gradient stop.
Definition: hdicoreGradient.h:61
Gradient()
Constructs an empty Gradient object.
void * _impl() const
Internal use only.
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:56
Definition: hdicoreaiArray.h:12
virtual bool setStopAtIndex(const int16_t index_, const Stop &stop_)
Sets a gradient stop at the given index.
virtual Gradient & operator=(const Gradient &rhs_)
Assigns one Gradient object to another.
Handles general gradient-related functionality.
Definition: hdicoreGradient.h:24
virtual bool operator==(const Gradient &rhs_) const
Tests whether a given Gradient object is the same as another.
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:67
virtual AIGradientHandle aiGradientHandle() const
Gets the gradient handle around which the target object is wrapped.
virtual bool dispose()
Removes the gradient from its document.
virtual bool insertStopAtIndex(const int16_t index_, Stop &stop__)
Inserts a gradient stop at the given index.
virtual ~Stop()
Destructs a Stop object.
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:32
virtual ~Gradient()
Gradient object destructor.
virtual void setName(const std::string &name_)
Sets the name of the gradient.
Type
Indicates the type of "gradient" an object is representing.
Definition: hdicoreGradient.h:30
virtual bool valid() const
Tests the validity of the target gradient by searching for it in the document.