Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreRasterArt.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_RASTER_ART__
8#define __HDI_CORE_RASTER_ART__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include "hdicoreArtboardRect.h"
14
15namespace hdi
16{
17 namespace core
18 {
19 class Art;
20
25 {
26 public:
30 enum Flags
31 {
32 UnknownFlag = 0,
33
34 // Used only for 1-bit gray images. When set, the 1-bit data is to be used as a mask. In this case
35 // the path style of the image indicates the color that the bits of the image with a value of 1 are
36 // painted.
37 MaskImageFlag = 1 << 0,
38
39 // Used only for 1-bit gray images. Reverses the sense of the component values so that for a gray
40 // image 0=white and 1=black and for an image mask the 0 value pixels are painted.
41 InvertBitsFlag = 1 << 1,
42
43 // Used only for 8-bit spot color rasters, or 16-bit if there is an extra alpha channel. When set,
44 // the gray component values are interpreted in the subtractive color spaces.
45 GraySubtractiveFlag = 1 << 2
46 };
47
52 {
53 UnknownColorSpace = 0,
54
55 // Each pixel value for a gray color space has a single component describing a grayscale value. The
56 // gray color space is additive so the minimum value represents black and the maximum represents
57 // white.
58 GrayColorSpace = 1,
59
60 // Each pixel value for a RGB color space has three components which represent red, green and blue
61 // respectively. The RGB color space is additive.
62 RGBColorSpace = 2,
63
64 // Each pixel value for a CMYK color space has four components which represent cyan, magenta, yellow
65 // and black respectively. The CMYK color space is subtractive.
66 CMYKColorSpace = 3,
67
68 // Not valid as an image type; can occur only in placed linked files
69 LabColorSpace = 4,
70
71 // Each pixel value for a separation color space has a single component describing a tint value. The
72 // separation color space is subtractive so the minimum value represents white and the maximum
73 // represents black.
74 SeparationColorSpace = 5,
75
76 // Each pixel value for an NChannel color space has of a variable number of components which
77 // represent individual channels in the NChannel color space. The process components of the color
78 // space could be either additive or subtractive. The spot components of the color space are
79 // subtractive.
80 NChannelColorSpace = 6,
81
82 // Each pixel value for an indexed color space has a single component describing an index value into
83 // a color lookup table. The number of components in the color lookup table depends on the base
84 // color space of the indexed color space.
85 IndexedColorSpace = 7,
86
87 // Flag indicating that the color model has an alpha channel. The alpha component appears after the
88 // color components.
89 ColorSpaceHasAlpha = 0x10,
90
91 // A gray color space with an alpha channel
92 AlphaGrayColorSpace = (GrayColorSpace | ColorSpaceHasAlpha),
93
94 // An RGB color space with an alpha channel
95 AlphaRGBColorSpace = (RGBColorSpace | ColorSpaceHasAlpha),
96
97 // A CMYK color space with an alpha channel
98 AlphaCMYKColorSpace = (CMYKColorSpace | ColorSpaceHasAlpha),
99
100 // A Lab color space with an alpha channel
101 AlphaLabColorSpace = (LabColorSpace | ColorSpaceHasAlpha),
102
103 // A separation color space with an alpha channel
104 AlphaSeparationColorSpace = (SeparationColorSpace | ColorSpaceHasAlpha),
105
106 // An NChannel color space with an alpha channel
107 AlphaNChannelColorSpace = (NChannelColorSpace | ColorSpaceHasAlpha),
108
109 // An indexed color space with an alpha channel
110 AlphaIndexedColorSpace = (IndexedColorSpace | ColorSpaceHasAlpha),
111
112 InvalidColorSpace = 0xFF
113 };
114
118 struct Record
119 {
124
129
137 int16_t bitsPerPx;
138
148 int32_t rowBytes;
149
154
160
167
175 Record(const Record& rec_);
176
190 const Flags flags_,
191 const Size& dim_,
192 const int16_t bitsPerPx_,
193 const int32_t rowBytes_,
194 const ColorSpace colorSpace_,
195 const ColorSpace origColorSpace_
196 );
197
203 virtual ~Record();
204
214 Record& operator=(const Record& rhs_);
215
224 bool operator==(const Record& rhs_);
225
234 bool operator!=(const Record& rhs_);
235 };
236
243
251 Record info() const;
252
260 void setInfo(const Record& rec_);
261
269 std::string filePath() const;
270
278 void setFilePath(const std::string& path_);
279
290
300 void setMatrix(const core::TransformMatrix& matrix_);
301
310
319
327 bool overprint() const;
328
336 void setOverprint(const bool op_);
337
347 bool colorized(bool& additive__) const;
348
355
356
357 private:
358 // Only Art can construct a new RasterArt object
359 friend class Art;
360
364 void* __data;
365
371 RasterArt();
372
380 RasterArt(void* const art_);
381
387 RasterArt(const RasterArt&);
388
394 RasterArt& operator=(const RasterArt&);
395 };
396 }
397}
398
402);
403
407);
408
409#endif
410// HDI_CORE_AIP_MODE
411
412#endif
413// __HDI_CORE_RASTER_ART__
Handles general art-related functionality.
Definition: hdicoreArt.h:51
Describes a rectangular area on the Illustrator artboard.
Definition: hdicoreArtboardRect.h:28
Allows for raster art manipulation, metadata access, etc.
Definition: hdicoreRasterArt.h:25
Flags
Describes raster art options.
Definition: hdicoreRasterArt.h:31
ColorSpace
Describes raster art color spaces.
Definition: hdicoreRasterArt.h:52
std::string filePath() const
Gets the file path for the raster art.
Record info() const
Retrieves the raster record associated with a raster art object.
void setBounds(const core::ArtboardRect &b_)
Sets the raster image bounding box of a raster art object.
bool overprint() const
Retrieves the overprint status for a raster object.
void setInfo(const Record &rec_)
Associates a raster record with a raster art object.
void setMatrix(const core::TransformMatrix &matrix_)
Sets the transformation matrix for a raster art object.
core::ArtboardRect bounds() const
Retrieves the raster image bounding box of a raster art object.
void clearColorization()
Clears the colorization on a colorized grayscale or bitmap image.
void setOverprint(const bool op_)
Enables or disables overprinting for a raster object.
void setFilePath(const std::string &path_)
Sets the file path for the raster art.
~RasterArt()
Destructs a RasterArt object.
core::TransformMatrix matrix() const
Retrieves the transformation matrix for a raster art object. This is the concatenation of all transfo...
bool colorized(bool &additive__) const
Gets whether a raster object is a colorized grayscale or bitmap image.
Contains a width and height for a rectangular shape.
Definition: hdicoreSize.h:25
Allows for 2-dimensional transformations in a single application via matrix math.
Definition: hdicoreTransformMatrix.h:34
Header file for geometric rectangle manipulation on the Illustrator artboard.
Header file for describing a 2D transformation matrix.
Describes more detailed information about raster art.
Definition: hdicoreRasterArt.h:119
Flags flags
Bitwise OR of flags defining additional options for the image.
Definition: hdicoreRasterArt.h:123
virtual ~Record()
Destructs a Record object.
Size dimensions
The width and height of the image data in pixels.
Definition: hdicoreRasterArt.h:128
Record & operator=(const Record &rhs_)
Record assignment operator.
int32_t rowBytes
The number of bytes in a single row of pixel data.
Definition: hdicoreRasterArt.h:148
bool operator!=(const Record &rhs_)
Compares two Record objects for inequality.
bool operator==(const Record &rhs_)
Compares two Record objects for equality.
ColorSpace colorSpace
The color model of the pixel data, which can include an alpha channel.
Definition: hdicoreRasterArt.h:153
Record()
Constructs a new Record object with default values.
Record(const Flags flags_, const Size &dim_, const int16_t bitsPerPx_, const int32_t rowBytes_, const ColorSpace colorSpace_, const ColorSpace origColorSpace_)
Constructs a new Record object from the given values.
int16_t bitsPerPx
The number of bits used to define each pixel in the pixel map.
Definition: hdicoreRasterArt.h:137
Record(const Record &rec_)
Constructs a new Record object from an existing one.
ColorSpace originalColorSpace
For an image that has been converted from one color space to another, the original color space....
Definition: hdicoreRasterArt.h:159