for (x=0; x < (ssize_t) (number_pixels-2); x+=3)
{
pixel=(unsigned int) (
- ScaleQuantumToAny(GetPixelIntensity(image,p+2),range) << 22 |
- ScaleQuantumToAny(GetPixelIntensity(image,p+1),range) << 12 |
- ScaleQuantumToAny(GetPixelIntensity(image,p+0),range) << 2);
+ ScaleQuantumToAny(GetPixelIntensity(image,p+2*channels),range) << 22 |
+ ScaleQuantumToAny(GetPixelIntensity(image,p+channels),range) << 12 |
+ ScaleQuantumToAny(GetPixelIntensity(image,p),range) << 2);
q=PopLongPixel(endian,pixel,q);
- p+=3;
+ p+=3*channels;
q+=quantum_info->pad;
}
if (x < (ssize_t) number_pixels)
{
pixel=0U;
if (x++ < (ssize_t) (number_pixels-1))
- pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+1),
- range) << 12;
+ pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+channels),
+ range) << 12;
if (x++ < (ssize_t) number_pixels)
- pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+0),
+ pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p),
range) << 2;
q=PopLongPixel(endian,pixel,q);
}
#include "MagickCore/monitor.h"
#include "MagickCore/monitor-private.h"
#include "MagickCore/option.h"
+#include "MagickCore/pixel-accessor.h"
#include "MagickCore/profile.h"
#include "MagickCore/property.h"
#include "MagickCore/quantum-private.h"
}
extent=GetBytesPerRow(image->columns,image->matte != MagickFalse ? 4UL : 3UL,
image->depth,MagickTrue);
- if ((image_info->type != UndefinedType) &&
- (image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
+ if ((image_info->type != TrueColorType) && (image->matte == MagickFalse) &&
(IsImageGray(image,exception) != MagickFalse))
{
quantum_type=GrayQuantum;