orig/xyzimage.csh
author Axel Jacobs <axel@jaloxa.eu>
Mon, 14 Apr 2014 22:21:17 +0100
changeset 73 87fa3132a136
parent 0 0aa115157c9c
permissions -rw-r--r--
New IES test file with spaces in file name
axel@0
     1
#!/bin/csh -f
axel@0
     2
# RCSid: $Id: xyzimage.csh,v 2.5 2008/08/25 04:50:32 greg Exp $
axel@0
     3
#
axel@0
     4
# Display one or more CIE XYZE pictures using ximage
axel@0
     5
#
axel@0
     6
set popt=""
axel@0
     7
if ( $?DISPLAY_PRIMARIES ) then
axel@0
     8
	set popt="-p $DISPLAY_PRIMARIES"
axel@0
     9
endif
axel@0
    10
set xiargs=""
axel@0
    11
set i=1
axel@0
    12
set firstarg=0
axel@0
    13
while ( $i <= $#argv && ! $firstarg )
axel@0
    14
	@ i1= $i + 1
axel@0
    15
	switch ( $argv[$i] )
axel@0
    16
	case -ge*:
axel@0
    17
	case -di*:
axel@0
    18
	case -g:
axel@0
    19
	case -c:
axel@0
    20
	case -e:
axel@0
    21
		if ( $i1 > $#argv ) goto notenough
axel@0
    22
		set xiargs=($xiargs $argv[$i] $argv[$i1])
axel@0
    23
		@ i1++
axel@0
    24
		breaksw
axel@0
    25
	case -d:
axel@0
    26
	case -b:
axel@0
    27
	case -m:
axel@0
    28
	case -f:
axel@0
    29
	case -s:
axel@0
    30
	case =*:
axel@0
    31
	case -o*:
axel@0
    32
		set xiargs=($xiargs $argv[$i])
axel@0
    33
		breaksw
axel@0
    34
	case -p:
axel@0
    35
		set popt="-p"
axel@0
    36
		while ( $i1 <= $i + 8 )
axel@0
    37
			if ( $i1 > $#argv ) goto notenough
axel@0
    38
			set popt="$popt $argv[$i1]"
axel@0
    39
			@ i1++
axel@0
    40
		end
axel@0
    41
		breaksw
axel@0
    42
	case -*:
axel@0
    43
		echo "Unknown option: $argv[$i]"
axel@0
    44
		exit 1
axel@0
    45
	default:
axel@0
    46
		set firstarg=$i
axel@0
    47
		breaksw
axel@0
    48
	endsw
axel@0
    49
	set i=$i1
axel@0
    50
end
axel@0
    51
set ecode=1
axel@0
    52
onintr quit
axel@0
    53
set td=`mktemp -d /tmp/xyz.XXXXXX`
axel@0
    54
if ( ! $firstarg ) then
axel@0
    55
	ra_xyze -r -u $popt > $td/stdin
axel@0
    56
	if ( $status ) goto quit
axel@0
    57
else
axel@0
    58
	set i=$firstarg
axel@0
    59
	while ( $i <= $#argv )
axel@0
    60
		ra_xyze -r -u $popt $argv[$i] $td/$argv[$i]:t
axel@0
    61
		if ( $status ) goto quit
axel@0
    62
		@ i++
axel@0
    63
	end
axel@0
    64
endif
axel@0
    65
ximage $xiargs $td/*
axel@0
    66
set ecode=$status
axel@0
    67
quit:
axel@0
    68
	rm -rf $td
axel@0
    69
	exit $ecode
axel@0
    70
notenough:
axel@0
    71
	echo "Missing arguments for $argv[$i] option"
axel@0
    72
	exit 1