Changeset 2702


Ignore:
Timestamp:
Aug 12, 2008, 12:02:13 AM (14 years ago)
Author:
Sam Hocevar
Message:
  • pipi.c: implement the "--gray" flag for grayscale conversion.
Location:
libpipi/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libpipi/trunk/pipi/context.c

    r2700 r2702  
    132132        ctx->images[ctx->nimages - 1] = dst;
    133133    }
     134    else if(!strcmp(cmd, "gray"))
     135    {
     136        if(ctx->nimages <= 0)
     137            return -1;
     138        pipi_getpixels(ctx->images[ctx->nimages - 1], PIPI_PIXELS_Y_F);
     139    }
    134140    else if(!strcmp(cmd, "free"))
    135141    {
  • libpipi/trunk/src/pipi.c

    r2694 r2702  
    3737            argv++;
    3838        }
     39        else if(!strcmp(argv[0], "--gray"))
     40        {
     41            if(pipi_command(ctx, "gray") != 0)
     42                return EXIT_FAILURE;
     43        }
    3944        else if(!strcmp(argv[0], "--output") || !strcmp(argv[0], "-o"))
    4045        {
Note: See TracChangeset for help on using the changeset viewer.