Re: 90 Rotation in one buffer only



and here is clockwise rotate:

public void rotate() {
int w = width - 1;
int h = height - 1;
int w2 = width / 2;
int h2 = height / 2;
int tmp;

for (int y = 0; y < h2; y++) {
for (int x = 0; x < w2; x++) {
tmp = getPixel(x, y);
setPixel(x, y, getPixel(y, h - x));
setPixel(y, h - x, getPixel(w - x, h - y));
setPixel(w - x, h - y, getPixel(w - y, x));
setPixel(w - y, x, tmp);
}
}
}


--
Andrey Kuznetsov
http://uio.imagero.com Unified I/O for Java
http://reader.imagero.com Java image reader
http://jgui.imagero.com Java GUI components and utilities


.



Relevant Pages

  • Re: pinpoint desk location
    ... for the book are provided in two languages, I think Java and C++. ... been able to find the book for a few years, but there is a web site in which ... Prev by Date: ...
    (microsoft.public.vb.winapi)
  • A quand un referendum Pan Canadien Sur la Peine de mort?
    ... Le criss de fou ou le juge qui l'a lache (loose) ... Java ... Prev by Date: ...
    (soc.culture.quebec)
  • Re: Problem with focus
    ... you can download jgui source and search for SwingUtilities.invokeLater ... http://uio.dev.java.net Unified I/O for Java ... http://reader.imagero.com Java image reader ... http://jgui.imagero.com Java GUI components and utilities ...
    (comp.lang.java.gui)
  • Re: How to call DOS cmd?
    ... which should save me much time to re-invent the wheel in java - if I'm ... Prev by Date: ...
    (comp.lang.java.programmer)
  • Re: Check of GUI layout requested..
    ... More errors (click on empty frame list): ... http://uio.imagero.com Unified I/O for Java ... http://jgui.imagero.com Java GUI components and utilities ... Prev by Date: ...
    (comp.lang.java.help)