117 #define MaxStacksize 524288UL 118 #define PushSegmentStack(up,left,right,delta) \ 120 if (s >= (segment_stack+MaxStacksize)) \ 121 ThrowBinaryException(DrawError,"SegmentStackOverflow",image->filename) \ 124 if ((((up)+(delta)) >= 0) && (((up)+(delta)) < (ssize_t) image->rows)) \ 126 s->x1=(double) (left); \ 127 s->y1=(double) (up); \ 128 s->x2=(double) (right); \ 129 s->y2=(double) (delta); \ 169 assert(image != (
Image *) NULL);
173 assert(draw_info != (
DrawInfo *) NULL);
175 if ((x_offset < 0) || (x_offset >= (ssize_t) image->
columns))
177 if ((y_offset < 0) || (y_offset >= (ssize_t) image->
rows))
190 if (floodplane_image == (
Image *) NULL)
216 while (s > segment_stack)
233 offset=(ssize_t) s->
y2;
234 y=(ssize_t) s->
y1+offset;
245 for (x=x1; x >= 0; x--)
270 if (x < (ssize_t) image->
columns)
278 for ( ; x < (ssize_t) image->
columns; x++)
307 for ( ; x <= x2; x++)
322 for (y=0; y < (ssize_t) image->
rows; y++)
345 for (x=0; x < (ssize_t) image->
columns; x++)
422 assert(image != (
const Image *) NULL);
426 assert(stops != (
const StopInfo *) NULL);
427 assert(number_stops > 0);
434 if (artifact != (
const char *) NULL)
439 if (artifact != (
const char *) NULL)
517 if (artifact != (
const char *) NULL)
520 if (artifact != (
const char *) NULL)
521 (void) sscanf(artifact,
"%lf%*[ ,]%lf%*[ ,]%lf%*[ ,]%lf",
533 if (artifact != (
const char *) NULL)
534 (
void) sscanf(artifact,
"%lf%*[ ,]%lf",&gradient->
center.
x,
537 if ((type ==
LinearGradient) && (artifact != (
const char *) NULL))
549 distance=fabs((
double) (image->
columns-1.0)*cosine)+
550 fabs((
double) (image->
rows-1.0)*sine);
560 if (artifact != (
const char *) NULL)
565 (image->
rows-1.0))/2.0;
570 gradient->
radii.
x=(double) (sqrt((
double) (image->
columns-1.0)*
577 gradient->
radii.
y=(double) (image->
rows-1.0)/2.0;
582 (image->
rows-1.0))/2.0;
588 (image->
rows-1.0)))/2.0;
593 if (artifact != (
const char *) NULL)
594 (void) sscanf(artifact,
"%lf%*[ ,]%lf",&gradient->
radii.
x,
603 sizeof(*gradient->
stops));
607 (void) memcpy(gradient->
stops,stops,(
size_t) number_stops*
sizeof(*stops));
653 assert(histogram != (
size_t **) NULL);
655 if (histogram[i] != (
size_t *) NULL)
672 if (histogram == (
size_t **) NULL)
673 return((
size_t **) NULL);
674 (void) memset(histogram,0,number_threads*
sizeof(*histogram));
675 for (i=0; i < (ssize_t) number_threads; i++)
678 if (histogram[i] == (
size_t *) NULL)
687 #define NumberPaintBins 256 688 #define OilPaintImageTag "OilPaint/Image" 715 assert(image != (
const Image *) NULL);
724 if ((linear_image == (
Image *) NULL) || (paint_image == (
Image *) NULL))
726 if (linear_image != (
Image *) NULL)
728 if (paint_image != (
Image *) NULL)
730 return((
Image *) NULL);
736 return((
Image *) NULL);
739 if (histograms == (
size_t **) NULL)
754 #if defined(MAGICKCORE_OPENMP_SUPPORT) 755 #pragma omp parallel for schedule(static) shared(progress,status) \ 756 magick_number_threads(linear_image,paint_image,linear_image->rows,1) 758 for (y=0; y < (ssize_t) linear_image->
rows; y++)
775 (width/2L),linear_image->
columns+width,width,exception);
784 for (x=0; x < (ssize_t) linear_image->
columns; x++)
806 for (v=0; v < (ssize_t) width; v++)
808 for (u=0; u < (ssize_t) width; u++)
813 if (histogram[n] > count)
819 k+=(ssize_t) (linear_image->
columns+width);
847 #if defined(MAGICKCORE_OPENMP_SUPPORT) 909 #define OpaquePaintImageTag "Opaque/Image" 928 assert(image != (
Image *) NULL);
945 #if defined(MAGICKCORE_OPENMP_SUPPORT) 946 #pragma omp parallel for schedule(static) shared(progress,status) \ 947 magick_number_threads(image,image,image->rows,1) 949 for (y=0; y < (ssize_t) image->
rows; y++)
969 for (x=0; x < (ssize_t) image->
columns; x++)
1002 #if defined(MAGICKCORE_OPENMP_SUPPORT) 1059 #define TransparentPaintImageTag "Transparent/Image" 1076 assert(image != (
Image *) NULL);
1092 #if defined(MAGICKCORE_OPENMP_SUPPORT) 1093 #pragma omp parallel for schedule(static) shared(progress,status) \ 1094 magick_number_threads(image,image,image->rows,1) 1096 for (y=0; y < (ssize_t) image->
rows; y++)
1116 for (x=0; x < (ssize_t) image->
columns; x++)
1130 #if defined(MAGICKCORE_OPENMP_SUPPORT) 1190 #define TransparentPaintImageTag "Transparent/Image" 1204 assert(image != (
Image *) NULL);
1220 #if defined(MAGICKCORE_OPENMP_SUPPORT) 1221 #pragma omp parallel for schedule(static) shared(progress,status) \ 1222 magick_number_threads(image,image,image->rows,1) 1224 for (y=0; y < (ssize_t) image->
rows; y++)
1247 for (x=0; x < (ssize_t) image->
columns; x++)
1250 match=((pixel.
red >= low->
red) && (pixel.
red <= high->
red) &&
1254 if (match != invert)
1265 #if defined(MAGICKCORE_OPENMP_SUPPORT)
MagickExport CacheView * DestroyCacheView(CacheView *cache_view)
MagickExport MemoryInfo * RelinquishVirtualMemory(MemoryInfo *memory_info)
MagickProgressMonitor progress_monitor
RectangleInfo bounding_box
MagickExport ssize_t ParseCommandOption(const CommandOption option, const MagickBooleanType list, const char *options)
MagickExport MemoryInfo * AcquireVirtualMemory(const size_t count, const size_t quantum)
static Quantum GetPixelGray(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
MagickExport MagickStatusType ParseAbsoluteGeometry(const char *geometry, RectangleInfo *region_info)
static void GetFillColor(const DrawInfo *draw_info, const ssize_t x, const ssize_t y, PixelInfo *fill, ExceptionInfo *exception)
static void SetPixelGray(const Image *magick_restrict image, const Quantum gray, Quantum *magick_restrict pixel)
MagickExport const char * GetImageArtifact(const Image *image, const char *artifact)
MagickExport MagickBooleanType TransparentPaintImage(Image *image, const PixelInfo *target, const Quantum opacity, const MagickBooleanType invert, ExceptionInfo *exception)
MagickExport MagickBooleanType SetImageAlpha(Image *image, const Quantum alpha, ExceptionInfo *exception)
static double StringToDouble(const char *magick_restrict string, char **magick_restrict sentinal)
static PixelTrait GetPixelChannelTraits(const Image *magick_restrict image, const PixelChannel channel)
static void SetPixelViaPixelInfo(const Image *magick_restrict image, const PixelInfo *magick_restrict pixel_info, Quantum *magick_restrict pixel)
static MagickBooleanType IsGrayColorspace(const ColorspaceType colorspace)
MagickExport const Quantum * GetCacheViewVirtualPixels(const CacheView *cache_view, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
MagickExport MagickBooleanType FloodfillPaintImage(Image *image, const DrawInfo *draw_info, const PixelInfo *target, const ssize_t x_offset, const ssize_t y_offset, const MagickBooleanType invert, ExceptionInfo *exception)
#define ThrowBinaryException(severity, tag, context)
static Quantum ClampToQuantum(const MagickRealType quantum)
MagickExport void GetPixelInfo(const Image *image, PixelInfo *pixel)
MagickExport MagickBooleanType DrawGradientImage(Image *image, const DrawInfo *draw_info, ExceptionInfo *exception)
#define MagickCoreSignature
MagickExport Quantum * GetCacheViewAuthenticPixels(CacheView *cache_view, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
MagickExport MagickBooleanType SetImageAlphaChannel(Image *image, const AlphaChannelOption alpha_type, ExceptionInfo *exception)
MagickExport MagickBooleanType TransparentPaintImageChroma(Image *image, const PixelInfo *low, const PixelInfo *high, const Quantum opacity, const MagickBooleanType invert, ExceptionInfo *exception)
static size_t ** AcquireHistogramThreadSet(const size_t count)
MagickExport DrawInfo * AcquireDrawInfo(void)
MagickExport void * AcquireQuantumMemory(const size_t count, const size_t quantum)
MagickPrivate size_t GetOptimalKernelWidth2D(const double, const double)
static double DegreesToRadians(const double degrees)
static int GetOpenMPThreadId(void)
static void GetPixelInfoPixel(const Image *magick_restrict image, const Quantum *magick_restrict pixel, PixelInfo *magick_restrict pixel_info)
MagickExport Quantum * QueueCacheViewAuthenticPixels(CacheView *cache_view, const ssize_t x, const ssize_t y, const size_t columns, const size_t rows, ExceptionInfo *exception)
MagickExport MagickBooleanType LogMagickEvent(const LogEventType type, const char *module, const char *function, const size_t line, const char *format,...)
MagickExport MagickBooleanType SetImageBackgroundColor(Image *image, ExceptionInfo *exception)
MagickExport MagickSizeType GetMagickResourceLimit(const ResourceType type)
MagickBooleanType(* MagickProgressMonitor)(const char *, const MagickOffsetType, const MagickSizeType, void *)
MagickExport MagickBooleanType QueryColorCompliance(const char *name, const ComplianceType compliance, PixelInfo *color, ExceptionInfo *exception)
static void SetPixelBlue(const Image *magick_restrict image, const Quantum blue, Quantum *magick_restrict pixel)
MagickExport MagickBooleanType SetImageStorageClass(Image *image, const ClassType storage_class, ExceptionInfo *exception)
#define TransparentPaintImageTag
MagickExport MagickBooleanType OpaquePaintImage(Image *image, const PixelInfo *target, const PixelInfo *fill, const MagickBooleanType invert, ExceptionInfo *exception)
static size_t GetPixelChannels(const Image *magick_restrict image)
MagickExport int LocaleCompare(const char *p, const char *q)
char filename[MagickPathExtent]
#define GetMagickModule()
MagickExport void ConformPixelInfo(Image *image, const PixelInfo *source, PixelInfo *destination, ExceptionInfo *exception)
#define ThrowImageException(severity, tag)
static PixelChannel GetPixelChannelChannel(const Image *magick_restrict image, const ssize_t offset)
MagickExport CacheView * AcquireVirtualCacheView(const Image *image, ExceptionInfo *exception)
MagickExport MagickBooleanType SetImageColorspace(Image *image, const ColorspaceType colorspace, ExceptionInfo *exception)
MagickExport DrawInfo * DestroyDrawInfo(DrawInfo *draw_info)
static size_t ** DestroyHistogramThreadSet(size_t **histogram)
MagickExport MagickBooleanType IsFuzzyEquivalencePixelInfo(const PixelInfo *p, const PixelInfo *q)
SegmentInfo gradient_vector
#define OpaquePaintImageTag
static void SetPixelChannel(const Image *magick_restrict image, const PixelChannel channel, const Quantum quantum, Quantum *magick_restrict pixel)
static void SetPixelAlpha(const Image *magick_restrict image, const Quantum alpha, Quantum *magick_restrict pixel)
MagickExport void * RelinquishMagickMemory(void *memory)
MagickExport MagickBooleanType GradientImage(Image *image, const GradientType type, const SpreadMethod method, const StopInfo *stops, const size_t number_stops, ExceptionInfo *exception)
static void SetPixelRed(const Image *magick_restrict image, const Quantum red, Quantum *magick_restrict pixel)
#define PushSegmentStack(up, left, right, delta)
MagickExport MagickBooleanType SyncCacheViewAuthenticPixels(CacheView *magick_restrict cache_view, ExceptionInfo *exception)
MagickExport Image * OilPaintImage(const Image *image, const double radius, const double sigma, ExceptionInfo *exception)
MagickExport CacheView * AcquireAuthenticCacheView(const Image *image, ExceptionInfo *exception)
static void SetPixelBlack(const Image *magick_restrict image, const Quantum black, Quantum *magick_restrict pixel)
MagickExport void * GetVirtualMemoryBlob(const MemoryInfo *memory_info)
MagickExport MagickRealType GetPixelIntensity(const Image *magick_restrict image, const Quantum *magick_restrict pixel)
PixelInfo background_color
MagickExport Image * DestroyImage(Image *image)
MagickExport Image * CloneImage(const Image *image, const size_t columns, const size_t rows, const MagickBooleanType detach, ExceptionInfo *exception)
ColorspaceType colorspace
MagickExport MagickBooleanType SetImageProgress(const Image *image, const char *tag, const MagickOffsetType offset, const MagickSizeType extent)
static void SetPixelGreen(const Image *magick_restrict image, const Quantum green, Quantum *magick_restrict pixel)