home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / graphics / 13422 < prev    next >
Encoding:
Text File  |  1993-01-05  |  1.7 KB  |  39 lines

  1. Newsgroups: comp.graphics
  2. Path: sparky!uunet!zaphod.mps.ohio-state.edu!swrinde!cs.utexas.edu!torn!news.ccs.queensu.ca!hausner
  3. From: hausner@qucis.queensu.ca (Alejo Hausner)
  4. Subject: Re: fast bitmap rotation
  5. Message-ID: <C0EKAF.1oq@knot.ccs.queensu.ca>
  6. Sender: news@knot.ccs.queensu.ca (Netnews control)
  7. Organization: M.Sc, C.S, Queen's, Kingston, Canada.
  8. References: <726100620.1@freudsys.iaf> <1993Jan4.215419.7730@a.cs.okstate.edu>
  9. Date: Tue, 5 Jan 1993 22:39:50 GMT
  10. Lines: 27
  11.  
  12. In article <1993Jan4.215419.7730@a.cs.okstate.edu> jmccorm@a.cs.okstate.edu (MCCORMICK JOSHUA C) writes:
  13.  
  14. > From article <726100620.1@freudsys.iaf>, by
  15. > Renee.Teunissen@freudsys.iaf.nl (Renee Teunissen):
  16. >>
  17. >> I have the following "problem". for a Photo montage package i wrote a
  18. >> rotation tool for full color objects [bitmap images]. this program
  19. >> runs unther windows 3.1. but rotating these bitmaps goes very slow, eg
  20. >> if I do the same rotation [same image size and pixel depth] in
  21. >> PhotoStyler is goes much faster. anyone any smart idears about a
  22. >> pointer to a fast rotation algorithm ??
  23. >
  24. >x' = x * cos (radians) - y * sin (radians)
  25. >y' = y * cos (radians) + x * sin (radians)
  26.  
  27. I think Foley and van Dam point out that a rotation can be decomposed
  28. into two shears, one about the x axis and the other about the y.  If
  29. your pixel array is n x n, each of the shears can be done in O(n) time
  30. if the displacements for each row or column are pre-computed.  There
  31. will be O(n x n) additions.  However, the usual method you give uses
  32. O(n x n) multiplications, so it can be a lot slower.
  33.  
  34. I forget the way to decompose the rotation into two shears, but I can
  35. look it up.
  36.  
  37. Alejo Hausner (hausner@qucis.queensu.ca)
  38.