Changeset 2746 for libpipi


Ignore:
Timestamp:
Aug 21, 2008, 12:00:17 AM (12 years ago)
Author:
Sam Hocevar
Message:
  • Add pipi_dilate() / pipi_erode() and --dilate / --erode.
Location:
libpipi/trunk
Files:
1 added
4 edited

Legend:

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

    r2744 r2746  
    5656        filter/convolution.c filter/convolution_template.h \
    5757        filter/color.c \
    58         filter/median.c
     58        filter/median.c \
     59        filter/dilate.c
    5960
    6061quantize_sources = \
  • libpipi/trunk/pipi/context.c

    r2744 r2746  
    479479        pipi_free(tmp);
    480480    }
     481    else if(!strcmp(cmd, "dilate"))
     482    {
     483        pipi_image_t *tmp;
     484        if(ctx->nimages < 1)
     485            return -1;
     486        tmp = ctx->images[ctx->nimages - 1];
     487        ctx->images[ctx->nimages - 1] = pipi_dilate(tmp);
     488        pipi_free(tmp);
     489    }
     490    else if(!strcmp(cmd, "erode"))
     491    {
     492        pipi_image_t *tmp;
     493        if(ctx->nimages < 1)
     494            return -1;
     495        tmp = ctx->images[ctx->nimages - 1];
     496        ctx->images[ctx->nimages - 1] = pipi_erode(tmp);
     497        pipi_free(tmp);
     498    }
    481499    else if(!strcmp(cmd, "gray"))
    482500    {
  • libpipi/trunk/pipi/pipi.h

    r2744 r2746  
    129129extern pipi_image_t *pipi_median(pipi_image_t *, int);
    130130extern pipi_image_t *pipi_median_ext(pipi_image_t *, int, int);
     131extern pipi_image_t *pipi_dilate(pipi_image_t *);
     132extern pipi_image_t *pipi_erode(pipi_image_t *);
    131133
    132134extern pipi_image_t *pipi_tile(pipi_image_t *, int, int);
  • libpipi/trunk/src/pipi.c

    r2744 r2746  
    113113                return EXIT_FAILURE;
    114114        }
     115        else if(!strcmp(argv[0], "--dilate"))
     116        {
     117            if(pipi_command(ctx, "dilate") != 0)
     118                return EXIT_FAILURE;
     119        }
     120        else if(!strcmp(argv[0], "--erode"))
     121        {
     122            if(pipi_command(ctx, "erode") != 0)
     123                return EXIT_FAILURE;
     124        }
    115125        else if(!strcmp(argv[0], "--wrap"))
    116126        {
Note: See TracChangeset for help on using the changeset viewer.