2 Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
3 dedicated to making software imaging solutions freely available.
5 You may not use this file except in compliance with the License. You may
6 obtain a copy of the License at
8 https://imagemagick.org/script/license.php
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.
16 MagickCore Binary Large OBjects methods.
18 #ifndef MAGICKCORE_BLOB_H
19 #define MAGICKCORE_BLOB_H
21 #if defined(__cplusplus) || defined(c_plusplus)
25 #define MagickMaxBufferExtent 81920
26 #define MagickMinBufferExtent 16384
37 (*CustomStreamHandler)(unsigned char *,const size_t,void *);
39 typedef MagickOffsetType
40 (*CustomStreamSeeker)(const MagickOffsetType,const int,void *);
42 typedef MagickOffsetType
43 (*CustomStreamTeller)(void *);
45 typedef struct _CustomStreamInfo
48 #include "MagickCore/image.h"
49 #include "MagickCore/stream.h"
51 extern MagickExport CustomStreamInfo
52 *AcquireCustomStreamInfo(ExceptionInfo *),
53 *DestroyCustomStreamInfo(CustomStreamInfo *);
55 extern MagickExport FILE
56 *GetBlobFileHandle(const Image *) magick_attribute((__pure__));
58 extern MagickExport Image
59 *BlobToImage(const ImageInfo *,const void *,const size_t,ExceptionInfo *),
60 *PingBlob(const ImageInfo *,const void *,const size_t,ExceptionInfo *),
61 *CustomStreamToImage(const ImageInfo *,ExceptionInfo *);
63 extern MagickExport MagickBooleanType
64 BlobToFile(char *,const void *,const size_t,ExceptionInfo *),
65 FileToImage(Image *,const char *,ExceptionInfo *),
66 GetBlobError(const Image *) magick_attribute((__pure__)),
67 ImageToFile(Image *,char *,ExceptionInfo *),
68 InjectImageBlob(const ImageInfo *,Image *,Image *,const char *,
70 IsBlobExempt(const Image *) magick_attribute((__pure__)),
71 IsBlobSeekable(const Image *) magick_attribute((__pure__)),
72 IsBlobTemporary(const Image *) magick_attribute((__pure__));
74 extern MagickExport MagickSizeType
75 GetBlobSize(const Image *);
77 extern MagickExport StreamHandler
78 GetBlobStreamHandler(const Image *) magick_attribute((__pure__));
80 extern MagickExport void
81 *GetBlobStreamData(const Image *) magick_attribute((__pure__)),
83 DuplicateBlob(Image *,const Image *),
84 *FileToBlob(const char *,const size_t,size_t *,ExceptionInfo *),
85 *ImageToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *),
86 ImageToCustomStream(const ImageInfo *,Image *,ExceptionInfo *),
87 *ImagesToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *),
88 ImagesToCustomStream(const ImageInfo *,Image *,ExceptionInfo *),
89 SetBlobExempt(Image *,const MagickBooleanType),
90 SetCustomStreamData(CustomStreamInfo *,void *),
91 SetCustomStreamReader(CustomStreamInfo *,CustomStreamHandler),
92 SetCustomStreamSeeker(CustomStreamInfo *,CustomStreamSeeker),
93 SetCustomStreamTeller(CustomStreamInfo *,CustomStreamTeller),
94 SetCustomStreamWriter(CustomStreamInfo *,CustomStreamHandler);
96 #if defined(__cplusplus) || defined(c_plusplus)