StreamHandler
stream;
- UserBlobInfo
- *user_info;
+ CustomBlobInfo
+ *custom_info;
unsigned char
*data;
clone_info->file_info.file=blob_info->file_info.file;
clone_info->properties=blob_info->properties;
clone_info->stream=blob_info->stream;
- clone_info->user_info=blob_info->user_info;
+ clone_info->custom_info=blob_info->custom_info;
clone_info->data=blob_info->data;
clone_info->debug=IsEventLogging();
clone_info->reference_count=1;
}
break;
}
- case UserStream:
+ case CustomStream:
break;
}
image->blob->status=status < 0 ? MagickTrue : MagickFalse;
status=fclose(image->blob->file_info.file);
break;
}
- case UserStream:
+ case CustomStream:
break;
}
(void) DetachBlob(image->blob);
data=blob_info->data;
blob_info->data=(unsigned char *) NULL;
blob_info->stream=(StreamHandler) NULL;
- blob_info->user_info=(UserBlobInfo*) NULL;
+ blob_info->custom_info=(CustomBlobInfo*) NULL;
return(data);
}
\f
}
case BlobStream:
break;
- case UserStream:
+ case CustomStream:
break;
}
return((int) image->blob->eof);
extent=(MagickSizeType) image->blob->length;
break;
}
- case UserStream:
+ case CustomStream:
break;
}
return(extent);
% %
% %
% %
-+ I m a g e T o U s e r B l o b %
++ I m a g e T o C u s t o m B l o b %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% ImageToUserBlob() is the equivalent of WriteImage(), but writes the
+% ImageToCustomBlob() is the equivalent of WriteImage(), but writes the
% formatted "file" to the suplied method rather than to an actual file.
%
-% The format of the ImageToUserBlob method is:
+% The format of the ImageToCustomBlob method is:
%
-% void ImageToUserBlob(const ImageInfo *image_info,Image *image,
-% UserBlobInfo *user_info,ExceptionInfo *exception)
+% void ImageToCustomBlob(const ImageInfo *image_info,Image *image,
+% CustomBlobInfo *custom_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o image: the image.
%
-% o user_info: the methods to use when writing and seeking.
+% o custom_info: the methods to use when writing and seeking.
%
% o exception: return any errors or warnings in this structure.
%
*/
-MagickExport void ImageToUserBlob(const ImageInfo *image_info,Image *image,
- UserBlobInfo *user_info,ExceptionInfo *exception)
+MagickExport void ImageToCustomBlob(const ImageInfo *image_info,Image *image,
+ CustomBlobInfo *custom_info,ExceptionInfo *exception)
{
const MagickInfo
*magick_info;
image_info->filename);
assert(image != (Image *) NULL);
assert(image->signature == MagickCoreSignature);
- assert(user_info != (UserBlobInfo *) NULL);
- assert(user_info->reader != (BlobHandler) NULL);
- assert(user_info->writer != (BlobHandler) NULL);
+ assert(custom_info != (CustomBlobInfo *) NULL);
+ assert(custom_info->reader != (BlobHandler) NULL);
+ assert(custom_info->writer != (BlobHandler) NULL);
assert(exception != (ExceptionInfo *) NULL);
blob_info=CloneImageInfo(image_info);
blob_info->adjoin=MagickFalse;
- blob_info->user_info=user_info;
+ blob_info->custom_info=custom_info;
(void) SetImageInfo(blob_info,1,exception);
if (*blob_info->magick != '\0')
(void) CopyMagickString(image->magick,blob_info->magick,MagickPathExtent);
/*
Write file to disk in blob image format.
*/
- blob_info->user_info=(UserBlobInfo *) NULL;
+ blob_info->custom_info=(CustomBlobInfo *) NULL;
blob=(unsigned char *) AcquireQuantumMemory(MagickMaxBufferExtent,
sizeof(*blob));
if (blob == (unsigned char *) NULL)
{
count=(ssize_t) fread(blob,sizeof(*blob),MagickMaxBufferExtent,
blob_info->file);
- user_info->writer(blob,count,user_info->data);
+ custom_info->writer(blob,count,custom_info->data);
}
}
(void) fclose(blob_info->file);
% %
% %
% %
-+ I m a g e s T o U s e r B l o b %
++ I m a g e s T o C u s t o m B l o b %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% ImagesToUserBlob() is the equivalent of WriteImages(), but writes the
+% ImagesToCustomBlob() is the equivalent of WriteImages(), but writes the
% formatted "file" to the suplied method rather than to an actual file.
%
-% The format of the ImageToUserBlob method is:
+% The format of the ImageToCustomBlob method is:
%
-% void ImagesToUserBlob(const ImageInfo *image_info,Image *images,
-% UserBlobInfo *user_info,ExceptionInfo *exception)
+% void ImagesToCustomBlob(const ImageInfo *image_info,Image *images,
+% CustomBlobInfo *custom_info,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o images: the image list.
%
-% o user_info: the methods to use when writing and seeking.
+% o custom_info: the methods to use when writing and seeking.
%
% o exception: return any errors or warnings in this structure.
%
*/
-MagickExport void ImagesToUserBlob(const ImageInfo *image_info,Image *images,
- UserBlobInfo *user_info,ExceptionInfo *exception)
+MagickExport void ImagesToCustomBlob(const ImageInfo *image_info,Image *images,
+ CustomBlobInfo *custom_info,ExceptionInfo *exception)
{
const MagickInfo
*magick_info;
image_info->filename);
assert(images != (Image *) NULL);
assert(images->signature == MagickCoreSignature);
- assert(user_info != (UserBlobInfo *) NULL);
- assert(user_info->reader != (BlobHandler) NULL);
- assert(user_info->writer != (BlobHandler) NULL);
+ assert(custom_info != (CustomBlobInfo *) NULL);
+ assert(custom_info->reader != (BlobHandler) NULL);
+ assert(custom_info->writer != (BlobHandler) NULL);
assert(exception != (ExceptionInfo *) NULL);
blob_info=CloneImageInfo(image_info);
- blob_info->user_info=user_info;
+ blob_info->custom_info=custom_info;
(void) SetImageInfo(blob_info,(unsigned int) GetImageListLength(images),
exception);
if (*blob_info->magick != '\0')
/*
Write file to disk in blob image format.
*/
- blob_info->user_info=(UserBlobInfo *) NULL;
+ blob_info->custom_info=(CustomBlobInfo *) NULL;
blob=(unsigned char *) AcquireQuantumMemory(MagickMaxBufferExtent,
sizeof(*blob));
if (blob == (unsigned char *) NULL)
{
count=(ssize_t) fread(blob,sizeof(*blob),MagickMaxBufferExtent,
blob_info->file);
- user_info->writer(blob,count,user_info->data);
+ custom_info->writer(blob,count,custom_info->data);
}
}
(void) fclose(blob_info->file);
seekable=MagickFalse;
break;
}
- case UserStream:
+ case CustomStream:
{
- if ((image->blob->user_info->seeker != (BlobSeeker) NULL) &&
- (image->blob->user_info->teller != (BlobTeller) NULL))
+ if ((image->blob->custom_info->seeker != (BlobSeeker) NULL) &&
+ (image->blob->custom_info->teller != (BlobTeller) NULL))
seekable=MagickTrue;
else
seekable=MagickFalse;
AttachBlob(image->blob,image_info->blob,image_info->length);
return(MagickTrue);
}
- if ((image_info->user_info != (UserBlobInfo *) NULL) &&
+ if ((image_info->custom_info != (CustomBlobInfo *) NULL) &&
(*image->filename == '\0'))
{
- image->blob->type=UserStream;
- image->blob->user_info=image_info->user_info;
+ image->blob->type=CustomStream;
+ image->blob->custom_info=image_info->custom_info;
return(MagickTrue);
}
(void) DetachBlob(image->blob);
(void) memcpy(q,p,(size_t) count);
break;
}
- case UserStream:
+ case CustomStream:
{
- count=image->blob->user_info->reader(q,length,
- image->blob->user_info->data);
+ count=image->blob->custom_info->reader(q,length,
+ image->blob->custom_info->data);
break;
}
}
}
break;
}
- case UserStream:
+ case CustomStream:
{
- if (image->blob->user_info->seeker == (BlobSeeker) NULL)
+ if (image->blob->custom_info->seeker == (BlobSeeker) NULL)
return(-1);
- image->blob->offset=image->blob->user_info->seeker(offset,whence,
- image->blob->user_info->data);
+ image->blob->offset=image->blob->custom_info->seeker(offset,whence,
+ image->blob->custom_info->data);
break;
}
}
}
break;
}
- case UserStream:
+ case CustomStream:
break;
}
return(MagickTrue);
break;
case BlobStream:
break;
- case UserStream:
+ case CustomStream:
break;
}
return(status);
offset=image->blob->offset;
break;
}
- case UserStream:
+ case CustomStream:
{
- if (image->blob->user_info->teller != (BlobTeller) NULL)
- offset=image->blob->user_info->teller(image->blob->user_info->data);
+ if (image->blob->custom_info->teller != (BlobTeller) NULL)
+ offset=image->blob->custom_info->teller(image->blob->custom_info->data);
break;
}
}
% %
% %
% %
-% U s e r B l o b T o I m a g e %
+% C u s t o m B l o b T o I m a g e %
% %
% %
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% UserBlobToImage() is the equivalent of ReadImage(), but reads the
+% CustomBlobToImage() is the equivalent of ReadImage(), but reads the
% formatted "file" from the suplied method rather than to an actual file.
%
% The format of the BlobToImage method is:
% o exception: return any errors or warnings in this structure.
%
*/
-MagickExport Image *UserBlobToImage(const ImageInfo *image_info,
- UserBlobInfo *user_info,ExceptionInfo *exception)
+MagickExport Image *CustomBlobToImage(const ImageInfo *image_info,
+ CustomBlobInfo *custom_info,ExceptionInfo *exception)
{
const MagickInfo
*magick_info;
if (image_info->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",
image_info->filename);
- assert(user_info != (UserBlobInfo *) NULL);
- assert(user_info->reader != (BlobHandler) NULL);
+ assert(custom_info != (CustomBlobInfo *) NULL);
+ assert(custom_info->reader != (BlobHandler) NULL);
assert(exception != (ExceptionInfo *) NULL);
blob_info=CloneImageInfo(image_info);
- blob_info->user_info=user_info;
+ blob_info->custom_info=custom_info;
if (*blob_info->magick == '\0')
(void) SetImageInfo(blob_info,0,exception);
magick_info=GetMagickInfo(blob_info->magick,exception);
}
image=(Image *) NULL;
if ((GetMagickBlobSupport(magick_info) != MagickFalse) ||
- (blob_info->user_info == (UserBlobInfo *) NULL))
+ (blob_info->custom_info == (CustomBlobInfo *) NULL))
{
/*
Native blob support for this image format or SetImageInfo changed the
/*
Write data to file on disk.
*/
- blob_info->user_info=(UserBlobInfo *) NULL;
+ blob_info->custom_info=(CustomBlobInfo *) NULL;
blob=(unsigned char *) AcquireQuantumMemory(MagickMaxBufferExtent,
sizeof(*blob));
if (blob == (unsigned char *) NULL)
count=(ssize_t) MagickMaxBufferExtent;
while (count == (ssize_t) MagickMaxBufferExtent)
{
- count=user_info->reader(blob,MagickMaxBufferExtent,
- user_info->data);
+ count=custom_info->reader(blob,MagickMaxBufferExtent,
+ custom_info->data);
count=(ssize_t) write(file,(const char *) blob,count);
}
(void) fclose(blob_info->file);
count=(ssize_t) length;
break;
}
- case UserStream:
+ case CustomStream:
{
- count=image->blob->user_info->writer((const unsigned char *) data,
- length,image->blob->user_info->data);
+ count=image->blob->custom_info->writer((const unsigned char *) data,
+ length,image->blob->custom_info->data);
break;
}
}