Kevin wrote:
[color=blue]
> Hello,
>
> I need to some help in reversing an 2-dimensional array. I am working
> with gif images and I am trying to make the mirror image. I was
> hoping that someone could help give me a headstart in how I can
> accomplish this. Also, I don't know the the size of the array before
> hand as the image can be any size. I already have the my read and
> write gif functions working, but I just need to know how to reverse
> the contents.
>
> Thanks for your help in advance.[/color]
I've always found that assembly languages are best at bit manipulation.
Your processor may have some instructions that will be more efficient
than C++ code.
I suggest you ask about image transformations in a graphics newsgroup.
They will probably have better algorithms there.
You could treat the graphic as a matrix and apply a transformation
to it.
You could copy the bits, row by row, in a reverse order to another
image or matrix.
You could write a multi-bit swap routine and apply it to each row.
.....
--
Thomas Matthews
C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq:
http://www.parashift.com/c++-faq-lite
C Faq:
http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.learn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book