diff --git a/MagickCore/image.c b/MagickCore/image.c
index e8f8963..d2cacbd 100644
--- a/MagickCore/image.c
+++ b/MagickCore/image.c
@@ -1804,6 +1804,9 @@
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
+ PixelInfo
+ pixel;
+
register const Quantum
*p;
diff --git a/MagickCore/magick-config.h b/MagickCore/magick-config.h
index 3db76f6..d618a68 100644
--- a/MagickCore/magick-config.h
+++ b/MagickCore/magick-config.h
@@ -12,7 +12,9 @@
/* #undef AUTOTRACE_DELEGATE */
/* Define if coders and filters are to be built as modules. */
-/* #undef BUILD_MODULES */
+#ifndef MAGICKCORE_BUILD_MODULES
+#define MAGICKCORE_BUILD_MODULES 1
+#endif
/* Define if you have the bzip2 library */
#ifndef MAGICKCORE_BZLIB_DELEGATE
@@ -219,7 +221,9 @@
#endif
/* Define to 1 if you have the <CL/cl.h> header file. */
-/* #undef HAVE_CL_CL_H */
+#ifndef MAGICKCORE_HAVE_CL_CL_H
+#define MAGICKCORE_HAVE_CL_CL_H 1
+#endif
/* Define to 1 if you have the <complex.h> header file. */
#ifndef MAGICKCORE_HAVE_COMPLEX_H
@@ -1188,7 +1192,9 @@
#endif
/* Define if you have JBIG library */
-/* #undef JBIG_DELEGATE */
+#ifndef MAGICKCORE_JBIG_DELEGATE
+#define MAGICKCORE_JBIG_DELEGATE 1
+#endif
/* Define if you have JPEG version 2 "Jasper" library */
#ifndef MAGICKCORE_JP2_DELEGATE
@@ -1229,7 +1235,7 @@
/* Define to the system default library search path. */
#ifndef MAGICKCORE_LT_DLSEARCH_PATH
-#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/atlas:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mysql:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tcl8.5:/usr/lib64/tracker-0.12:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
+#define MAGICKCORE_LT_DLSEARCH_PATH "/lib64:/usr/lib64:/lib:/usr/lib:/usr/lib64/R/lib:/usr/lib64/alliance/lib:/usr/lib64/atlas:/opt/modules/pkg/intel/f77/10.0.025/lib:/usr/lib64/kicad:/usr/lib/llvm:/usr/lib64/llvm:/usr/local/lib:/usr/lib64/mpich2/lib/:/usr/lib64/mysql:/usr/lib64/nvidia:/usr/lib64/openmotif:/usr/lib64/qt-3.3/lib:/usr/lib64/tcl8.5/tclx8.4:/usr/lib64/tracker-0.12:/usr/lib/wine/:/usr/lib64/wine/:/usr/lib64/xulrunner-2"
#endif
/* The archive extension */
@@ -1283,7 +1289,9 @@
/* #undef NO_MINUS_C_MINUS_O */
/* Define if you have OPENEXR library */
-/* #undef OPENEXR_DELEGATE */
+#ifndef MAGICKCORE_OPENEXR_DELEGATE
+#define MAGICKCORE_OPENEXR_DELEGATE 1
+#endif
/* Name of package */
#ifndef MAGICKCORE_PACKAGE
@@ -1353,7 +1361,9 @@
#endif
/* Define if you have RSVG library */
-/* #undef RSVG_DELEGATE */
+#ifndef MAGICKCORE_RSVG_DELEGATE
+#define MAGICKCORE_RSVG_DELEGATE 1
+#endif
/* Define to the type of arg 1 for `select'. */
#ifndef MAGICKCORE_SELECT_TYPE_ARG1
@@ -1581,7 +1591,9 @@
/* #undef _MINIX */
/* Define this for the OpenCL Accelerator */
-/* #undef _OPENCL */
+#ifndef MAGICKCORE__OPENCL
+#define MAGICKCORE__OPENCL 1
+#endif
/* Define to 2 if the system does not provide POSIX.1 features except with
this defined. */
diff --git a/MagickCore/quantum-export.c b/MagickCore/quantum-export.c
index de0ea44..904578c 100644
--- a/MagickCore/quantum-export.c
+++ b/MagickCore/quantum-export.c
@@ -89,10 +89,9 @@
%
% The format of the ExportQuantumPixels method is:
%
-% size_t ExportQuantumPixels(const Image *image,
-% const CacheView *image_view,const QuantumInfo *quantum_info,
-% const QuantumType quantum_type,unsigned char *pixels,
-% ExceptionInfo *exception)
+% size_t ExportQuantumPixels(const Image *image,CacheView *image_view,
+% QuantumInfo *quantum_info,const QuantumType quantum_type,
+% unsigned char *pixels,ExceptionInfo *exception)
%
% A description of each parameter follows:
%
@@ -111,7 +110,7 @@
%
*/
-static inline unsigned char *PopDoublePixel(const QuantumState *quantum_state,
+static inline unsigned char *PopDoublePixel(QuantumInfo *quantum_info,
const double pixel,unsigned char *pixels)
{
double
@@ -121,8 +120,8 @@
quantum[8];
p=(double *) quantum;
- *p=(double) (pixel*quantum_state->inverse_scale+quantum_state->minimum);
- if (quantum_state->endian != LSBEndian)
+ *p=(double) (pixel*quantum_info->state.inverse_scale+quantum_info->minimum);
+ if (quantum_info->endian != LSBEndian)
{
*pixels++=quantum[7];
*pixels++=quantum[6];
@@ -145,7 +144,7 @@
return(pixels);
}
-static inline unsigned char *PopFloatPixel(const QuantumState *quantum_state,
+static inline unsigned char *PopFloatPixel(QuantumInfo *quantum_info,
const float pixel,unsigned char *pixels)
{
float
@@ -155,9 +154,9 @@
quantum[4];
p=(float *) quantum;
- *p=(float) ((double) pixel*quantum_state->inverse_scale+
- quantum_state->minimum);
- if (quantum_state->endian != LSBEndian)
+ *p=(float) ((double) pixel*quantum_info->state.inverse_scale+
+ quantum_info->minimum);
+ if (quantum_info->endian != LSBEndian)
{
*pixels++=quantum[3];
*pixels++=quantum[2];
@@ -172,8 +171,8 @@
return(pixels);
}
-static inline unsigned char *PopQuantumPixel(QuantumState *quantum_state,
- const size_t depth,const QuantumAny pixel,unsigned char *pixels)
+static inline unsigned char *PopQuantumPixel(QuantumInfo *quantum_info,
+ const QuantumAny pixel,unsigned char *pixels)
{
register ssize_t
i;
@@ -181,30 +180,30 @@
size_t
quantum_bits;
- if (quantum_state->bits == 0UL)
- quantum_state->bits=8U;
- for (i=(ssize_t) depth; i > 0L; )
+ if (quantum_info->state.bits == 0UL)
+ quantum_info->state.bits=8U;
+ for (i=(ssize_t) quantum_info->depth; i > 0L; )
{
quantum_bits=(size_t) i;
- if (quantum_bits > quantum_state->bits)
- quantum_bits=quantum_state->bits;
+ if (quantum_bits > quantum_info->state.bits)
+ quantum_bits=quantum_info->state.bits;
i-=(ssize_t) quantum_bits;
- if (quantum_state->bits == 8UL)
+ if (quantum_info->state.bits == 8UL)
*pixels='\0';
- quantum_state->bits-=quantum_bits;
+ quantum_info->state.bits-=quantum_bits;
*pixels|=(((pixel >> i) &~ ((~0UL) << quantum_bits)) <<
- quantum_state->bits);
- if (quantum_state->bits == 0UL)
+ quantum_info->state.bits);
+ if (quantum_info->state.bits == 0UL)
{
pixels++;
- quantum_state->bits=8UL;
+ quantum_info->state.bits=8UL;
}
}
return(pixels);
}
-static inline unsigned char *PopQuantumLongPixel(QuantumState *quantum_state,
- const size_t depth,const size_t pixel,unsigned char *pixels)
+static inline unsigned char *PopQuantumLongPixel(QuantumInfo *quantum_info,
+ const size_t pixel,unsigned char *pixels)
{
register ssize_t
i;
@@ -212,42 +211,39 @@
size_t
quantum_bits;
- if (quantum_state->bits == 0U)
- quantum_state->bits=32UL;
- for (i=(ssize_t) depth; i > 0; )
+ if (quantum_info->state.bits == 0U)
+ quantum_info->state.bits=32UL;
+ for (i=(ssize_t) quantum_info->depth; i > 0; )
{
quantum_bits=(size_t) i;
- if (quantum_bits > quantum_state->bits)
- quantum_bits=quantum_state->bits;
- quantum_state->pixel|=(((pixel >> (depth-i)) &
- quantum_state->mask[quantum_bits]) << (32U-quantum_state->bits));
+ if (quantum_bits > quantum_info->state.bits)
+ quantum_bits=quantum_info->state.bits;
+ quantum_info->state.pixel|=(((pixel >> (quantum_info->depth-i)) &
+ quantum_info->state.mask[quantum_bits]) << (32U-
+ quantum_info->state.bits));
i-=(ssize_t) quantum_bits;
- quantum_state->bits-=quantum_bits;
- if (quantum_state->bits == 0U)
+ quantum_info->state.bits-=quantum_bits;
+ if (quantum_info->state.bits == 0U)
{
- pixels=PopLongPixel(quantum_state->endian,quantum_state->pixel,pixels);
- quantum_state->pixel=0U;
- quantum_state->bits=32U;
+ pixels=PopLongPixel(quantum_info->endian,quantum_info->state.pixel,
+ pixels);
+ quantum_info->state.pixel=0U;
+ quantum_info->state.bits=32U;
}
}
return(pixels);
}
-static void ExportAlphaQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportAlphaQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -274,7 +270,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -283,7 +279,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -298,7 +294,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelAlpha(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelAlpha(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -307,7 +303,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelAlpha(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -319,7 +315,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelAlpha(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelAlpha(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -331,8 +327,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelAlpha(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelAlpha(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -341,13 +337,10 @@
}
}
-static void ExportBGRQuantum(const Image *image,const QuantumInfo *quantum_info,
- QuantumState quantum_state,const MagickSizeType number_pixels,
- const Quantum *restrict p,unsigned char *restrict q,ExceptionInfo *exception)
+static void ExportBGRQuantum(const Image *image,QuantumInfo *quantum_info,
+ const MagickSizeType number_pixels,const Quantum *restrict p,
+ unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -357,7 +350,6 @@
ssize_t
bit;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -386,7 +378,7 @@
ScaleQuantumToAny(GetPixelRed(image,p),range) << 22 |
ScaleQuantumToAny(GetPixelGreen(image,p),range) << 12 |
ScaleQuantumToAny(GetPixelBlue(image,p),range) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -397,12 +389,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -411,11 +403,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -454,7 +446,7 @@
break;
}
}
- q=PopShortPixel(endian,(unsigned short) (pixel << 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q);
switch ((x+1) % 3)
{
default:
@@ -478,7 +470,7 @@
break;
}
}
- q=PopShortPixel(endian,(unsigned short) (pixel << 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q);
q+=quantum_info->pad;
}
for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++)
@@ -506,7 +498,7 @@
break;
}
}
- q=PopShortPixel(endian,(unsigned short) (pixel << 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q);
q+=quantum_info->pad;
}
if (bit != 0)
@@ -518,12 +510,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -532,11 +524,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -552,11 +544,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -565,11 +557,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -584,9 +576,9 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -595,11 +587,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -611,9 +603,9 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -625,12 +617,12 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -639,21 +631,16 @@
}
}
-static void ExportBGRAQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportBGRAQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -725,7 +712,7 @@
{
pixel|=(size_t) (ScaleQuantumToAny((Quantum) quantum,
range) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=0;
break;
}
@@ -742,15 +729,15 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelAlpha(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -759,13 +746,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelAlpha(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -781,13 +768,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -796,13 +783,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -820,11 +807,11 @@
float
pixel;
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
pixel=(float) GetPixelAlpha(image,p);
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -833,13 +820,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelAlpha(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -854,11 +841,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
pixel=(double) GetPixelAlpha(image,p);
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -870,14 +857,14 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelAlpha(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelAlpha(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -886,14 +873,10 @@
}
}
-static void ExportBlackQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportBlackQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -906,7 +889,6 @@
"ColorSeparatedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -933,7 +915,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -942,7 +924,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelBlack(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -957,7 +939,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlack(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlack(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -966,7 +948,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelBlack(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -978,7 +960,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlack(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlack(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -990,8 +972,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlack(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlack(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1000,21 +982,16 @@
}
}
-static void ExportBlueQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportBlueQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -1041,7 +1018,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1050,7 +1027,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1065,7 +1042,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1074,7 +1051,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1086,7 +1063,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1098,8 +1075,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1108,14 +1085,10 @@
}
}
-static void ExportCbYCrYQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
Quantum
cbcr[4];
@@ -1132,7 +1105,6 @@
ssize_t
n;
- endian=quantum_state.endian;
n=0;
quantum=0;
switch (quantum_info->depth)
@@ -1168,11 +1140,11 @@
}
pixel=(unsigned int) ((size_t) (cbcr[1]) << 22 | (size_t)
(cbcr[0]) << 12 | (size_t) (cbcr[2]) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
pixel=(unsigned int) ((size_t) (cbcr[3]) << 22 | (size_t)
(cbcr[0]) << 12 | (size_t) (cbcr[2]) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1211,19 +1183,13 @@
n++;
}
range=GetQuantumRange(quantum_info->depth);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(cbcr[1],range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(cbcr[0],range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(cbcr[2],range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(cbcr[1],range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(cbcr[0],range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(cbcr[2],range),q);
p+=GetPixelChannels(image);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(cbcr[3],range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(cbcr[0],range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(cbcr[2],range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(cbcr[3],range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(cbcr[0],range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(cbcr[2],range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1232,14 +1198,10 @@
}
}
-static void ExportCMYKQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportCMYKQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
register ssize_t
x;
@@ -1249,7 +1211,6 @@
"ColorSeparatedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -1282,13 +1243,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1297,13 +1258,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelBlack(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1318,10 +1279,10 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlack(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlack(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1330,13 +1291,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelBlack(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1348,10 +1309,10 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlack(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlack(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1366,14 +1327,14 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlack(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlack(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1382,14 +1343,10 @@
}
}
-static void ExportCMYKAQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
register ssize_t
x;
@@ -1399,7 +1356,6 @@
"ColorSeparatedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -1434,15 +1390,15 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlack(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1451,15 +1407,15 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelBlack(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1477,12 +1433,12 @@
float
pixel;
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlack(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlack(image,p),q);
pixel=(float) (GetPixelAlpha(image,p));
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1491,15 +1447,15 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelBlack(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelAlpha(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1514,12 +1470,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlack(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlack(image,p),q);
pixel=(double) (GetPixelAlpha(image,p));
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1534,16 +1490,16 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlack(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelAlpha(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlack(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelAlpha(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1552,21 +1508,16 @@
}
}
-static void ExportGrayQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportGrayQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 1:
@@ -1670,11 +1621,11 @@
for (x=0; x < (ssize_t) (number_pixels-2); x+=3)
{
- pixel=(unsigned int) (
- ScaleQuantumToAny(GetPixelIntensity(image,p+2*GetPixelChannels(image)),range) << 22 |
- ScaleQuantumToAny(GetPixelIntensity(image,p+GetPixelChannels(image)),range) << 12 |
+ pixel=(unsigned int) (ScaleQuantumToAny(GetPixelIntensity(image,
+ p+2*GetPixelChannels(image)),range) << 22 | ScaleQuantumToAny(
+ GetPixelIntensity(image,p+GetPixelChannels(image)),range) << 12 |
ScaleQuantumToAny(GetPixelIntensity(image,p),range) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=3*GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1682,19 +1633,18 @@
{
pixel=0U;
if (x++ < (ssize_t) (number_pixels-1))
- pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+GetPixelChannels(image)),
- range) << 12;
+ pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p+
+ GetPixelChannels(image)),range) << 12;
if (x++ < (ssize_t) number_pixels)
- pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p),
- range) << 2;
- q=PopLongPixel(endian,pixel,q);
+ pixel|=ScaleQuantumToAny(GetPixelIntensity(image,p),range) << 2;
+ q=PopLongPixel(quantum_info->endian,pixel,q);
}
break;
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelIntensity(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(
+ GetPixelIntensity(image,p),range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1711,7 +1661,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelIntensity(image,p));
- q=PopShortPixel(endian,(unsigned short) (pixel >> 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel >> 4),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1719,8 +1669,8 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelIntensity(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(
+ GetPixelIntensity(image,p),range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1737,7 +1687,7 @@
{
pixel=SinglePrecisionToHalf(QuantumScale*
GetPixelIntensity(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1746,7 +1696,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelIntensity(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1765,7 +1715,7 @@
pixel;
pixel=(float) GetPixelIntensity(image,p);
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1774,7 +1724,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelIntensity(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1790,7 +1740,7 @@
pixel;
pixel=(double) GetPixelIntensity(image,p);
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1802,8 +1752,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelIntensity(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(
+ GetPixelIntensity(image,p),range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1812,21 +1762,16 @@
}
}
-static void ExportGrayAlphaQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 1:
@@ -1935,9 +1880,9 @@
{
pixel=SinglePrecisionToHalf(QuantumScale*
GetPixelIntensity(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1946,9 +1891,9 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelIntensity(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1967,9 +1912,9 @@
pixel;
pixel=(float) GetPixelIntensity(image,p);
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
pixel=(float) (GetPixelAlpha(image,p));
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1978,9 +1923,9 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelIntensity(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelAlpha(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -1996,9 +1941,9 @@
pixel;
pixel=(double) GetPixelIntensity(image,p);
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
pixel=(double) (GetPixelAlpha(image,p));
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2010,10 +1955,10 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelIntensity(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelAlpha(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(
+ GetPixelIntensity(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelAlpha(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2022,21 +1967,16 @@
}
}
-static void ExportGreenQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportGreenQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2063,7 +2003,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2072,7 +2012,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2087,7 +2027,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2096,7 +2036,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2108,7 +2048,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2120,8 +2060,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2130,14 +2070,10 @@
}
}
-static void ExportIndexQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportIndexQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
register ssize_t
x;
@@ -2150,7 +2086,6 @@
"ColormappedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 1:
@@ -2239,7 +2174,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopShortPixel(endian,SinglePrecisionToHalf(QuantumScale*
+ q=PopShortPixel(quantum_info->endian,SinglePrecisionToHalf(QuantumScale*
GetPixelIndex(image,p)),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
@@ -2248,7 +2183,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopShortPixel(endian,(unsigned short) GetPixelIndex(image,p),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) GetPixelIndex(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2260,7 +2195,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelIndex(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelIndex(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2268,7 +2203,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopLongPixel(endian,(unsigned int) GetPixelIndex(image,p),q);
+ q=PopLongPixel(quantum_info->endian,(unsigned int) GetPixelIndex(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2280,7 +2215,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelIndex(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelIndex(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2291,8 +2226,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- GetPixelIndex(image,p),q);
+ q=PopQuantumPixel(quantum_info,GetPixelIndex(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2302,13 +2236,9 @@
}
static void ExportIndexAlphaQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
- const MagickSizeType number_pixels,const Quantum *restrict p,
- unsigned char *restrict q,ExceptionInfo *exception)
+ QuantumInfo *quantum_info,const MagickSizeType number_pixels,
+ const Quantum *restrict p,unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
register ssize_t
x;
@@ -2321,7 +2251,6 @@
"ColormappedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 1:
@@ -2413,9 +2342,9 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopShortPixel(endian,(unsigned short) GetPixelIndex(image,p),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) GetPixelIndex(image,p),q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2423,9 +2352,9 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopShortPixel(endian,(unsigned short) GetPixelIndex(image,p),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) GetPixelIndex(image,p),q);
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2443,9 +2372,9 @@
float
pixel;
- q=PopFloatPixel(&quantum_state,(float) GetPixelIndex(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelIndex(image,p),q);
pixel=(float) GetPixelAlpha(image,p);
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2453,9 +2382,9 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopLongPixel(endian,(unsigned int) GetPixelIndex(image,p),q);
+ q=PopLongPixel(quantum_info->endian,(unsigned int) GetPixelIndex(image,p),q);
pixel=ScaleQuantumToLong(GetPixelAlpha(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2470,9 +2399,9 @@
double
pixel;
- q=PopDoublePixel(&quantum_state,(double) GetPixelIndex(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelIndex(image,p),q);
pixel=(double) GetPixelAlpha(image,p);
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2487,10 +2416,9 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- GetPixelIndex(image,p),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelAlpha(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,GetPixelIndex(image,p),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelAlpha(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2499,21 +2427,16 @@
}
}
-static void ExportOpacityQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportOpacityQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2540,7 +2463,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelOpacity(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2549,7 +2472,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelOpacity(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2564,7 +2487,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelOpacity(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelOpacity(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2573,7 +2496,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelOpacity(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2585,8 +2508,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelOpacity(image,p),
- q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelOpacity(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2598,8 +2520,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelOpacity(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(
+ GetPixelOpacity(image,p),range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2608,20 +2530,16 @@
}
}
-static void ExportRedQuantum(const Image *image,const QuantumInfo *quantum_info,
- QuantumState quantum_state,const MagickSizeType number_pixels,
- const Quantum *restrict p,unsigned char *restrict q,ExceptionInfo *exception)
+static void ExportRedQuantum(const Image *image,QuantumInfo *quantum_info,
+ const MagickSizeType number_pixels,const Quantum *restrict p,
+ unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2648,7 +2566,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2657,7 +2575,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2672,7 +2590,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2681,7 +2599,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2693,7 +2611,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2705,8 +2623,8 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2715,13 +2633,10 @@
}
}
-static void ExportRGBQuantum(const Image *image,const QuantumInfo *quantum_info,
- QuantumState quantum_state,const MagickSizeType number_pixels,
- const Quantum *restrict p,unsigned char *restrict q,ExceptionInfo *exception)
+static void ExportRGBQuantum(const Image *image,QuantumInfo *quantum_info,
+ const MagickSizeType number_pixels,const Quantum *restrict p,
+ unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -2731,7 +2646,6 @@
ssize_t
bit;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2760,7 +2674,7 @@
ScaleQuantumToAny(GetPixelRed(image,p),range) << 22 |
ScaleQuantumToAny(GetPixelGreen(image,p),range) << 12 |
ScaleQuantumToAny(GetPixelBlue(image,p),range) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2771,12 +2685,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2785,11 +2699,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2828,7 +2742,7 @@
break;
}
}
- q=PopShortPixel(endian,(unsigned short) (pixel << 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q);
switch ((x+1) % 3)
{
default:
@@ -2852,7 +2766,7 @@
break;
}
}
- q=PopShortPixel(endian,(unsigned short) (pixel << 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q);
q+=quantum_info->pad;
}
for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++)
@@ -2880,7 +2794,7 @@
break;
}
}
- q=PopShortPixel(endian,(unsigned short) (pixel << 4),q);
+ q=PopShortPixel(quantum_info->endian,(unsigned short) (pixel << 4),q);
q+=quantum_info->pad;
}
if (bit != 0)
@@ -2892,12 +2806,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2906,11 +2820,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2926,11 +2840,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2939,11 +2853,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2958,9 +2872,9 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2969,11 +2883,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2985,9 +2899,9 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -2999,12 +2913,12 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3013,21 +2927,16 @@
}
}
-static void ExportRGBAQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ExportRGBAQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const Quantum *restrict p,
unsigned char *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
register ssize_t
x;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -3099,7 +3008,7 @@
{
pixel|=(size_t) (ScaleQuantumToAny((Quantum) quantum,
range) << 2);
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=0;
break;
}
@@ -3116,15 +3025,15 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelAlpha(image,p),
range);
- q=PopQuantumLongPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumLongPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3133,13 +3042,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=(unsigned int) ScaleQuantumToAny(GetPixelRed(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelGreen(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelBlue(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
pixel=(unsigned int) ScaleQuantumToAny(GetPixelAlpha(image,p),range);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,pixel,q);
+ q=PopQuantumPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3155,13 +3064,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=SinglePrecisionToHalf(QuantumScale*GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3170,13 +3079,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToShort(GetPixelRed(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelGreen(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelBlue(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToShort(GetPixelAlpha(image,p));
- q=PopShortPixel(endian,pixel,q);
+ q=PopShortPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3194,11 +3103,11 @@
float
pixel;
- q=PopFloatPixel(&quantum_state,(float) GetPixelRed(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelGreen(image,p),q);
- q=PopFloatPixel(&quantum_state,(float) GetPixelBlue(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelRed(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelGreen(image,p),q);
+ q=PopFloatPixel(quantum_info,(float) GetPixelBlue(image,p),q);
pixel=(float) GetPixelAlpha(image,p);
- q=PopFloatPixel(&quantum_state,pixel,q);
+ q=PopFloatPixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3207,13 +3116,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
pixel=ScaleQuantumToLong(GetPixelRed(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelGreen(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelBlue(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
pixel=ScaleQuantumToLong(GetPixelAlpha(image,p));
- q=PopLongPixel(endian,pixel,q);
+ q=PopLongPixel(quantum_info->endian,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3228,11 +3137,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopDoublePixel(&quantum_state,(double) GetPixelRed(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelGreen(image,p),q);
- q=PopDoublePixel(&quantum_state,(double) GetPixelBlue(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelRed(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelGreen(image,p),q);
+ q=PopDoublePixel(quantum_info,(double) GetPixelBlue(image,p),q);
pixel=(double) GetPixelAlpha(image,p);
- q=PopDoublePixel(&quantum_state,pixel,q);
+ q=PopDoublePixel(quantum_info,pixel,q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3244,14 +3153,14 @@
range=GetQuantumRange(quantum_info->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelRed(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelGreen(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelBlue(image,p),range),q);
- q=PopQuantumPixel(&quantum_state,quantum_info->depth,
- ScaleQuantumToAny(GetPixelAlpha(image,p),range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelRed(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelGreen(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelBlue(image,p),
+ range),q);
+ q=PopQuantumPixel(quantum_info,ScaleQuantumToAny(GetPixelAlpha(image,p),
+ range),q);
p+=GetPixelChannels(image);
q+=quantum_info->pad;
}
@@ -3261,15 +3170,12 @@
}
MagickExport size_t ExportQuantumPixels(Image *image,CacheView *image_view,
- const QuantumInfo *quantum_info,const QuantumType quantum_type,
+ QuantumInfo *quantum_info,const QuantumType quantum_type,
unsigned char *pixels,ExceptionInfo *exception)
{
MagickSizeType
number_pixels;
- QuantumState
- quantum_state;
-
register const Quantum
*restrict p;
@@ -3372,118 +3278,101 @@
}
x=0;
q=pixels;
- InitializeQuantumState(quantum_info,image->endian,&quantum_state);
+ ResetQuantumState(quantum_info);
extent=GetQuantumExtent(image,quantum_info,quantum_type);
switch (quantum_type)
{
case AlphaQuantum:
{
- ExportAlphaQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportAlphaQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BGRQuantum:
{
- ExportBGRQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportBGRQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BGRAQuantum:
case BGROQuantum:
{
- ExportBGRAQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportBGRAQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BlackQuantum:
{
- ExportBlackQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportBlackQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BlueQuantum:
case YellowQuantum:
{
- ExportBlueQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportBlueQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case CMYKQuantum:
{
- ExportCMYKQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportCMYKQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case CMYKAQuantum:
case CMYKOQuantum:
{
- ExportCMYKAQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportCMYKAQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case CbYCrYQuantum:
{
- ExportCbYCrYQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportCbYCrYQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case GrayQuantum:
{
- ExportGrayQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportGrayQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case GrayAlphaQuantum:
{
- ExportGrayAlphaQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportGrayAlphaQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case GreenQuantum:
case MagentaQuantum:
{
- ExportGreenQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportGreenQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case IndexQuantum:
{
- ExportIndexQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportIndexQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case IndexAlphaQuantum:
{
- ExportIndexAlphaQuantum(image,quantum_info,quantum_state,number_pixels,p,
- q,exception);
+ ExportIndexAlphaQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case RedQuantum:
case CyanQuantum:
{
- ExportRedQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportRedQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case OpacityQuantum:
{
- ExportOpacityQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportOpacityQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case RGBQuantum:
case CbYCrQuantum:
{
- ExportRGBQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportRGBQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case RGBAQuantum:
case RGBOQuantum:
case CbYCrAQuantum:
{
- ExportRGBAQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ExportRGBAQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
default:
diff --git a/MagickCore/quantum-import.c b/MagickCore/quantum-import.c
index 6bb74fd..9dae7b7 100644
--- a/MagickCore/quantum-import.c
+++ b/MagickCore/quantum-import.c
@@ -1,4 +1,5 @@
-/*
+
+ /*
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% %
% %
@@ -90,7 +91,7 @@
% The format of the ImportQuantumPixels method is:
%
% size_t ImportQuantumPixels(Image *image,CacheView *image_view,
-% const QuantumInfo *quantum_info,const QuantumType quantum_type,
+% QuantumInfo *quantum_info,const QuantumType quantum_type,
% const unsigned char *pixels,ExceptionInfo *exception)
%
% A description of each parameter follows:
@@ -119,8 +120,8 @@
return((Quantum) 0);
}
-static inline const unsigned char *PushDoublePixel(
- const QuantumState *quantum_state,const unsigned char *pixels,double *pixel)
+static inline const unsigned char *PushDoublePixel(QuantumInfo *quantum_info,
+ const unsigned char *pixels,double *pixel)
{
double
*p;
@@ -128,7 +129,7 @@
unsigned char
quantum[8];
- if (quantum_state->endian != LSBEndian)
+ if (quantum_info->endian != LSBEndian)
{
quantum[7]=(*pixels++);
quantum[6]=(*pixels++);
@@ -140,8 +141,8 @@
quantum[0]=(*pixels++);
p=(double *) quantum;
*pixel=(*p);
- *pixel-=quantum_state->minimum;
- *pixel*=quantum_state->scale;
+ *pixel-=quantum_info->minimum;
+ *pixel*=quantum_info->scale;
return(pixels);
}
quantum[0]=(*pixels++);
@@ -154,13 +155,13 @@
quantum[7]=(*pixels++);
p=(double *) quantum;
*pixel=(*p);
- *pixel-=quantum_state->minimum;
- *pixel*=quantum_state->scale;
+ *pixel-=quantum_info->minimum;
+ *pixel*=quantum_info->scale;
return(pixels);
}
-static inline const unsigned char *PushFloatPixel(
- const QuantumState *quantum_state,const unsigned char *pixels,float *pixel)
+static inline const unsigned char *PushFloatPixel(QuantumInfo *quantum_info,
+ const unsigned char *pixels,float *pixel)
{
float
*p;
@@ -168,7 +169,7 @@
unsigned char
quantum[4];
- if (quantum_state->endian != LSBEndian)
+ if (quantum_info->endian != LSBEndian)
{
quantum[3]=(*pixels++);
quantum[2]=(*pixels++);
@@ -176,8 +177,8 @@
quantum[0]=(*pixels++);
p=(float *) quantum;
*pixel=(*p);
- *pixel-=quantum_state->minimum;
- *pixel*=quantum_state->scale;
+ *pixel-=quantum_info->minimum;
+ *pixel*=quantum_info->scale;
return(pixels);
}
quantum[0]=(*pixels++);
@@ -186,12 +187,13 @@
quantum[3]=(*pixels++);
p=(float *) quantum;
*pixel=(*p);
- *pixel-=quantum_state->minimum;
- *pixel*=quantum_state->scale;
+ *pixel-=quantum_info->minimum;
+ *pixel*=quantum_info->scale;
return(pixels);
}
-static inline const unsigned char *PushQuantumPixel(QuantumState *quantum_state, const size_t depth,const unsigned char *pixels,unsigned int *quantum)
+static inline const unsigned char *PushQuantumPixel(QuantumInfo *quantum_info,
+ const unsigned char *pixels,unsigned int *quantum)
{
register ssize_t
i;
@@ -200,28 +202,27 @@
quantum_bits;
*quantum=(QuantumAny) 0;
- for (i=(ssize_t) depth; i > 0L; )
+ for (i=(ssize_t) quantum_info->depth; i > 0L; )
{
- if (quantum_state->bits == 0UL)
+ if (quantum_info->state.bits == 0UL)
{
- quantum_state->pixel=(*pixels++);
- quantum_state->bits=8UL;
+ quantum_info->state.pixel=(*pixels++);
+ quantum_info->state.bits=8UL;
}
quantum_bits=(size_t) i;
- if (quantum_bits > quantum_state->bits)
- quantum_bits=quantum_state->bits;
+ if (quantum_bits > quantum_info->state.bits)
+ quantum_bits=quantum_info->state.bits;
i-=(ssize_t) quantum_bits;
- quantum_state->bits-=quantum_bits;
+ quantum_info->state.bits-=quantum_bits;
*quantum=(unsigned int) ((*quantum << quantum_bits) |
- ((quantum_state->pixel >> quantum_state->bits) &~ ((~0UL) <<
+ ((quantum_info->state.pixel >> quantum_info->state.bits) &~ ((~0UL) <<
quantum_bits)));
}
return(pixels);
}
static inline const unsigned char *PushQuantumLongPixel(
- QuantumState *quantum_state,const size_t depth,const unsigned char *pixels,
- unsigned int *quantum)
+ QuantumInfo *quantum_info,const unsigned char *pixels,unsigned int *quantum)
{
register ssize_t
i;
@@ -230,33 +231,29 @@
quantum_bits;
*quantum=0UL;
- for (i=(ssize_t) depth; i > 0; )
+ for (i=(ssize_t) quantum_info->depth; i > 0; )
{
- if (quantum_state->bits == 0)
+ if (quantum_info->state.bits == 0)
{
- pixels=PushLongPixel(quantum_state->endian,pixels,
- &quantum_state->pixel);
- quantum_state->bits=32U;
+ pixels=PushLongPixel(quantum_info->endian,pixels,
+ &quantum_info->state.pixel);
+ quantum_info->state.bits=32U;
}
quantum_bits=(size_t) i;
- if (quantum_bits > quantum_state->bits)
- quantum_bits=quantum_state->bits;
- *quantum|=(((quantum_state->pixel >> (32U-quantum_state->bits)) &
- quantum_state->mask[quantum_bits]) << (depth-i));
+ if (quantum_bits > quantum_info->state.bits)
+ quantum_bits=quantum_info->state.bits;
+ *quantum|=(((quantum_info->state.pixel >> (32U-quantum_info->state.bits)) &
+ quantum_info->state.mask[quantum_bits]) << (quantum_info->depth-i));
i-=(ssize_t) quantum_bits;
- quantum_state->bits-=quantum_bits;
+ quantum_info->state.bits-=quantum_bits;
}
return(pixels);
}
-static void ImportAlphaQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportAlphaQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -266,7 +263,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -292,7 +288,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -302,7 +298,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -321,7 +317,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -330,7 +326,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -346,7 +342,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -359,7 +355,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -369,13 +365,10 @@
}
}
-static void ImportBGRQuantum(const Image *image,const QuantumInfo *quantum_info,
- QuantumState quantum_state,const MagickSizeType number_pixels,
- const unsigned char *restrict p,Quantum *restrict q,ExceptionInfo *exception)
+static void ImportBGRQuantum(const Image *image,QuantumInfo *quantum_info,
+ const MagickSizeType number_pixels,const unsigned char *restrict p,
+ Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -388,7 +381,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -417,7 +409,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range),q);
SetPixelGreen(image,ScaleAnyToQuantum((pixel >> 12) & 0x3ff,range),
q);
@@ -431,11 +423,11 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -443,11 +435,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -463,7 +455,7 @@
for (x=0; x < (ssize_t) (3*number_pixels-1); x+=2)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
switch (x % 3)
{
default:
@@ -487,7 +479,7 @@
break;
}
}
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
switch ((x+1) % 3)
{
default:
@@ -515,7 +507,7 @@
}
for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
switch ((x+bit) % 3)
{
default:
@@ -549,11 +541,11 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -561,11 +553,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -580,13 +572,13 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -596,11 +588,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -619,11 +611,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -632,11 +624,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -652,11 +644,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -669,11 +661,11 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -682,14 +674,10 @@
}
}
-static void ImportBGRAQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportBGRAQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -699,7 +687,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -746,7 +733,7 @@
{
case 0:
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
quantum=(size_t) (ScaleShortToQuantum((unsigned short)
(((pixel >> 22) & 0x3ff) << 6)));
break;
@@ -780,15 +767,15 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),
q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),
q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),
q);
q+=GetPixelChannels(image);
@@ -804,16 +791,16 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -823,13 +810,13 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -848,13 +835,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -863,13 +850,13 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -885,13 +872,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -904,13 +891,13 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -919,14 +906,10 @@
}
}
-static void ImportBlackQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportBlackQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -942,7 +925,6 @@
"ColorSeparatedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -968,7 +950,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -978,7 +960,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -997,7 +979,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlack(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1006,7 +988,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1022,7 +1004,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlack(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1035,7 +1017,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlack(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1045,14 +1027,10 @@
}
}
-static void ImportBlueQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportBlueQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -1062,7 +1040,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -1088,7 +1065,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -1098,7 +1075,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1117,7 +1094,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1126,7 +1103,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1142,7 +1119,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1155,7 +1132,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1165,14 +1142,10 @@
}
}
-static void ImportCbYCrYQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportCbYCrYQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -1182,7 +1155,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 10:
@@ -1212,7 +1184,7 @@
{
case 0:
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
quantum=(size_t) (ScaleShortToQuantum((unsigned short)
(((pixel >> 22) & 0x3ff) << 6)));
break;
@@ -1251,9 +1223,9 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -1262,14 +1234,10 @@
}
}
-static void ImportCMYKQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportCMYKQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -1285,7 +1253,6 @@
"ColorSeparatedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -1317,16 +1284,16 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -1336,13 +1303,13 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1361,13 +1328,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlack(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1376,13 +1343,13 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1398,13 +1365,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlack(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1417,13 +1384,13 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlack(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -1432,14 +1399,10 @@
}
}
-static void ImportCMYKAQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportCMYKAQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -1455,7 +1418,6 @@
"ColorSeparatedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -1489,19 +1451,19 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -1511,15 +1473,15 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1538,15 +1500,15 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlack(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1555,15 +1517,15 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlack(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1579,17 +1541,17 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlack(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
}
@@ -1601,15 +1563,15 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlack(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -1618,14 +1580,10 @@
}
}
-static void ImportGrayQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportGrayQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -1638,7 +1596,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 1:
@@ -1732,7 +1689,7 @@
{
for (x=0; x < (ssize_t) (number_pixels-2); x+=3)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum((pixel >> 2) & 0x3ff,
range),q);
q+=GetPixelChannels(image);
@@ -1744,7 +1701,7 @@
p+=quantum_info->pad;
q+=GetPixelChannels(image);
}
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
if (x++ < (ssize_t) (number_pixels-1))
{
SetPixelGray(image,ScaleAnyToQuantum((pixel >> 2) & 0x3ff,
@@ -1761,7 +1718,7 @@
}
for (x=0; x < (ssize_t) (number_pixels-2); x+=3)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range),
q);
q+=GetPixelChannels(image);
@@ -1773,7 +1730,7 @@
p+=quantum_info->pad;
q+=GetPixelChannels(image);
}
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
if (x++ < (ssize_t) (number_pixels-1))
{
SetPixelGray(image,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range),
@@ -1790,7 +1747,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1807,11 +1764,11 @@
for (x=0; x < (ssize_t) (number_pixels-1); x+=2)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum((QuantumAny) (pixel >> 4),
range),q);
q+=GetPixelChannels(image);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum((QuantumAny) (pixel >> 4),
range),q);
p+=quantum_info->pad;
@@ -1819,7 +1776,7 @@
}
for (bit=0; bit < (ssize_t) (number_pixels % 2); bit++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum((QuantumAny) (pixel >> 4),
range),q);
p+=quantum_info->pad;
@@ -1831,7 +1788,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1847,7 +1804,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1858,7 +1815,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -1868,7 +1825,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1887,7 +1844,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGray(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1896,7 +1853,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1912,7 +1869,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGray(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1925,7 +1882,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -1935,14 +1892,10 @@
}
}
-static void ImportGrayAlphaQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportGrayAlphaQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -1955,7 +1908,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 1:
@@ -2026,9 +1978,9 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2040,9 +1992,9 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2058,10 +2010,10 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -2071,9 +2023,9 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2092,9 +2044,9 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGray(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2103,9 +2055,9 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGray(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2121,9 +2073,9 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGray(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2136,9 +2088,9 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGray(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2148,14 +2100,10 @@
}
}
-static void ImportGreenQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportGreenQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -2165,7 +2113,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2191,7 +2138,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -2201,7 +2148,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2220,7 +2167,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2229,7 +2176,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2245,7 +2192,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2258,7 +2205,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2268,14 +2215,10 @@
}
}
-static void ImportIndexQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportIndexQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
MagickBooleanType
range_exception;
@@ -2294,7 +2237,6 @@
"ColormappedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
range_exception=MagickFalse;
switch (quantum_info->depth)
{
@@ -2388,7 +2330,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(
(MagickRealType) QuantumRange*HalfToSinglePrecision(pixel)),
&range_exception),q);
@@ -2401,7 +2343,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,pixel,&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
@@ -2422,7 +2364,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(pixel),
&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
@@ -2434,7 +2376,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,pixel,&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
@@ -2452,7 +2394,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(pixel),
&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
@@ -2467,7 +2409,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,pixel,&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
@@ -2483,13 +2425,9 @@
}
static void ImportIndexAlphaQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
- const MagickSizeType number_pixels,const unsigned char *restrict p,
- Quantum *restrict q,ExceptionInfo *exception)
+ QuantumInfo *quantum_info,const MagickSizeType number_pixels,
+ const unsigned char *restrict p,Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
MagickBooleanType
range_exception;
@@ -2511,7 +2449,6 @@
"ColormappedImageRequired","`%s'",image->filename);
return;
}
- endian=quantum_state.endian;
range_exception=MagickFalse;
switch (quantum_info->depth)
{
@@ -2596,13 +2533,13 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(
(MagickRealType) QuantumRange*HalfToSinglePrecision(pixel)),
&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ClampToQuantum((MagickRealType)
QuantumRange*HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -2612,11 +2549,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,pixel,&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2635,12 +2572,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,
ClampToQuantum(pixel),&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2649,11 +2586,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,pixel,&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2669,12 +2606,12 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,ClampToQuantum(pixel),
&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2687,11 +2624,11 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelIndex(image,PushColormapIndex(image,pixel,&range_exception),q);
SetPixelInfoPixel(image,image->colormap+(ssize_t)
GetPixelIndex(image,q),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2704,14 +2641,10 @@
"InvalidColormapIndex","`%s'",image->filename);
}
-static void ImportOpacityQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportOpacityQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -2721,7 +2654,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2747,7 +2679,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelOpacity(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -2757,7 +2689,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelOpacity(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2776,7 +2708,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelOpacity(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2785,7 +2717,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelOpacity(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2801,7 +2733,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelOpacity(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2814,7 +2746,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelOpacity(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2823,13 +2755,10 @@
}
}
}
-static void ImportRedQuantum(const Image *image,const QuantumInfo *quantum_info,
- QuantumState quantum_state,const MagickSizeType number_pixels,
- const unsigned char *restrict p,Quantum *restrict q,ExceptionInfo *exception)
+static void ImportRedQuantum(const Image *image,QuantumInfo *quantum_info,
+ const MagickSizeType number_pixels,const unsigned char *restrict p,
+ Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -2839,7 +2768,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2865,7 +2793,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -2875,7 +2803,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2894,7 +2822,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2903,7 +2831,7 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2919,7 +2847,7 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2932,7 +2860,7 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -2942,13 +2870,10 @@
}
}
-static void ImportRGBQuantum(const Image *image,const QuantumInfo *quantum_info,
- QuantumState quantum_state,const MagickSizeType number_pixels,
- const unsigned char *restrict p,Quantum *restrict q,ExceptionInfo *exception)
+static void ImportRGBQuantum(const Image *image,QuantumInfo *quantum_info,
+ const MagickSizeType number_pixels,const unsigned char *restrict p,
+ Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -2961,7 +2886,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -2990,7 +2914,7 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum((pixel >> 22) & 0x3ff,range),q);
SetPixelGreen(image,ScaleAnyToQuantum((pixel >> 12) & 0x3ff,range),
q);
@@ -3004,11 +2928,11 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -3016,11 +2940,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -3036,7 +2960,7 @@
for (x=0; x < (ssize_t) (3*number_pixels-1); x+=2)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
switch (x % 3)
{
default:
@@ -3060,7 +2984,7 @@
break;
}
}
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
switch ((x+1) % 3)
{
default:
@@ -3088,7 +3012,7 @@
}
for (bit=0; bit < (ssize_t) (3*number_pixels % 2); bit++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
switch ((x+bit) % 3)
{
default:
@@ -3122,11 +3046,11 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumLongPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumLongPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -3134,11 +3058,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -3153,13 +3077,13 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -3169,11 +3093,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3192,11 +3116,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3205,11 +3129,11 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3225,11 +3149,11 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3242,11 +3166,11 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -3255,14 +3179,10 @@
}
}
-static void ImportRGBAQuantum(const Image *image,
- const QuantumInfo *quantum_info,QuantumState quantum_state,
+static void ImportRGBAQuantum(const Image *image,QuantumInfo *quantum_info,
const MagickSizeType number_pixels,const unsigned char *restrict p,
Quantum *restrict q,ExceptionInfo *exception)
{
- EndianType
- endian;
-
QuantumAny
range;
@@ -3272,7 +3192,6 @@
unsigned int
pixel;
- endian=quantum_state.endian;
switch (quantum_info->depth)
{
case 8:
@@ -3319,7 +3238,7 @@
{
case 0:
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
quantum=(size_t) (ScaleShortToQuantum((unsigned short)
(((pixel >> 22) & 0x3ff) << 6)));
break;
@@ -3353,15 +3272,15 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),
q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),
q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum((unsigned short) (pixel << 6)),
q);
q+=GetPixelChannels(image);
@@ -3377,16 +3296,16 @@
{
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ClampToQuantum((MagickRealType) QuantumRange*
HalfToSinglePrecision(pixel)),q);
p+=quantum_info->pad;
@@ -3396,13 +3315,13 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleShortToQuantum(pixel),q);
- p=PushShortPixel(endian,p,&pixel);
+ p=PushShortPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleShortToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3421,13 +3340,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushFloatPixel(&quantum_state,p,&pixel);
+ p=PushFloatPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3436,13 +3355,13 @@
}
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelRed(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelGreen(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelBlue(image,ScaleLongToQuantum(pixel),q);
- p=PushLongPixel(endian,p,&pixel);
+ p=PushLongPixel(quantum_info->endian,p,&pixel);
SetPixelAlpha(image,ScaleLongToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3458,13 +3377,13 @@
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelRed(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelGreen(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelBlue(image,ClampToQuantum(pixel),q);
- p=PushDoublePixel(&quantum_state,p,&pixel);
+ p=PushDoublePixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ClampToQuantum(pixel),q);
p+=quantum_info->pad;
q+=GetPixelChannels(image);
@@ -3477,13 +3396,13 @@
range=GetQuantumRange(image->depth);
for (x=0; x < (ssize_t) number_pixels; x++)
{
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelRed(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelGreen(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelBlue(image,ScaleAnyToQuantum(pixel,range),q);
- p=PushQuantumPixel(&quantum_state,image->depth,p,&pixel);
+ p=PushQuantumPixel(quantum_info,p,&pixel);
SetPixelAlpha(image,ScaleAnyToQuantum(pixel,range),q);
q+=GetPixelChannels(image);
}
@@ -3493,15 +3412,12 @@
}
MagickExport size_t ImportQuantumPixels(Image *image,CacheView *image_view,
- const QuantumInfo *quantum_info,const QuantumType quantum_type,
+ QuantumInfo *quantum_info,const QuantumType quantum_type,
const unsigned char *pixels,ExceptionInfo *exception)
{
MagickSizeType
number_pixels;
- QuantumState
- quantum_state;
-
register const unsigned char
*restrict p;
@@ -3534,118 +3450,101 @@
number_pixels=GetCacheViewExtent(image_view);
q=GetCacheViewAuthenticPixelQueue(image_view);
}
- InitializeQuantumState(quantum_info,image->endian,&quantum_state);
+ ResetQuantumState(quantum_info);
extent=GetQuantumExtent(image,quantum_info,quantum_type);
switch (quantum_type)
{
case AlphaQuantum:
{
- ImportAlphaQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportAlphaQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BGRQuantum:
{
- ImportBGRQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportBGRQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BGRAQuantum:
case BGROQuantum:
{
- ImportBGRAQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportBGRAQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BlackQuantum:
{
- ImportBlackQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportBlackQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case BlueQuantum:
case YellowQuantum:
{
- ImportBlueQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportBlueQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case CMYKQuantum:
{
- ImportCMYKQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportCMYKQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case CMYKAQuantum:
case CMYKOQuantum:
{
- ImportCMYKAQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportCMYKAQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case CbYCrYQuantum:
{
- ImportCbYCrYQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportCbYCrYQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case GrayQuantum:
{
- ImportGrayQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportGrayQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case GrayAlphaQuantum:
{
- ImportGrayAlphaQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportGrayAlphaQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case GreenQuantum:
case MagentaQuantum:
{
- ImportGreenQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportGreenQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case IndexQuantum:
{
- ImportIndexQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportIndexQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case IndexAlphaQuantum:
{
- ImportIndexAlphaQuantum(image,quantum_info,quantum_state,number_pixels,p,
- q,exception);
+ ImportIndexAlphaQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case OpacityQuantum:
{
- ImportOpacityQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportOpacityQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case RedQuantum:
case CyanQuantum:
{
- ImportRedQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportRedQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case RGBQuantum:
case CbYCrQuantum:
{
- ImportRGBQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportRGBQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
case RGBAQuantum:
case RGBOQuantum:
case CbYCrAQuantum:
{
- ImportRGBAQuantum(image,quantum_info,quantum_state,number_pixels,p,q,
- exception);
+ ImportRGBAQuantum(image,quantum_info,number_pixels,p,q,exception);
break;
}
default:
diff --git a/MagickCore/quantum-private.h b/MagickCore/quantum-private.h
index 6bc11d3..976df36 100644
--- a/MagickCore/quantum-private.h
+++ b/MagickCore/quantum-private.h
@@ -26,12 +26,7 @@
typedef struct _QuantumState
{
- EndianType
- endian;
-
double
- minimum,
- scale,
inverse_scale;
unsigned int
@@ -77,6 +72,12 @@
size_t
extent;
+ EndianType
+ endian;
+
+ QuantumState
+ state;
+
SemaphoreInfo
*semaphore;
@@ -168,31 +169,6 @@
return(map.single_precision);
}
-static inline void InitializeQuantumState(const QuantumInfo *quantum_info,
- const EndianType endian,QuantumState *quantum_state)
-{
- static const unsigned int mask[32] =
- {
- 0x00000000U, 0x00000001U, 0x00000003U, 0x00000007U, 0x0000000fU,
- 0x0000001fU, 0x0000003fU, 0x0000007fU, 0x000000ffU, 0x000001ffU,
- 0x000003ffU, 0x000007ffU, 0x00000fffU, 0x00001fffU, 0x00003fffU,
- 0x00007fffU, 0x0000ffffU, 0x0001ffffU, 0x0003ffffU, 0x0007ffffU,
- 0x000fffffU, 0x001fffffU, 0x003fffffU, 0x007fffffU, 0x00ffffffU,
- 0x01ffffffU, 0x03ffffffU, 0x07ffffffU, 0x0fffffffU, 0x1fffffffU,
- 0x3fffffffU, 0x7fffffffU
- };
-
- quantum_state->endian=endian;
- quantum_state->minimum=quantum_info->minimum;
- quantum_state->scale=quantum_info->scale;
- quantum_state->inverse_scale=1.0;
- if (fabs(quantum_state->scale) >= MagickEpsilon)
- quantum_state->inverse_scale/=quantum_state->scale;
- quantum_state->pixel=0U;
- quantum_state->bits=0U;
- quantum_state->mask=mask;
-}
-
static inline unsigned char *PopCharPixel(const unsigned char pixel,
unsigned char *pixels)
{
diff --git a/MagickCore/quantum.c b/MagickCore/quantum.c
index 3d9ac71..2d9c77b 100644
--- a/MagickCore/quantum.c
+++ b/MagickCore/quantum.c
@@ -424,6 +424,8 @@
if (option != (char *) NULL)
quantum_info->min_is_white=LocaleCompare(option,"min-is-white") == 0 ?
MagickTrue : MagickFalse;
+ quantum_info->endian=image_info->endian;
+ ResetQuantumState(quantum_info);
}
/*
@@ -520,6 +522,51 @@
% %
% %
% %
+% R e s e t Q u a n t u m S t a t e %
+% %
+% %
+% %
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% ResetQuantumState() resets the quantum state.
+%
+% The format of the ResetQuantumState method is:
+%
+% void ResetQuantumState(QuantumInfo *quantum_info)
+%
+% A description of each parameter follows:
+%
+% o quantum_info: the quantum info.
+%
+*/
+MagickExport void ResetQuantumState(QuantumInfo *quantum_info)
+{
+ static const unsigned int mask[32] =
+ {
+ 0x00000000U, 0x00000001U, 0x00000003U, 0x00000007U, 0x0000000fU,
+ 0x0000001fU, 0x0000003fU, 0x0000007fU, 0x000000ffU, 0x000001ffU,
+ 0x000003ffU, 0x000007ffU, 0x00000fffU, 0x00001fffU, 0x00003fffU,
+ 0x00007fffU, 0x0000ffffU, 0x0001ffffU, 0x0003ffffU, 0x0007ffffU,
+ 0x000fffffU, 0x001fffffU, 0x003fffffU, 0x007fffffU, 0x00ffffffU,
+ 0x01ffffffU, 0x03ffffffU, 0x07ffffffU, 0x0fffffffU, 0x1fffffffU,
+ 0x3fffffffU, 0x7fffffffU
+ };
+
+ assert(quantum_info != (QuantumInfo *) NULL);
+ assert(quantum_info->signature == MagickSignature);
+ quantum_info->state.inverse_scale=1.0;
+ if (fabs(quantum_info->scale) >= MagickEpsilon)
+ quantum_info->state.inverse_scale/=quantum_info->scale;
+ quantum_info->state.pixel=0U;
+ quantum_info->state.bits=0U;
+ quantum_info->state.mask=mask;
+}
+
+/*
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% %
+% %
+% %
% S e t Q u a n t u m F o r m a t %
% %
% %
diff --git a/MagickCore/quantum.h b/MagickCore/quantum.h
index 719abbc..0ac3f65 100644
--- a/MagickCore/quantum.h
+++ b/MagickCore/quantum.h
@@ -166,10 +166,10 @@
GetQuantumType(Image *,ExceptionInfo *);
extern MagickExport size_t
- ExportQuantumPixels(Image *,CacheView *,const QuantumInfo *,const QuantumType,
+ ExportQuantumPixels(Image *,CacheView *,QuantumInfo *,const QuantumType,
unsigned char *,ExceptionInfo *),
GetQuantumExtent(const Image *,const QuantumInfo *,const QuantumType),
- ImportQuantumPixels(Image *,CacheView *,const QuantumInfo *,const QuantumType,
+ ImportQuantumPixels(Image *,CacheView *,QuantumInfo *,const QuantumType,
const unsigned char *,ExceptionInfo *);
extern MagickExport unsigned char
@@ -177,6 +177,7 @@
extern MagickExport void
GetQuantumInfo(const ImageInfo *,QuantumInfo *),
+ ResetQuantumState(QuantumInfo *),
SetQuantumAlphaType(QuantumInfo *,const QuantumAlphaType),
SetQuantumImageType(Image *,const QuantumType),
SetQuantumMinIsWhite(QuantumInfo *,const MagickBooleanType),
diff --git a/MagickCore/version.h b/MagickCore/version.h
index d1b3e8a..eff2b72 100644
--- a/MagickCore/version.h
+++ b/MagickCore/version.h
@@ -27,14 +27,14 @@
*/
#define MagickPackageName "ImageMagick"
#define MagickCopyright "Copyright (C) 1999-2012 ImageMagick Studio LLC"
-#define MagickSVNRevision "6363"
+#define MagickSVNRevision "exported"
#define MagickLibVersion 0x700
#define MagickLibVersionText "7.0.0"
#define MagickLibVersionNumber 7,0,0
#define MagickLibAddendum "-0"
#define MagickLibInterface 7
#define MagickLibMinInterface 7
-#define MagickReleaseDate "2012-01-11"
+#define MagickReleaseDate "2012-01-12"
#define MagickChangeDate "20110801"
#define MagickAuthoritativeURL "http://www.imagemagick.org"
#if defined(MAGICKCORE_OPENMP_SUPPORT)