开发者

Java Image Processing using PGM files and Multi-Dimensional arrays

I'm in a intro CS class. We've been given a project where we've been supplied a basic file, and a few .PGM files of our school's mascot and things like that. Basically we're told开发者_StackOverflow中文版 that we need to use the framework they've written, and flip, rotate etc.. this file.

How do you flip or rotate clockwise a PGM file? I'm totally lost as what to do.


You may find this question useful How to read PGM images in Java? . You could use this to read into a 2D array. It should be fairly easy to rotate this by 90, 180 or -90 degrees (any other value will be a lot of work with interpolation).

The flip and rotate operations involving interchanging x and y values and/or changing the signs. This has some examples.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜