static bool HHVM_METHOD(ImagickDraw, popPattern) { auto wand = getDrawingWandResource(Object{this_}); auto status = DrawPopPattern(wand->getWand()); if (status == MagickFalse) { IMAGICKDRAW_THROW("Unable to terminate the pattern definition"); } return true; }
// Given a pattern name (which MUST have a leading #) and a pattern file, // set up a pattern URL for later reference in the specified drawing wand // Currently only used in Text Effect 2 void set_tile_pattern(DrawingWand *d_wand,char *pattern_name,char *pattern_file) { MagickWand *t_wand; long w,h; t_wand=NewMagickWand(); MagickReadImage(t_wand,pattern_file); // Read the tile's width and height w = MagickGetImageWidth(t_wand); h = MagickGetImageHeight(t_wand); DrawPushPattern(d_wand, pattern_name+1, 0, 0, w, h); DrawComposite(d_wand, SrcOverCompositeOp, 0, 0, 0, 0, t_wand); DrawPopPattern(d_wand); DrawSetFillPatternURL(d_wand, pattern_name); }
MAGICK_NET_EXPORT void DrawingWand_PopPattern(DrawingWand *instance, ExceptionInfo **exception) { DrawPopPattern(instance); MAGICK_NET_SET_DRAW_EXCEPTION; }