MagickCore  7.0.10
blob.h
Go to the documentation of this file.
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 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 #define MagickMinBufferExtent 16384
27 
28 typedef enum
29 {
34 } MapMode;
35 
36 typedef ssize_t
37  (*CustomStreamHandler)(unsigned char *,const size_t,void *);
38 
39 typedef MagickOffsetType
40  (*CustomStreamSeeker)(const MagickOffsetType,const int,void *);
41 
42 typedef MagickOffsetType
43  (*CustomStreamTeller)(void *);
44 
45 typedef struct _CustomStreamInfo
47 
48 #include "MagickCore/image.h"
49 #include "MagickCore/stream.h"
50 
54 
55 extern MagickExport FILE
56  *GetBlobFileHandle(const Image *) magick_attribute((__pure__));
57 
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 *);
62 
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 *,
69  ExceptionInfo *),
70  IsBlobExempt(const Image *) magick_attribute((__pure__)),
71  IsBlobSeekable(const Image *) magick_attribute((__pure__)),
72  IsBlobTemporary(const Image *) magick_attribute((__pure__));
73 
75  GetBlobSize(const Image *);
76 
78  GetBlobStreamHandler(const Image *) magick_attribute((__pure__));
79 
80 extern MagickExport void
81  *GetBlobStreamData(const Image *) magick_attribute((__pure__)),
82  DestroyBlob(Image *),
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),
91  SetCustomStreamReader(CustomStreamInfo *,CustomStreamHandler),
92  SetCustomStreamSeeker(CustomStreamInfo *,CustomStreamSeeker),
93  SetCustomStreamTeller(CustomStreamInfo *,CustomStreamTeller),
94  SetCustomStreamWriter(CustomStreamInfo *,CustomStreamHandler);
95 
96 #if defined(__cplusplus) || defined(c_plusplus)
97 }
98 #endif
99 
100 #endif
MagickExport void ImageToCustomStream(const ImageInfo *image_info, Image *image, ExceptionInfo *exception)
Definition: blob.c:2151
Definition: blob.h:30
MagickExport void SetCustomStreamWriter(CustomStreamInfo *custom_stream, CustomStreamHandler writer)
Definition: blob.c:5371
MagickExport MagickBooleanType GetBlobError(const Image *image)
Definition: blob.c:1714
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:2019
Definition: blob.h:32
MagickExport Image * PingBlob(const ImageInfo *image_info, const void *blob, const size_t length, ExceptionInfo *exception)
Definition: blob.c:3595
MagickExport MagickBooleanType ImageToFile(Image *image, char *filename, ExceptionInfo *exception)
Definition: blob.c:2299
MagickExport MagickBooleanType FileToImage(Image *image, const char *filename, ExceptionInfo *exception)
Definition: blob.c:1614
MagickExport Image * CustomStreamToImage(const ImageInfo *image_info, ExceptionInfo *exception)
Definition: blob.c:777
ssize_t MagickOffsetType
Definition: magick-type.h:133
Definition: image.h:151
#define magick_attribute(x)
MagickOffsetType(* CustomStreamSeeker)(const MagickOffsetType, const int, void *)
Definition: blob.h:40
MagickExport void SetCustomStreamReader(CustomStreamInfo *custom_stream, CustomStreamHandler reader)
Definition: blob.c:5272
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:169
MagickExport FILE * GetBlobFileHandle(const Image *image)
Definition: blob.c:1747
MagickExport void * FileToBlob(const char *filename, const size_t extent, size_t *length, ExceptionInfo *exception)
Definition: blob.c:1393
MagickOffsetType(* CustomStreamTeller)(void *)
Definition: blob.h:43
MagickExport MagickBooleanType InjectImageBlob(const ImageInfo *image_info, Image *image, Image *inject_image, const char *format, ExceptionInfo *exception)
Definition: blob.c:2714
size_t MagickSizeType
Definition: magick-type.h:134
MagickExport MagickBooleanType IsBlobTemporary(const Image *image)
Definition: blob.c:2969
MagickExport void SetBlobExempt(Image *image, const MagickBooleanType exempt)
Definition: blob.c:5053
MagickExport void * ImagesToBlob(const ImageInfo *image_info, Image *images, size_t *length, ExceptionInfo *exception)
Definition: blob.c:2421
MagickExport CustomStreamInfo * DestroyCustomStreamInfo(CustomStreamInfo *custom_stream)
Definition: blob.c:995
MagickExport MagickBooleanType IsBlobSeekable(const Image *image)
Definition: blob.c:2890
ssize_t(* CustomStreamHandler)(unsigned char *, const size_t, void *)
Definition: blob.h:37
MagickExport MagickSizeType GetBlobSize(const Image *image)
Definition: blob.c:1844
Definition: blob.h:31
MagickExport void SetCustomStreamData(CustomStreamInfo *custom_stream, void *data)
Definition: blob.c:5239
MagickExport MagickBooleanType IsBlobExempt(const Image *image)
Definition: blob.c:2859
MapMode
Definition: blob.h:28
MagickExport CustomStreamInfo * AcquireCustomStreamInfo(ExceptionInfo *magick_unused(exception))
Definition: blob.c:223
MagickExport void SetCustomStreamTeller(CustomStreamInfo *custom_stream, CustomStreamTeller teller)
Definition: blob.c:5338
MagickExport void SetCustomStreamSeeker(CustomStreamInfo *custom_stream, CustomStreamSeeker seeker)
Definition: blob.c:5305
#define MagickExport
MagickExport StreamHandler GetBlobStreamHandler(const Image *image)
Definition: blob.c:1977
MagickExport void DestroyBlob(Image *image)
Definition: blob.c:933
MagickExport void ImagesToCustomStream(const ImageInfo *image_info, Image *images, ExceptionInfo *exception)
Definition: blob.c:2559
MagickExport void DuplicateBlob(Image *image, const Image *duplicate)
Definition: blob.c:1193
MagickExport void * GetBlobStreamData(const Image *image)
Definition: blob.c:1948
MagickExport MagickBooleanType BlobToFile(char *filename, const void *blob, const size_t length, ExceptionInfo *exception)
Definition: blob.c:347