From: cristy Date: Thu, 3 Jun 2010 16:24:13 +0000 (+0000) Subject: (no commit message) X-Git-Tag: 7.0.1-0~9318 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35ef824baa82511126ff0072ae30eee0da9c05a3;p=imagemagick --- diff --git a/Magick++/lib/Image.cpp b/Magick++/lib/Image.cpp index 089bda66a..b3f3f68e3 100644 --- a/Magick++/lib/Image.cpp +++ b/Magick++/lib/Image.cpp @@ -928,8 +928,8 @@ void Magick::Image::flip ( void ) // 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_ ) ); @@ -943,8 +943,8 @@ void Magick::Image::floodFillColor( const Geometry &point_, // 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_ ) { @@ -961,9 +961,9 @@ void Magick::Image::floodFillColor( const Geometry &point_, // 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(); @@ -986,8 +986,8 @@ void Magick::Image::floodFillOpacity( const size_t x_, // 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(); @@ -1025,8 +1025,8 @@ void Magick::Image::floodFillTexture( const Magick::Geometry &point_, // 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_ ) { @@ -1318,7 +1318,7 @@ void Magick::Image::map ( const Image &mapImage_ , const bool dither_ ) } // 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_ ) { @@ -1427,7 +1427,7 @@ void Magick::Image::oilPaint ( const double radius_ ) // 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_ ); @@ -2871,8 +2871,8 @@ Magick::Geometry Magick::Image::density ( void ) const { 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(constImage()->x_resolution + 0.5); @@ -3388,7 +3388,7 @@ Magick::Image Magick::Image::penTexture ( void ) const } // 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. @@ -3412,8 +3412,8 @@ void Magick::Image::pixelColor ( const size_t x_, const size_t y_, } // 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(); diff --git a/Magick++/lib/Magick++/Geometry.h b/Magick++/lib/Magick++/Geometry.h index f8d0015a3..817f322e6 100644 --- a/Magick++/lib/Magick++/Geometry.h +++ b/Magick++/lib/Magick++/Geometry.h @@ -109,8 +109,8 @@ namespace Magick 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; diff --git a/Magick++/lib/Magick++/Image.h b/Magick++/lib/Magick++/Image.h index 3dd5d2dbf..ce271b5f3 100644 --- a/Magick++/lib/Magick++/Image.h +++ b/Magick++/lib/Magick++/Image.h @@ -314,8 +314,8 @@ namespace Magick // 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_ ); @@ -323,8 +323,8 @@ namespace Magick // 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_, @@ -333,16 +333,16 @@ namespace Magick // 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_ ); @@ -350,8 +350,8 @@ namespace Magick // 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_, @@ -449,7 +449,7 @@ namespace Magick // 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_ ); @@ -493,7 +493,7 @@ namespace Magick // 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_, @@ -1085,11 +1085,11 @@ typedef struct _ImageStatistics 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 diff --git a/Magick++/lib/Magick++/STL.h b/Magick++/lib/Magick++/STL.h index ca385c57d..2b9317c8d 100644 --- a/Magick++/lib/Magick++/STL.h +++ b/Magick++/lib/Magick++/STL.h @@ -71,7 +71,7 @@ namespace Magick private: size_t _width; size_t _height; - size_t _offset; + ssize_t _offset; }; // Add noise to image with specified noise type @@ -228,9 +228,9 @@ namespace Magick 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; }; @@ -904,8 +904,8 @@ namespace Magick 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. diff --git a/coders/icon.c b/coders/icon.c index b37afa511..298ec2f1e 100644 --- a/coders/icon.c +++ b/coders/icon.c @@ -902,6 +902,9 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, } else { + size_t + one; + /* Colormapped ICON raster. */ @@ -912,7 +915,8 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, 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); @@ -1126,17 +1130,17 @@ static MagickBooleanType WriteICONImage(const ImageInfo *image_info, 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 diff --git a/coders/palm.c b/coders/palm.c index 15b920c69..d73d1d943 100644 --- a/coders/palm.c +++ b/coders/palm.c @@ -227,7 +227,7 @@ static int FindColor(PixelPacket *pixel) % */ -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); diff --git a/coders/png.c b/coders/png.c index 6e2576551..f0f8e3eb7 100644 --- a/coders/png.c +++ b/coders/png.c @@ -387,7 +387,7 @@ typedef struct _MngInfo RenderingIntent global_srgb_intent; - size_t + unsigned int delay, global_plte_length, global_trns_length, @@ -2199,11 +2199,14 @@ static Image *ReadOnePNGImage(MngInfo *mng_info, 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) || @@ -4352,7 +4355,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception) 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++) @@ -4381,7 +4384,7 @@ static Image *ReadMNGImage(const ImageInfo *image_info,ExceptionInfo *exception) 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; } @@ -6877,8 +6880,9 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, } 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) @@ -7056,6 +7060,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, 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 @@ -7067,7 +7072,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, 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 @@ -7078,7 +7083,7 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, 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; } @@ -7293,7 +7298,10 @@ static MagickBooleanType WriteOnePNGImage(MngInfo *mng_info, 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) @@ -8496,7 +8504,7 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, (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)); } @@ -8513,17 +8521,17 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, 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)); } @@ -8538,9 +8546,9 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, 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; } @@ -8548,16 +8556,16 @@ static MagickBooleanType WriteOneJNGImage(MngInfo *mng_info, { 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; } } @@ -9337,7 +9345,7 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image) (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; @@ -9354,17 +9362,17 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image) 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; @@ -9380,9 +9388,9 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image) 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; } @@ -9390,16 +9398,16 @@ static MagickBooleanType WriteMNGImage(const ImageInfo *image_info,Image *image) { 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; } }