From 31fd250bd24332abfaa723ac69bfc373cef29f8e Mon Sep 17 00:00:00 2001 From: sam Date: Tue, 12 Aug 2008 17:18:17 +0000 Subject: [PATCH] * Support --autocontrast in pipi. git-svn-id: file:///srv/caca.zoy.org/var/lib/svn/libpipi/trunk@2704 92316355-f0b4-4df1-b90c-862c8a59935f --- pipi/context.c | 9 +++++++++ src/pipi.c | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/pipi/context.c b/pipi/context.c index f2fe391..1696117 100644 --- a/pipi/context.c +++ b/pipi/context.c @@ -137,6 +137,15 @@ int pipi_command(pipi_context_t *ctx, char const *cmd, ...) return -1; ctx->images[ctx->nimages - 1]->wrap = 1; } + else if(!strcmp(cmd, "autocontrast")) + { + pipi_image_t *tmp; + if(ctx->nimages <= 0) + return -1; + tmp = ctx->images[ctx->nimages - 1]; + ctx->images[ctx->nimages - 1] = pipi_autocontrast(tmp); + pipi_free(tmp); + } else if(!strcmp(cmd, "gray")) { if(ctx->nimages <= 0) diff --git a/src/pipi.c b/src/pipi.c index 6f63a66..d477cd7 100644 --- a/src/pipi.c +++ b/src/pipi.c @@ -41,6 +41,11 @@ int main(int argc, char *argv[]) if(pipi_command(ctx, "gray") != 0) return EXIT_FAILURE; } + else if(!strcmp(argv[0], "--autocontrast")) + { + if(pipi_command(ctx, "autocontrast") != 0) + return EXIT_FAILURE; + } else if(!strcmp(argv[0], "--wrap")) { if(pipi_command(ctx, "wrap") != 0)