Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreRasterArt.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_RASTER_ART__
8 #define __HDI_CORE_RASTER_ART__
9 
10 #include "hdicoreArtboardRect.h"
11 #include "hdicoreTransformMatrix.h"
12 
13 namespace hdi
14 {
15  namespace core
16  {
17  class Art;
18 
22  class RasterArt
23  {
24  public:
28  enum Flags
29  {
30  UnknownFlag = 0,
31 
32  // Used only for 1-bit gray images. When set, the 1-bit data is to be used as a mask. In this case
33  // the path style of the image indicates the color that the bits of the image with a value of 1 are
34  // painted.
35  MaskImageFlag = 1 << 0,
36 
37  // Used only for 1-bit gray images. Reverses the sense of the component values so that for a gray
38  // image 0=white and 1=black and for an image mask the 0 value pixels are painted.
39  InvertBitsFlag = 1 << 1,
40 
41  // Used only for 8-bit spot color rasters, or 16-bit if there is an extra alpha channel. When set,
42  // the gray component values are interpreted in the subtractive color spaces.
43  GraySubtractiveFlag = 1 << 2
44  };
45 
50  {
51  UnknownColorSpace = 0,
52 
53  // Each pixel value for a gray color space has a single component describing a grayscale value. The
54  // gray color space is additive so the minimum value represents black and the maximum represents
55  // white.
56  GrayColorSpace = 1,
57 
58  // Each pixel value for a RGB color space has three components which represent red, green and blue
59  // respectively. The RGB color space is additive.
60  RGBColorSpace = 2,
61 
62  // Each pixel value for a CMYK color space has four components which represent cyan, magenta, yellow
63  // and black respectively. The CMYK color space is subtractive.
64  CMYKColorSpace = 3,
65 
66  // Not valid as an image type; can occur only in placed linked files
67  LabColorSpace = 4,
68 
69  // Each pixel value for a separation color space has a single component describing a tint value. The
70  // separation color space is subtractive so the minimum value represents white and the maximum
71  // represents black.
72  SeparationColorSpace = 5,
73 
74  // Each pixel value for an NChannel color space has of a variable number of components which
75  // represent individual channels in the NChannel color space. The process components of the color
76  // space could be either additive or subtractive. The spot components of the color space are
77  // subtractive.
78  NChannelColorSpace = 6,
79 
80  // Each pixel value for an indexed color space has a single component describing an index value into
81  // a color lookup table. The number of components in the color lookup table depends on the base
82  // color space of the indexed color space.
83  IndexedColorSpace = 7,
84 
85  // Flag indicating that the color model has an alpha channel. The alpha component appears after the
86  // color components.
87  ColorSpaceHasAlpha = 0x10,
88 
89  // A gray color space with an alpha channel
90  AlphaGrayColorSpace = (GrayColorSpace | ColorSpaceHasAlpha),
91 
92  // An RGB color space with an alpha channel
93  AlphaRGBColorSpace = (RGBColorSpace | ColorSpaceHasAlpha),
94 
95  // A CMYK color space with an alpha channel
96  AlphaCMYKColorSpace = (CMYKColorSpace | ColorSpaceHasAlpha),
97 
98  // A Lab color space with an alpha channel
99  AlphaLabColorSpace = (LabColorSpace | ColorSpaceHasAlpha),
100 
101  // A separation color space with an alpha channel
102  AlphaSeparationColorSpace = (SeparationColorSpace | ColorSpaceHasAlpha),
103 
104  // An NChannel color space with an alpha channel
105  AlphaNChannelColorSpace = (NChannelColorSpace | ColorSpaceHasAlpha),
106 
107  // An indexed color space with an alpha channel
108  AlphaIndexedColorSpace = (IndexedColorSpace | ColorSpaceHasAlpha),
109 
110  InvalidColorSpace = 0xFF
111  };
112 
116  struct Record
117  {
122 
127 
135  int16_t bitsPerPx;
136 
146  int32_t rowBytes;
147 
152 
158 
164  Record();
165 
173  Record(const Record& rec_);
174 
187  Record(
188  const Flags flags_,
189  const Size& dim_,
190  const int16_t bitsPerPx_,
191  const int32_t rowBytes_,
192  const ColorSpace colorSpace_,
193  const ColorSpace origColorSpace_
194  );
195 
201  virtual ~Record();
202 
212  Record& operator=(const Record& rhs_);
213 
222  bool operator==(const Record& rhs_);
223 
232  bool operator!=(const Record& rhs_);
233  };
234 
240  ~RasterArt();
241 
249  Record info() const;
250 
258  void setInfo(const Record& rec_);
259 
267  std::string filePath() const;
268 
276  void setFilePath(const std::string& path_);
277 
288 
298  void setMatrix(const core::TransformMatrix& matrix_);
299 
307  core::ArtboardRect bounds() const;
308 
316  void setBounds(const core::ArtboardRect& b_);
317 
325  bool overprint() const;
326 
334  void setOverprint(const bool op_);
335 
345  bool colorized(bool& additive__) const;
346 
352  void clearColorization();
353 
354 
355  private:
356  // Only Art can construct a new RasterArt object
357  friend class Art;
358 
362  Art* __art;
363 
369  RasterArt();
370 
378  RasterArt(Art* const art_);
379 
385  RasterArt(const RasterArt&);
386 
392  RasterArt& operator=(const RasterArt&);
393  };
394  }
395 }
396 
398  const hdi::core::RasterArt::Flags lhs_,
399  const hdi::core::RasterArt::Flags rhs_
400 );
401 
402 hdi::core::RasterArt::Flags& operator|=(
404  const hdi::core::RasterArt::Flags rhs_
405 );
406 
407 #endif
408 // __HDI_CORE_RASTER_ART__
bool operator==(const Record &rhs_)
Compares two Record objects for equality.
Handles general art-related functionality.
Definition: hdicoreArt.h:48
bool colorized(bool &additive__) const
Gets whether a raster object is a colorized grayscale or bitmap image.
Allows for raster art manipulation, metadata access, etc.
Definition: hdicoreRasterArt.h:22
core::TransformMatrix matrix() const
Retrieves the transformation matrix for a raster art object. This is the concatenation of all transfo...
int16_t bitsPerPx
The number of bits used to define each pixel in the pixel map.
Definition: hdicoreRasterArt.h:135
ColorSpace colorSpace
The color model of the pixel data, which can include an alpha channel.
Definition: hdicoreRasterArt.h:151
Flags
Describes raster art options.
Definition: hdicoreRasterArt.h:28
Header file for describing a 2D transformation matrix.
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:25
core::ArtboardRect bounds() const
Retrieves the raster image bounding box of a raster art object.
Header file for geometric rectangle manipulation on the Illustrator artboard.
Allows for 2-dimensional transformations in a single application via matrix math. ...
Definition: hdicoreTransformMatrix.h:26
Record & operator=(const Record &rhs_)
Record assignment operator.
Describes more detailed information about raster art.
Definition: hdicoreRasterArt.h:116
Record info() const
Retrieves the raster record associated with a raster art object.
void setFilePath(const std::string &path_)
Sets the file path for the raster art.
void clearColorization()
Clears the colorization on a colorized grayscale or bitmap image.
void setMatrix(const core::TransformMatrix &matrix_)
Sets the transformation matrix for a raster art object.
Record()
Constructs a new Record object with default values.
virtual ~Record()
Destructs a Record object.
bool overprint() const
Retrieves the overprint status for a raster object.
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:24
Definition: hdicoreaiArray.h:12
void setInfo(const Record &rec_)
Associates a raster record with a raster art object.
void setBounds(const core::ArtboardRect &b_)
Sets the raster image bounding box of a raster art object.
bool operator!=(const Record &rhs_)
Compares two Record objects for inequality.
void setOverprint(const bool op_)
Enables or disables overprinting for a raster object.
Flags flags
Bitwise OR of flags defining additional options for the image.
Definition: hdicoreRasterArt.h:121
std::string filePath() const
Gets the file path for the raster art.
ColorSpace originalColorSpace
For an image that has been converted from one color space to another, the original color space...
Definition: hdicoreRasterArt.h:157
~RasterArt()
Destructs a RasterArt object.
int32_t rowBytes
The number of bytes in a single row of pixel data.
Definition: hdicoreRasterArt.h:146
ColorSpace
Describes raster art color spaces.
Definition: hdicoreRasterArt.h:49
Size dimensions
The width and height of the image data in pixels.
Definition: hdicoreRasterArt.h:126