()
| 143 | } |
| 144 | |
| 145 | public ImageProcessor crop() { |
| 146 | ImageProcessor ip2 = createProcessor(roiWidth, roiHeight); |
| 147 | byte[] pixels2 = (byte[])ip2.getPixels(); |
| 148 | for (int ys=roiY; ys<roiY+roiHeight; ys++) { |
| 149 | int offset1 = (ys-roiY)*roiWidth; |
| 150 | int offset2 = ys*width+roiX; |
| 151 | for (int xs=0; xs<roiWidth; xs++) |
| 152 | pixels2[offset1++] = pixels[offset2++]; |
| 153 | } |
| 154 | return ip2; |
| 155 | } |
| 156 | |
| 157 | /** Returns a duplicate of this image. */ |
| 158 | public ImageProcessor duplicate() { |
no test coverage detected