拖了好久终于写完了
PixImage:
- Testing getWidth/getHeight on a 3x3 image. Input image:
- {0 0 0} {30 30 30} {80 80 80}
- {10 10 10} {120 120 120} {250 250 250}
- {240 240 240} {250 250 250} {255 255 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} {0 0 0}
- {100 100 100} {0 0 0}
- {100 100 100} {100 100 100}
- Good.
- Testing blurring on a 2x3 image.
- Good.
- Testing edge detection on a 2x3 image.
- Good.
复制代码
RunLengthEncoding:
- Testing one-parameter RunLengthEncoding constuctor on a 3x3 image. Input image:
- {0 0 0} {1 1 1} {2 2 2}
- {3 3 3} {4 4 4} {5 5 5}
- {6 6 6} {7 7 7} {8 8 8}
- Check completed! Encoded image:[[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]
- Check completed! Encoded image:[[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]
- width:3 height:3
- [[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]
- Testing getWidth/getHeight on a 3x3 encoding.
- Good.
- Testing toPixImage() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[42, 42, 42] 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]
- Check completed! Encoded image:[[42, 42, 42] 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]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[42, 42, 42] 2,[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]
- Check completed! Encoded image:[[42, 42, 42] 2,[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]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[42, 42, 42] 2,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[8, 8, 8] 1]
- Check completed! Encoded image:[[42, 42, 42] 2,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[8, 8, 8] 1]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[8, 8, 8] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[8, 8, 8] 1]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 2]
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 2]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[42, 42, 42] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[42, 42, 42] 1]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[42, 42, 42] 2]
- Check completed! Encoded image:[[0, 0, 0] 1,[42, 42, 42] 1,[2, 2, 2] 2,[4, 4, 4] 1,[5, 5, 5] 1,[6, 6, 6] 1,[42, 42, 42] 2]
- Good.
- Testing one-parameter RunLengthEncoding constuctor on another 3x3 image. Input image:
- {2 2 2} {2 2 2} {3 3 3}
- {3 3 3} {4 4 4} {4 4 4}
- {5 5 5} {5 5 5} {6 6 6}
- Check completed! Encoded image:[[2, 2, 2] 2,[3, 3, 3] 2,[4, 4, 4] 2,[5, 5, 5] 2,[6, 6, 6] 1]
- Check completed! Encoded image:[[2, 2, 2] 2,[3, 3, 3] 2,[4, 4, 4] 2,[5, 5, 5] 2,[6, 6, 6] 1]
- Testing getWidth/getHeight on a 3x3 encoding.
- Good.
- Testing toPixImage() on a 3x3 encoding.
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[2, 2, 2] 2,[3, 3, 3] 1,[2, 2, 2] 1,[4, 4, 4] 2,[5, 5, 5] 2,[6, 6, 6] 1]
- Check completed! Encoded image:[[2, 2, 2] 2,[3, 3, 3] 1,[2, 2, 2] 1,[4, 4, 4] 2,[5, 5, 5] 2,[6, 6, 6] 1]
- Good.
- Testing setPixel() on a 3x3 encoding.
- Check completed! Encoded image:[[2, 2, 2] 4,[4, 4, 4] 2,[5, 5, 5] 2,[6, 6, 6] 1]
- Check completed! Encoded image:[[2, 2, 2] 4,[4, 4, 4] 2,[5, 5, 5] 2,[6, 6, 6] 1]
- Good.
- Testing one-parameter RunLengthEncoding constuctor on a 5x2 image. Input image:
- {0 0 0} {1 1 1} {2 2 2} {3 3 3} {4 4 4}
- {5 5 5} {6 6 6} {7 7 7} {8 8 8} {9 9 9}
- Check completed! Encoded image:[[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] 1]
- Check completed! Encoded image:[[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] 1]
- Testing getWidth/getHeight on a 5x2 encoding.
- Good.
- Testing toPixImage() on a 5x2 encoding.
- Good.
- Testing setPixel() on a 5x2 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[2, 2, 2] 1,[3, 3, 3] 1,[6, 6, 6] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[8, 8, 8] 1,[9, 9, 9] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[2, 2, 2] 1,[3, 3, 3] 1,[6, 6, 6] 1,[5, 5, 5] 1,[6, 6, 6] 1,[7, 7, 7] 1,[8, 8, 8] 1,[9, 9, 9] 1]
- Good.
- Testing setPixel() on a 5x2 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[2, 2, 2] 1,[3, 3, 3] 1,[6, 6, 6] 3,[7, 7, 7] 1,[8, 8, 8] 1,[9, 9, 9] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[2, 2, 2] 1,[3, 3, 3] 1,[6, 6, 6] 3,[7, 7, 7] 1,[8, 8, 8] 1,[9, 9, 9] 1]
- Good.
- Testing setPixel() on a 5x2 encoding.
- Check completed! Encoded image:[[1, 1, 1] 2,[2, 2, 2] 1,[3, 3, 3] 1,[6, 6, 6] 3,[7, 7, 7] 1,[8, 8, 8] 1,[9, 9, 9] 1]
- Check completed! Encoded image:[[1, 1, 1] 2,[2, 2, 2] 1,[3, 3, 3] 1,[6, 6, 6] 3,[7, 7, 7] 1,[8, 8, 8] 1,[9, 9, 9] 1]
- Good.
- Testing one-parameter RunLengthEncoding constuctor on a 3x2 image. Input image:
- {0 0 0} {1 1 1} {2 2 2}
- {3 3 3} {4 4 4} {5 5 5}
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[2, 2, 2] 1,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[2, 2, 2] 1,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Testing getWidth/getHeight on a 3x2 encoding.
- Good.
- Testing toPixImage() on a 3x2 encoding.
- Good.
- Testing setPixel() on a 3x2 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[0, 0, 0] 1,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[0, 0, 0] 1,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Good.
- Testing setPixel() on a 3x2 encoding.
- Check completed! Encoded image:[[0, 0, 0] 3,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Check completed! Encoded image:[[0, 0, 0] 3,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Good.
- Testing setPixel() on a 3x2 encoding.
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[0, 0, 0] 1,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Check completed! Encoded image:[[0, 0, 0] 1,[1, 1, 1] 1,[0, 0, 0] 1,[3, 3, 3] 1,[4, 4, 4] 1,[5, 5, 5] 1]
- Good.
复制代码 |