MagickCore  7.0.3
blob.h
Go to the documentation of this file.
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 Binary Large OBjects methods.
17 */
18 #ifndef MAGICKCORE_BLOB_H
19 #define MAGICKCORE_BLOB_H
20 
21 #if defined(__cplusplus) || defined(c_plusplus)
22 extern "C" {
23 #endif
24 
25 #define MagickMaxBufferExtent 81920
26 
27 typedef enum
28 {
33 } MapMode;
34 
35 typedef ssize_t
36  (*CustomStreamHandler)(unsigned char *,const size_t,void *);
37 
38 typedef MagickOffsetType
39  (*CustomStreamSeeker)(const MagickOffsetType,const int,void *);
40 
41 typedef MagickOffsetType
42  (*CustomStreamTeller)(void *);
43 
44 typedef struct _CustomStreamInfo
46 
47 #include "MagickCore/image.h"
48 #include "MagickCore/stream.h"
49 
53 
54 extern MagickExport FILE
55  *GetBlobFileHandle(const Image *) magick_attribute((__pure__));
56 
57 extern MagickExport Image
58  *BlobToImage(const ImageInfo *,const void *,const size_t,ExceptionInfo *),
59  *PingBlob(const ImageInfo *,const void *,const size_t,ExceptionInfo *),
60  *CustomStreamToImage(const ImageInfo *,ExceptionInfo *);
61 
63  BlobToFile(char *,const void *,const size_t,ExceptionInfo *),
64  FileToImage(Image *,const char *,ExceptionInfo *),
65  GetBlobError(const Image *) magick_attribute((__pure__)),
66  ImageToFile(Image *,char *,ExceptionInfo *),
67  InjectImageBlob(const ImageInfo *,Image *,Image *,const char *,
68  ExceptionInfo *),
69  IsBlobExempt(const Image *) magick_attribute((__pure__)),
70  IsBlobSeekable(const Image *) magick_attribute((__pure__)),
71  IsBlobTemporary(const Image *) magick_attribute((__pure__));
72 
74  GetBlobSize(const Image *);
75 
77  GetBlobStreamHandler(const Image *) magick_attribute((__pure__));
78 
79 extern MagickExport void
80  *GetBlobStreamData(const Image *) magick_attribute((__pure__)),
81  DestroyBlob(Image *),
82  DuplicateBlob(Image *,const Image *),
83  *FileToBlob(const char *,const size_t,size_t *,ExceptionInfo *),
84  *ImageToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *),
85  ImageToCustomStream(const ImageInfo *,Image *,ExceptionInfo *),
86  *ImagesToBlob(const ImageInfo *,Image *,size_t *,ExceptionInfo *),
87  ImagesToCustomStream(const ImageInfo *,Image *,ExceptionInfo *),
88  SetBlobExempt(Image *,const MagickBooleanType),
90  SetCustomStreamReader(CustomStreamInfo *,CustomStreamHandler),
91  SetCustomStreamSeeker(CustomStreamInfo *,CustomStreamSeeker),
92  SetCustomStreamTeller(CustomStreamInfo *,CustomStreamTeller),
93  SetCustomStreamWriter(CustomStreamInfo *,CustomStreamHandler);
94 
95 #if defined(__cplusplus) || defined(c_plusplus)
96 }
97 #endif
98 
99 #endif
MagickExport void ImageToCustomStream(const ImageInfo *image_info, Image *image, ExceptionInfo *exception)
Definition: blob.c:2109
Definition: blob.h:29
MagickExport void SetCustomStreamWriter(CustomStreamInfo *custom_stream, CustomStreamHandler writer)
Definition: blob.c:5309
MagickExport MagickBooleanType GetBlobError(const Image *image)
Definition: blob.c:1674
size_t(* StreamHandler)(const Image *, const void *, const size_t)
Definition: stream.h:31
MagickExport void * ImageToBlob(const ImageInfo *image_info, Image *image, size_t *length, ExceptionInfo *exception)
Definition: blob.c:1977
Definition: blob.h:31
MagickExport Image * PingBlob(const ImageInfo *image_info, const void *blob, const size_t length, ExceptionInfo *exception)
Definition: blob.c:3552
MagickExport MagickBooleanType ImageToFile(Image *image, char *filename, ExceptionInfo *exception)
Definition: blob.c:2257
MagickExport MagickBooleanType FileToImage(Image *image, const char *filename, ExceptionInfo *exception)
Definition: blob.c:1574
MagickExport Image * CustomStreamToImage(const ImageInfo *image_info, ExceptionInfo *exception)
Definition: blob.c:737
ssize_t MagickOffsetType
Definition: magick-type.h:129
Definition: image.h:151
#define magick_attribute(x)
MagickOffsetType(* CustomStreamSeeker)(const MagickOffsetType, const int, void *)
Definition: blob.h:39
MagickExport void SetCustomStreamReader(CustomStreamInfo *custom_stream, CustomStreamHandler reader)
Definition: blob.c:5210
MagickExport Image * BlobToImage(const ImageInfo *image_info, const void *blob, const size_t length, ExceptionInfo *exception)
Definition: blob.c:422
MagickBooleanType
Definition: magick-type.h:158
MagickExport FILE * GetBlobFileHandle(const Image *image)
Definition: blob.c:1705
MagickExport void * FileToBlob(const char *filename, const size_t extent, size_t *length, ExceptionInfo *exception)
Definition: blob.c:1352
MagickOffsetType(* CustomStreamTeller)(void *)
Definition: blob.h:42
MagickExport MagickBooleanType InjectImageBlob(const ImageInfo *image_info, Image *image, Image *inject_image, const char *format, ExceptionInfo *exception)
Definition: blob.c:2672
size_t MagickSizeType
Definition: magick-type.h:130
MagickExport MagickBooleanType IsBlobTemporary(const Image *image)
Definition: blob.c:2927
MagickExport void SetBlobExempt(Image *image, const MagickBooleanType exempt)
Definition: blob.c:4991
MagickExport void * ImagesToBlob(const ImageInfo *image_info, Image *images, size_t *length, ExceptionInfo *exception)
Definition: blob.c:2379
MagickExport CustomStreamInfo * DestroyCustomStreamInfo(CustomStreamInfo *custom_stream)
Definition: blob.c:955
MagickExport MagickBooleanType IsBlobSeekable(const Image *image)
Definition: blob.c:2848
ssize_t(* CustomStreamHandler)(unsigned char *, const size_t, void *)
Definition: blob.h:36
MagickExport MagickSizeType GetBlobSize(const Image *image)
Definition: blob.c:1802
Definition: blob.h:30
MagickExport void SetCustomStreamData(CustomStreamInfo *custom_stream, void *data)
Definition: blob.c:5177
MagickExport MagickBooleanType IsBlobExempt(const Image *image)
Definition: blob.c:2817
MapMode
Definition: blob.h:27
MagickExport CustomStreamInfo * AcquireCustomStreamInfo(ExceptionInfo *magick_unused(exception))
Definition: blob.c:223
MagickExport void SetCustomStreamTeller(CustomStreamInfo *custom_stream, CustomStreamTeller teller)
Definition: blob.c:5276
MagickExport void SetCustomStreamSeeker(CustomStreamInfo *custom_stream, CustomStreamSeeker seeker)
Definition: blob.c:5243
#define MagickExport
MagickExport StreamHandler GetBlobStreamHandler(const Image *image)
Definition: blob.c:1935
MagickExport void DestroyBlob(Image *image)
Definition: blob.c:893
MagickExport void ImagesToCustomStream(const ImageInfo *image_info, Image *images, ExceptionInfo *exception)
Definition: blob.c:2517
MagickExport void DuplicateBlob(Image *image, const Image *duplicate)
Definition: blob.c:1152
MagickExport void * GetBlobStreamData(const Image *image)
Definition: blob.c:1906
MagickExport MagickBooleanType BlobToFile(char *filename, const void *blob, const size_t length, ExceptionInfo *exception)
Definition: blob.c:347