活跃农民
- 积分
- 317
- 大米
- 颗
- 鳄梨
- 个
- 水井
- 尺
- 蓝莓
- 颗
- 萝卜
- 根
- 小米
- 粒
- 学分
- 个
- 注册时间
- 2016-8-24
- 最后登录
- 1970-1-1
|
拖了好久,总算把project1做完了。自己刚开始没有注意到这个RLE要求是逐行扫描像素。。。写成了逐列扫描像素,压缩后的图始终出不来。同时通过这次project也让我更加重视不同类型数据赋值的问题,自己好多bug都是和这个有关。- xiaojundeMacBook-Air:project1 apple$ javac PixImage.java
- xiaojundeMacBook-Air:project1 apple$ java PixImage
- Testing getWidth/getHeight on a 3x3 image. Input image:
- |[0,0]=0|[1,0]=30|[2,0]=80|
- |[0,1]=10|[1,1]=120|[2,1]=250|
- |[0,2]=240|[1,2]=250|[2,2]=255|
- Good.
- Testing blurring on a 3x3 image.
- Good.
- Good.
- Good.
- Testing edge detection on a 3x3 image.
- Good.
- Testing getWidth/getHeight on a 2x3 image. Input image:
- |[0,0]=0|[1,0]=0|
- |[0,1]=100|[1,1]=0|
- |[0,2]=100|[1,2]=100|
- Good.
- Testing blurring on a 2x3 image.
- Good.
- Testing edge detection on a 2x3 image.
- Good.
- xiaojundeMacBook-Air:project1 apple$ javac RunLengthEncoding.java
- xiaojundeMacBook-Air:project1 apple$ java RunLengthEncoding
- Testing one-parameter RunLengthEncoding constuctor on a 3x3 image. Input image:
- |[0,0]=0|[1,0]=1|[2,0]=2|
- |[0,1]=3|[1,1]=4|[2,1]=5|
- |[0,2]=6|[1,2]=7|[2,2]=8|
- |1 0 0 0 |1 1 1 1 |1 2 2 2 |1 3 3 3 |1 4 4 4 |1 5 5 5 |1 6 6 6 |1 7 7 7 |1 8 8 8 |
- Testing getWidth/getHeight on a 3x3 encoding.
- Good.
- Testing toPixImage() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing one-parameter RunLengthEncoding constuctor on another 3x3 image. Input image:
- |[0,0]=2|[1,0]=2|[2,0]=3|
- |[0,1]=3|[1,1]=4|[2,1]=4|
- |[0,2]=5|[1,2]=5|[2,2]=6|
- |2 2 2 2 |2 3 3 3 |2 4 4 4 |2 5 5 5 |1 6 6 6 |
- Testing getWidth/getHeight on a 3x3 encoding.
- Good.
- Testing toPixImage() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Good.
- Testing one-parameter RunLengthEncoding constuctor on a 5x2 image. Input image:
- |[0,0]=0|[1,0]=1|[2,0]=2|[3,0]=3|[4,0]=4|
- |[0,1]=5|[1,1]=6|[2,1]=7|[3,1]=8|[4,1]=9|
- |1 0 0 0 |1 1 1 1 |1 2 2 2 |1 3 3 3 |1 4 4 4 |1 5 5 5 |1 6 6 6 |1 7 7 7 |1 8 8 8 |1 9 9 9 |
- Testing getWidth/getHeight on a 5x2 encoding.
- Good.
- Testing toPixImage() on a 5x2 encoding.
- Good.
- Testing setPixel() on a 5x2 encoding.
- Good.
- Testing setPixel() on a 5x2 encoding.
- Good.
- Testing setPixel() on a 5x2 encoding.
- Good.
- Testing one-parameter RunLengthEncoding constuctor on a 3x2 image. Input image:
- |[0,0]=0|[1,0]=1|[2,0]=2|
- |[0,1]=3|[1,1]=4|[2,1]=5|
- |1 0 0 0 |1 1 1 1 |1 2 2 2 |1 3 3 3 |1 4 4 4 |1 5 5 5 |
- Testing getWidth/getHeight on a 3x2 encoding.
- Good.
- Testing toPixImage() on a 3x2 encoding.
- Good.
- Testing setPixel() on a 3x2 encoding.
- Good.
- Testing setPixel() on a 3x2 encoding.
- Good.
- Testing setPixel() on a 3x2 encoding.
- Good.
- xiaojundeMacBook-Air:project1 apple$
复制代码
|
|