1 /* 2 Copyright 1999-2020 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 #if defined(__cplusplus) || defined(c_plusplus) 29 # define magick_module _module /* reserved word in C++(20) */ 30 #else 31 # define magick_module module 32 #endif 33 34 typedef enum 35 { 36 UndefinedFormatType, 37 ImplicitFormatType, 38 ExplicitFormatType 39 } MagickFormatType; 40 41 typedef enum 42 { 43 CoderNoFlag = 0x0000, 44 CoderAdjoinFlag = 0x0001, 45 CoderBlobSupportFlag = 0x0002, 46 CoderDecoderThreadSupportFlag = 0x0004, 47 CoderEncoderThreadSupportFlag = 0x0008, 48 CoderEndianSupportFlag = 0x0010, 49 CoderRawSupportFlag = 0x0020, 50 CoderSeekableStreamFlag = 0x0040, /* deprecated */ 51 CoderStealthFlag = 0x0080, 52 CoderUseExtensionFlag = 0x0100, 53 CoderDecoderSeekableStreamFlag = 0x0200, 54 CoderEncoderSeekableStreamFlag = 0x0400, 55 56 } MagickInfoFlag; 57 58 typedef Image 59 *DecodeImageHandler(const ImageInfo *,ExceptionInfo *); 60 61 typedef MagickBooleanType 62 EncodeImageHandler(const ImageInfo *,Image *,ExceptionInfo *); 63 64 typedef MagickBooleanType 65 IsImageFormatHandler(const unsigned char *,const size_t); 66 67 typedef struct _MagickInfo 68 { 69 char 70 *name, 71 *description, 72 *version, 73 *mime_type, 74 *note, 75 *magick_module; 76 77 DecodeImageHandler 78 *decoder; 79 80 EncodeImageHandler 81 *encoder; 82 83 ImageInfo 84 *image_info; 85 86 IsImageFormatHandler 87 *magick; 88 89 MagickFormatType 90 format_type; 91 92 MagickStatusType 93 flags; 94 95 SemaphoreInfo 96 *semaphore; 97 98 size_t 99 signature; 100 101 void 102 *client_data; 103 } MagickInfo; 104 105 extern MagickExport char 106 **GetMagickList(const char *,size_t *,ExceptionInfo *); 107 108 extern MagickExport const char 109 *GetMagickDescription(const MagickInfo *), 110 *GetMagickMimeType(const MagickInfo *), 111 *GetMagickModuleName(const MagickInfo *), 112 *GetMagickName(const MagickInfo *); 113 114 extern MagickExport DecodeImageHandler 115 *GetImageDecoder(const MagickInfo *) magick_attribute((__pure__)); 116 117 extern MagickExport EncodeImageHandler 118 *GetImageEncoder(const MagickInfo *) magick_attribute((__pure__)); 119 120 extern MagickExport int 121 GetMagickPrecision(void), 122 SetMagickPrecision(const int); 123 124 extern MagickExport MagickBooleanType 125 GetImageMagick(const unsigned char *,const size_t,char *), 126 GetMagickAdjoin(const MagickInfo *) magick_attribute((__pure__)), 127 GetMagickBlobSupport(const MagickInfo *) magick_attribute((__pure__)), 128 GetMagickDecoderSeekableStream(const MagickInfo *) 129 magick_attribute((__pure__)), 130 GetMagickDecoderThreadSupport(const MagickInfo *) 131 magick_attribute((__pure__)), 132 GetMagickEncoderSeekableStream(const MagickInfo *) 133 magick_attribute((__pure__)), 134 GetMagickEncoderThreadSupport(const MagickInfo *) 135 magick_attribute((__pure__)), 136 GetMagickEndianSupport(const MagickInfo *) magick_attribute((__pure__)), 137 GetMagickRawSupport(const MagickInfo *) magick_attribute((__pure__)), 138 GetMagickStealth(const MagickInfo *) magick_attribute((__pure__)), 139 GetMagickUseExtension(const MagickInfo *) magick_attribute((__pure__)), 140 IsMagickCoreInstantiated(void) magick_attribute((__pure__)), 141 RegisterMagickInfo(MagickInfo *), 142 UnregisterMagickInfo(const char *); 143 144 extern const MagickExport MagickInfo 145 *GetMagickInfo(const char *,ExceptionInfo *), 146 **GetMagickInfoList(const char *,size_t *,ExceptionInfo *); 147 148 extern MagickExport MagickInfo 149 *AcquireMagickInfo(const char *, const char *, const char *); 150 151 extern MagickExport void 152 MagickCoreGenesis(const char *,const MagickBooleanType), 153 MagickCoreTerminus(void); 154 155 #if defined(__cplusplus) || defined(c_plusplus) 156 } 157 #endif 158 159 #endif 160