DestroyPixelHandler
destroy_pixel_handler;
+
+ MagickBooleanType
+ stream;
} CacheMethods;
typedef struct _NexusInfo
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
if ((image->columns == 0) || (image->rows == 0))
ThrowBinaryException(CacheError,"NoPixelsDefinedInCache",image->filename);
+ cache_info=(CacheInfo *) image->cache;
+ assert(cache_info->signature == MagickSignature);
+ if (cache_info->methods.stream != MagickFalse)
+ return(MagickTrue);
if ((AcquireMagickResource(WidthResource,image->columns) == MagickFalse) ||
(AcquireMagickResource(HeightResource,image->rows) == MagickFalse))
ThrowBinaryException(ResourceLimitError,"PixelCacheAllocationFailed",
image->filename);
- cache_info=(CacheInfo *) image->cache;
- assert(cache_info->signature == MagickSignature);
source_info=(*cache_info);
source_info.file=(-1);
(void) FormatLocaleString(cache_info->filename,MagickPathExtent,"%s[%.20g]",
(GetOneAuthenticPixelFromHandler) NULL)
cache_info->methods.get_one_authentic_pixel_from_handler=
cache_methods->get_one_authentic_pixel_from_handler;
+ cache_info->methods.stream=cache_methods->stream;
}
\f
/*
static inline const unsigned char *PushLongPixel(const EndianType endian,
const unsigned char *pixels,unsigned int *pixel)
{
- register unsigned int
+ register unsigned long
quantum;
if (endian == LSBEndian)
{
- quantum=(unsigned int) (*pixels++);
- quantum|=(unsigned int) (*pixels++ << 8);
- quantum|=(unsigned int) (*pixels++ << 16);
- quantum|=(unsigned int) (*pixels++ << 24);
+ quantum=((unsigned long) *pixels++);
+ quantum|=((unsigned long) *pixels++ << 8);
+ quantum|=((unsigned long) *pixels++ << 16);
+ quantum|=((unsigned long) *pixels++ << 24);
*pixel=(unsigned int) (quantum & 0xffffffff);
return(pixels);
}
- quantum=(unsigned int) (*pixels++ << 24);
- quantum|=(unsigned int) (*pixels++ << 16);
- quantum|=(unsigned int) (*pixels++ << 8);
- quantum|=(unsigned int) (*pixels++);
+ quantum=((unsigned long) *pixels++ << 24);
+ quantum|=((unsigned long) *pixels++ << 16);
+ quantum|=((unsigned long) *pixels++ << 8);
+ quantum|=((unsigned long) *pixels++);
*pixel=(unsigned int) (quantum & 0xffffffff);
return(pixels);
}
read_info->cache=AcquirePixelCache(0);
GetPixelCacheMethods(&cache_methods);
cache_methods.get_virtual_pixel_handler=GetVirtualPixelStream;
+ cache_methods.get_virtual_pixels_handler=GetVirtualPixelsStream;
cache_methods.get_virtual_metacontent_from_handler=
GetVirtualMetacontentFromStream;
- cache_methods.get_virtual_pixels_handler=GetVirtualPixelsStream;
cache_methods.get_authentic_pixels_handler=GetAuthenticPixelsStream;
cache_methods.queue_authentic_pixels_handler=QueueAuthenticPixelsStream;
cache_methods.sync_authentic_pixels_handler=SyncAuthenticPixelsStream;
cache_methods.get_one_authentic_pixel_from_handler=
GetOneAuthenticPixelFromStream;
cache_methods.destroy_pixel_handler=DestroyPixelStream;
+ cache_methods.stream=MagickTrue;
SetPixelCacheMethods(read_info->cache,&cache_methods);
read_info->stream=stream;
image=ReadImage(read_info,exception);
#define XVisualColormapSize(visual_info) MagickMin((unsigned int) (\
(visual_info->klass == TrueColor) || (visual_info->klass == DirectColor) ? \
visual_info->red_mask | visual_info->green_mask | visual_info->blue_mask : \
- (unsigned int) visual_info->colormap_size),1U << visual_info->depth)
+ (unsigned long) visual_info->colormap_size),1UL << visual_info->depth)
char
*map_type,
if (composite_options->compose_args != (char *) NULL)
composite_options->compose_args=(char *)
RelinquishMagickMemory(composite_options->compose_args);
+ if (composite_options->geometry != (char *) NULL)
+ composite_options->geometry=(char *)
+ RelinquishMagickMemory(composite_options->geometry);
}
WandExport MagickBooleanType CompositeImageCommand(ImageInfo *image_info,
*/
typedef struct _BMPInfo
{
- unsigned int
+ unsigned long
file_size,
ba_offset,
offset_bits,
planes,
bits_per_pixel;
- unsigned int
+ unsigned long
compression,
image_size,
x_pixels,
alpha_mask,
colors_important;
- int
+ long
colorspace;
PrimaryInfo
bmp_info.offset_bits=ReadBlobLSBLong(image);
bmp_info.size=ReadBlobLSBLong(image);
if (image->debug != MagickFalse)
- (void) LogMagickEvent(CoderEvent,GetMagickModule()," BMP size: %u",
+ (void) LogMagickEvent(CoderEvent,GetMagickModule()," BMP size: %lu",
bmp_info.size);
if (bmp_info.size == 12)
{
default:
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Compression: UNKNOWN (%u)",bmp_info.compression);
+ " Compression: UNKNOWN (%lu)",bmp_info.compression);
}
}
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Number of colors: %u",bmp_info.number_colors);
+ " Number of colors: %lu",bmp_info.number_colors);
}
bmp_info.red_mask=ReadBlobLSBLong(image);
bmp_info.green_mask=ReadBlobLSBLong(image);
bmp_info.blue_mask=ReadBlobLSBLong(image);
if (bmp_info.size > 40)
{
-
double
- sum;
+ gamma;
/*
Read color management information.
bmp_info.blue_primary.y=(double) ReadBlobLSBLong(image)/BMP_DENOM;
bmp_info.blue_primary.z=(double) ReadBlobLSBLong(image)/BMP_DENOM;
- sum=bmp_info.red_primary.x+bmp_info.red_primary.y+
+ gamma=bmp_info.red_primary.x+bmp_info.red_primary.y+
bmp_info.red_primary.z;
- bmp_info.red_primary.x/=sum;
- bmp_info.red_primary.y/=sum;
+ gamma=PerceptibleReciprocal(gamma);
+ bmp_info.red_primary.x*=gamma;
+ bmp_info.red_primary.y*=gamma;
image->chromaticity.red_primary.x=bmp_info.red_primary.x;
image->chromaticity.red_primary.y=bmp_info.red_primary.y;
- sum=bmp_info.green_primary.x+bmp_info.green_primary.y+
+ gamma=bmp_info.green_primary.x+bmp_info.green_primary.y+
bmp_info.green_primary.z;
- bmp_info.green_primary.x/=sum;
- bmp_info.green_primary.y/=sum;
+ gamma=PerceptibleReciprocal(gamma);
+ bmp_info.green_primary.x*=gamma;
+ bmp_info.green_primary.y*=gamma;
image->chromaticity.green_primary.x=bmp_info.green_primary.x;
image->chromaticity.green_primary.y=bmp_info.green_primary.y;
- sum=bmp_info.blue_primary.x+bmp_info.blue_primary.y+
+ gamma=bmp_info.blue_primary.x+bmp_info.blue_primary.y+
bmp_info.blue_primary.z;
- bmp_info.blue_primary.x/=sum;
- bmp_info.blue_primary.y/=sum;
+ gamma=PerceptibleReciprocal(gamma);
+ bmp_info.blue_primary.x*=gamma;
+ bmp_info.blue_primary.y*=gamma;
image->chromaticity.blue_primary.x=bmp_info.blue_primary.x;
image->chromaticity.blue_primary.y=bmp_info.blue_primary.y;
default:
{
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Compression=UNKNOWN (%u)",bmp_info.compression);
+ " Compression=UNKNOWN (%lu)",bmp_info.compression);
break;
}
}
" Number_colors=unspecified");
else
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Number_colors=%u",bmp_info.number_colors);
+ " Number_colors=%lu",bmp_info.number_colors);
}
(void) WriteBlob(image,2,(unsigned char *) "BM");
(void) WriteBlobLSBLong(image,bmp_info.file_size);
}
if (image->debug != MagickFalse)
(void) LogMagickEvent(CoderEvent,GetMagickModule(),
- " Pixels: %u bytes",bmp_info.image_size);
+ " Pixels: %lu bytes",bmp_info.image_size);
(void) WriteBlob(image,(size_t) bmp_info.image_size,pixels);
pixel_info=RelinquishVirtualMemory(pixel_info);
if (GetNextImageInList(image) == (Image *) NULL)
(void) FormatLocaleFile(stderr,"Option does not match\n");
exit(1);
}
+ option=(char *) MagickRelinquishMemory(option);
options=MagickGetOptions(magick_wand,"*",&number_options);
if (options != (char **) NULL)
{
(void) FormatLocaleFile(stderr,"Property does not match\n");
exit(1);
}
+ property=(char *) MagickRelinquishMemory(property);
properties=MagickGetImageProperties(magick_wand,"*",&number_properties);
if (properties != (char **) NULL)
{