// Flood-fill color across pixels that match the color of the
// target pixel and are neighbors of the target pixel.
// Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillColor( const size_t x_,
- const size_t y_,
+void Magick::Image::floodFillColor( const ssize_t x_,
+ const ssize_t y_,
const Magick::Color &fillColor_ )
{
floodFillTexture( x_, y_, Image( Geometry( 1, 1), fillColor_ ) );
// Flood-fill color across pixels starting at target-pixel and
// stopping at pixels matching specified border color.
// Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillColor( const size_t x_,
- const size_t y_,
+void Magick::Image::floodFillColor( const ssize_t x_,
+ const ssize_t y_,
const Magick::Color &fillColor_,
const Magick::Color &borderColor_ )
{
// Floodfill pixels matching color (within fuzz factor) of target
// pixel(x,y) with replacement opacity value using method.
-void Magick::Image::floodFillOpacity( const size_t x_,
- const size_t y_,
- const size_t opacity_,
+void Magick::Image::floodFillOpacity( const ssize_t x_,
+ const ssize_t y_,
+ const unsigned int opacity_,
const PaintMethod method_ )
{
modifyImage();
// Flood-fill texture across pixels that match the color of the
// target pixel and are neighbors of the target pixel.
// Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillTexture( const size_t x_,
- const size_t y_,
+void Magick::Image::floodFillTexture( const ssize_t x_,
+ const ssize_t y_,
const Magick::Image &texture_ )
{
modifyImage();
// Flood-fill texture across pixels starting at target-pixel and
// stopping at pixels matching specified border color.
// Uses current fuzz setting when determining color match.
-void Magick::Image::floodFillTexture( const size_t x_,
- const size_t y_,
+void Magick::Image::floodFillTexture( const ssize_t x_,
+ const ssize_t y_,
const Magick::Image &texture_,
const Magick::Color &borderColor_ )
{
}
// Floodfill designated area with replacement opacity value
void Magick::Image::matteFloodfill ( const Color &target_ ,
- const size_t opacity_,
+ const unsigned int opacity_,
const ssize_t x_, const ssize_t y_,
const Magick::PaintMethod method_ )
{
// opacity_ ranges from 0 (completely opaque) to QuantumRange. The defines
// OpaqueOpacity and TransparentOpacity are available to specify
// completely opaque or completely transparent, respectively.
-void Magick::Image::opacity ( const size_t opacity_ )
+void Magick::Image::opacity ( const unsigned int opacity_ )
{
modifyImage();
SetImageOpacity( image(), opacity_ );
{
if (isValid())
{
- size_t x_resolution=72;
- size_t y_resolution=72;
+ ssize_t x_resolution=72;
+ ssize_t y_resolution=72;
if (constImage()->x_resolution > 0.0)
x_resolution=static_cast<size_t>(constImage()->x_resolution + 0.5);
}
// Set the color of a pixel.
-void Magick::Image::pixelColor ( const size_t x_, const size_t y_,
+void Magick::Image::pixelColor ( const ssize_t x_, const ssize_t y_,
const Color &color_ )
{
// Test arguments to ensure they are within the image.
}
// Get the color of a pixel
-Magick::Color Magick::Image::pixelColor ( const size_t x_,
- const size_t y_ ) const
+Magick::Color Magick::Image::pixelColor ( const ssize_t x_,
+ const ssize_t y_ ) const
{
ClassType storage_class;
storage_class = classType();
private:
size_t _width;
size_t _height;
- size_t _xOff;
- size_t _yOff;
+ ssize_t _xOff;
+ ssize_t _yOff;
bool _xNegative;
bool _yNegative;
bool _isValid;
// Flood-fill color across pixels that match the color of the
// target pixel and are neighbors of the target pixel.
// Uses current fuzz setting when determining color match.
- void floodFillColor( const size_t x_,
- const size_t y_,
+ void floodFillColor( const ssize_t x_,
+ const ssize_t y_,
const Color &fillColor_ );
void floodFillColor( const Geometry &point_,
const Color &fillColor_ );
// Flood-fill color across pixels starting at target-pixel and
// stopping at pixels matching specified border color.
// Uses current fuzz setting when determining color match.
- void floodFillColor( const size_t x_,
- const size_t y_,
+ void floodFillColor( const ssize_t x_,
+ const ssize_t y_,
const Color &fillColor_,
const Color &borderColor_ );
void floodFillColor( const Geometry &point_,
// Floodfill pixels matching color (within fuzz factor) of target
// pixel(x,y) with replacement opacity value using method.
- void floodFillOpacity ( const size_t x_,
- const size_t y_,
- const size_t opacity_,
+ void floodFillOpacity ( const ssize_t x_,
+ const ssize_t y_,
+ const unsigned int opacity_,
const PaintMethod method_ );
// Flood-fill texture across pixels that match the color of the
// target pixel and are neighbors of the target pixel.
// Uses current fuzz setting when determining color match.
- void floodFillTexture( const size_t x_,
- const size_t y_,
+ void floodFillTexture( const ssize_t x_,
+ const ssize_t y_,
const Image &texture_ );
void floodFillTexture( const Geometry &point_,
const Image &texture_ );
// Flood-fill texture across pixels starting at target-pixel and
// stopping at pixels matching specified border color.
// Uses current fuzz setting when determining color match.
- void floodFillTexture( const size_t x_,
- const size_t y_,
+ void floodFillTexture( const ssize_t x_,
+ const ssize_t y_,
const Image &texture_,
const Color &borderColor_ );
void floodFillTexture( const Geometry &point_,
// Floodfill designated area with replacement opacity value
void matteFloodfill ( const Color &target_ ,
- const size_t opacity_,
+ const unsigned int opacity_,
const ssize_t x_, const ssize_t y_,
const PaintMethod method_ );
// to QuantumRange. The defines OpaqueOpacity and TransparentOpacity are
// available to specify completely opaque or completely
// transparent, respectively.
- void opacity ( const size_t opacity_ );
+ void opacity ( const unsigned int opacity_ );
// Change color of opaque pixel to specified pen color.
void opaque ( const Color &opaqueColor_,
Image penTexture ( void ) const;
// Get/set pixel color at location x & y.
- void pixelColor ( const size_t x_,
- const size_t y_,
+ void pixelColor ( const ssize_t x_,
+ const ssize_t y_,
const Color &color_ );
- Color pixelColor ( const size_t x_,
- const size_t y_ ) const;
+ Color pixelColor ( const ssize_t x_,
+ const ssize_t y_ ) const;
// Add or remove a named profile to/from the image. Remove the
// profile by passing an empty Blob (e.g. Blob()). Valid names are
private:
size_t _width;
size_t _height;
- size_t _offset;
+ ssize_t _offset;
};
// Add noise to image with specified noise type
void operator()( Image &image_ ) const;
private:
- size_t _opacityRed;
- size_t _opacityGreen;
- size_t _opacityBlue;
+ unsigned int _opacityRed;
+ unsigned int _opacityGreen;
+ unsigned int _opacityBlue;
Color _penColor;
};
void operator()( Image &image_ ) const;
private:
- ssize_t _columns;
- ssize_t _rows;
+ size_t _columns;
+ size_t _rows;
};
// Rotate image counter-clockwise by specified number of degrees.
}
else
{
+ size_t
+ one;
+
/*
Colormapped ICON raster.
*/
icon_info.bits_per_pixel=4;
if (next->colors <= 2)
icon_info.bits_per_pixel=1;
- icon_info.number_colors=1 << icon_info.bits_per_pixel;
+ one=1;
+ icon_info.number_colors=one << icon_info.bits_per_pixel;
if (icon_info.number_colors < next->colors)
{
(void) SetImageStorageClass(next,DirectClass);
icon_file.directory[scene].bits_per_pixel=icon_info.bits_per_pixel;
icon_file.directory[scene].size=icon_info.size;
icon_file.directory[scene].offset=(size_t) TellBlob(image);
- (void) WriteBlobLSBLong(image,(size_t) 40);
- (void) WriteBlobLSBLong(image,(size_t) icon_info.width);
- (void) WriteBlobLSBLong(image,(size_t) icon_info.height*2);
+ (void) WriteBlobLSBLong(image,(unsigned int) 40);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.width);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.height*2);
(void) WriteBlobLSBShort(image,icon_info.planes);
(void) WriteBlobLSBShort(image,icon_info.bits_per_pixel);
- (void) WriteBlobLSBLong(image,icon_info.compression);
- (void) WriteBlobLSBLong(image,icon_info.image_size);
- (void) WriteBlobLSBLong(image,icon_info.x_pixels);
- (void) WriteBlobLSBLong(image,icon_info.y_pixels);
- (void) WriteBlobLSBLong(image,icon_info.number_colors);
- (void) WriteBlobLSBLong(image,icon_info.colors_important);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.compression);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.image_size);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.x_pixels);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.y_pixels);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.number_colors);
+ (void) WriteBlobLSBLong(image,(unsigned int) icon_info.colors_important);
if (next->storage_class == PseudoClass)
{
unsigned char
%
*/
-static inline ssize_t MagickMax(const ssize_t x,const ssize_t y)
+static inline size_t MagickMax(const size_t x,const size_t y)
{
if (x > y)
return(x);
RenderingIntent
global_srgb_intent;
- size_t
+ unsigned int
delay,
global_plte_length,
global_trns_length,
int
max_sample;
+ size_t
+ one=1;
+
if (logging != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
" Reading PNG tRNS chunk.");
- max_sample = (1 << ping_bit_depth) - 1;
+ max_sample = (one << ping_bit_depth) - 1;
if ((ping_color_type == PNG_COLOR_TYPE_GRAY &&
(int)ping_trans_color->gray > max_sample) ||
mng_info->global_plte[i].green=p[3*i+1];
mng_info->global_plte[i].blue=p[3*i+2];
}
- mng_info->global_plte_length=length/3;
+ mng_info->global_plte_length=(unsigned int) (length/3);
}
#ifdef MNG_LOOSE
for ( ; i < 256; i++)
for ( ; i < 256; i++)
mng_info->global_trns[i]=255;
#endif
- mng_info->global_trns_length=length;
+ mng_info->global_trns_length=(usnigned int) length;
chunk=(unsigned char *) RelinquishMagickMemory(chunk);
continue;
}
}
if (ping_color_type == PNG_COLOR_TYPE_PALETTE)
{
+ size_t one = 1;
ping_bit_depth=1;
- while ((int) (1 << ping_bit_depth) < (ssize_t) image_colors)
+ while ((int) (one << ping_bit_depth) < (ssize_t) image_colors)
ping_bit_depth <<= 1;
if (logging != MagickFalse)
mng_info->write_png_colortype-1 != PNG_COLOR_TYPE_PALETTE &&
ImageIsGray(image) && (!image_matte || image_depth >= 8))
{
+ size_t one=1;
if (image_matte != MagickFalse)
ping_color_type=PNG_COLOR_TYPE_GRAY_ALPHA;
else
if (image_depth > MAGICKCORE_QUANTUM_DEPTH)
image_depth=MAGICKCORE_QUANTUM_DEPTH;
if (image_colors == 0 || image_colors-1 > MaxColormapSize)
- image_colors=1 << image_depth;
+ image_colors=one << image_depth;
if (image_depth > 8)
ping_bit_depth=16;
else
if(!mng_info->write_png_depth)
{
ping_bit_depth=1;
- while ((int) (1 << ping_bit_depth)
+ while ((int) (one << ping_bit_depth)
< (ssize_t) image_colors)
ping_bit_depth <<= 1;
}
png_color_16
background;
- maxval=(png_uint_16) ((1 << ping_bit_depth)-1);
+ size_t
+ one=1;
+
+ maxval=(png_uint_16) ((ine << ping_bit_depth)-1);
background.gray=(png_uint_16)
(void) WriteBlobMSBULong(image,4L);
PNGType(chunk,mng_gAMA);
LogPNGChunk((int) logging,mng_gAMA,4L);
- PNGLong(chunk+4,(size_t) (100000*image->gamma+0.5));
+ PNGLong(chunk+4,(png_uint_32) (100000*image->gamma+0.5));
(void) WriteBlob(image,8,chunk);
(void) WriteBlobMSBULong(image,crc32(0,chunk,8));
}
PNGType(chunk,mng_cHRM);
LogPNGChunk((int) logging,mng_cHRM,32L);
primary=image->chromaticity.white_point;
- PNGLong(chunk+4,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+8,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+4,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+8,(png_uint_32) (100000*primary.y+0.5));
primary=image->chromaticity.red_primary;
- PNGLong(chunk+12,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+16,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+12,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+16,(png_uint_32) (100000*primary.y+0.5));
primary=image->chromaticity.green_primary;
- PNGLong(chunk+20,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+24,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+20,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+24,(png_uint_32) (100000*primary.y+0.5));
primary=image->chromaticity.blue_primary;
- PNGLong(chunk+28,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+32,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+28,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+32,(png_uint_32) (100000*primary.y+0.5));
(void) WriteBlob(image,36,chunk);
(void) WriteBlobMSBULong(image,crc32(0,chunk,36));
}
LogPNGChunk((int) logging,mng_pHYs,9L);
if (image->units == PixelsPerInchResolution)
{
- PNGLong(chunk+4,(size_t)
+ PNGLong(chunk+4,(png_uint_32)
(image->x_resolution*100.0/2.54+0.5));
- PNGLong(chunk+8,(size_t)
+ PNGLong(chunk+8,(png_uint_32)
(image->y_resolution*100.0/2.54+0.5));
chunk[12]=1;
}
{
if (image->units == PixelsPerCentimeterResolution)
{
- PNGLong(chunk+4,(size_t)
+ PNGLong(chunk+4,(png_uint_32)
(image->x_resolution*100.0+0.5));
- PNGLong(chunk+8,(size_t)
+ PNGLong(chunk+8,(png_uint_32)
(image->y_resolution*100.0+0.5));
chunk[12]=1;
}
else
{
- PNGLong(chunk+4,(size_t) (image->x_resolution+0.5));
- PNGLong(chunk+8,(size_t) (image->y_resolution+0.5));
+ PNGLong(chunk+4,(png_uint_32) (image->x_resolution+0.5));
+ PNGLong(chunk+8,(png_uint_32) (image->y_resolution+0.5));
chunk[12]=0;
}
}
(void) WriteBlobMSBULong(image,4L);
PNGType(chunk,mng_gAMA);
LogPNGChunk((int) logging,mng_gAMA,4L);
- PNGLong(chunk+4,(size_t) (100000*image->gamma+0.5));
+ PNGLong(chunk+4,(png_uint_32) (100000*image->gamma+0.5));
(void) WriteBlob(image,8,chunk);
(void) WriteBlobMSBULong(image,crc32(0,chunk,8));
mng_info->have_write_global_gama=MagickTrue;
PNGType(chunk,mng_cHRM);
LogPNGChunk((int) logging,mng_cHRM,32L);
primary=image->chromaticity.white_point;
- PNGLong(chunk+4,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+8,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+4,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+8,(png_uint_32) (100000*primary.y+0.5));
primary=image->chromaticity.red_primary;
- PNGLong(chunk+12,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+16,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+12,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+16,(png_uint_32) (100000*primary.y+0.5));
primary=image->chromaticity.green_primary;
- PNGLong(chunk+20,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+24,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+20,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+24,(png_uint_32) (100000*primary.y+0.5));
primary=image->chromaticity.blue_primary;
- PNGLong(chunk+28,(size_t) (100000*primary.x+0.5));
- PNGLong(chunk+32,(size_t) (100000*primary.y+0.5));
+ PNGLong(chunk+28,(png_uint_32) (100000*primary.x+0.5));
+ PNGLong(chunk+32,(png_uint_32) (100000*primary.y+0.5));
(void) WriteBlob(image,36,chunk);
(void) WriteBlobMSBULong(image,crc32(0,chunk,36));
mng_info->have_write_global_chrm=MagickTrue;
LogPNGChunk((int) logging,mng_pHYs,9L);
if (image->units == PixelsPerInchResolution)
{
- PNGLong(chunk+4,(size_t)
+ PNGLong(chunk+4,(png_uint_32)
(image->x_resolution*100.0/2.54+0.5));
- PNGLong(chunk+8,(size_t)
+ PNGLong(chunk+8,(png_uint_32)
(image->y_resolution*100.0/2.54+0.5));
chunk[12]=1;
}
{
if (image->units == PixelsPerCentimeterResolution)
{
- PNGLong(chunk+4,(size_t)
+ PNGLong(chunk+4,(png_uint_32)
(image->x_resolution*100.0+0.5));
- PNGLong(chunk+8,(size_t)
+ PNGLong(chunk+8,(png_uint_32)
(image->y_resolution*100.0+0.5));
chunk[12]=1;
}
else
{
- PNGLong(chunk+4,(size_t) (image->x_resolution+0.5));
- PNGLong(chunk+8,(size_t) (image->y_resolution+0.5));
+ PNGLong(chunk+4,(png_uint_32) (image->x_resolution+0.5));
+ PNGLong(chunk+8,(png_uint_32) (image->y_resolution+0.5));
chunk[12]=0;
}
}