% 2008.05.07 %
% v 0.9 %
% %
-% Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
+% Copyright 1999-2015 ImageMagick Studio LLC, a non-profit organization %
% dedicated to making software imaging solutions freely available. %
% %
% You may not use this file except in compliance with the License. You may %
static MagickBooleanType
WriteIPLImage(const ImageInfo *,Image *,ExceptionInfo *);
-void increase (void *pixel, int byteType){
+/*
+static void increase (void *pixel, int byteType){
switch(byteType){
case 0:(*((unsigned char *) pixel))++; break;
case 1:(*((signed int *) pixel))++; break;
default:(*((unsigned int *) pixel))++; break;
}
}
+*/
/*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
*/
-void SetHeaderFromIPL(Image *image, IPLInfo *ipl){
+static void SetHeaderFromIPL(Image *image, IPLInfo *ipl){
image->columns = ipl->width;
image->rows = ipl->height;
image->depth = ipl->depth;
- image->x_resolution = 1;
- image->y_resolution = 1;
+ image->resolution.x = 1;
+ image->resolution.y = 1;
}
image_info->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickSignature);
- image=AcquireImage(image_info);
+ image=AcquireImage(image_info,exception);
status=OpenBlob(image_info,image,ReadBinaryBlobMode,exception);
if (status == MagickFalse)
{
if((ipl_info.width == 0UL) || (ipl_info.height == 0UL))
ThrowReaderException(CorruptImageError,"ImproperImageHeader");
ipl_info.colors=ReadBlobLong(image);
- if(ipl_info.colors == 3){ image->colorspace=RGBColorspace;}
+ if(ipl_info.colors == 3){ SetImageColorspace(image,sRGBColorspace,exception);}
else { image->colorspace = GRAYColorspace; }
ipl_info.z=ReadBlobLong(image);
ipl_info.time=ReadBlobLong(image);
/* Thats all we need if we are pinging. */
if (image_info->ping != MagickFalse)
- {
- (void) CloseBlob(image);
- return(GetFirstImageInList(image));
- }
+ {
+ (void) CloseBlob(image);
+ return(GetFirstImageInList(image));
+ }
length=image->columns;
quantum_type=GetQuantumType(image,exception);
do
{
SetHeaderFromIPL(image, &ipl_info);
- if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
+ if ((image_info->ping != MagickFalse) && (image_info->number_scenes != 0))
if (image->scene >= (image_info->scene+image_info->number_scenes-1))
break;
+ status=SetImageExtent(image,image->columns,image->rows,exception);
+ if (status == MagickFalse)
+ return(DestroyImageList(image));
/*
printf("Length: %.20g, Memory size: %.20g\n", (double) length,(double)
image->depth);
status=SetQuantumFormat(image,quantum_info,quantum_format);
if (status == MagickFalse)
ThrowReaderException(ResourceLimitError,"MemoryAllocationFailed");
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(unsigned char *) GetQuantumPixels(quantum_info);
if(image->columns != ipl_info.width){
/*
printf("Columns not set correctly! Wanted: %.20g, got: %.20g\n",
/*
Proceed to next image.
*/
- AcquireNextImage(image_info, image);
+ AcquireNextImage(image_info,image,exception);
if (GetNextImageInList(image) == (Image *) NULL)
{
image=DestroyImageList(image);
MagickInfo
*entry;
- entry=SetMagickInfo("IPL");
+ entry=AcquireMagickInfo("IPL","IPL","IPL Image Sequence");
entry->decoder=(DecodeImageHandler *) ReadIPLImage;
entry->encoder=(EncodeImageHandler *) WriteIPLImage;
entry->magick=(IsImageFormatHandler *) IsIPL;
- entry->adjoin=MagickTrue;
- entry->description=ConstantString("IPL Image Sequence");
- entry->module=ConstantString("IPL");
- entry->endian_support=MagickTrue;
+ entry->flags|=CoderEndianSupportFlag;
(void) RegisterMagickInfo(entry);
return(MagickImageCoderSignature);
}
scene=0;
- quantum_info=AcquireQuantumInfo(image_info, image);
+ quantum_info=AcquireQuantumInfo(image_info,image);
if ((quantum_info->format == UndefinedQuantumFormat) &&
(IsHighDynamicRangeImage(image,exception) != MagickFalse))
SetQuantumFormat(image,quantum_info,FloatingPointQuantumFormat);
ipl_info.time = 1;
ipl_info.width = (unsigned int) image->columns;
ipl_info.height = (unsigned int) image->rows;
-
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace);
-
- if(IsRGBColorspace(image->colorspace) == MagickTrue) { ipl_info.colors = 3; }
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
+ if(IssRGBCompatibleColorspace(image->colorspace) != MagickFalse) { ipl_info.colors = 3; }
else{ ipl_info.colors = 1; }
ipl_info.size = (unsigned int) (28 +
/*
Convert MIFF to IPL raster pixels.
*/
- pixels=GetQuantumPixels(quantum_info);
+ pixels=(unsigned char *) GetQuantumPixels(quantum_info);
if(ipl_info.colors == 1){
/* Red frame */
for(y = 0; y < (ssize_t) ipl_info.height; y++){