Changeset 2749 for libpipi


Ignore:
Timestamp:
Aug 21, 2008, 2:10:16 AM (12 years ago)
Author:
Sam Hocevar
Message:
  • Implement pipi_vflip() and pipi_hflip().
Location:
libpipi/trunk
Files:
1 added
4 edited

Legend:

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

    r2746 r2749  
    5656        filter/convolution.c filter/convolution_template.h \
    5757        filter/color.c \
     58        filter/transform.c \
    5859        filter/median.c \
    5960        filter/dilate.c
  • libpipi/trunk/pipi/context.c

    r2747 r2749  
    325325        ctx->images[ctx->nimages - 1] = dst;
    326326    }
     327    else if(!strcmp(cmd, "hflip"))
     328    {
     329        pipi_image_t *tmp;
     330        if(ctx->nimages < 1)
     331            return -1;
     332        tmp = ctx->images[ctx->nimages - 1];
     333        ctx->images[ctx->nimages - 1] = pipi_hflip(tmp);
     334        pipi_free(tmp);
     335    }
     336    else if(!strcmp(cmd, "vflip"))
     337    {
     338        pipi_image_t *tmp;
     339        if(ctx->nimages < 1)
     340            return -1;
     341        tmp = ctx->images[ctx->nimages - 1];
     342        ctx->images[ctx->nimages - 1] = pipi_vflip(tmp);
     343        pipi_free(tmp);
     344    }
    327345    else if(!strcmp(cmd, "mean"))
    328346    {
  • libpipi/trunk/pipi/pipi.h

    r2747 r2749  
    128128extern pipi_image_t *pipi_invert(pipi_image_t *);
    129129extern pipi_image_t *pipi_threshold(pipi_image_t *, double);
     130extern pipi_image_t *pipi_hflip(pipi_image_t *);
     131extern pipi_image_t *pipi_vflip(pipi_image_t *);
    130132extern pipi_image_t *pipi_median(pipi_image_t *, int);
    131133extern pipi_image_t *pipi_median_ext(pipi_image_t *, int, int);
  • libpipi/trunk/src/pipi.c

    r2747 r2749  
    108108                return EXIT_FAILURE;
    109109        }
     110        else if(!strcmp(argv[0], "--hflip"))
     111        {
     112            if(pipi_command(ctx, "hflip") != 0)
     113                return EXIT_FAILURE;
     114        }
     115        else if(!strcmp(argv[0], "--vflip"))
     116        {
     117            if(pipi_command(ctx, "vflip") != 0)
     118                return EXIT_FAILURE;
     119        }
    110120        else if(!strcmp(argv[0], "--invert"))
    111121        {
Note: See TracChangeset for help on using the changeset viewer.