Ignore:
Timestamp:
Oct 17, 2010, 2:57:27 AM (9 years ago)
Author:
Sam Hocevar
Message:

Implement bicubic resampling. Lacks some blurring in the pre-pass, maybe.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi-php/php_pipi.c

    r3342 r4696  
    3838        PHP_FE(pipi_measure_msd, NULL)
    3939        PHP_FE(pipi_measure_rmsd, NULL)
    40         PHP_FE(pipi_resize, NULL)
     40        PHP_FE(pipi_resize_bicubic, NULL)
     41        PHP_FE(pipi_resize_bresenham, NULL)
    4142        PHP_FE(pipi_render_random, NULL)
    4243        PHP_FE(pipi_render_bayer, NULL)
     
    340341}
    341342
    342 PHP_FUNCTION(pipi_resize) {
     343PHP_FUNCTION(pipi_resize_bicubic) {
    343344        zval *_zval;
    344345        long width, height = 0;
     
    349350        ZEND_FETCH_RESOURCE(src, pipi_image_t*, &_zval, -1, PHP_PIPI_IMAGE_RES_NAME, le_pipi_image);
    350351
    351         result = pipi_resize(src, width, height);
     352        result = pipi_resize_bicubic(src, width, height);
     353        ZEND_REGISTER_RESOURCE(return_value, result, le_pipi_image);
     354}
     355
     356PHP_FUNCTION(pipi_resize_bresenham) {
     357        zval *_zval;
     358        long width, height = 0;
     359        if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rll", &_zval, &width, &height) == FAILURE) {
     360                RETURN_FALSE;
     361        }
     362        pipi_image_t *src, *result;
     363        ZEND_FETCH_RESOURCE(src, pipi_image_t*, &_zval, -1, PHP_PIPI_IMAGE_RES_NAME, le_pipi_image);
     364
     365        result = pipi_resize_bresenham(src, width, height);
    352366        ZEND_REGISTER_RESOURCE(return_value, result, le_pipi_image);
    353367}
Note: See TracChangeset for help on using the changeset viewer.