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