🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.graphics.algorithms
Article #79

Re: 90 degree rotation algorithm.

#79
From: Sim Zacks
Date: Mon, 07 Dec 1998 00:00
24 lines
1524 bytes
I screwed up in calculating the new pixel number.
Can anyone help?

Sim Zacks wrote:

> 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: <366C2FA7.6FAA5E69@imprsv.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <366C0D35.6B526E61@imprsv.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: 10a296,2557fc568053e596
X-Google-Attributes: gid10a296,public
X-Google-Thread: fdc2a,2557fc568053e596
X-Google-Attributes: gidfdc2a,public
From: Sim Zacks <szacks@imprsv.com>
Subject: Re: 90 degree rotation algorithm.
Date: 1998/12/07
Message-ID: <366C2FA7.6FAA5E69@imprsv.com>
X-Deja-AN: 419731736
Content-Transfer-Encoding: 8bit
References: <366C0D35.6B526E61@imprsv.com>
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