*newImage;
GetPPException;
- newImage=SpreadImage(constImage(),amount_,image()->interpolate,
- exceptionInfo);
+ newImage=SpreadImage(constImage(),amount_,exceptionInfo);
replaceImage(newImage);
ThrowImageException;
}
}
case SpreadPreview:
{
- preview_image=SpreadImage(thumbnail,radius,thumbnail->interpolate,
- exception);
- (void) FormatLocaleString(label,MagickPathExtent,"spread %g",radius+0.5);
+ preview_image=SpreadImage(thumbnail,radius,exception);
+ (void) FormatLocaleString(label,MagickPathExtent,"spread %g",
+ radius+0.5);
break;
}
case SolarizePreview:
% The format of the SpreadImage method is:
%
% Image *SpreadImage(const Image *image,const double radius,
-% const PixelInterpolateMethod method,ExceptionInfo *exception)
+% ExceptionInfo *exception)
%
% A description of each parameter follows:
%
%
% o radius: choose a random pixel in a neighborhood of this extent.
%
-% o method: the pixel interpolation method.
-%
% o exception: return any errors or warnings in this structure.
%
*/
+
+static void inline SwapPixelComponent(Quantum *p,Quantum *q)
+{
+ Quantum
+ pixel;
+
+ pixel=(*p);
+ (*p)=(*q);
+ (*q)=pixel;
+}
+
MagickExport Image *SpreadImage(const Image *image,const double radius,
- const PixelInterpolateMethod method,ExceptionInfo *exception)
+ ExceptionInfo *exception)
{
#define SpreadImageTag "Spread/Image"
progress;
RandomInfo
- **restrict random_info;
+ *restrict random_info;
size_t
width;
ssize_t
y;
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
- unsigned long
- key;
-#endif
-
/*
Initialize spread image attributes.
*/
(void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
assert(exception != (ExceptionInfo *) NULL);
assert(exception->signature == MagickCoreSignature);
- spread_image=CloneImage(image,image->columns,image->rows,MagickTrue,
- exception);
+ spread_image=CloneImage(image,0,0,MagickTrue,exception);
if (spread_image == (Image *) NULL)
return((Image *) NULL);
- if (SetImageStorageClass(spread_image,DirectClass,exception) == MagickFalse)
- {
- spread_image=DestroyImage(spread_image);
- return((Image *) NULL);
- }
/*
Spread image.
*/
status=MagickTrue;
progress=0;
width=GetOptimalKernelWidth1D(radius,0.5);
- random_info=AcquireRandomInfoThreadSet();
- image_view=AcquireVirtualCacheView(image,exception);
+ random_info=AcquireRandomInfo();
+ image_view=AcquireAuthenticCacheView(spread_image,exception);
spread_view=AcquireAuthenticCacheView(spread_image,exception);
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
- key=GetRandomSecretKey(random_info[0]);
- #pragma omp parallel for schedule(static,4) shared(progress,status) \
- magick_threads(image,spread_image,image->rows,key == ~0UL)
-#endif
for (y=0; y < (ssize_t) image->rows; y++)
{
- const int
- id = GetOpenMPThreadId();
-
- register Quantum
- *restrict q;
-
register ssize_t
x;
if (status == MagickFalse)
continue;
- q=QueueCacheViewAuthenticPixels(spread_view,0,y,spread_image->columns,1,
- exception);
- if (q == (Quantum *) NULL)
- {
- status=MagickFalse;
- continue;
- }
for (x=0; x < (ssize_t) image->columns; x++)
{
- PointInfo
- point;
-
- point.x=GetPseudoRandomValue(random_info[id]);
- point.y=GetPseudoRandomValue(random_info[id]);
- status=InterpolatePixelChannels(image,image_view,spread_image,
- method == UndefinedInterpolatePixel ? NearestInterpolatePixel : method,
- (double) x+width*(point.x-0.5),(double) y+width*(point.y-0.5),q,
- exception);
- q+=GetPixelChannels(spread_image);
+ register Quantum
+ *restrict p,
+ *restrict q;
+
+ register ssize_t
+ i;
+
+ ssize_t
+ x_offset,
+ y_offset;
+
+ for ( ; ; )
+ {
+ x_offset=(ssize_t) (x+width*GetPseudoRandomValue(random_info));
+ y_offset=(ssize_t) (y+width*GetPseudoRandomValue(random_info));
+ if ((x_offset >= 0) && (x_offset < image->columns) &&
+ (y_offset >= 0) && (y_offset < image->rows))
+ break;
+ }
+ p=GetCacheViewAuthenticPixels(image_view,x_offset,y_offset,1,1,exception);
+ q=GetCacheViewAuthenticPixels(spread_view,x,y,1,1,exception);
+ if ((p == (Quantum *) NULL) || (q == (Quantum *) NULL))
+ {
+ status=MagickFalse;
+ continue;
+ }
+ for (i=0; i < (ssize_t) GetPixelChannels(spread_image); i++)
+ SwapPixelComponent(p+i,q+i);
+ if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
+ status=MagickFalse;
+ if (SyncCacheViewAuthenticPixels(spread_view,exception) == MagickFalse)
+ status=MagickFalse;
}
- if (SyncCacheViewAuthenticPixels(spread_view,exception) == MagickFalse)
- status=MagickFalse;
if (image->progress_monitor != (MagickProgressMonitor) NULL)
{
MagickBooleanType
proceed;
-#if defined(MAGICKCORE_OPENMP_SUPPORT)
- #pragma omp critical (MagickCore_SpreadImage)
-#endif
proceed=SetImageProgress(image,SpreadImageTag,progress++,image->rows);
if (proceed == MagickFalse)
status=MagickFalse;
}
spread_view=DestroyCacheView(spread_view);
image_view=DestroyCacheView(image_view);
- random_info=DestroyRandomInfoThreadSet(random_info);
+ random_info=DestroyRandomInfo(random_info);
if (status == MagickFalse)
spread_image=DestroyImage(spread_image);
return(spread_image);
*ShadeImage(const Image *,const MagickBooleanType,const double,const double,
ExceptionInfo *),
*SharpenImage(const Image *,const double,const double,ExceptionInfo *),
- *SpreadImage(const Image *,const double,const PixelInterpolateMethod,
- ExceptionInfo *),
+ *SpreadImage(const Image *,const double,ExceptionInfo *),
*UnsharpMaskImage(const Image *,const double,const double,const double,
const double,ExceptionInfo *);
%
% The format of the MagickSpreadImage method is:
%
-% MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius,
-% const PixelInterpolateMethod method)
-%
+% MagickBooleanType MagickSpreadImage(MagickWand *wand,const double radius)
+%
% A description of each parameter follows:
%
% o wand: the magick wand.
%
% o radius: Choose a random pixel in a neighborhood of this extent.
%
-% o method: the pixel interpolation method.
-%
*/
WandExport MagickBooleanType MagickSpreadImage(MagickWand *wand,
- const double radius,const PixelInterpolateMethod method)
+ const double radius)
{
Image
*spread_image;
(void) LogMagickEvent(WandEvent,GetMagickModule(),"%s",wand->name);
if (wand->images == (Image *) NULL)
ThrowWandException(WandError,"ContainsNoImages",wand->name);
- spread_image=SpreadImage(wand->images,radius,method,wand->exception);
+ spread_image=SpreadImage(wand->images,radius,wand->exception);
if (spread_image == (Image *) NULL)
return(MagickFalse);
ReplaceImageInList(&wand->images,spread_image);
const double *),
MagickSpliceImage(MagickWand *,const size_t,const size_t,const ssize_t,
const ssize_t),
- MagickSpreadImage(MagickWand *,const double,const PixelInterpolateMethod),
+ MagickSpreadImage(MagickWand *,const double),
MagickStatisticImage(MagickWand *,const StatisticType,const size_t,
const size_t),
MagickStripImage(MagickWand *),
*/
(void) SyncImageSettings(mogrify_info,*image,exception);
(void) ParseGeometry(argv[i+1],&geometry_info);
- mogrify_image=SpreadImage(*image,geometry_info.rho,
- interpolate_method,exception);
+ mogrify_image=SpreadImage(*image,geometry_info.rho,exception);
break;
}
if (LocaleCompare("statistic",option+1) == 0)
flags=ParseGeometry(arg1,&geometry_info);
if ((flags & RhoValue) == 0)
CLIWandExceptArgBreak(OptionError,"InvalidArgument",option,arg2);
- new_image=SpreadImage(_image,geometry_info.rho,_image->interpolate,
- _exception);
+ new_image=SpreadImage(_image,geometry_info.rho,_exception);
break;
}
if (LocaleCompare("statistic",option+1) == 0)
{ "Shear", { {"geometry", StringReference}, {"x", RealReference},
{"y", RealReference}, { "fill", StringReference},
{"color", StringReference} } },
- { "Spread", { {"radius", RealReference},
- {"interpolate", MagickInterpolateOptions} } },
+ { "Spread", { {"radius", RealReference} } },
{ "Swirl", { {"degrees", RealReference},
{"interpolate", MagickInterpolateOptions} } },
{ "Resize", { {"geometry", StringReference}, {"width", IntegerReference},
}
case 29: /* Spread */
{
- PixelInterpolateMethod
- method;
-
if (attribute_flag[0] == 0)
argument_list[0].real_reference=1.0;
- method=UndefinedInterpolatePixel;
- if (attribute_flag[1] != 0)
- method=(PixelInterpolateMethod) argument_list[1].integer_reference;
- image=SpreadImage(image,argument_list[0].real_reference,method,
- exception);
+ image=SpreadImage(image,argument_list[0].real_reference,exception);
break;
}
case 30: /* Swirl */
{ "Shear", { {"geometry", StringReference}, {"x", RealReference},
{"y", RealReference}, { "fill", StringReference},
{"color", StringReference} } },
- { "Spread", { {"radius", RealReference},
- {"interpolate", MagickInterpolateOptions} } },
+ { "Spread", { {"radius", RealReference} } },
{ "Swirl", { {"degrees", RealReference},
{"interpolate", MagickInterpolateOptions} } },
{ "Resize", { {"geometry", StringReference}, {"width", IntegerReference},
}
case 29: /* Spread */
{
- PixelInterpolateMethod
- method;
-
if (attribute_flag[0] == 0)
argument_list[0].real_reference=1.0;
- method=UndefinedInterpolatePixel;
- if (attribute_flag[1] != 0)
- method=(PixelInterpolateMethod) argument_list[1].integer_reference;
- image=SpreadImage(image,argument_list[0].real_reference,method,
- exception);
+ image=SpreadImage(image,argument_list[0].real_reference,exception);
break;
}
case 30: /* Swirl */
}
}
spread_image=SpreadImage(msl_info->image[n],geometry_info.rho,
- msl_info->image[n]->interpolate,msl_info->exception);
+ msl_info->exception);
if (spread_image == (Image *) NULL)
break;
msl_info->image[n]=DestroyImage(msl_info->image[n]);
--- /dev/null
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE configuremap [
+<!ELEMENT configuremap (configure)+>
+<!ELEMENT configure (#PCDATA)>
+<!ATTLIST configure name CDATA #REQUIRED>
+<!ATTLIST configure value CDATA #REQUIRED>
+]>
+<configuremap>
+ <configure name="CC" value="gcc"/>
+ <configure name="CFLAGS" value="-I/usr/include/libxml2 -I/usr/include/libpng16 -pthread -I/usr/include/pango-1.0 -I/usr/include/cairo -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libdrm -I/usr/include/libpng16 -pthread -I/usr/include/OpenEXR -I/usr/include/libdrm -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/freetype2 -I/usr/include/libpng16 -pthread -fopenmp -g -O2 -Wall -mtune=sandybridge -fexceptions -pthread -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16"/>
+ <configure name="CODER_PATH" value="/usr/local/lib/ImageMagick-7.0.0/modules-Q16HDRI/coders"/>
+ <configure name="CONFIGURE_PATH" value="/usr/local/etc/ImageMagick-7/"/>
+ <configure name="CONFIGURE" value="./configure "/>
+ <configure name="COPYRIGHT" value="Copyright (C) 1999-2015 ImageMagick Studio LLC"/>
+ <configure name="CPPFLAGS" value="-I/usr/local/include/ImageMagick-7"/>
+ <configure name="CXXFLAGS" value="-g -O2 -pthread"/>
+ <configure name="CXX" value="g++"/>
+ <configure name="DEFS" value="-DHAVE_CONFIG_H"/>
+ <configure name="DELEGATES" value="bzlib djvu mpeg fftw fpx fontconfig freetype jbig jng jpeg lcms lzma openexr pango png ps tiff webp wmf x xml zlib"/>
+ <configure name="DISTCHECK_CONFIG_FLAGS" value=" --disable-deprecated --with-quantum-depth=16 --with-jemalloc=no --with-umem=no --with-autotrace=no --with-gslib=no --with-fontpath= --with-rsvg=no --with-perl=no "/>
+ <configure name="DOCUMENTATION_PATH" value="/usr/local/share/doc/ImageMagick-7"/>
+ <configure name="EXEC-PREFIX" value="/usr/local"/>
+ <configure name="EXECUTABLE_PATH" value="/usr/local/bin"/>
+ <configure name="FEATURES" value="DPC HDRI Cipher OpenMP"/>
+ <configure name="FILTER_PATH" value="/usr/local/lib/ImageMagick-7.0.0/modules-Q16HDRI/filters"/>
+ <configure name="HOST" value="x86_64-unknown-linux-gnu"/>
+ <configure name="INCLUDE_PATH" value="/usr/local/include/ImageMagick-7"/>
+ <configure name="LDFLAGS" value="-L/usr/local/lib "/>
+ <configure name="LIBRARY_PATH" value="/usr/local/lib/ImageMagick-7.0.0"/>
+ <configure name="LIBS" value=" -ljbig -llcms2 -ltiff -lfreetype -ljpeg -lpng16 -ldjvulibre -lfftw3 -lfpx -lfontconfig -lfreetype -lwebp -lwmflite -lXext -lXt -lSM -lICE -lX11 -llzma -lbz2 -lIlmImf -lImath -lHalf -lIex -lIexMath -lIlmThread -pthread -lpangocairo-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lcairo -lxml2 -L/usr/lib64 -lz -lm -lgomp "/>
+ <configure name="LIB_VERSION_NUMBER" value="7,0,0,0"/>
+ <configure name="LIB_VERSION" value="0x700"/>
+ <configure name="NAME" value="ImageMagick"/>
+ <configure name="PCFLAGS" value="-fopenmp -DMAGICKCORE_HDRI_ENABLE=1 -DMAGICKCORE_QUANTUM_DEPTH=16"/>
+ <configure name="PREFIX" value="/usr/local"/>
+ <configure name="QuantumDepth" value="16"/>
+ <configure name="RELEASE_DATE" value="2015-08-09"/>
+ <configure name="SHAREARCH_PATH" value="/usr/local/lib/ImageMagick-7.0.0/config-Q16HDRI"/>
+ <configure name="SHARE_PATH" value="/usr/local/share/ImageMagick-7"/>
+ <configure name="SVN_REVISION" value="Unversioned" />
+ <configure name="TARGET_CPU" value="x86_64"/>
+ <configure name="TARGET_OS" value="linux-gnu"/>
+ <configure name="TARGET_VENDOR" value="unknown"/>
+ <configure name="VERSION" value="7.0.0"/>
+ <configure name="WEBSITE" value="http://www.imagemagick.org"/>
+</configuremap>