summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Muizelaar <jmuizelaar@mozilla.com>2010-02-18 15:00:34 -0500
committerJeff Muizelaar <jmuizelaar@mozilla.com>2010-02-18 15:00:34 -0500
commit5e77549bb4a8e7ec0e2adc5d7b8bd4f257e9507b (patch)
tree86426c865a40e0f67469d731915cd287a3b47344
parentf8f9be616850855f6215b833da9dd718e8599c9e (diff)
colorsync-perf: Support specifying input and output profiles
-rw-r--r--util/colorsync-perf.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/util/colorsync-perf.c b/util/colorsync-perf.c
index 2878c0e..fb1fd6d 100644
--- a/util/colorsync-perf.c
+++ b/util/colorsync-perf.c
@@ -5,12 +5,17 @@
#define BITMAP_INFO (kCGBitmapByteOrder32Big | kCGImageAlphaNoneSkipLast)
-int main() {
+int main(int argc, char **argv) {
int width = 256;
int height = 256*256;
-
- CGDataProviderRef input_file = CGDataProviderCreateWithFilename("input.icc");
- CGDataProviderRef output_file = CGDataProviderCreateWithFilename("output.icc");
+ char *input_profile_file = "input.icc";
+ char *output_profile_file = "output.icc";
+ if (argc >= 3) {
+ input_profile_file = argv[1];
+ output_profile_file = argv[2];
+ }
+ CGDataProviderRef input_file = CGDataProviderCreateWithFilename(input_profile_file);
+ CGDataProviderRef output_file = CGDataProviderCreateWithFilename(output_profile_file);
float range[] = {0, 1., 0, 1., 0, 1.};
CGColorSpaceRef output_profile = CGColorSpaceCreateICCBased(3, range, output_file, NULL);
CGColorSpaceRef input_profile = CGColorSpaceCreateICCBased(3, range, input_file, NULL);