(ImageRoi roi, int options)
| 400 | } |
| 401 | |
| 402 | private int saveImageRoi(ImageRoi roi, int options) { |
| 403 | byte[] bytes = roi.getSerializedImage(); |
| 404 | int imageSize = bytes.length; |
| 405 | byte[] data2 = new byte[HEADER_SIZE+HEADER2_SIZE+imageSize+roiNameSize+roiPropsSize]; |
| 406 | System.arraycopy(data, 0, data2, 0, HEADER_SIZE); |
| 407 | data = data2; |
| 408 | putShort(RoiDecoder.SUBTYPE, RoiDecoder.IMAGE); |
| 409 | for (int i=0; i<imageSize; i++) |
| 410 | putByte(HEADER_SIZE+i, bytes[i]&255); |
| 411 | int hdr2Offset = HEADER_SIZE+imageSize; |
| 412 | double opacity = roi.getOpacity(); |
| 413 | putByte(hdr2Offset+RoiDecoder.IMAGE_OPACITY, (int)(opacity*255.0)); |
| 414 | putInt(hdr2Offset+RoiDecoder.IMAGE_SIZE, imageSize); |
| 415 | if (roi.getZeroTransparent()) |
| 416 | options |= RoiDecoder.ZERO_TRANSPARENT; |
| 417 | putHeader2(roi, hdr2Offset); |
| 418 | return options; |
| 419 | } |
| 420 | |
| 421 | void putHeader2(Roi roi, int hdr2Offset) { |
| 422 | //ij.IJ.log("putHeader2: "+hdr2Offset+" "+roiNameSize+" "+roiName); |
no test coverage detected