Re: 90 Rotation in one buffer only
- From: Thomas Richter <thor@xxxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: 24 Nov 2005 17:15:22 GMT
Hi,
> //image width and height
> int w, h;
> //only first quadrant
> int w2 = w / 2;
> int h2 = h / 2;
> //loop through pixels
> for(int j = 0; j < h2; j++) {
> for(int i = 0; i < w2; i++) {
> tmp = getPixel(i, j);
> setPixel(i, j, getPixel(i, h - j));
> setPixel(i, h - j, getPixel(w - i, h - j));
> setPixel(w - i, h - j, getPixel(w - i, j));
> setPixel(w - i, j, tmp);
> }
> }
Except that this doesn't work. If you split your image into four parts,
labeled 1,2,3,4 from left to right, top to bottom, this flips 3 to 1, 4 to
3, 2 to 4 and 1 to 2. However, each of these operations is a mirroring.
If 1,2,3,4 contain letters, they will come out "left handed" after this
operation has been performed. Thus, no rotataion here, sorry.
So long,
Thomas
.
- Follow-Ups:
- Re: 90 Rotation in one buffer only
- From: Andrey Kuznetsov
- Re: 90 Rotation in one buffer only
- From: Andrey Kuznetsov
- Re: 90 Rotation in one buffer only
- References:
- 90 Rotation in one buffer only
- From: Naresh
- Re: 90 Rotation in one buffer only
- From: Andrey Kuznetsov
- 90 Rotation in one buffer only
- Prev by Date: Re: 90 Rotation in one buffer only
- Next by Date: Re: 90 Rotation in one buffer only
- Previous by thread: Re: 90 Rotation in one buffer only
- Next by thread: Re: 90 Rotation in one buffer only
- Index(es):
Relevant Pages
|