Article View: comp.graphics.algorithms
Article #7890 degree rotation algorithm.
From: Sim Zacks
Date: Mon, 07 Dec 1998 00:00
Date: Mon, 07 Dec 1998 00:00
19 lines
1361 bytes
1361 bytes
Could you please look at the algorithm I just figured out and tell me what you think of it. If there's a better method, or anything, please let me know. I am dealing with 1 bit per pixel images. 90 degree rotation 1. Imagewidth := pixels per row 2. Imageheight := pixels per column 3. Newrownumber := imageheight � rownum +1 4. Firstpixelinrow := imagewidth * (rownumber-1) +1 5. Pixelnuminrow := pixelnum � first pixel in row 6. Newpixelnum := pixelnuminrow * imageheight+newrownumber; 7. CorrectByte := newpixelnum div 8 + 1; 8. Allocate enough memory for new image 9. Fill the memory with 0�s 10. AND the current byte to get the current pixel 11. OR the current Pixel with the Byte you want to put it into 12. Do this for entire image.
Technical Details
Message-ID:
<366C0D35.6B526E61@imprsv.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: fdc2a,2557fc568053e596,start X-Google-Attributes: gidfdc2a,public X-Google-Thread: 10a296,2557fc568053e596,start X-Google-Attributes: gid10a296,public From: Sim Zacks <szacks@imprsv.com> Subject: 90 degree rotation algorithm. Date: 1998/12/07 Message-ID: <366C0D35.6B526E61@imprsv.com> X-Deja-AN: 419688520 Content-Transfer-Encoding: 8bit X-Accept-Language: en Content-Type: text/plain; charset=iso-8859-1 Organization: Impressive Solutions Mime-Version: 1.0 Newsgroups: comp.graphics.algorithms,borland.public.delphi.graphics