Changeset 3397 for libpipi


Ignore:
Timestamp:
Feb 21, 2009, 3:26:01 PM (12 years ago)
Author:
Sam Hocevar
Message:

Add a wave filter for crappy sine effects.

Location:
libpipi/trunk/pipi
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/Makefile.am

    r3343 r3397  
    7373        filter/transform.c \
    7474        filter/median.c \
    75         filter/dilate.c
     75        filter/dilate.c \
     76        filter/wave.c
    7677
    7778quantize_sources = \
  • libpipi/trunk/pipi/context.c

    r3342 r3397  
    8989        { "overlay", 0 },
    9090        { "line", 1 },
     91        { "wave", 1 },
    9192
    9293        /* End marker */
     
    773774        ctx->nimages++;
    774775    }
     776    else if(!strcmp(cmd, "wave"))
     777    {
     778        pipi_image_t *tmp;
     779        char const *arg;
     780        va_list ap;
     781        float freq, phase, theta, ampx, ampy;
     782        int ret;
     783
     784        if(ctx->nimages < 1)
     785            return -1;
     786
     787        va_start(ap, cmd);
     788        arg = va_arg(ap, char const *);
     789        va_end(ap);
     790
     791        ret = sscanf(arg, "%g,%g,%g,%gx%g",
     792                     &freq, &phase, &theta, &ampx, &ampy);
     793        if(ret < 5)
     794            return -1;
     795
     796        tmp = ctx->images[ctx->nimages - 1];
     797        ctx->images[ctx->nimages - 1] = pipi_wave(tmp, freq, phase,
     798                                                  theta, ampx, ampy);
     799        pipi_free(tmp);
     800    }
    775801    else
    776802    {
  • libpipi/trunk/pipi/pipi.h

    r3342 r3397  
    198198__extern pipi_image_t *pipi_dilate(pipi_image_t *);
    199199__extern pipi_image_t *pipi_erode(pipi_image_t *);
     200__extern pipi_image_t *pipi_wave(pipi_image_t *, double, double,
     201                                 double, double, double);
    200202
    201203__extern pipi_image_t *pipi_order(pipi_image_t *);
Note: See TracChangeset for help on using the changeset viewer.