Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(159)

Unified Diff: src/ply-image.c

Issue 6877024: Add gamma support to ply-image. (Closed) Base URL: ssh://gitrw.chromium.org:9222/ply-image.git@master
Patch Set: Add a command line option for gamma. Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ply-gamma.c ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ply-image.c
diff --git a/src/ply-image.c b/src/ply-image.c
index 3395c9200b6d3697678562d79b786d510cf27e8f..dc3c9c47b14b0e7e40c3e275f4ad8648223d04fa 100644
--- a/src/ply-image.c
+++ b/src/ply-image.c
@@ -451,6 +451,7 @@ ply_image_from_file(const char *path)
}
#include "ply-frame-buffer.h"
+#include "ply-gamma.h"
#include <math.h>
#include <signal.h>
@@ -529,6 +530,7 @@ main (int argc,
{
int exit_code = 0;
int clear = 0;
+ int gamma = 0;
int help = 0;
ply_frame_buffer_t *buffer;
int i;
@@ -544,11 +546,12 @@ main (int argc,
if (argc > 1)
{
clear = strcasecmp (argv[1], "--clear") == 0;
+ gamma = strcasecmp (argv[1], "--gamma") == 0;
help = strcasecmp (argv[1], "--help") == 0 ||
strcasecmp (argv[1], "-h") == 0;
}
- if (help || argc == 1 || argc == 3 || argc == 4)
+ if (help)
{
usage();
}
@@ -568,6 +571,19 @@ main (int argc,
}
else
{
+ int num_gamma_args = 0;
+ if (gamma)
+ {
+ if (argc < 6)
+ usage();
+ ply_gamma_set(argv[2]);
+ argv += 2;
+ argc -= 2;
+ }
+ else
+ if (argc < 4)
+ usage();
+
/*
* Display main image.
*/
« no previous file with comments | « src/ply-gamma.c ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698