Changeset 2718 for libpipi


Ignore:
Timestamp:
Aug 14, 2008, 8:35:01 PM (12 years ago)
Author:
Sam Hocevar
Message:
  • Add pipi_invert() to invert an image's colours.
Location:
libpipi/trunk
Files:
1 added
4 edited

Legend:

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

    r2717 r2718  
    5353        filter/autocontrast.c \
    5454        filter/blur.c \
    55         filter/convolution.c \
    56         filter/convolution.h
     55        filter/convolution.c filter/convolution_template.h \
     56        filter/color.c
    5757
    5858dither_sources = \
  • libpipi/trunk/pipi/context.c

    r2717 r2718  
    384384        pipi_free(tmp);
    385385    }
     386    else if(!strcmp(cmd, "invert"))
     387    {
     388        pipi_image_t *tmp;
     389        if(ctx->nimages < 1)
     390            return -1;
     391        tmp = ctx->images[ctx->nimages - 1];
     392        ctx->images[ctx->nimages - 1] = pipi_invert(tmp);
     393        pipi_free(tmp);
     394    }
    386395    else if(!strcmp(cmd, "gray"))
    387396    {
  • libpipi/trunk/pipi/pipi.h

    r2717 r2718  
    104104extern pipi_image_t *pipi_box_blur_ext(pipi_image_t *, int, int);
    105105extern pipi_image_t *pipi_autocontrast(pipi_image_t *);
     106extern pipi_image_t *pipi_invert(pipi_image_t *);
    106107
    107108extern pipi_image_t *pipi_tile(pipi_image_t *, int, int);
  • libpipi/trunk/src/pipi.c

    r2717 r2718  
    7676                return EXIT_FAILURE;
    7777        }
     78        else if(!strcmp(argv[0], "--invert"))
     79        {
     80            if(pipi_command(ctx, "invert") != 0)
     81                return EXIT_FAILURE;
     82        }
    7883        else if(!strcmp(argv[0], "--wrap"))
    7984        {
Note: See TracChangeset for help on using the changeset viewer.