about summary refs log tree commit diff
path: root/editor
diff options
context:
space:
mode:
Diffstat (limited to 'editor')
-rwxr-xr-xeditor/pnmquant19
1 files changed, 17 insertions, 2 deletions
diff --git a/editor/pnmquant b/editor/pnmquant
index 80d8e09f..827d6fde 100755
--- a/editor/pnmquant
+++ b/editor/pnmquant
@@ -199,10 +199,10 @@ sub openSeekableAsStdin($) {
 
 
 
-sub makeColormap($$$$$$) {
+sub makeColormap($$$$$$$) {
 
     my ($ncolors, $opt_center, $opt_meanpixel, $opt_meancolor,
-        $opt_spreadluminosity, $opt_quiet) = @_;
+        $opt_spreadbrightness, $opt_spreadluminosity, $opt_quiet) = @_;
 
     # Make a colormap of $ncolors colors from the image on Standard Input.
     # Put it in a temporary file and return its name.
@@ -235,6 +235,16 @@ sub makeColormap($$$$$$) {
         $averageOpt = "-center";
     }
 
+    my $spreadOptCt =
+        (defined($opt_spreadluminosity) ? 1 : 0) +
+        (defined($opt_spreadbrightness) ? 1 : 0);
+
+    if ($spreadOptCt > 1) {
+        print(STDERR "You can specify only one of " .
+              "-spreadluminosity and -spreadbrightness\n");
+        exit(1);
+    }
+
     my $spreadOpt;
     if (defined($opt_spreadluminosity)) {
         $spreadOpt = "-spreadluminosity";
@@ -276,6 +286,10 @@ sub remap($$$$$$) {
         push(@options, "-floyd");
     }
     if ($opt_norandom) {
+        if (defined($opt_randomseed)) {
+             print(STDERR "You cannot specify -randomseed with -norandom\n");
+             exit(1);
+        }
         push(@options, "-norandom");
     }
     if (defined($opt_randomseed)) {
@@ -322,6 +336,7 @@ my $mapfileSpec = makeColormap($cmdlineR->{ncolors},
                                $cmdlineR->{center}, 
                                $cmdlineR->{meanpixel}, 
                                $cmdlineR->{meancolor}, 
+                               $cmdlineR->{spreadbrightness},
                                $cmdlineR->{spreadluminosity},
                                $cmdlineR->{quiet});