matrix=(double **) AcquireQuantumMemory(number_rows,sizeof(*matrix));
if (matrix == (double **) NULL)
- return((double **)NULL);
+ return((double **) NULL);
for (i=0; i < (ssize_t) number_rows; i++)
{
matrix[i]=(double *) AcquireQuantumMemory(size,sizeof(*matrix[i]));
%
% The format of the GaussJordanElimination method is:
%
-% MagickBooleanType GaussJordanElimination(double **matrix,double **vectors,
-% const size_t rank,const size_t number_vectors)
+% MagickBooleanType GaussJordanElimination(double **matrix,
+% double **vectors,const size_t rank,const size_t number_vectors)
%
% A description of each parameter follows:
%
%
% You can also use the 'vectors' to generate an inverse of the given 'matrix'
% though as a 'column first array' rather than a 'row first array'. For
-% details see http://en.wikipedia.org/wiki/Gauss-Jordan_elimination
+% details see http://en.wikipedia.org/wiki/Gauss-Jordan_elimination.
%
*/
MagickPrivate MagickBooleanType GaussJordanElimination(double **matrix,
% o vectors: the result vectors to add terms/results to.
%
% o terms: the pre-calculated terms (without the unknown coefficent
-% weights) that forms the equation being added.
+% weights) that forms the equation being added.
%
% o results: the result(s) that should be generated from the given terms
-% weighted by the yet-to-be-solved coefficents.
+% weighted by the yet-to-be-solved coefficents.
%
% o rank: the rank or size of the dimentions of the square matrix.
-% Also the length of vectors, and number of terms being added.
+% Also the length of vectors, and number of terms being added.
%
% o number_vectors: Number of result vectors, and number or results being
% added. Also represents the number of separable systems of equations
for (i=0; i < (ssize_t) number_vectors; i++)
vectors[i][j]+=results[i]*terms[j];
}
- return;
}
\f
/*
matrix=(double **) RelinquishMagickMemory(matrix);
return(matrix);
}
-
for (x=0; x < (ssize_t) image->columns; x++)
{
byte<<=1;
- if (((MagickRealType) GetPixelRed(image,p) < threshold) ||
- ((MagickRealType) GetPixelGreen(image,p) < threshold) ||
- ((MagickRealType) GetPixelBlue(image,p) < threshold))
+ if (GetPixelIntensity(image,p) < threshold)
byte|=0x01;
bit++;
if (bit == 8)
for (x=0; x < (ssize_t) image->columns; x++)
{
byte<<=1;
- if (((MagickRealType) GetPixelRed(image,p) < threshold) ||
- ((MagickRealType) GetPixelGreen(image,p) < threshold) ||
- ((MagickRealType) GetPixelBlue(image,p) < threshold))
+ if (GetPixelIntensity(image,p) < threshold)
byte|=0x01;
bit++;
if (bit == 8)
background.red+=QuantumScale*GetPixelRed(image,p);
background.green+=QuantumScale*GetPixelGreen(image,p);
background.blue+=QuantumScale*GetPixelBlue(image,p);
- background.alpha+=QuantumScale*GetPixelAlpha(image,p);
+ if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
+ background.alpha+=QuantumScale*GetPixelAlpha(image,p);
count++;
p+=GetPixelChannels(image);
}
background.green/count);
image->background_color.blue=ClampToQuantum((MagickRealType) QuantumRange*
background.blue/count);
- image->background_color.alpha=ClampToQuantum((MagickRealType) QuantumRange*
- background.alpha/count);
+ if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
+ image->background_color.alpha=ClampToQuantum((MagickRealType) QuantumRange*
+ background.alpha/count);
}
MagickExport Image *DeskewImage(const Image *image,const double threshold,
Rotate 90 degrees.
*/
GetPixelCacheTileSize(image,&tile_width,&tile_height);
- for (tile_y=0; tile_y < (ssize_t) image->rows; tile_y+=(ssize_t) tile_height)
+ tile_y=0;
+ for ( ; tile_y < (ssize_t) image->rows; tile_y+=(ssize_t) tile_height)
{
register ssize_t
tile_x;
if (status == MagickFalse)
continue;
- for (tile_x=0; tile_x < (ssize_t) image->columns; tile_x+=(ssize_t) tile_width)
+ tile_x=0;
+ for ( ; tile_x < (ssize_t) image->columns; tile_x+=(ssize_t) tile_width)
{
MagickBooleanType
sync;
Rotate 270 degrees.
*/
GetPixelCacheTileSize(image,&tile_width,&tile_height);
- for (tile_y=0; tile_y < (ssize_t) image->rows; tile_y+=(ssize_t) tile_height)
+ tile_y=0;
+ for ( ; tile_y < (ssize_t) image->rows; tile_y+=(ssize_t) tile_height)
{
register ssize_t
tile_x;
if (status == MagickFalse)
continue;
- for (tile_x=0; tile_x < (ssize_t) image->columns; tile_x+=(ssize_t) tile_width)
+ tile_x=0;
+ for ( ; tile_x < (ssize_t) image->columns; tile_x+=(ssize_t) tile_width)
{
MagickBooleanType
sync;