[alt.graphics.pixutils] how to give pnmrotate a negative angle?

cca13@seq1.keele.ac.uk (G.D. Pratt) (02/06/91)

Can anyone tell me how to tell the pnmrotate command, in the new
beta release of PBMPLUS, how to rotate the image by a negative angle
since it appears to take the "-" as the flag symbol as in:-

	pnmrotate -10 < turing.pgm > fred.pgm
	usage:  pnmrotate [-noantialias] <angle> [pnmfile]

many thanks,

gerry

-- 
gerry pratt  --  workstation support  --  university of keele
email:  gerry@seq1.keele.ac.uk   *   tel:  0782 621111 x 3290
"these opinions are mine, mine, mine....ALL MINE I TELL YOU!"

jef@well.sf.ca.us (Jef Poskanzer) (02/07/91)

In the referenced message, cca13@seq1.keele.ac.uk (G.D. Pratt) wrote:
}Can anyone tell me how to tell the pnmrotate command, in the new
}beta release of PBMPLUS, how to rotate the image by a negative angle
}since it appears to take the "-" as the flag symbol

Yes, that's a bug, introduced when I added the -noantialias flag.
pnmshear has the same problem.  Until the next patch comes out you
can work around it using pnmflip.  For example, to do a -20 rotate,
you could instead do pnmflip -lr | pnmrotate 20 | pnmflip -lr.
---
Jef

  Jef Poskanzer  jef@well.sf.ca.us  {apple, ucbvax, hplabs}!well!jef
 "If you give me six lines written by the most honest man, I will find
       something in them to hang him." -- Cardinal de Richelieu

rslau@tarazed.usc.edu (Robert Lau) (02/07/91)

In article <865@keele.keele.ac.uk> cca13@seq1.keele.ac.uk (G.D. Pratt) writes:

   Can anyone tell me how to tell the pnmrotate command, in the new
   beta release of PBMPLUS, how to rotate the image by a negative angle
   since it appears to take the "-" as the flag symbol as in:-

	   pnmrotate -10 < turing.pgm > fred.pgm
	   usage:  pnmrotate [-noantialias] <angle> [pnmfile]

from the source:

    if ( argn < argc && argv[argn][0] == '-' && argv[argn][1] != '\0' )
        {
        if ( pm_keymatch( argv[argn], "-antialias", 2 ) )
            antialias = 1;
        else if ( pm_keymatch( argv[argn], "-noantialias", 2 ) )
            antialias = 0;
        else
            pm_usage( usage );
        ++argn;
        }

    if ( argn == argc )
        pm_usage( usage );
    if ( sscanf( argv[argn], "%f", &fangle ) != 1 )
        pm_usage( usage );

It only checks the first flagged option, so if you want a negative angle,
you'll need to add a -antialias (yes, it's the default but...) followed
by the negative angle:

  pnmrotate -antialias -45 < {file}.ppm > {file}.ppm.rot

Bug?  nah :)

-robert
-- 
Robert Lau					213.740.2866
  Unix Systems					Internet: rslau@usc.edu
  University Computing Services			UUCP:     ...!uunet!usc!rslau
  University of Southern California		Bitnet:   RSLAU@GAMERA

mcastle@mcs213f.cs.umr.edu (Mike Castle {Nexus}) (02/07/91)

I've only used pbmplus once, so I'm not sure about it's limitations, but,
why wouldn't
  pnmrotate 340 .....

work as well as 
  pnmrotate -20

Would it result in more work, of does it have to be <= 180 ???

Just curious....
-- 
Mike Castle (Nexus) S087891@UMRVMA.UMR.EDU (preferred)       | RN ate my 
                mcastle@mcs213k.cs.umr.edu (unix mail-YEACH!)| .newsrc!
Life is like a clock:  You can work constantly, and be right | I am not
all the time, or not work at all, and be right twice a day.  | happy :-<