コード例 #1
0
ファイル: ccxxmake.c プロジェクト: beku/Argyll-Releases
void
/* Flag = 0x0000 = default */
/* Flag & 0x0001 = list ChromCast's */
/* Flag & 0x0002 = list Technology choice */
usage(int flag, char *diag, ...) {
	disppath **dp;
	icompaths *icmps = new_icompaths(0);
	inst2_capability cap = 0;

	fprintf(stderr,"Create CCMX or CCSS, Version %s\n",ARGYLL_VERSION_STR);
	fprintf(stderr,"Author: Graeme W. Gill, licensed under the AGPL Version 3\n");
	if (diag != NULL) {
		va_list args;
		fprintf(stderr,"Diagnostic: ");
		va_start(args, diag);
		vfprintf(stderr, diag, args);
		va_end(args);
		fprintf(stderr,"\n");
	}
	fprintf(stderr,"usage: ccmxmake -t dtech [-options] output.ccmx\n");
	fprintf(stderr," -v                Verbose mode\n");
	fprintf(stderr," -S                Create CCSS rather than CCMX\n");
	fprintf(stderr," -f ref.ti3[,targ.ti3]  Create from one or two .ti3 files rather than measure.\n");
#if defined(UNIX_X11)
	fprintf(stderr," -display displayname   Choose X11 display name\n");
	fprintf(stderr," -d n[,m]          Choose the display n from the following list (default 1)\n");
	fprintf(stderr,"                   Optionally choose different display m for VideoLUT access\n"); 
#else
	fprintf(stderr," -d n              Choose the display from the following list (default 1)\n");
#endif
	dp = get_displays();
	if (dp == NULL || dp[0] == NULL)
		fprintf(stderr,"    ** No displays found **\n");
	else {
		int i;
		for (i = 0; ; i++) {
			if (dp[i] == NULL)
				break;
			fprintf(stderr,"    %d name = '%s'\n",i+1,dp[i]->name);
			fprintf(stderr,"    %d = '%s'\n",i+1,dp[i]->description);
		}
	}
	free_disppaths(dp);
	fprintf(stderr," -dweb[:port]      Display via a web server at port (default 8080)\n");
	fprintf(stderr," -dcc[:n]          Display via n'th ChromeCast (default 1, ? for list)\n");
	if (flag & 0x001) {
		ccast_id **ids;
		if ((ids = get_ccids()) == NULL) {
			fprintf(stderr,"    ** Error discovering ChromCasts **\n");
		} else {
			if (ids[0] == NULL)
				fprintf(stderr,"    ** No ChromCasts found **\n");
			else {
				int i;
				for (i = 0; ids[i] != NULL; i++)
					fprintf(stderr,"    %d = '%s'\n",i+1,ids[i]->name);
				free_ccids(ids);
			}
		}
	}
#ifdef NT
	fprintf(stderr," -dmadvr           Display via MadVR Video Renderer\n");
#endif
//	fprintf(stderr," -d fake           Use a fake display device for testing, fake%s if present\n",ICC_FILE_EXT);
	fprintf(stderr," -p                Use telephoto mode (ie. for a projector) (if available)\n");
	cap = inst_show_disptype_options(stderr, " -y c|l                 ", icmps, 1);
	fprintf(stderr," -z disptype       Different display type for spectrometer (see -y)\n");
	fprintf(stderr," -P ho,vo,ss[,vs]  Position test window and scale it\n");
	fprintf(stderr,"                   ho,vi: 0.0 = left/top, 0.5 = center, 1.0 = right/bottom etc.\n");
	fprintf(stderr,"                   ss: 0.5 = half, 1.0 = normal, 2.0 = double etc.\n");
	fprintf(stderr," -F                Fill whole screen with black background\n");
#if defined(UNIX_X11)
	fprintf(stderr," -n                Don't set override redirect on test window\n");
#endif
	fprintf(stderr," -N                Disable initial calibration of instrument if possible\n");
	fprintf(stderr," -H                Use high resolution spectrum mode (if available)\n");
//	fprintf(stderr," -V                Use adaptive measurement mode (if available)\n");
	fprintf(stderr," -C \"command\"      Invoke shell \"command\" each time a color is set\n");
	fprintf(stderr," -o observ         Choose CIE Observer for CCMX spectrometer data:\n");
	fprintf(stderr,"                   1931_2 (def), 1964_10, S&B 1955_2, shaw, J&V 1978_2\n");
	fprintf(stderr," -s steps          Override default patch sequence combination steps  (default %d)\n",DEFAULT_MSTEPS);
	fprintf(stderr," -W n|h|x          Override serial port flow control: n = none, h = HW, x = Xon/Xoff\n");
	fprintf(stderr," -D [level]        Print debug diagnostics to stderr\n");
	fprintf(stderr," -E desciption     Override the default overall description\n");
	fprintf(stderr," -I displayname    Set display make and model description (optional)\n");
	if (flag & 0x0002) {
		int i;
		disptech_info *list = disptech_get_list();
		for (i = 0; list[i].dtech != disptech_end; i++)
			fprintf(stderr," %s %s               %s\n",i == 0 ? "-t" : "  ", list[i].lsel,list[i].desc);
	} else {
		fprintf(stderr," -t dtech          Set display technology type\n");
		fprintf(stderr,"                    (Use -?? to list technology choices)\n");
	}
	fprintf(stderr," -U c              Set UI selection character(s)\n");
	fprintf(stderr," -Y r|n            Set or override refresh/non-refresh display type\n");
	fprintf(stderr," -Y R:rate         Override measured refresh rate with rate Hz\n");
	fprintf(stderr," -Y A              Use non-adaptive integration time mode (if available).\n");
	fprintf(stderr," correction.ccmx | calibration.ccss\n");
	fprintf(stderr,"                   File to save result to\n");
	if (icmps != NULL)
		icmps->del(icmps);
	exit(1);
}
コード例 #2
0
ファイル: dispread.c プロジェクト: comstock/hargyllcms
void usage(char *diag, ...) {
	disppath **dp;
	icoms *icom;

	fprintf(stderr,"Read a Display, Version %s\n",ARGYLL_VERSION_STR);
	fprintf(stderr,"Author: Graeme W. Gill, licensed under the GPL Version 3\n");
	if (setup_spyd2(NULL) == 2)
		fprintf(stderr,"WARNING: This file contains a proprietary firmware image, and may not be freely distributed !\n");
	if (diag != NULL) {
		va_list args;
		fprintf(stderr,"Diagnostic: ");
		va_start(args, diag);
		vfprintf(stderr, diag, args);
		va_end(args);
		fprintf(stderr,"\n");
	}
	fprintf(stderr,"usage: dispread [options] outfile\n");
	fprintf(stderr," -v              Verbose mode\n");
#if defined(UNIX) && !defined(__APPLE__)
	fprintf(stderr," -display displayname Choose X11 display name\n");
	fprintf(stderr," -d n[,m]             Choose the display n from the following list (default 1)\n");
	fprintf(stderr,"                      Optionally choose different display m for VideoLUT access\n"); 
#else
	fprintf(stderr," -d n                 Choose the display from the following list (default 1)\n");
#endif
//	fprintf(stderr," -d fake              Use a fake display device for testing, fake%s if present\n",ICC_FILE_EXT);
	dp = get_displays();
	if (dp == NULL || dp[0] == NULL)
		fprintf(stderr,"    ** No displays found **\n");
	else {
		int i;
		for (i = 0; ; i++) {
			if (dp[i] == NULL)
				break;
			fprintf(stderr,"    %d = '%s'\n",i+1,dp[i]->description);
		}
	}
	free_disppaths(dp);
	fprintf(stderr," -c listno            Set communication port from the following list (default %d)\n",COMPORT);
	if ((icom = new_icoms()) != NULL) {
		icompath **paths;
		if ((paths = icom->get_paths(icom)) != NULL) {
			int i;
			for (i = 0; ; i++) {
				if (paths[i] == NULL)
					break;
				if (strlen(paths[i]->path) >= 8
				  && strcmp(paths[i]->path+strlen(paths[i]->path)-8, "Spyder2)") == 0
				  && setup_spyd2(NULL) == 0)
					fprintf(stderr,"    %d = '%s' !! Disabled - no firmware !!\n",i+1,paths[i]->path);
				else
					fprintf(stderr,"    %d = '%s'\n",i+1,paths[i]->path);
			}
		} else
			fprintf(stderr,"    ** No ports found **\n");
		icom->del(icom);
	}
	fprintf(stderr," -p                   Use projector mode (if available)\n");
	fprintf(stderr," -y c|l               Display type, c = CRT, l = LCD\n");
	fprintf(stderr," -k file.cal          Apply display calibration file while reading\n");
	fprintf(stderr," -s                   Save spectral information (default don't save)\n");
	fprintf(stderr," -P ho,vo,ss          Position test window and scale it\n");
	fprintf(stderr,"                      ho,vi: 0.0 = left/top, 0.5 = center, 1.0 = right/bottom etc.\n");
	fprintf(stderr,"                      ss: 0.5 = half, 1.0 = normal, 2.0 = double etc.\n");
	fprintf(stderr," -F                   Fill whole screen with black background\n");
#if defined(UNIX) && !defined(__APPLE__)
	fprintf(stderr," -n                   Don't set override redirect on test window\n");
#endif
	fprintf(stderr," -K                   Run instrument calibration first (used rarely)\n");
	fprintf(stderr," -N                   Disable auto calibration of instrument\n");
	fprintf(stderr," -H                   Use high resolution spectrum mode (if available)\n");
	fprintf(stderr," -C \"command\"         Invoke shell \"command\" each time a color is set\n");
	fprintf(stderr," -M \"command\"         Invoke shell \"command\" each time a color is measured\n");
	fprintf(stderr," -W n|h|x             Override serial port flow control: n = none, h = HW, x = Xon/Xoff\n");
	fprintf(stderr," -D [level]           Print debug diagnostics to stderr\n");
	fprintf(stderr," outfile              Base name for input[ti1]/output[ti3] file\n");
	exit(1);
	}