Home | History | Annotate | Download | only in MagickCore
      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 {
     29   ReadMode,
     30   WriteMode,
     31   IOMode,
     32   PersistMode
     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
     45   CustomStreamInfo;
     46 
     47 #include "MagickCore/image.h"
     48 #include "MagickCore/stream.h"
     49 
     50 extern MagickExport CustomStreamInfo
     51   *AcquireCustomStreamInfo(ExceptionInfo *),
     52   *DestroyCustomStreamInfo(CustomStreamInfo *);
     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 
     62 extern MagickExport MagickBooleanType
     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 
     73 extern MagickExport MagickSizeType
     74   GetBlobSize(const Image *);
     75 
     76 extern MagickExport StreamHandler
     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),
     89   SetCustomStreamData(CustomStreamInfo *,void *),
     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
    100