github.com/kaydxh/golang@v0.0.131/pkg/gocv/cgo/third_path/graphics-magick/include/GraphicsMagick/magick/pixel_cache.h (about) 1 /* 2 Copyright (C) 2003 - 2018 GraphicsMagick Group 3 Copyright (C) 2002 ImageMagick Studio 4 5 This program is covered by multiple licenses, which are described in 6 Copyright.txt. You should have received a copy of Copyright.txt with this 7 package; otherwise see http://www.graphicsmagick.org/www/Copyright.html. 8 9 GraphicsMagick Pixel Cache Methods. 10 */ 11 #ifndef _MAGICK_CACHE_H 12 #define _MAGICK_CACHE_H 13 14 #include "magick/forward.h" 15 16 #if defined(__cplusplus) || defined(c_plusplus) 17 extern "C" { 18 #endif 19 20 /* 21 Enum declaractions. 22 */ 23 24 typedef enum 25 { 26 UndefinedVirtualPixelMethod, 27 ConstantVirtualPixelMethod, 28 EdgeVirtualPixelMethod, 29 MirrorVirtualPixelMethod, 30 TileVirtualPixelMethod 31 } VirtualPixelMethod; 32 33 /* 34 Typedef declaractions. 35 */ 36 typedef _CacheInfoPtr_ Cache; 37 38 /***** 39 * 40 * Default View interfaces 41 * 42 *****/ 43 44 /* 45 Read only access to a rectangular pixel region. 46 */ 47 MagickExport const PixelPacket 48 *AcquireImagePixels(const Image *image,const long x,const long y, 49 const unsigned long columns, 50 const unsigned long rows,ExceptionInfo *exception); 51 52 /* 53 AccessImmutableIndexes() returns the read-only indexes 54 associated with a rectangular pixel region already selected via 55 AcquireImagePixels(). 56 */ 57 extern MagickExport const IndexPacket 58 *AccessImmutableIndexes(const Image *image); 59 60 /* 61 Return one DirectClass pixel at the the specified (x,y) location. 62 Similar function as GetOnePixel(). Note that the value returned 63 by GetIndexes() may or may not be influenced by this function. 64 */ 65 extern MagickExport PixelPacket 66 AcquireOnePixel(const Image *image,const long x,const long y, 67 ExceptionInfo *exception); 68 69 70 /* 71 GetImagePixels() and GetImagePixelsEx() obtains a pixel region for 72 read/write access. 73 */ 74 extern MagickExport PixelPacket 75 *GetImagePixels(Image *image,const long x,const long y, 76 const unsigned long columns,const unsigned long rows); 77 extern MagickExport PixelPacket 78 *GetImagePixelsEx(Image *image,const long x,const long y, 79 const unsigned long columns,const unsigned long rows, 80 ExceptionInfo *exception); 81 82 /* 83 GetImageVirtualPixelMethod() gets the "virtual pixels" method for 84 the image. 85 */ 86 extern MagickExport VirtualPixelMethod 87 GetImageVirtualPixelMethod(const Image *image) MAGICK_FUNC_PURE; 88 89 /* 90 GetPixels() and AccessMutablePixels() return the pixels associated 91 with the last call to SetImagePixels() or GetImagePixels(). 92 */ 93 extern MagickExport PixelPacket 94 *GetPixels(const Image *image) 95 MAGICK_FUNC_DEPRECATED; /* Prefer AccessMutablePixels instead */ 96 extern MagickExport PixelPacket 97 *AccessMutablePixels(Image *image); 98 99 /* 100 GetIndexes() and AccessMutableIndexes() return the colormap 101 indexes associated with the last call to SetImagePixels() or 102 GetImagePixels(). 103 */ 104 extern MagickExport IndexPacket 105 *GetIndexes(const Image *image) 106 MAGICK_FUNC_DEPRECATED; /* Prefer AccessMutableIndexes() instead */ 107 extern MagickExport IndexPacket 108 *AccessMutableIndexes(Image *image); 109 110 /* 111 GetOnePixel() returns a single DirectClass pixel at the specified 112 (x,y) location. Similar to AcquireOnePixel(). It is preferred to 113 use AcquireOnePixel() since it allows reporting to a specified 114 exception structure. Note that the value returned by GetIndexes() 115 is not reliably influenced by this function. 116 */ 117 extern MagickExport PixelPacket 118 GetOnePixel(Image *image,const long x,const long y) 119 MAGICK_FUNC_DEPRECATED; /* Prefer AcquireOnePixel() instead */ 120 121 /* 122 GetPixelCacheArea() returns the area (width * height in pixels) 123 consumed by the current pixel cache. 124 */ 125 extern MagickExport magick_off_t 126 GetPixelCacheArea(const Image *image); 127 128 /* 129 SetImagePixels() and SetImagePixelsEx() initialize a pixel region 130 for write-only access. 131 */ 132 extern MagickExport PixelPacket 133 *SetImagePixels(Image *image,const long x,const long y, 134 const unsigned long columns,const unsigned long rows); 135 extern MagickExport PixelPacket 136 *SetImagePixelsEx(Image *image,const long x,const long y, 137 const unsigned long columns,const unsigned long rows, 138 ExceptionInfo *exception); 139 140 /* 141 SetImageVirtualPixelMethod() sets the "virtual pixels" method for 142 the image. 143 */ 144 extern MagickExport MagickPassFail 145 SetImageVirtualPixelMethod(const Image *image, 146 const VirtualPixelMethod method); 147 148 /* 149 SyncImagePixels() and SyncImagePixelsEx() save the image pixels to 150 the in-memory or disk cache. 151 */ 152 extern MagickExport MagickPassFail 153 SyncImagePixels(Image *image); 154 extern MagickExport MagickPassFail 155 SyncImagePixelsEx(Image *image,ExceptionInfo *exception); 156 157 /**** 158 * 159 * Cache view interfaces 160 * 161 ****/ 162 163 /* 164 OpenCacheView() opens a cache view. 165 */ 166 extern MagickExport ViewInfo 167 *OpenCacheView(Image *image); 168 169 /* 170 CloseCacheView() closes a cache view. 171 */ 172 extern MagickExport void 173 CloseCacheView(ViewInfo *view); 174 175 176 /* 177 AccessCacheViewPixels() returns the pixels associated with the 178 last request to select a view pixel region 179 (i.e. AcquireCacheViewPixels() or GetCacheViewPixels()). 180 */ 181 extern MagickExport PixelPacket 182 *AccessCacheViewPixels(const ViewInfo *view) MAGICK_FUNC_PURE; 183 184 /* 185 AcquireCacheViewIndexes() returns read-only indexes associated 186 with a cache view. 187 */ 188 extern MagickExport const IndexPacket 189 *AcquireCacheViewIndexes(const ViewInfo *view) MAGICK_FUNC_PURE; 190 191 /* 192 AcquireCacheViewPixels() obtains a pixel region from a cache view 193 for read-only access. 194 */ 195 extern MagickExport const PixelPacket 196 *AcquireCacheViewPixels(ViewInfo *view, 197 const long x,const long y, 198 const unsigned long columns, 199 const unsigned long rows, 200 ExceptionInfo *exception); 201 202 /* 203 AcquireOneCacheViewPixel() returns one DirectClass pixel from a 204 cache view. Note that the value returned by GetCacheViewIndexes() 205 is not reliably influenced by this function. 206 */ 207 extern MagickExport MagickPassFail 208 AcquireOneCacheViewPixel(ViewInfo *view,PixelPacket *pixel, 209 const long x,const long y,ExceptionInfo *exception); 210 211 /* 212 GetCacheViewArea() returns the area (width * height in pixels) 213 currently consumed by the pixel cache view. 214 */ 215 extern MagickExport magick_off_t 216 GetCacheViewArea(const ViewInfo *view) MAGICK_FUNC_PURE; 217 218 /* 219 GetCacheViewImage() obtains the image used to allocate the cache view. 220 */ 221 extern Image * 222 GetCacheViewImage(const ViewInfo *view) MAGICK_FUNC_PURE; 223 224 /* 225 GetCacheViewIndexes() returns the indexes associated with a cache view. 226 */ 227 extern MagickExport IndexPacket 228 *GetCacheViewIndexes(const ViewInfo *view) MAGICK_FUNC_PURE; 229 230 /* 231 GetCacheViewPixels() obtains a pixel region from a cache view for 232 read/write access. 233 */ 234 extern MagickExport PixelPacket 235 *GetCacheViewPixels(ViewInfo *view,const long x,const long y, 236 const unsigned long columns,const unsigned long rows, 237 ExceptionInfo *exception); 238 239 /* 240 Obtain the offset and size of the selected region. 241 */ 242 extern MagickExport RectangleInfo 243 GetCacheViewRegion(const ViewInfo *view) MAGICK_FUNC_PURE; 244 245 246 /* 247 SetCacheViewPixels() gets blank writeable pixels from the pixel 248 cache view. 249 */ 250 extern MagickExport PixelPacket 251 *SetCacheViewPixels(ViewInfo *view,const long x,const long y, 252 const unsigned long columns,const unsigned long rows, 253 ExceptionInfo *exception); 254 255 /* 256 SyncCacheViewPixels() saves any changes to the pixel cache view. 257 */ 258 extern MagickExport MagickPassFail 259 SyncCacheViewPixels(const ViewInfo *view,ExceptionInfo *exception); 260 261 #if defined(MAGICK_IMPLEMENTATION) 262 263 #include "magick/pixel_cache-private.h" 264 265 #endif /* defined(MAGICK_IMPLEMENTATION) */ 266 267 #if defined(__cplusplus) || defined(c_plusplus) 268 } 269 #endif /* defined(__cplusplus) || defined(c_plusplus) */ 270 271 #endif /* _MAGICK_CACHE_H */ 272 273 /* 274 * Local Variables: 275 * mode: c 276 * c-basic-offset: 2 277 * fill-column: 78 278 * End: 279 */