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

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: git cl push 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..1230492f2b7c44248073db0079e17721d90de53a 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>
@@ -517,7 +518,8 @@ int usage(void)
{
fprintf(stderr,
"usage: ply-image --clear\n"
- " ply-image <background> [<x-offset> <y-offset> "
+ " ply-image [--gamma <gammafile>] "
+ "<background> [<x-offset> <y-offset> "
"<frame-1> ... <frame-n>]\n");
exit(1);
}
@@ -529,6 +531,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 +547,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 +572,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