(ImageProcessor ip)
| 135 | } |
| 136 | |
| 137 | private ImageProcessor convertType(ImageProcessor ip) { |
| 138 | int newBitDepth = ip.getBitDepth(); |
| 139 | if (this.bitDepth==0) |
| 140 | this.bitDepth = newBitDepth; |
| 141 | if (this.bitDepth!=newBitDepth) { |
| 142 | switch (this.bitDepth) { |
| 143 | case 8: ip=ip.convertToByte(true); break; |
| 144 | case 16: ip=ip.convertToShort(true); break; |
| 145 | case 24: ip=ip.convertToRGB(); break; |
| 146 | case 32: ip=ip.convertToFloat(); break; |
| 147 | } |
| 148 | } |
| 149 | return ip; |
| 150 | } |
| 151 | |
| 152 | /** Adds the image in 'ip' to the stack following slice 'n'. Adds |
| 153 | the slice to the beginning of the stack if 'n' is zero. */ |
no test coverage detected