Rotating a bitmap 90 degrees

前端 未结 9 1894
粉色の甜心
粉色の甜心 2021-02-04 05:49

I have a one 64-bit integer, which I need to rotate 90 degrees in 8 x 8 area (preferably with straight bit-manipulation). I cannot figure out any handy algorith

9条回答
  •  我寻月下人不归
    2021-02-04 06:44

    If you look at this as a 2 dimensional array then you have the solution no? Just make the rows the new columns. First row is the last column, 2nd is the one before last and so on.

    Visually at least, it looks like your solution.

提交回复
热议问题