Hot Door CORE  0.7.1
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__
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.
void * _data
Private implementation data.
Definition: hdicoreGradient.h:344
Describes the attributes of a gradient stop.
Definition: hdicoreGradient.h:40
ArtColor color
The color for the target gradient stop.
Definition: hdicoreGradient.h:61
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
Handles general gradient-related functionality.
Definition: hdicoreGradient.h:24
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
Describes the color of art on the artboard.
Definition: hdicoreArtColor.h:32
Type
Indicates the type of "gradient" an object is representing.
Definition: hdicoreGradient.h:30