% Read/Write Raw Bi-Level Bitmap Format %
% %
% Software Design %
-% John Cristy %
+% Cristy %
% July 1992 %
% %
% %
-% 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 %
Include declarations.
*/
#include "MagickCore/studio.h"
+#include "MagickCore/attribute.h"
#include "MagickCore/blob.h"
#include "MagickCore/blob-private.h"
#include "MagickCore/cache.h"
(void) CloseBlob(image);
return(GetFirstImageInList(image));
}
+ status=SetImageExtent(image,image->columns,image->rows,exception);
+ if (status == MagickFalse)
+ return(DestroyImageList(image));
/*
Convert bi-level image to pixel packets.
*/
if (status == MagickFalse)
break;
}
- (void) SyncImage(image);
+ (void) SyncImage(image,exception);
if (EOFBlob(image) != MagickFalse)
ThrowFileException(exception,CorruptImageError,"UnexpectedEndOfFile",
image->filename);
entry=SetMagickInfo("MONO");
entry->decoder=(DecodeImageHandler *) ReadMONOImage;
entry->encoder=(EncodeImageHandler *) WriteMONOImage;
- entry->raw=MagickTrue;
- entry->endian_support=MagickTrue;
- entry->adjoin=MagickFalse;
+ entry->flags|=CoderRawSupportFlag;
+ entry->flags|=CoderEndianSupportFlag;
+ entry->flags^=CoderAdjoinFlag;
entry->description=ConstantString("Raw bi-level bitmap");
entry->module=ConstantString("MONO");
(void) RegisterMagickInfo(entry);
status=OpenBlob(image_info,image,WriteBinaryBlobMode,exception);
if (status == MagickFalse)
return(status);
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
- (void) TransformImageColorspace(image,RGBColorspace);
+ (void) TransformImageColorspace(image,sRGBColorspace,exception);
/*
Convert image to a bi-level image.
*/
byte>>=1;
if (image->endian == LSBEndian)
{
- if (GetPixelIntensity(image,p) < ((Quantum) QuantumRange/2.0))
+ if (GetPixelLuma(image,p) < (QuantumRange/2.0))
byte|=0x80;
}
else
- if (GetPixelIntensity(image,p) >= ((Quantum) QuantumRange/2.0))
+ if (GetPixelLuma(image,p) >= (QuantumRange/2.0))
byte|=0x80;
bit++;
if (bit == 8)