55
55
import java .io .IOException ;
56
56
57
57
import net .imagej .axis .Axes ;
58
+ import net .imglib2 .Interval ;
58
59
59
- import org .scijava .log .LogService ;
60
- import org .scijava .plugin .Parameter ;
61
- import org .scijava .plugin .Plugin ;
62
-
60
+ import org .bytedeco .javacpp .opencv_core .IplImage ;
63
61
import org .bytedeco .javacv .FFmpegFrameGrabber ;
64
62
import org .bytedeco .javacv .FFmpegFrameRecorder ;
65
63
import org .bytedeco .javacv .FrameGrabber ;
66
64
import org .bytedeco .javacv .FrameRecorder ;
67
- import org .bytedeco .javacpp .opencv_core .IplImage ;
65
+ import org .scijava .log .LogService ;
66
+ import org .scijava .plugin .Parameter ;
67
+ import org .scijava .plugin .Plugin ;
68
68
69
69
/**
70
70
* A SCIFIO format for reading and writing movies using JavaCV.
@@ -205,7 +205,8 @@ public synchronized void close() throws IOException {
205
205
206
206
@ Override
207
207
public void writePlane (int imageIndex , long planeIndex , Plane plane ,
208
- long [] min , long [] max ) throws FormatException , IOException {
208
+ Interval bounds ) throws FormatException , IOException
209
+ {
209
210
if (imageIndex != 0 ) {
210
211
throw new IllegalArgumentException ("Invalid image index: " + imageIndex );
211
212
}
@@ -215,7 +216,7 @@ public void writePlane(int imageIndex, long planeIndex, Plane plane,
215
216
}
216
217
Metadata meta = getMetadata ();
217
218
218
- if (!SCIFIOMetadataTools .wholePlane (imageIndex , meta , min , max )) {
219
+ if (!SCIFIOMetadataTools .wholePlane (imageIndex , meta , bounds )) {
219
220
throw new FormatException (
220
221
"MovieWriter does not yet support saving image tiles." );
221
222
}
@@ -297,15 +298,16 @@ public void close() throws IOException {
297
298
298
299
@ Override
299
300
public BufferedImagePlane openPlane (int imageIndex , long planeIndex ,
300
- BufferedImagePlane plane , long [] min , long [] max )
301
- throws FormatException , IOException {
302
- return openPlane (imageIndex , planeIndex , plane , min , max , null );
301
+ BufferedImagePlane plane , Interval bounds ) throws FormatException ,
302
+ IOException
303
+ {
304
+ return openPlane (imageIndex , planeIndex , plane , bounds , null );
303
305
}
304
306
305
307
@ Override
306
308
public BufferedImagePlane openPlane (int imageIndex , long planeIndex ,
307
- BufferedImagePlane plane , long [] min , long [] max ,
308
- SCIFIOConfig config ) throws FormatException , IOException
309
+ BufferedImagePlane plane , Interval bounds , SCIFIOConfig config )
310
+ throws FormatException , IOException
309
311
{
310
312
if (imageIndex != 0 ) {
311
313
throw new IllegalArgumentException ("Illegal image index: " + imageIndex );
@@ -318,7 +320,9 @@ public BufferedImagePlane openPlane(int imageIndex, long planeIndex,
318
320
try {
319
321
final BufferedImage image = grabber .grab ().getBufferedImage ();
320
322
nextPlaneIndex ++;
321
- plane .setData (AWTImageTools .getSubimage (image , false , (int ) min [0 ], (int ) min [1 ], (int ) max [0 ], (int ) max [1 ]));
323
+ plane .setData (AWTImageTools .getSubimage (image , false , //
324
+ (int ) bounds .min (0 ), (int ) bounds .min (1 ), //
325
+ (int ) bounds .max (0 ), (int ) bounds .max (1 )));
322
326
return plane ;
323
327
} catch (FrameGrabber .Exception e ) {
324
328
throw new IOException (e );
0 commit comments