Exemple #1
0
/*
@description	Clears resources associated with the wand.
*/
value nMagick_pixel_clear( value pixel )
{
	PixelWand *pix;

	val_check_kind( pixel, k_pixel );

	pix = PIXEL( pixel );

	ClearPixelWand( pix );
}
/* {{{ proto bool ImagickPixel::clear()
	Clears resources associated with the wand.
*/
PHP_METHOD(imagickpixel, clear)
{
    php_imagickpixel_object *internp;

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

    internp = Z_IMAGICKPIXEL_P(getThis());

    ClearPixelWand(internp->pixel_wand);
    RETURN_TRUE;
}
Exemple #3
0
/* {{{ proto bool ImagickPixel::clear()
	Clears resources associated with the wand.
*/
PHP_METHOD(imagickpixel, clear)
{
	php_imagickpixel_object *internp;

	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "") == FAILURE) {
		return;
	}

	internp = (php_imagickpixel_object *)zend_object_store_get_object(getThis() TSRMLS_CC);

	ClearPixelWand(internp->pixel_wand);
	RETURN_TRUE;
}
Exemple #4
0
/*
 * Apply image modifications (rotate, gamma, etc) to the
 * image. Resizing to web image or thumbnail is done afterwards
 */
static gboolean _apply_modifications(struct data *data, 
                                     MagickWand *wand, 
                                     struct image *image)
{
    gchar *desc;
    ExceptionType severity;

    g_debug("in _apply_modifications");

    g_assert(data != NULL);
    g_assert(wand != NULL);
    g_assert(image != NULL);
    
    /* rotate image */
    if (image->rotate) {
        PixelWand *px;

        px = NewPixelWand();
        g_assert(px);

        PixelSetColor(px, "blue");

        if( !MagickRotateImage(wand, px, image->rotate)) {
            desc = MagickGetException(wand, &severity);
            /* FIXME: popup */
            g_warning("_apply_modifications: "
                      "error rotating image: %s\n", desc);
            ClearPixelWand(px);
            desc = (char *) MagickRelinquishMemory(desc);
            return FALSE;
        }
        DestroyPixelWand( px );
    }

    /* Apply gamma, if over changed over 0.01 */
    if (image->gamma <= 0.99 || image->gamma >= 1.01) {
        if (!MagickGammaImage(wand, image->gamma)) {
            desc = MagickGetException(wand, &severity);
            
            /* FIXME: popup */
            g_warning("_apply_modifications: "
                      "error setting gamma (%.2f) of image: %s\n",
                      image->gamma, desc);
            desc = (char *) MagickRelinquishMemory(desc);
            return FALSE;
        }
    }

    return TRUE;
}
Exemple #5
0
//////////////////////////////////////////////////////////////////////////////
// class ImagickPixel
static bool HHVM_METHOD(ImagickPixel, clear) {
  auto wand = getPixelWandResource(this_);
  ClearPixelWand(wand->getWand());
  return true;
}