Exemplo n.º 1
0
/* {{{ proto array GmagickDraw::getStrokeDashArray()
        Returns an array representing the pattern of dashes and gaps used to stroke paths (see DrawSetStrokeDashArray). The array must be freed once it is no longer required by the user.
*/
PHP_METHOD(gmagickdraw, getstrokedasharray)
{
        php_gmagickdraw_object *internd;
        double *stroke_array;
        unsigned long num_elements, i;

        if (zend_parse_parameters_none() == FAILURE) {
                return;
        }

        internd = (php_gmagickdraw_object *)zend_object_store_get_object(getThis() TSRMLS_CC);

        stroke_array = DrawGetStrokeDashArray(internd->drawing_wand, &num_elements);
        array_init(return_value);

        for (i = 0; i < num_elements ; i++) {
                add_next_index_double(return_value, stroke_array[i]);
        }

		GMAGICK_FREE_MEMORY(double *, stroke_array);        
        return;
}
Exemplo n.º 2
0
static Array HHVM_METHOD(ImagickDraw, getStrokeDashArray) {
  auto wand = getDrawingWandResource(Object{this_});
  size_t num;
  double* arr = DrawGetStrokeDashArray(wand->getWand(), &num);
  return convertMagickArray(num, arr);
}