are now possible: pipi src.png --split --contrast -.2 --combine -o dest.png git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2755 92316355-f0b4-4df1-b90c-862c8a59935fremotes/tiles
@@ -373,7 +373,20 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) | |||||
ctx->images[ctx->nimages - 1] = pipi_rotate270(tmp); | ctx->images[ctx->nimages - 1] = pipi_rotate270(tmp); | ||||
pipi_free(tmp); | pipi_free(tmp); | ||||
} | } | ||||
else if(!strcmp(cmd, "rgb")) | |||||
else if(!strcmp(cmd, "split")) | |||||
{ | |||||
pipi_image_t *src; | |||||
if(ctx->nimages < 1) | |||||
return -1; | |||||
src = ctx->images[ctx->nimages - 1]; | |||||
ctx->nimages += 2; | |||||
ctx->images[ctx->nimages - 3] = pipi_red(src); | |||||
ctx->images[ctx->nimages - 2] = pipi_green(src); | |||||
ctx->images[ctx->nimages - 1] = pipi_blue(src); | |||||
pipi_free(src); | |||||
} | |||||
else if(!strcmp(cmd, "combine")) | |||||
{ | { | ||||
pipi_image_t *dst; | pipi_image_t *dst; | ||||
@@ -168,9 +168,14 @@ int main(int argc, char *argv[]) | |||||
if(pipi_command(ctx, "wrap") != 0) | if(pipi_command(ctx, "wrap") != 0) | ||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
} | } | ||||
else if(!strcmp(argv[0], "--rgb")) | |||||
else if(!strcmp(argv[0], "--combine")) | |||||
{ | { | ||||
if(pipi_command(ctx, "rgb") != 0) | |||||
if(pipi_command(ctx, "combine") != 0) | |||||
return EXIT_FAILURE; | |||||
} | |||||
else if(!strcmp(argv[0], "--split")) | |||||
{ | |||||
if(pipi_command(ctx, "split") != 0) | |||||
return EXIT_FAILURE; | return EXIT_FAILURE; | ||||
} | } | ||||
else if(!strcmp(argv[0], "--mean")) | else if(!strcmp(argv[0], "--mean")) | ||||