#include "MagickCore/property.h"
#include "MagickCore/quantize.h"
#include "MagickCore/random_.h"
+#include "MagickCore/resource_.h"
#include "MagickCore/segment.h"
#include "MagickCore/semaphore.h"
#include "MagickCore/signature-private.h"
image->depth=MAGICKCORE_QUANTUM_DEPTH;
image->colorspace=sRGBColorspace;
image->rendering_intent=PerceptualIntent;
- image->gamma=0.45455;
- image->chromaticity.red_primary.x=0.6400;
- image->chromaticity.red_primary.y=0.3300;
- image->chromaticity.green_primary.x=0.3000;
- image->chromaticity.green_primary.y=0.6000;
- image->chromaticity.blue_primary.x=0.1500;
- image->chromaticity.blue_primary.y=0.0600;
- image->chromaticity.white_point.x=0.3127;
- image->chromaticity.white_point.y=0.3290;
+ image->gamma=1.000f/2.200f;
+ image->chromaticity.red_primary.x=0.6400f;
+ image->chromaticity.red_primary.y=0.3300f;
+ image->chromaticity.red_primary.z=0.0300f;
+ image->chromaticity.green_primary.x=0.3000f;
+ image->chromaticity.green_primary.y=0.6000f;
+ image->chromaticity.green_primary.z=0.1000f;
+ image->chromaticity.blue_primary.x=0.1500f;
+ image->chromaticity.blue_primary.y=0.0600f;
+ image->chromaticity.blue_primary.z=0.7900f;
+ image->chromaticity.white_point.x=0.3127f;
+ image->chromaticity.white_point.y=0.3290f;
+ image->chromaticity.white_point.z=0.3583f;
image->interlace=NoInterlace;
image->ticks_per_second=UndefinedTicksPerSecond;
image->compose=OverCompositeOp;
x_offset=0;
y_offset=0;
next=images;
- append_view=AcquireCacheView(append_image);
+ append_view=AcquireAuthenticCacheView(append_image,exception);
for (n=0; n < (MagickOffsetType) number_images; n++)
{
CacheView
x_offset-=geometry.x;
else
y_offset-=geometry.y;
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static) shared(status)
+ #pragma omp parallel for schedule(static) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
if (mask_image == (Image *) NULL)
return((Image *) NULL);
status=MagickTrue;
- mask_image->colorspace=GRAYColorspace;
+ SetImageColorspace(mask_image,GRAYColorspace,exception);
mask_image->mask=MagickFalse;
- image_view=AcquireCacheView(image);
- mask_view=AcquireCacheView(mask_image);
+ image_view=AcquireVirtualCacheView(image,exception);
+ mask_view=AcquireAuthenticCacheView(mask_image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
register const Quantum
/*
Image option.
*/
+ /* FUTURE: Compare update with code from InterpretImageProperties()
+ Note that a 'filename:' properity should not need depth recursion.
+ */
if (strchr(p,']') == (char *) NULL)
break;
depth=1;
if (LocaleNCompare(pattern,"filename:",9) != 0)
break;
value=(const char *) NULL;
+#if 0
+ // FUTURE: remove this code. -- Anthony 29 Arpil 2012
+ // Removed as GetMagickProperty() will will never match a "filename:"
+ // string as this is not a 'known' image properity.
+ //
if ((image_info != (const ImageInfo *) NULL) &&
(image != (const Image *) NULL))
value=GetMagickProperty(image_info,image,pattern,exception);
else
- if (image != (Image *) NULL)
- value=GetImageProperty(image,pattern,exception);
- else
- if (image_info != (ImageInfo *) NULL)
- value=GetImageOption(image_info,pattern);
+#endif
+ if (image != (Image *) NULL)
+ value=GetImageProperty(image,pattern,exception);
+ if ((value == (const char *) NULL) &&
+ (image != (Image *) NULL))
+ value=GetImageArtifact(image,pattern);
+ if ((value == (const char *) NULL) &&
+ (image_info != (ImageInfo *) NULL))
+ value=GetImageOption(image_info,pattern);
if (value == (const char *) NULL)
break;
q--;
if (image->debug != MagickFalse)
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireVirtualCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
image->fuzz=background->fuzz;
image->depth=background->depth;
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
break;
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
break;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
break;
if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
break;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
Set image background color.
*/
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
register Quantum
image->fuzz=color->fuzz;
image->depth=color->depth;
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
% %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
-% SetImageInfo() initializes the `magick' field of the ImageInfo structure.
+% SetImageInfo() initializes the 'magick' field of the ImageInfo structure.
% It is set to a type of image format based on the prefix or suffix of the
-% filename. For example, `ps:image' returns PS indicating a Postscript image.
-% JPEG is returned for this filename: `image.jpg'. The filename prefix has
+% filename. For example, 'ps:image' returns PS indicating a Postscript image.
+% JPEG is returned for this filename: 'image.jpg'. The filename prefix has
% precendence over the suffix. Use an optional index enclosed in brackets
% after a file name to specify a desired scene of a multi-resolution image
% format like Photo CD (e.g. img0001.pcd[4]). A True (non-zero) return value
}
status=MagickTrue;
image->mask=MagickTrue;
- image_view=AcquireCacheView(image);
- mask_view=AcquireCacheView(mask);
+ mask_view=AcquireVirtualCacheView(mask,exception);
+ image_view=AcquireAuthenticCacheView(image,exception);
for (y=0; y < (ssize_t) image->rows; y++)
{
register const Quantum
assert(image->signature == MagickSignature);
image->matte=MagickTrue;
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(status)
+ #pragma omp parallel for schedule(static,4) shared(status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
}
case PaletteType:
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
if ((image->storage_class == DirectClass) || (image->colors > 256))
{
ChannelType
channel_mask;
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
if (image->matte == MagickFalse)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
}
case PaletteMatteType:
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
if (image->matte == MagickFalse)
(void) SetImageAlphaChannel(image,OpaqueAlphaChannel,exception);
}
case TrueColorType:
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
if (image->storage_class != DirectClass)
status=SetImageStorageClass(image,DirectClass,exception);
}
case TrueColorMatteType:
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
if (image->storage_class != DirectClass)
status=SetImageStorageClass(image,DirectClass,exception);
{
if (image->colorspace != CMYKColorspace)
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
status=TransformImageColorspace(image,CMYKColorspace,exception);
}
{
if (image->colorspace != CMYKColorspace)
{
- if (IsRGBColorspace(image->colorspace) == MagickFalse)
+ if (IssRGBColorspace(image->colorspace) == MagickFalse)
status=TransformImageColorspace(image,sRGBColorspace,exception);
status=TransformImageColorspace(image,CMYKColorspace,exception);
}
GravityAdjustGeometry(left_image->columns,left_image->rows,
left_image->gravity,&left_geometry);
gap=right_image->columns;
- left_view=AcquireCacheView(left_image);
- right_view=AcquireCacheView(right_image);
+ left_view=AcquireVirtualCacheView(left_image,exception);
+ right_view=AcquireVirtualCacheView(right_image,exception);
for (y=0; y < (ssize_t) smush_image->rows; y++)
{
for (x=(ssize_t) left_image->columns-1; x > 0; x--)
GravityAdjustGeometry(top_image->columns,top_image->rows,top_image->gravity,
&top_geometry);
gap=bottom_image->rows;
- top_view=AcquireCacheView(top_image);
- bottom_view=AcquireCacheView(bottom_image);
+ top_view=AcquireVirtualCacheView(top_image,exception);
+ bottom_view=AcquireVirtualCacheView(bottom_image,exception);
for (x=0; x < (ssize_t) smush_image->columns; x++)
{
for (y=(ssize_t) top_image->rows-1; y > 0; y--)
{
#define SmushImageTag "Smush/Image"
- CacheView
- *smush_view;
-
const Image
*image;
status=MagickTrue;
x_offset=0;
y_offset=0;
- smush_view=AcquireCacheView(smush_image);
for (n=0; n < (MagickOffsetType) number_images; n++)
{
SetGeometry(smush_image,&geometry);
smush_image->columns=(size_t) x_offset;
else
smush_image->rows=(size_t) y_offset;
- smush_view=DestroyCacheView(smush_view);
if (status == MagickFalse)
smush_image=DestroyImage(smush_image);
return(smush_image);
return(MagickFalse);
range_exception=MagickFalse;
status=MagickTrue;
- image_view=AcquireCacheView(image);
+ image_view=AcquireAuthenticCacheView(image,exception);
#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp parallel for schedule(static,4) shared(range_exception,status)
+ #pragma omp parallel for schedule(static,4) shared(range_exception,status) \
+ dynamic_number_threads(image->columns,image->rows,1)
#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
image_view=DestroyCacheView(image_view);
if (range_exception != MagickFalse)
(void) ThrowMagickException(exception,GetMagickModule(),CorruptImageError,
- "InvalidColormapIndex","`%s'",image->filename);
+ "InvalidColormapIndex","'%s'",image->filename);
return(status);
}
\f