(Image parImage, int parWidth, int parHeight)
| 125 | * |
| 126 | */ |
| 127 | private boolean convertImage (Image parImage, int parWidth, int parHeight) { |
| 128 | int pad; |
| 129 | if(biBitCount == 24) |
| 130 | intBitmap = (int[]) imp.getProcessor().getPixels(); |
| 131 | else |
| 132 | byteBitmap = (byte[]) imp.getProcessor().convertToByte(true).getPixels(); |
| 133 | biWidth = parWidth; |
| 134 | biHeight = parHeight; |
| 135 | if(biBitCount==24) |
| 136 | pad = 4 - ((biWidth * 3) % 4); |
| 137 | else |
| 138 | pad = 4 - ((biWidth) % 4); |
| 139 | if (pad == 4) // <==== Bug correction |
| 140 | pad = 0; // <==== Bug correction |
| 141 | padWidth = biWidth*(biBitCount==24?3:1)+pad; |
| 142 | return (true); |
| 143 | } |
| 144 | |
| 145 | /* |
| 146 | * writeBitmap converts the image returned from the pixel grabber to |
no test coverage detected