Changeset 3153
- Timestamp:
- 10/12/07 18:29:41 (6 years ago)
- File:
-
- 1 edited
-
trunk/src/host/splash/splashimg.pl (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/host/splash/splashimg.pl
r1065 r3153 22 22 # 23 23 24 25 %bpp = 16; 26 27 24 28 sub usage 25 29 { 26 print STDERR "usage: $0 [ System_boot.png]\n";30 print STDERR "usage: $0 [-32] [-pnm] [System_boot.png]\n"; 27 31 exit(1); 28 32 } 29 33 34 35 while ($ARGV[0] =~ /^-[^-]/) { 36 if ($ARGV[0] eq "-32") { 37 $bpp = 32; 38 shift @ARGV; 39 } 40 elsif ($ARGV[0] eq "-pnm") { 41 $pnm = 1; 42 shift @ARGV; 43 } 44 else { 45 die "unrecognized option: \"$ARGV[0]\""; 46 } 47 } 30 48 31 49 &usage unless $#ARGV < 2; … … 37 55 } 38 56 39 $cmd = "pngtopnm '$file' | ppmtorgb3"; 57 if ($pnm) { 58 $cmd = "cat '$file' | ppmtorgb3"; 59 } 60 else { 61 $cmd = "pngtopnm '$file' | ppmtorgb3"; 62 } 40 63 41 64 system($cmd) && die "system \"$cmd\": $?"; … … 57 80 $g = unpack("C",substr($p{"grn"},$i,1)); 58 81 $b = unpack("C",substr($p{"blu"},$i,1)); 59 $v = ($r >> 3) << 11 | ($g >> 2) << 5 | ($b >> 3); 60 print pack("v",$v) || die "print: $!"; 82 if ($bpp == 16) { 83 $v = ($r >> 3) << 11 | ($g >> 2) << 5 | ($b >> 3); 84 print pack("v",$v) || die "print: $!"; 85 } 86 else { 87 $v = ($r) << 16 | ($g) << 8 | $b; 88 print pack("V",$v) || die "print: $!"; 89 } 61 90 }
Note: See TracChangeset
for help on using the changeset viewer.
