2 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
6 % DDDD EEEEE CCCC OOO RRRR AAA TTTTT EEEEE %
7 % D D E C O O R R A A T E %
8 % D D EEE C O O RRRR AAAAA T EEE %
9 % D D E C O O R R A A T E %
10 % DDDD EEEEE CCCC OOO R R A A T EEEEE %
13 % MagickCore Image Decoration Methods %
20 % Copyright 1999-2011 ImageMagick Studio LLC, a non-profit organization %
21 % dedicated to making software imaging solutions freely available. %
23 % You may not use this file except in compliance with the License. You may %
24 % obtain a copy of the License at %
26 % http://www.imagemagick.org/script/license.php %
28 % Unless required by applicable law or agreed to in writing, software %
29 % distributed under the License is distributed on an "AS IS" BASIS, %
30 % WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. %
31 % See the License for the specific language governing permissions and %
32 % limitations under the License. %
34 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
43 #include "MagickCore/studio.h"
44 #include "MagickCore/cache-view.h"
45 #include "MagickCore/color-private.h"
46 #include "MagickCore/colorspace-private.h"
47 #include "MagickCore/composite.h"
48 #include "MagickCore/decorate.h"
49 #include "MagickCore/exception.h"
50 #include "MagickCore/exception-private.h"
51 #include "MagickCore/image.h"
52 #include "MagickCore/memory_.h"
53 #include "MagickCore/monitor.h"
54 #include "MagickCore/monitor-private.h"
55 #include "MagickCore/pixel-accessor.h"
56 #include "MagickCore/quantum.h"
57 #include "MagickCore/quantum-private.h"
58 #include "MagickCore/thread-private.h"
59 #include "MagickCore/transform.h"
64 #define AccentuateModulate ScaleCharToQuantum(80)
65 #define HighlightModulate ScaleCharToQuantum(125)
66 #define ShadowModulate ScaleCharToQuantum(135)
67 #define DepthModulate ScaleCharToQuantum(185)
68 #define TroughModulate ScaleCharToQuantum(110)
71 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
75 % B o r d e r I m a g e %
79 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
81 % BorderImage() surrounds the image with a border of the color defined by
82 % the bordercolor member of the image structure. The width and height
83 % of the border are defined by the corresponding members of the border_info
86 % The format of the BorderImage method is:
88 % Image *BorderImage(const Image *image,const RectangleInfo *border_info,
89 % const CompositeOperator compose,ExceptionInfo *exception)
91 % A description of each parameter follows:
95 % o border_info: define the width and height of the border.
97 % o compose: the composite operator.
99 % o exception: return any errors or warnings in this structure.
102 MagickExport Image *BorderImage(const Image *image,
103 const RectangleInfo *border_info,const CompositeOperator compose,
104 ExceptionInfo *exception)
113 assert(image != (const Image *) NULL);
114 assert(image->signature == MagickSignature);
115 if (image->debug != MagickFalse)
116 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
117 assert(border_info != (RectangleInfo *) NULL);
118 frame_info.width=image->columns+(border_info->width << 1);
119 frame_info.height=image->rows+(border_info->height << 1);
120 frame_info.x=(ssize_t) border_info->width;
121 frame_info.y=(ssize_t) border_info->height;
122 frame_info.inner_bevel=0;
123 frame_info.outer_bevel=0;
124 clone_image=CloneImage(image,0,0,MagickTrue,exception);
125 if (clone_image == (Image *) NULL)
126 return((Image *) NULL);
127 clone_image->matte_color=image->border_color;
128 border_image=FrameImage(clone_image,&frame_info,compose,exception);
129 clone_image=DestroyImage(clone_image);
130 if (border_image != (Image *) NULL)
131 border_image->matte_color=image->matte_color;
132 return(border_image);
136 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
140 % F r a m e I m a g e %
144 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
146 % FrameImage() adds a simulated three-dimensional border around the image.
147 % The color of the border is defined by the matte_color member of image.
148 % Members width and height of frame_info specify the border width of the
149 % vertical and horizontal sides of the frame. Members inner and outer
150 % indicate the width of the inner and outer shadows of the frame.
152 % The format of the FrameImage method is:
154 % Image *FrameImage(const Image *image,const FrameInfo *frame_info,
155 % const CompositeOperator compose,ExceptionInfo *exception)
157 % A description of each parameter follows:
159 % o image: the image.
161 % o frame_info: Define the width and height of the frame and its bevels.
163 % o compose: the composite operator.
165 % o exception: return any errors or warnings in this structure.
168 MagickExport Image *FrameImage(const Image *image,const FrameInfo *frame_info,
169 const CompositeOperator compose,ExceptionInfo *exception)
171 #define FrameImageTag "Frame/Image"
206 Check frame geometry.
208 assert(image != (Image *) NULL);
209 assert(image->signature == MagickSignature);
210 if (image->debug != MagickFalse)
211 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
212 assert(frame_info != (FrameInfo *) NULL);
213 if ((frame_info->outer_bevel < 0) || (frame_info->inner_bevel < 0))
214 ThrowImageException(OptionError,"FrameIsLessThanImageSize");
215 bevel_width=(size_t) (frame_info->outer_bevel+frame_info->inner_bevel);
216 width=frame_info->width-frame_info->x-bevel_width;
217 height=frame_info->height-frame_info->y-bevel_width;
218 if ((width < image->columns) || (height < image->rows))
219 ThrowImageException(OptionError,"FrameIsLessThanImageSize");
221 Initialize framed image attributes.
223 frame_image=CloneImage(image,frame_info->width,frame_info->height,MagickTrue,
225 if (frame_image == (Image *) NULL)
226 return((Image *) NULL);
227 if (SetImageStorageClass(frame_image,DirectClass,exception) == MagickFalse)
229 frame_image=DestroyImage(frame_image);
230 return((Image *) NULL);
232 if (frame_image->matte_color.alpha != OpaqueAlpha)
233 frame_image->matte=MagickTrue;
234 frame_image->page=image->page;
235 if ((image->page.width != 0) && (image->page.height != 0))
237 frame_image->page.width+=frame_image->columns-image->columns;
238 frame_image->page.height+=frame_image->rows-image->rows;
241 Initialize 3D effects color.
243 interior=image->border_color;
244 matte=image->matte_color;
246 accentuate.red=(MagickRealType) (QuantumScale*((QuantumRange-
247 AccentuateModulate)*matte.red+(QuantumRange*AccentuateModulate)));
248 accentuate.green=(MagickRealType) (QuantumScale*((QuantumRange-
249 AccentuateModulate)*matte.green+(QuantumRange*AccentuateModulate)));
250 accentuate.blue=(MagickRealType) (QuantumScale*((QuantumRange-
251 AccentuateModulate)*matte.blue+(QuantumRange*AccentuateModulate)));
252 accentuate.black=(MagickRealType) (QuantumScale*((QuantumRange-
253 AccentuateModulate)*matte.black+(QuantumRange*AccentuateModulate)));
254 accentuate.alpha=matte.alpha;
256 highlight.red=(MagickRealType) (QuantumScale*((QuantumRange-
257 HighlightModulate)*matte.red+(QuantumRange*HighlightModulate)));
258 highlight.green=(MagickRealType) (QuantumScale*((QuantumRange-
259 HighlightModulate)*matte.green+(QuantumRange*HighlightModulate)));
260 highlight.blue=(MagickRealType) (QuantumScale*((QuantumRange-
261 HighlightModulate)*matte.blue+(QuantumRange*HighlightModulate)));
262 highlight.black=(MagickRealType) (QuantumScale*((QuantumRange-
263 HighlightModulate)*matte.black+(QuantumRange*HighlightModulate)));
264 highlight.alpha=matte.alpha;
266 shadow.red=QuantumScale*matte.red*ShadowModulate;
267 shadow.green=QuantumScale*matte.green*ShadowModulate;
268 shadow.blue=QuantumScale*matte.blue*ShadowModulate;
269 shadow.black=QuantumScale*matte.black*ShadowModulate;
270 shadow.alpha=matte.alpha;
272 trough.red=QuantumScale*matte.red*TroughModulate;
273 trough.green=QuantumScale*matte.green*TroughModulate;
274 trough.blue=QuantumScale*matte.blue*TroughModulate;
275 trough.black=QuantumScale*matte.black*TroughModulate;
276 trough.alpha=matte.alpha;
279 image_view=AcquireCacheView(image);
280 frame_view=AcquireCacheView(frame_image);
281 height=(size_t) (frame_info->outer_bevel+(frame_info->y-bevel_width)+
282 frame_info->inner_bevel);
292 Draw top of ornamental border.
294 q=QueueCacheViewAuthenticPixels(frame_view,0,0,frame_image->columns,
296 if (q != (Quantum *) NULL)
299 Draw top of ornamental border.
301 for (y=0; y < (ssize_t) frame_info->outer_bevel; y++)
303 for (x=0; x < (ssize_t) (frame_image->columns-y); x++)
306 SetPixelInfoPixel(frame_image,&highlight,q);
308 SetPixelInfoPixel(frame_image,&accentuate,q);
309 q+=GetPixelChannels(frame_image);
311 for ( ; x < (ssize_t) frame_image->columns; x++)
313 SetPixelInfoPixel(frame_image,&shadow,q);
314 q+=GetPixelChannels(frame_image);
317 for (y=0; y < (ssize_t) (frame_info->y-bevel_width); y++)
319 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
321 SetPixelInfoPixel(frame_image,&highlight,q);
322 q+=GetPixelChannels(frame_image);
324 width=frame_image->columns-2*frame_info->outer_bevel;
325 for (x=0; x < (ssize_t) width; x++)
327 SetPixelInfoPixel(frame_image,&matte,q);
328 q+=GetPixelChannels(frame_image);
330 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
332 SetPixelInfoPixel(frame_image,&shadow,q);
333 q+=GetPixelChannels(frame_image);
336 for (y=0; y < (ssize_t) frame_info->inner_bevel; y++)
338 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
340 SetPixelInfoPixel(frame_image,&highlight,q);
341 q+=GetPixelChannels(frame_image);
343 for (x=0; x < (ssize_t) (frame_info->x-bevel_width); x++)
345 SetPixelInfoPixel(frame_image,&matte,q);
346 q+=GetPixelChannels(frame_image);
348 width=image->columns+((size_t) frame_info->inner_bevel << 1)-
350 for (x=0; x < (ssize_t) width; x++)
353 SetPixelInfoPixel(frame_image,&shadow,q);
355 SetPixelInfoPixel(frame_image,&trough,q);
356 q+=GetPixelChannels(frame_image);
358 for ( ; x < (ssize_t) (image->columns+2*frame_info->inner_bevel); x++)
360 SetPixelInfoPixel(frame_image,&highlight,q);
361 q+=GetPixelChannels(frame_image);
363 width=frame_info->width-frame_info->x-image->columns-bevel_width;
364 for (x=0; x < (ssize_t) width; x++)
366 SetPixelInfoPixel(frame_image,&matte,q);
367 q+=GetPixelChannels(frame_image);
369 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
371 SetPixelInfoPixel(frame_image,&shadow,q);
372 q+=GetPixelChannels(frame_image);
375 (void) SyncCacheViewAuthenticPixels(frame_view,exception);
379 Draw sides of ornamental border.
381 #if defined(MAGICKCORE_OPENMP_SUPPORT)
382 #pragma omp parallel for schedule(dynamic,4) shared(progress,status) omp_throttle(1)
384 for (y=0; y < (ssize_t) image->rows; y++)
393 Initialize scanline with matte color.
395 if (status == MagickFalse)
397 q=QueueCacheViewAuthenticPixels(frame_view,0,frame_info->y+y,
398 frame_image->columns,1,exception);
399 if (q == (Quantum *) NULL)
404 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
406 SetPixelInfoPixel(frame_image,&highlight,q);
407 q+=GetPixelChannels(frame_image);
409 for (x=0; x < (ssize_t) (frame_info->x-bevel_width); x++)
411 SetPixelInfoPixel(frame_image,&matte,q);
412 q+=GetPixelChannels(frame_image);
414 for (x=0; x < (ssize_t) frame_info->inner_bevel; x++)
416 SetPixelInfoPixel(frame_image,&shadow,q);
417 q+=GetPixelChannels(frame_image);
420 Set frame interior to interior color.
422 if ((compose != CopyCompositeOp) && ((compose != OverCompositeOp) ||
423 (image->matte != MagickFalse)))
424 for (x=0; x < (ssize_t) image->columns; x++)
426 SetPixelInfoPixel(frame_image,&interior,q);
427 q+=GetPixelChannels(frame_image);
431 register const Quantum
434 p=GetCacheViewVirtualPixels(image_view,0,y,image->columns,1,exception);
435 if (p == (const Quantum *) NULL)
440 for (x=0; x < (ssize_t) image->columns; x++)
442 if ((GetPixelRedTraits(image) & UpdatePixelTrait) != 0)
443 SetPixelRed(frame_image,GetPixelRed(image,p),q);
444 if ((GetPixelGreenTraits(image) & UpdatePixelTrait) != 0)
445 SetPixelGreen(frame_image,GetPixelGreen(image,p),q);
446 if ((GetPixelBlueTraits(image) & UpdatePixelTrait) != 0)
447 SetPixelBlue(frame_image,GetPixelBlue(image,p),q);
448 if ((GetPixelBlackTraits(image) & UpdatePixelTrait) != 0)
449 SetPixelBlack(frame_image,GetPixelBlack(image,p),q);
450 if ((GetPixelAlphaTraits(image) & UpdatePixelTrait) != 0)
451 SetPixelAlpha(frame_image,GetPixelAlpha(image,p),q);
452 p+=GetPixelChannels(image);
453 q+=GetPixelChannels(frame_image);
456 for (x=0; x < (ssize_t) frame_info->inner_bevel; x++)
458 SetPixelInfoPixel(frame_image,&highlight,q);
459 q+=GetPixelChannels(frame_image);
461 width=frame_info->width-frame_info->x-image->columns-bevel_width;
462 for (x=0; x < (ssize_t) width; x++)
464 SetPixelInfoPixel(frame_image,&matte,q);
465 q+=GetPixelChannels(frame_image);
467 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
469 SetPixelInfoPixel(frame_image,&shadow,q);
470 q+=GetPixelChannels(frame_image);
472 if (SyncCacheViewAuthenticPixels(frame_view,exception) == MagickFalse)
474 if (image->progress_monitor != (MagickProgressMonitor) NULL)
479 #if defined(MAGICKCORE_OPENMP_SUPPORT)
480 #pragma omp critical (MagickCore_FrameImage)
482 proceed=SetImageProgress(image,FrameImageTag,progress++,image->rows);
483 if (proceed == MagickFalse)
487 height=(size_t) (frame_info->inner_bevel+frame_info->height-
488 frame_info->y-image->rows-bevel_width+frame_info->outer_bevel);
498 Draw bottom of ornamental border.
500 q=QueueCacheViewAuthenticPixels(frame_view,0,(ssize_t) (frame_image->rows-
501 height),frame_image->columns,height,exception);
502 if (q != (Quantum *) NULL)
505 Draw bottom of ornamental border.
507 for (y=frame_info->inner_bevel-1; y >= 0; y--)
509 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
511 SetPixelInfoPixel(frame_image,&highlight,q);
512 q+=GetPixelChannels(frame_image);
514 for (x=0; x < (ssize_t) (frame_info->x-bevel_width); x++)
516 SetPixelInfoPixel(frame_image,&matte,q);
517 q+=GetPixelChannels(frame_image);
519 for (x=0; x < y; x++)
521 SetPixelInfoPixel(frame_image,&shadow,q);
522 q+=GetPixelChannels(frame_image);
524 for ( ; x < (ssize_t) (image->columns+2*frame_info->inner_bevel); x++)
526 if (x >= (ssize_t) (image->columns+2*frame_info->inner_bevel-y))
527 SetPixelInfoPixel(frame_image,&highlight,q);
529 SetPixelInfoPixel(frame_image,&accentuate,q);
530 q+=GetPixelChannels(frame_image);
532 width=frame_info->width-frame_info->x-image->columns-bevel_width;
533 for (x=0; x < (ssize_t) width; x++)
535 SetPixelInfoPixel(frame_image,&matte,q);
536 q+=GetPixelChannels(frame_image);
538 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
540 SetPixelInfoPixel(frame_image,&shadow,q);
541 q+=GetPixelChannels(frame_image);
544 height=frame_info->height-frame_info->y-image->rows-bevel_width;
545 for (y=0; y < (ssize_t) height; y++)
547 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
549 SetPixelInfoPixel(frame_image,&highlight,q);
550 q+=GetPixelChannels(frame_image);
552 width=frame_image->columns-2*frame_info->outer_bevel;
553 for (x=0; x < (ssize_t) width; x++)
555 SetPixelInfoPixel(frame_image,&matte,q);
556 q+=GetPixelChannels(frame_image);
558 for (x=0; x < (ssize_t) frame_info->outer_bevel; x++)
560 SetPixelInfoPixel(frame_image,&shadow,q);
561 q+=GetPixelChannels(frame_image);
564 for (y=frame_info->outer_bevel-1; y >= 0; y--)
566 for (x=0; x < y; x++)
568 SetPixelInfoPixel(frame_image,&highlight,q);
569 q+=GetPixelChannels(frame_image);
571 for ( ; x < (ssize_t) frame_image->columns; x++)
573 if (x >= (ssize_t) (frame_image->columns-y))
574 SetPixelInfoPixel(frame_image,&shadow,q);
576 SetPixelInfoPixel(frame_image,&trough,q);
577 q+=GetPixelChannels(frame_image);
580 (void) SyncCacheViewAuthenticPixels(frame_view,exception);
583 frame_view=DestroyCacheView(frame_view);
584 image_view=DestroyCacheView(image_view);
585 if ((compose != CopyCompositeOp) && ((compose != OverCompositeOp) ||
586 (image->matte != MagickFalse)))
588 x=(ssize_t) (frame_info->outer_bevel+(frame_info->x-bevel_width)+
589 frame_info->inner_bevel);
590 y=(ssize_t) (frame_info->outer_bevel+(frame_info->y-bevel_width)+
591 frame_info->inner_bevel);
592 (void) CompositeImage(frame_image,compose,image,x,y,exception);
598 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
602 % R a i s e I m a g e %
606 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
608 % RaiseImage() creates a simulated three-dimensional button-like effect
609 % by lightening and darkening the edges of the image. Members width and
610 % height of raise_info define the width of the vertical and horizontal
611 % edge of the effect.
613 % The format of the RaiseImage method is:
615 % MagickBooleanType RaiseImage(const Image *image,
616 % const RectangleInfo *raise_info,const MagickBooleanType raise,
617 % ExceptionInfo *exception)
619 % A description of each parameter follows:
621 % o image: the image.
623 % o raise_info: Define the width and height of the raise area.
625 % o raise: A value other than zero creates a 3-D raise effect,
626 % otherwise it has a lowered effect.
628 % o exception: return any errors or warnings in this structure.
631 MagickExport MagickBooleanType RaiseImage(Image *image,
632 const RectangleInfo *raise_info,const MagickBooleanType raise,
633 ExceptionInfo *exception)
635 #define AccentuateFactor ScaleCharToQuantum(135)
636 #define HighlightFactor ScaleCharToQuantum(190)
637 #define ShadowFactor ScaleCharToQuantum(190)
638 #define RaiseImageTag "Raise/Image"
639 #define TroughFactor ScaleCharToQuantum(135)
657 assert(image != (Image *) NULL);
658 assert(image->signature == MagickSignature);
659 if (image->debug != MagickFalse)
660 (void) LogMagickEvent(TraceEvent,GetMagickModule(),"%s",image->filename);
661 assert(raise_info != (RectangleInfo *) NULL);
662 if ((image->columns <= (raise_info->width << 1)) ||
663 (image->rows <= (raise_info->height << 1)))
664 ThrowBinaryException(OptionError,"ImageSizeMustExceedBevelWidth",
666 foreground=(Quantum) QuantumRange;
667 background=(Quantum) 0;
668 if (raise == MagickFalse)
670 foreground=(Quantum) 0;
671 background=(Quantum) QuantumRange;
673 if (SetImageStorageClass(image,DirectClass,exception) == MagickFalse)
680 image_view=AcquireCacheView(image);
681 #if defined(MAGICKCORE_OPENMP_SUPPORT)
682 #pragma omp parallel for schedule(dynamic,4) shared(progress,status) omp_throttle(1)
684 for (y=0; y < (ssize_t) raise_info->height; y++)
696 if (status == MagickFalse)
698 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
699 if (q == (Quantum *) NULL)
704 for (x=0; x < y; x++)
706 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
708 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
709 if ((traits & UpdatePixelTrait) != 0)
710 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
711 HighlightFactor+(MagickRealType) foreground*(QuantumRange-
714 q+=GetPixelChannels(image);
716 for ( ; x < (ssize_t) (image->columns-y); x++)
718 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
720 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
721 if ((traits & UpdatePixelTrait) != 0)
722 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
723 AccentuateFactor+(MagickRealType) foreground*(QuantumRange-
726 q+=GetPixelChannels(image);
728 for ( ; x < (ssize_t) image->columns; x++)
730 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
732 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
733 if ((traits & UpdatePixelTrait) != 0)
734 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
735 ShadowFactor+(MagickRealType) background*(QuantumRange-
738 q+=GetPixelChannels(image);
740 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
742 if (image->progress_monitor != (MagickProgressMonitor) NULL)
747 proceed=SetImageProgress(image,RaiseImageTag,progress++,image->rows);
748 if (proceed == MagickFalse)
752 #if defined(MAGICKCORE_OPENMP_SUPPORT)
753 #pragma omp parallel for schedule(dynamic,4) shared(progress,status) omp_throttle(1)
755 for (y=(ssize_t) raise_info->height; y < (ssize_t) (image->rows-raise_info->height); y++)
767 if (status == MagickFalse)
769 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
770 if (q == (Quantum *) NULL)
775 for (x=0; x < (ssize_t) raise_info->width; x++)
777 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
779 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
780 if ((traits & UpdatePixelTrait) != 0)
781 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
782 HighlightFactor+(MagickRealType) foreground*(QuantumRange-
785 q+=GetPixelChannels(image);
787 for ( ; x < (ssize_t) (image->columns-raise_info->width); x++)
788 q+=GetPixelChannels(image);
789 for ( ; x < (ssize_t) image->columns; x++)
791 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
793 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
794 if ((traits & UpdatePixelTrait) != 0)
795 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
796 ShadowFactor+(MagickRealType) background*(QuantumRange-
799 q+=GetPixelChannels(image);
801 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
803 if (image->progress_monitor != (MagickProgressMonitor) NULL)
808 proceed=SetImageProgress(image,RaiseImageTag,progress++,image->rows);
809 if (proceed == MagickFalse)
813 #if defined(MAGICKCORE_OPENMP_SUPPORT)
814 #pragma omp parallel for schedule(dynamic,4) shared(progress,status) omp_throttle(1)
816 for (y=(ssize_t) (image->rows-raise_info->height); y < (ssize_t) image->rows; y++)
828 if (status == MagickFalse)
830 q=GetCacheViewAuthenticPixels(image_view,0,y,image->columns,1,exception);
831 if (q == (Quantum *) NULL)
836 for (x=0; x < (ssize_t) (image->rows-y); x++)
838 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
840 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
841 if ((traits & UpdatePixelTrait) != 0)
842 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
843 HighlightFactor+(MagickRealType) foreground*(QuantumRange-
846 q+=GetPixelChannels(image);
848 for ( ; x < (ssize_t) (image->columns-(image->rows-y)); x++)
850 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
852 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
853 if ((traits & UpdatePixelTrait) != 0)
854 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
855 TroughFactor+(MagickRealType) background*(QuantumRange-
858 q+=GetPixelChannels(image);
860 for ( ; x < (ssize_t) image->columns; x++)
862 for (i=0; i < (ssize_t) GetPixelChannels(image); i++)
864 traits=GetPixelChannelMapTraits(image,(PixelChannel) i);
865 if ((traits & UpdatePixelTrait) != 0)
866 q[i]=ClampToQuantum(QuantumScale*((MagickRealType) q[i]*
867 ShadowFactor+(MagickRealType) background*(QuantumRange-
870 q+=GetPixelChannels(image);
872 if (SyncCacheViewAuthenticPixels(image_view,exception) == MagickFalse)
874 if (image->progress_monitor != (MagickProgressMonitor) NULL)
879 #if defined(MAGICKCORE_OPENMP_SUPPORT)
880 #pragma omp critical (MagickCore_RaiseImage)
882 proceed=SetImageProgress(image,RaiseImageTag,progress++,image->rows);
883 if (proceed == MagickFalse)
887 image_view=DestroyCacheView(image_view);