1 /* 2 Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization 3 dedicated to making software imaging solutions freely available. 4 5 You may not use this file except in compliance with the License. You may 6 obtain a copy of the License at 7 8 https://imagemagick.org/script/license.php 9 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 magick methods. 17 */ 18 #ifndef MAGICKCORE_MAGICK_H 19 #define MAGICKCORE_MAGICK_H 20 21 #if defined(__cplusplus) || defined(c_plusplus) 22 extern "C" { 23 #endif 24 25 #include <stdarg.h> 26 #include "MagickCore/semaphore.h" 27 28 typedef enum 29 { 30 UndefinedFormatType, 31 ImplicitFormatType, 32 ExplicitFormatType 33 } MagickFormatType; 34 35 typedef enum 36 { 37 CoderNoFlag = 0x0000, 38 CoderAdjoinFlag = 0x0001, 39 CoderBlobSupportFlag = 0x0002, 40 CoderDecoderThreadSupportFlag = 0x0004, 41 CoderEncoderThreadSupportFlag = 0x0008, 42 CoderEndianSupportFlag = 0x0010, 43 CoderRawSupportFlag = 0x0020, 44 CoderSeekableStreamFlag = 0x0040, /* deprecated */ 45 CoderStealthFlag = 0x0080, 46 CoderUseExtensionFlag = 0x0100, 47 CoderDecoderSeekableStreamFlag = 0x0200, 48 CoderEncoderSeekableStreamFlag = 0x0400, 49 50 } MagickInfoFlag; 51 52 typedef Image 53 *DecodeImageHandler(const ImageInfo *,ExceptionInfo *); 54 55 typedef MagickBooleanType 56 EncodeImageHandler(const ImageInfo *,Image *,ExceptionInfo *); 57 58 typedef MagickBooleanType 59 IsImageFormatHandler(const unsigned char *,const size_t); 60 61 typedef struct _MagickInfo 62 { 63 char 64 *name, 65 *description, 66 *version, 67 *mime_type, 68 *note, 69 *module; 70 71 DecodeImageHandler 72 *decoder; 73 74 EncodeImageHandler 75 *encoder; 76 77 ImageInfo 78 *image_info; 79 80 IsImageFormatHandler 81 *magick; 82 83 MagickFormatType 84 format_type; 85 86 MagickStatusType 87 flags; 88 89 SemaphoreInfo 90 *semaphore; 91 92 size_t 93 signature; 94 95 void 96 *client_data; 97 } MagickInfo; 98 99 extern MagickExport char 100 **GetMagickList(const char *,size_t *,ExceptionInfo *); 101 102 extern MagickExport const char 103 *GetMagickDescription(const MagickInfo *), 104 *GetMagickMimeType(const MagickInfo *); 105 106 extern MagickExport DecodeImageHandler 107 *GetImageDecoder(const MagickInfo *) magick_attribute((__pure__)); 108 109 extern MagickExport EncodeImageHandler 110 *GetImageEncoder(const MagickInfo *) magick_attribute((__pure__)); 111 112 extern MagickExport int 113 GetMagickPrecision(void), 114 SetMagickPrecision(const int); 115 116 extern MagickExport MagickBooleanType 117 GetImageMagick(const unsigned char *,const size_t,char *), 118 GetMagickAdjoin(const MagickInfo *) magick_attribute((__pure__)), 119 GetMagickBlobSupport(const MagickInfo *) magick_attribute((__pure__)), 120 GetMagickDecoderSeekableStream(const MagickInfo *) 121 magick_attribute((__pure__)), 122 GetMagickDecoderThreadSupport(const MagickInfo *) 123 magick_attribute((__pure__)), 124 GetMagickEncoderSeekableStream(const MagickInfo *) 125 magick_attribute((__pure__)), 126 GetMagickEncoderThreadSupport(const MagickInfo *) 127 magick_attribute((__pure__)), 128 GetMagickEndianSupport(const MagickInfo *) magick_attribute((__pure__)), 129 GetMagickRawSupport(const MagickInfo *) magick_attribute((__pure__)), 130 GetMagickStealth(const MagickInfo *) magick_attribute((__pure__)), 131 GetMagickUseExtension(const MagickInfo *) magick_attribute((__pure__)), 132 IsMagickCoreInstantiated(void) magick_attribute((__pure__)), 133 RegisterMagickInfo(MagickInfo *), 134 UnregisterMagickInfo(const char *); 135 136 extern const MagickExport MagickInfo 137 *GetMagickInfo(const char *,ExceptionInfo *), 138 **GetMagickInfoList(const char *,size_t *,ExceptionInfo *); 139 140 extern MagickExport MagickInfo 141 *AcquireMagickInfo(const char *, const char *, const char *); 142 143 extern MagickExport void 144 MagickCoreGenesis(const char *,const MagickBooleanType), 145 MagickCoreTerminus(void); 146 147 #if defined(__cplusplus) || defined(c_plusplus) 148 } 149 #endif 150 151 #endif 152