image->depth = 32; /* double type cell */
(void) SetImageOption(clone_info,"quantum:format","floating-point");
if (MATLAB_HDR.StructureFlag & FLAG_COMPLEX)
- { /* complex float type cell */
- }
+ { /* complex float type cell */
+ }
ldblk = (ssize_t) (4 * MATLAB_HDR.SizeX);
break;
case miDOUBLE:
ThrowReaderException(CoderError, "IncompatibleSizeOfDouble");
}
if (MATLAB_HDR.StructureFlag & FLAG_COMPLEX)
- { /* complex double type cell */
- }
+ { /* complex double type cell */
+ }
ldblk = (ssize_t) (8 * MATLAB_HDR.SizeX);
break;
default:
MinVal = 0;
MaxVal = 0;
if (CellType==miDOUBLE || CellType==miSINGLE) /* Find Min and Max Values for floats */
- {
- CalcMinMax(image2, image_info->endian, MATLAB_HDR.SizeX, MATLAB_HDR.SizeY, CellType, ldblk, BImgBuff, &quantum_info->minimum, &quantum_info->maximum);
- }
+ {
+ CalcMinMax(image2,image_info->endian,MATLAB_HDR.SizeX,MATLAB_HDR.SizeY,
+ CellType,ldblk,BImgBuff,&quantum_info->minimum,
+ &quantum_info->maximum);
+ }
/* Main loop for reading all scanlines */
if(z==1) z=0; /* read grey scanlines */
{
q=GetAuthenticPixels(image,0,MATLAB_HDR.SizeY-i-1,image->columns,1,exception);
if (q == (Quantum *) NULL)
- {
- if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
+ {
+ if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
" MAT set image pixels returns unexpected NULL on a row %u.", (unsigned)(MATLAB_HDR.SizeY-i-1));
- goto done_reading; /* Skip image rotation, when cannot set image pixels */
- }
+ goto done_reading; /* Skip image rotation, when cannot set image pixels */
+ }
if(ReadBlob(image2,ldblk,(unsigned char *)BImgBuff) != (ssize_t) ldblk)
- {
- if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
- " MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1));
- goto ExitLoop;
- }
+ {
+ if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
+ " MAT cannot read scanrow %u from a file.", (unsigned)(MATLAB_HDR.SizeY-i-1));
+ goto ExitLoop;
+ }
if((CellType==miINT8 || CellType==miUINT8) && (MATLAB_HDR.StructureFlag & FLAG_LOGICAL))
{
FixLogical((unsigned char *)BImgBuff,ldblk);
if(ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,z2qtype[z],BImgBuff,exception) <= 0)
- {
+ {
ImportQuantumPixelsFailed:
- if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
- " MAT failed to ImportQuantumPixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1));
- break;
- }
+ if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
+ " MAT failed to ImportQuantumPixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1));
+ break;
+ }
}
else
{
if(ImportQuantumPixels(image,(CacheView *) NULL,quantum_info,z2qtype[z],BImgBuff,exception) <= 0)
- goto ImportQuantumPixelsFailed;
+ goto ImportQuantumPixelsFailed;
if (z<=1 && /* fix only during a last pass z==0 || z==1 */
- (CellType==miINT8 || CellType==miINT16 || CellType==miINT32 || CellType==miINT64))
- FixSignedValues(image,q,MATLAB_HDR.SizeX);
+ (CellType==miINT8 || CellType==miINT16 || CellType==miINT32 || CellType==miINT64))
+ FixSignedValues(image,q,MATLAB_HDR.SizeX);
}
if (!SyncAuthenticPixels(image,exception))
- {
- if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
- " MAT failed to sync image pixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1));
- goto ExitLoop;
- }
+ {
+ if (logging) (void)LogMagickEvent(CoderEvent,GetMagickModule(),
+ " MAT failed to sync image pixels for a row %u", (unsigned)(MATLAB_HDR.SizeY-i-1));
+ goto ExitLoop;
+ }
}
} while(z-- >= 2);
ExitLoop:
if (CellType==miDOUBLE)
for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++)
- {
+ {
ReadBlobDoublesXXX(image2, ldblk, (double *)BImgBuff);
InsertComplexDoubleRow(image, (double *)BImgBuff, i, MinVal, MaxVal,
exception);
- }
+ }
if (CellType==miSINGLE)
for (i = 0; i < (ssize_t) MATLAB_HDR.SizeY; i++)
- {
+ {
ReadBlobFloatsXXX(image2, ldblk, (float *)BImgBuff);
InsertComplexFloatRow(image,(float *)BImgBuff,i,MinVal,MaxVal,
exception);
- }
+ }
}
/* Image is gray when no complex flag is set and 2D Matrix AGAIN!!! */
if(image2!=image)
{
DeleteImageFromList(&image2);
- if(clone_info)
- {
+ if(clone_info)
+ {
if(clone_info->file)
- {
+ {
fclose(clone_info->file);
clone_info->file = NULL;
(void) remove_utf8(clone_info->filename);
- }
+ }
}
}
if (EOFBlob(image) != MagickFalse)
(void) remove_utf8(clone_info->filename);
}
}
- }
+ }
if (clone_info)
clone_info=DestroyImageInfo(clone_info);