cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 1 | /* |
Cristy | 7ce65e7 | 2015-12-12 18:03:16 -0500 | [diff] [blame] | 2 | Copyright 1999-2016 ImageMagick Studio LLC, a non-profit organization |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 3 | dedicated to making software imaging solutions freely available. |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 4 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 5 | You may not use this file except in compliance with the License. |
| 6 | obtain a copy of the License at |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 7 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 8 | http://www.imagemagick.org/script/license.php |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 9 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 10 | Unless required by applicable law or agreed to in writing, software |
| 11 | distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | See the License for the specific language governing permissions and |
| 14 | limitations under the License. |
| 15 | |
| 16 | MagickCore image methods. |
| 17 | */ |
| 18 | #ifndef _MAGICKCORE_IMAGE_H |
| 19 | #define _MAGICKCORE_IMAGE_H |
| 20 | |
cristy | 6398ec7 | 2013-11-28 02:00:27 +0000 | [diff] [blame] | 21 | #include "MagickCore/color.h" |
| 22 | #include "MagickCore/pixel.h" |
| 23 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 24 | #if defined(__cplusplus) || defined(c_plusplus) |
| 25 | extern "C" { |
| 26 | #endif |
| 27 | |
cristy | 288a353 | 2012-08-28 00:19:44 +0000 | [diff] [blame] | 28 | #define OpaqueAlpha ((Quantum) QuantumRange) |
| 29 | #define TransparentAlpha ((Quantum) 0) |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 30 | |
| 31 | typedef enum |
| 32 | { |
| 33 | UndefinedAlphaChannel, |
| 34 | ActivateAlphaChannel, |
cristy | 7894d4a | 2014-09-29 12:43:59 +0000 | [diff] [blame] | 35 | AssociateAlphaChannel, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 36 | BackgroundAlphaChannel, |
| 37 | CopyAlphaChannel, |
| 38 | DeactivateAlphaChannel, |
cristy | dd00eb3 | 2014-10-01 13:11:19 +0000 | [diff] [blame] | 39 | DiscreteAlphaChannel, |
cristy | 7894d4a | 2014-09-29 12:43:59 +0000 | [diff] [blame] | 40 | DisassociateAlphaChannel, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 41 | ExtractAlphaChannel, |
cristy | 17f11b0 | 2014-12-20 19:37:04 +0000 | [diff] [blame] | 42 | OffAlphaChannel, |
| 43 | OnAlphaChannel, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 44 | OpaqueAlphaChannel, |
cristy | 6180838 | 2012-01-30 01:24:49 +0000 | [diff] [blame] | 45 | RemoveAlphaChannel, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 46 | SetAlphaChannel, |
| 47 | ShapeAlphaChannel, |
cristy | 6180838 | 2012-01-30 01:24:49 +0000 | [diff] [blame] | 48 | TransparentAlphaChannel |
cristy | b15b06c | 2012-08-28 11:36:48 +0000 | [diff] [blame] | 49 | } AlphaChannelOption; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 50 | |
| 51 | typedef enum |
| 52 | { |
cristy | 5f1c1ff | 2010-12-23 21:38:06 +0000 | [diff] [blame] | 53 | UndefinedType, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 54 | BilevelType, |
| 55 | GrayscaleType, |
cristy | def23e5 | 2015-01-22 11:52:01 +0000 | [diff] [blame] | 56 | GrayscaleAlphaType, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 57 | PaletteType, |
cristy | def23e5 | 2015-01-22 11:52:01 +0000 | [diff] [blame] | 58 | PaletteAlphaType, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 59 | TrueColorType, |
cristy | def23e5 | 2015-01-22 11:52:01 +0000 | [diff] [blame] | 60 | TrueColorAlphaType, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 61 | ColorSeparationType, |
cristy | def23e5 | 2015-01-22 11:52:01 +0000 | [diff] [blame] | 62 | ColorSeparationAlphaType, |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 63 | OptimizeType, |
cristy | def23e5 | 2015-01-22 11:52:01 +0000 | [diff] [blame] | 64 | PaletteBilevelAlphaType |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 65 | } ImageType; |
| 66 | |
| 67 | typedef enum |
| 68 | { |
| 69 | UndefinedInterlace, |
| 70 | NoInterlace, |
| 71 | LineInterlace, |
| 72 | PlaneInterlace, |
| 73 | PartitionInterlace, |
| 74 | GIFInterlace, |
| 75 | JPEGInterlace, |
| 76 | PNGInterlace |
| 77 | } InterlaceType; |
| 78 | |
| 79 | typedef enum |
| 80 | { |
| 81 | UndefinedOrientation, |
| 82 | TopLeftOrientation, |
| 83 | TopRightOrientation, |
| 84 | BottomRightOrientation, |
| 85 | BottomLeftOrientation, |
| 86 | LeftTopOrientation, |
| 87 | RightTopOrientation, |
| 88 | RightBottomOrientation, |
| 89 | LeftBottomOrientation |
| 90 | } OrientationType; |
| 91 | |
| 92 | typedef enum |
| 93 | { |
| 94 | UndefinedResolution, |
| 95 | PixelsPerInchResolution, |
| 96 | PixelsPerCentimeterResolution |
| 97 | } ResolutionType; |
| 98 | |
| 99 | typedef struct _PrimaryInfo |
| 100 | { |
| 101 | double |
| 102 | x, |
| 103 | y, |
| 104 | z; |
| 105 | } PrimaryInfo; |
| 106 | |
| 107 | typedef struct _SegmentInfo |
| 108 | { |
| 109 | double |
| 110 | x1, |
| 111 | y1, |
| 112 | x2, |
| 113 | y2; |
| 114 | } SegmentInfo; |
| 115 | |
| 116 | typedef enum |
| 117 | { |
| 118 | UndefinedTransmitType, |
| 119 | FileTransmitType, |
| 120 | BlobTransmitType, |
| 121 | StreamTransmitType, |
| 122 | ImageTransmitType |
| 123 | } TransmitType; |
| 124 | |
| 125 | typedef struct _ChromaticityInfo |
| 126 | { |
| 127 | PrimaryInfo |
| 128 | red_primary, |
| 129 | green_primary, |
| 130 | blue_primary, |
| 131 | white_point; |
| 132 | } ChromaticityInfo; |
| 133 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 134 | #include "MagickCore/blob.h" |
| 135 | #include "MagickCore/colorspace.h" |
| 136 | #include "MagickCore/cache-view.h" |
| 137 | #include "MagickCore/color.h" |
| 138 | #include "MagickCore/composite.h" |
| 139 | #include "MagickCore/compress.h" |
| 140 | #include "MagickCore/effect.h" |
| 141 | #include "MagickCore/geometry.h" |
| 142 | #include "MagickCore/layer.h" |
| 143 | #include "MagickCore/locale_.h" |
| 144 | #include "MagickCore/monitor.h" |
| 145 | #include "MagickCore/pixel.h" |
| 146 | #include "MagickCore/profile.h" |
| 147 | #include "MagickCore/quantum.h" |
| 148 | #include "MagickCore/resample.h" |
| 149 | #include "MagickCore/resize.h" |
| 150 | #include "MagickCore/semaphore.h" |
| 151 | #include "MagickCore/stream.h" |
| 152 | #include "MagickCore/timer.h" |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 153 | |
| 154 | struct _Image |
| 155 | { |
| 156 | ClassType |
| 157 | storage_class; |
| 158 | |
| 159 | ColorspaceType |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 160 | colorspace; /* colorspace of image data */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 161 | |
| 162 | CompressionType |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 163 | compression; /* compression of image when read/write */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 164 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 165 | size_t |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 166 | quality; /* compression quality setting, meaning varies */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 167 | |
| 168 | OrientationType |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 169 | orientation; /* photo orientation of image */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 170 | |
| 171 | MagickBooleanType |
cristy | 8a46d82 | 2012-08-28 23:32:39 +0000 | [diff] [blame] | 172 | taint; /* has image been modified since reading */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 173 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 174 | size_t |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 175 | columns, /* physical size of image */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 176 | rows, |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 177 | depth, /* depth of image on read/write */ |
| 178 | colors; /* Size of color table, or actual color count */ |
| 179 | /* Only valid if image is not DirectClass */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 180 | |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 181 | PixelInfo |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 182 | *colormap, |
dirk | b797b2c | 2016-02-01 22:20:32 +0100 | [diff] [blame] | 183 | alpha_color, /* current alphacolor attribute */ |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 184 | background_color, /* current background color attribute */ |
| 185 | border_color, /* current bordercolor attribute */ |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 186 | transparent_color; /* color for 'transparent' color index in GIF */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 187 | |
| 188 | double |
| 189 | gamma; |
| 190 | |
| 191 | ChromaticityInfo |
| 192 | chromaticity; |
| 193 | |
| 194 | RenderingIntent |
| 195 | rendering_intent; |
| 196 | |
| 197 | void |
| 198 | *profiles; |
| 199 | |
| 200 | ResolutionType |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 201 | units; /* resolution/density ppi or ppc */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 202 | |
| 203 | char |
| 204 | *montage, |
| 205 | *directory, |
| 206 | *geometry; |
| 207 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 208 | ssize_t |
anthony | 30b912a | 2012-03-22 01:20:28 +0000 | [diff] [blame] | 209 | offset; /* ??? */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 210 | |
cristy | 2a11bef | 2011-10-28 18:33:11 +0000 | [diff] [blame] | 211 | PointInfo |
| 212 | resolution; /* image resolution/density */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 213 | |
| 214 | RectangleInfo |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 215 | page, /* virtual canvas size and offset of image */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 216 | extract_info; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 217 | |
| 218 | double |
anthony | a322a83 | 2013-04-27 06:28:03 +0000 | [diff] [blame] | 219 | fuzz; /* current color fuzz attribute - move to image_info */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 220 | |
dirk | 8b9f21c | 2016-02-01 22:30:19 +0100 | [diff] [blame^] | 221 | FilterType |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 222 | filter; /* resize/distort filter to apply */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 223 | |
cristy | 70e9f68 | 2013-03-12 22:31:22 +0000 | [diff] [blame] | 224 | PixelIntensityMethod |
| 225 | intensity; /* method to generate an intensity value from a pixel */ |
| 226 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 227 | InterlaceType |
| 228 | interlace; |
| 229 | |
| 230 | EndianType |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 231 | endian; /* raw data integer ordering on read/write */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 232 | |
| 233 | GravityType |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 234 | gravity; /* Gravity attribute for positioning in image */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 235 | |
| 236 | CompositeOperator |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 237 | compose; /* alpha composition method for layered images */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 238 | |
| 239 | DisposeType |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 240 | dispose; /* GIF animation disposal method */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 241 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 242 | size_t |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 243 | scene, /* index of image in multi-image file */ |
cristy | 9089547 | 2014-01-27 20:12:07 +0000 | [diff] [blame] | 244 | delay, /* Animation delay time */ |
| 245 | duration; /* Total animation duration sum(delay*iterations) */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 246 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 247 | ssize_t |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 248 | ticks_per_second; /* units for delay time, default 100 for GIF */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 249 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 250 | size_t |
anthony | 5f78bca | 2012-10-05 06:51:00 +0000 | [diff] [blame] | 251 | iterations, /* number of interations for GIF animations */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 252 | total_colors; |
| 253 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 254 | ssize_t |
anthony | 30b912a | 2012-03-22 01:20:28 +0000 | [diff] [blame] | 255 | start_loop; /* ??? */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 256 | |
cristy | 5c4e258 | 2011-09-11 19:21:03 +0000 | [diff] [blame] | 257 | PixelInterpolateMethod |
anthony | 1e4df87 | 2011-03-19 14:10:59 +0000 | [diff] [blame] | 258 | interpolate; /* Interpolation of color for between pixel lookups */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 259 | |
| 260 | MagickBooleanType |
| 261 | black_point_compensation; |
| 262 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 263 | RectangleInfo |
| 264 | tile_offset; |
| 265 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 266 | ImageType |
| 267 | type; |
| 268 | |
| 269 | MagickBooleanType |
anthony | ad98c29 | 2011-09-29 10:43:26 +0000 | [diff] [blame] | 270 | dither; /* dithering on/off */ |
cristy | 81b8ce5 | 2010-02-05 01:53:17 +0000 | [diff] [blame] | 271 | |
| 272 | MagickSizeType |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 273 | extent; /* Size of image read from disk */ |
cristy | 7372451 | 2010-04-12 14:43:14 +0000 | [diff] [blame] | 274 | |
| 275 | MagickBooleanType |
anthony | 30b912a | 2012-03-22 01:20:28 +0000 | [diff] [blame] | 276 | ping; /* no image data read, just attributes */ |
cristy | 0d26717 | 2011-04-25 20:13:48 +0000 | [diff] [blame] | 277 | |
cristy | 10a6c61 | 2012-01-29 21:41:05 +0000 | [diff] [blame] | 278 | MagickBooleanType |
cristy | 883fde1 | 2013-04-08 00:50:13 +0000 | [diff] [blame] | 279 | read_mask, |
| 280 | write_mask; |
cristy | 10a6c61 | 2012-01-29 21:41:05 +0000 | [diff] [blame] | 281 | |
cristy | 2485594 | 2012-08-28 11:25:09 +0000 | [diff] [blame] | 282 | PixelTrait |
cristy | 8a46d82 | 2012-08-28 23:32:39 +0000 | [diff] [blame] | 283 | alpha_trait; /* is transparency channel defined and active */ |
cristy | 288a353 | 2012-08-28 00:19:44 +0000 | [diff] [blame] | 284 | |
cristy | 0d26717 | 2011-04-25 20:13:48 +0000 | [diff] [blame] | 285 | size_t |
cristy | ed23157 | 2011-07-14 02:18:59 +0000 | [diff] [blame] | 286 | number_channels, |
cristy | b3a73b5 | 2011-07-26 01:34:43 +0000 | [diff] [blame] | 287 | number_meta_channels, |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 288 | metacontent_extent; |
| 289 | |
cristy | bd5a96c | 2011-08-21 00:04:26 +0000 | [diff] [blame] | 290 | ChannelType |
anthony | ad98c29 | 2011-09-29 10:43:26 +0000 | [diff] [blame] | 291 | channel_mask; |
cristy | 490408a | 2011-07-07 14:42:05 +0000 | [diff] [blame] | 292 | |
cristy | ed23157 | 2011-07-14 02:18:59 +0000 | [diff] [blame] | 293 | PixelChannelMap |
cristy | bd5a96c | 2011-08-21 00:04:26 +0000 | [diff] [blame] | 294 | *channel_map; |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 295 | |
| 296 | void |
| 297 | *cache; |
| 298 | |
| 299 | ErrorInfo |
| 300 | error; |
| 301 | |
| 302 | TimerInfo |
| 303 | timer; |
| 304 | |
| 305 | MagickProgressMonitor |
| 306 | progress_monitor; |
| 307 | |
| 308 | void |
| 309 | *client_data; |
| 310 | |
| 311 | Ascii85Info |
| 312 | *ascii85; |
| 313 | |
| 314 | ProfileInfo |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 315 | *generic_profile; |
| 316 | |
cristy | bd686c6 | 2013-02-03 19:01:05 +0000 | [diff] [blame] | 317 | void |
| 318 | *properties, /* general settings, to save with image */ |
| 319 | *artifacts; /* general operational/coder settings, not saved */ |
| 320 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 321 | char |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 322 | filename[MagickPathExtent], /* images input filename */ |
| 323 | magick_filename[MagickPathExtent], /* given image filename (with read mods) */ |
| 324 | magick[MagickPathExtent]; /* images file format (file magic) */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 325 | |
| 326 | size_t |
anthony | 30b912a | 2012-03-22 01:20:28 +0000 | [diff] [blame] | 327 | magick_columns, /* size of image when read/created */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 328 | magick_rows; |
| 329 | |
| 330 | BlobInfo |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 331 | *blob; /* image file as in-memory string of 'extent' */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 332 | |
cristy | bd686c6 | 2013-02-03 19:01:05 +0000 | [diff] [blame] | 333 | time_t |
| 334 | timestamp; |
| 335 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 336 | MagickBooleanType |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 337 | debug; /* debug output attribute */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 338 | |
| 339 | volatile ssize_t |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 340 | reference_count; /* image data sharing memory management */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 341 | |
| 342 | SemaphoreInfo |
| 343 | *semaphore; |
| 344 | |
Cristy | 36421ee | 2015-08-28 11:58:20 -0400 | [diff] [blame] | 345 | struct _ImageInfo |
anthony | 5f78bca | 2012-10-05 06:51:00 +0000 | [diff] [blame] | 346 | *image_info; /* (Optional) Image belongs to this ImageInfo 'list' |
| 347 | * For access to 'global options' when no per-image |
| 348 | * attribute, properity, or artifact has been set. |
anthony | 5f78bca | 2012-10-05 06:51:00 +0000 | [diff] [blame] | 349 | */ |
anthony | 007bad3 | 2012-07-28 10:52:03 +0000 | [diff] [blame] | 350 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 351 | struct _Image |
anthony | 007bad3 | 2012-07-28 10:52:03 +0000 | [diff] [blame] | 352 | *list, /* Undo/Redo image processing list (for display) */ |
| 353 | *previous, /* Image list links */ |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 354 | *next; |
| 355 | |
| 356 | size_t |
| 357 | signature; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 358 | }; |
| 359 | |
cristy | 939d92b | 2015-06-17 11:14:12 +0000 | [diff] [blame] | 360 | /* |
| 361 | ImageInfo structure: |
| 362 | Stores an image list, as well as all global settings used by all images |
| 363 | held, -- unless overridden for that specific image. See SyncImagesettings() |
| 364 | which maps any global setting that always overrides specific image settings. |
| 365 | */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 366 | struct _ImageInfo |
| 367 | { |
| 368 | CompressionType |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 369 | compression; /* compression method when reading/saving image */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 370 | |
| 371 | OrientationType |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 372 | orientation; /* orientation setting */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 373 | |
| 374 | MagickBooleanType |
anthony | d5daafa | 2012-03-28 12:49:10 +0000 | [diff] [blame] | 375 | temporary, /* image file to be deleted after read "empemeral:" */ |
dirk | 288e957 | 2015-06-05 16:11:55 +0000 | [diff] [blame] | 376 | adjoin, /* save images to separate scene files */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 377 | affirm, |
| 378 | antialias; |
| 379 | |
| 380 | char |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 381 | *size, /* image generation size */ |
| 382 | *extract, /* crop/resize string on image read */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 383 | *page, |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 384 | *scenes; /* scene numbers that is to be read in */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 385 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 386 | size_t |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 387 | scene, /* starting value for image save numbering */ |
| 388 | number_scenes, /* total number of images in list - for escapes */ |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 389 | depth; /* current read/save depth of images */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 390 | |
| 391 | InterlaceType |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 392 | interlace; /* interlace for image write */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 393 | |
| 394 | EndianType |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 395 | endian; /* integer endian order for raw image data */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 396 | |
| 397 | ResolutionType |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 398 | units; /* denisty pixels/inch or pixel/cm */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 399 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 400 | size_t |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 401 | quality; /* compression quality */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 402 | |
| 403 | char |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 404 | *sampling_factor, /* JPEG write sampling factor */ |
| 405 | *server_name, /* X windows server name - display/animate */ |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 406 | *font, /* DUP for draw_info */ |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 407 | *texture, /* montage/display background tile */ |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 408 | *density; /* DUP for image and draw_info */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 409 | |
| 410 | double |
cristy | 947cb4c | 2011-10-20 18:41:46 +0000 | [diff] [blame] | 411 | pointsize, |
anthony | e95d3f0 | 2011-10-12 10:58:48 +0000 | [diff] [blame] | 412 | fuzz; /* current color fuzz attribute */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 413 | |
cristy | 101ab70 | 2011-10-13 13:06:32 +0000 | [diff] [blame] | 414 | PixelInfo |
dirk | b797b2c | 2016-02-01 22:20:32 +0100 | [diff] [blame] | 415 | alpha_color, /* alpha (frame) color */ |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 416 | background_color, /* user set background color */ |
| 417 | border_color, /* user set border color */ |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 418 | transparent_color; /* color for transparent index in color tables */ |
| 419 | /* NB: fill color is only needed in draw_info! */ |
| 420 | /* the same for undercolor (for font drawing) */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 421 | |
| 422 | MagickBooleanType |
anthony | fd706f9 | 2012-01-19 04:22:02 +0000 | [diff] [blame] | 423 | dither, /* dither enable-disable */ |
| 424 | monochrome; /* read/write pcl,pdf,ps,xps as monocrome image */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 425 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 426 | ColorspaceType |
| 427 | colorspace; |
| 428 | |
anthony | 72feaa6 | 2012-01-17 06:46:23 +0000 | [diff] [blame] | 429 | CompositeOperator |
| 430 | compose; |
| 431 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 432 | ImageType |
| 433 | type; |
| 434 | |
| 435 | PreviewType |
| 436 | preview_type; |
| 437 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 438 | ssize_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 439 | group; |
| 440 | |
| 441 | MagickBooleanType |
anthony | 8ea7983 | 2011-10-05 10:08:39 +0000 | [diff] [blame] | 442 | ping, /* fast read image attributes, not image data */ |
| 443 | verbose; /* verbose output enable/disable */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 444 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 445 | ChannelType |
| 446 | channel; |
| 447 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 448 | void |
anthony | 5f78bca | 2012-10-05 06:51:00 +0000 | [diff] [blame] | 449 | *options; /* splay tree of global options */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 450 | |
cristy | 4c08aed | 2011-07-01 19:47:50 +0000 | [diff] [blame] | 451 | void |
| 452 | *profile; |
| 453 | |
| 454 | MagickBooleanType |
| 455 | synchronize; |
| 456 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 457 | MagickProgressMonitor |
| 458 | progress_monitor; |
| 459 | |
| 460 | void |
| 461 | *client_data, |
| 462 | *cache; |
| 463 | |
| 464 | StreamHandler |
| 465 | stream; |
| 466 | |
| 467 | FILE |
| 468 | *file; |
| 469 | |
| 470 | void |
| 471 | *blob; |
| 472 | |
| 473 | size_t |
| 474 | length; |
| 475 | |
| 476 | char |
cristy | 151b66d | 2015-04-15 10:50:31 +0000 | [diff] [blame] | 477 | magick[MagickPathExtent], /* image file format (file magick) */ |
| 478 | unique[MagickPathExtent], /* unique tempory filename - delegates */ |
| 479 | zero[MagickPathExtent], /* unique filename ? - delegates */ |
| 480 | filename[MagickPathExtent]; /* filename when reading/writing image */ |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 481 | |
| 482 | MagickBooleanType |
| 483 | debug; |
| 484 | |
cristy | bb50337 | 2010-05-27 20:51:26 +0000 | [diff] [blame] | 485 | size_t |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 486 | signature; |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 487 | }; |
| 488 | |
cristy | cf1296e | 2012-08-26 23:40:49 +0000 | [diff] [blame] | 489 | extern MagickExport ChannelType |
| 490 | SetImageChannelMask(Image *,const ChannelType); |
| 491 | |
cristy | 8ea8122 | 2011-09-04 10:33:32 +0000 | [diff] [blame] | 492 | extern MagickExport const char |
cristy | 8ea8122 | 2011-09-04 10:33:32 +0000 | [diff] [blame] | 493 | DefaultTileGeometry[], |
| 494 | DefaultTileLabel[], |
| 495 | LoadImageTag[], |
| 496 | LoadImagesTag[], |
| 497 | PSDensityGeometry[], |
| 498 | PSPageGeometry[], |
| 499 | SaveImageTag[], |
| 500 | SaveImagesTag[]; |
| 501 | |
| 502 | extern MagickExport const double |
| 503 | DefaultResolution; |
| 504 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 505 | extern MagickExport ExceptionType |
| 506 | CatchImageException(Image *); |
| 507 | |
cristy | 15781e5 | 2009-12-05 23:05:27 +0000 | [diff] [blame] | 508 | extern MagickExport FILE |
| 509 | *GetImageInfoFile(const ImageInfo *); |
| 510 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 511 | extern MagickExport Image |
cristy | 9950d57 | 2011-10-01 18:22:35 +0000 | [diff] [blame] | 512 | *AcquireImage(const ImageInfo *,ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 513 | *AppendImages(const Image *,const MagickBooleanType,ExceptionInfo *), |
cristy | 5ed838e | 2010-05-31 00:05:35 +0000 | [diff] [blame] | 514 | *CloneImage(const Image *,const size_t,const size_t,const MagickBooleanType, |
| 515 | ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 516 | *DestroyImage(Image *), |
dirk | af131f1 | 2016-01-10 01:29:22 +0100 | [diff] [blame] | 517 | *GetImageMask(const Image *,const PixelMask,ExceptionInfo *), |
cristy | 0740a98 | 2011-10-13 15:01:01 +0000 | [diff] [blame] | 518 | *NewMagickImage(const ImageInfo *,const size_t,const size_t,const PixelInfo *, |
| 519 | ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 520 | *ReferenceImage(Image *), |
cristy | 4285d78 | 2011-02-09 20:12:28 +0000 | [diff] [blame] | 521 | *SmushImages(const Image *,const MagickBooleanType,const ssize_t, |
| 522 | ExceptionInfo *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 523 | |
| 524 | extern MagickExport ImageInfo |
| 525 | *AcquireImageInfo(void), |
| 526 | *CloneImageInfo(const ImageInfo *), |
| 527 | *DestroyImageInfo(ImageInfo *); |
| 528 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 529 | extern MagickExport MagickBooleanType |
cristy | 018f07f | 2011-09-04 21:15:19 +0000 | [diff] [blame] | 530 | ClipImage(Image *,ExceptionInfo *), |
| 531 | ClipImagePath(Image *,const char *,const MagickBooleanType,ExceptionInfo *), |
cristy | 957f261 | 2015-06-21 23:51:58 +0000 | [diff] [blame] | 532 | CopyImagePixels(Image *,const Image *,const RectangleInfo *, |
cristy | 17fbd72 | 2015-06-22 00:46:58 +0000 | [diff] [blame] | 533 | const OffsetInfo *,ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 534 | IsTaintImage(const Image *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 535 | IsHighDynamicRangeImage(const Image *,ExceptionInfo *), |
| 536 | IsImageObject(const Image *), |
| 537 | ListMagickInfo(FILE *,ExceptionInfo *), |
| 538 | ModifyImage(Image **,ExceptionInfo *), |
| 539 | ResetImagePage(Image *,const char *), |
cristy | e941a75 | 2011-10-15 01:52:48 +0000 | [diff] [blame] | 540 | SetImageAlpha(Image *,const Quantum,ExceptionInfo *), |
cristy | ea1a8aa | 2011-10-20 13:24:06 +0000 | [diff] [blame] | 541 | SetImageBackgroundColor(Image *,ExceptionInfo *), |
cristy | e941a75 | 2011-10-15 01:52:48 +0000 | [diff] [blame] | 542 | SetImageColor(Image *,const PixelInfo *,ExceptionInfo *), |
cristy | 6324088 | 2011-08-05 19:05:27 +0000 | [diff] [blame] | 543 | SetImageExtent(Image *,const size_t,const size_t,ExceptionInfo *), |
cristy | d965a42 | 2010-03-03 17:47:35 +0000 | [diff] [blame] | 544 | SetImageInfo(ImageInfo *,const unsigned int,ExceptionInfo *), |
cristy | acd0d4c | 2015-07-25 16:12:33 +0000 | [diff] [blame] | 545 | SetImageMask(Image *,const PixelMask type,const Image *,ExceptionInfo *), |
cristy | 574cc26 | 2011-08-05 01:23:58 +0000 | [diff] [blame] | 546 | SetImageStorageClass(Image *,const ClassType,ExceptionInfo *), |
cristy | e941a75 | 2011-10-15 01:52:48 +0000 | [diff] [blame] | 547 | StripImage(Image *,ExceptionInfo *), |
cristy | ea1a8aa | 2011-10-20 13:24:06 +0000 | [diff] [blame] | 548 | SyncImage(Image *,ExceptionInfo *), |
cristy | 6fccee1 | 2011-10-20 18:43:18 +0000 | [diff] [blame] | 549 | SyncImageSettings(const ImageInfo *,Image *,ExceptionInfo *), |
| 550 | SyncImagesSettings(ImageInfo *,Image *,ExceptionInfo *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 551 | |
| 552 | extern MagickExport size_t |
cristy | 6fccee1 | 2011-10-20 18:43:18 +0000 | [diff] [blame] | 553 | InterpretImageFilename(const ImageInfo *,Image *,const char *,int,char *, |
| 554 | ExceptionInfo *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 555 | |
cristy | 5ed838e | 2010-05-31 00:05:35 +0000 | [diff] [blame] | 556 | extern MagickExport ssize_t |
| 557 | GetImageReferenceCount(Image *); |
| 558 | |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 559 | extern MagickExport VirtualPixelMethod |
| 560 | GetImageVirtualPixelMethod(const Image *), |
cristy | 387430f | 2012-02-07 13:09:46 +0000 | [diff] [blame] | 561 | SetImageVirtualPixelMethod(Image *,const VirtualPixelMethod,ExceptionInfo *); |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 562 | |
| 563 | extern MagickExport void |
cristy | 9950d57 | 2011-10-01 18:22:35 +0000 | [diff] [blame] | 564 | AcquireNextImage(const ImageInfo *,Image *,ExceptionInfo *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 565 | DestroyImagePixels(Image *), |
| 566 | DisassociateImageStream(Image *), |
cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame] | 567 | GetImageInfo(ImageInfo *), |
| 568 | SetImageInfoBlob(ImageInfo *,const void *,const size_t), |
| 569 | SetImageInfoFile(ImageInfo *,FILE *); |
| 570 | |
| 571 | #if defined(__cplusplus) || defined(c_plusplus) |
| 572 | } |
| 573 | #endif |
| 574 | |
| 575 | #endif |