Package boofcv.io.wrapper.images
Class BufferedFileImageSequence<T extends ImageBase<T>>
java.lang.Object
boofcv.io.wrapper.images.BufferedFileImageSequence<T>
- All Implemented Interfaces:
SimpleImageSequence<T>
public class BufferedFileImageSequence<T extends ImageBase<T>>
extends Object
implements SimpleImageSequence<T>
Loads or plays a sequence of buffered images.
-
Constructor Summary
ConstructorsConstructorDescriptionBufferedFileImageSequence(ImageType<T> type, BufferedImage[] orig) BufferedFileImageSequence(ImageType<T> type, File directory, String suffix) Will load an image sequence with no modification. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Call when done reading the image sequence.intReturns the number of the current frame in the sequence.Returns the image in the original format that it was read in as.intReturns the height of the current imagegetImage()Returns the currently loaded image in the sequenceReturns the type of class used to store the output imageintgetWidth()Returns the width of the current imagebooleanhasNext()True if there is another image to read and false if there are no more.next()Loads the next image into a BufferedImage and returns it.voidreset()Start reading the sequence from the startvoidsetLoop(boolean loop) Sets if the video should loop or not
-
Constructor Details
-
BufferedFileImageSequence
Will load an image sequence with no modification.- Parameters:
directory- The directory containing the images.suffix- The suffix that the images have.
-
BufferedFileImageSequence
-
-
Method Details
-
setLoop
public void setLoop(boolean loop) Description copied from interface:SimpleImageSequenceSets if the video should loop or not- Specified by:
setLoopin interfaceSimpleImageSequence<T extends ImageBase<T>>- Parameters:
loop- true for looping forever, false for once
-
getWidth
public int getWidth()Description copied from interface:SimpleImageSequenceReturns the width of the current image- Specified by:
getWidthin interfaceSimpleImageSequence<T extends ImageBase<T>>
-
getHeight
public int getHeight()Description copied from interface:SimpleImageSequenceReturns the height of the current image- Specified by:
getHeightin interfaceSimpleImageSequence<T extends ImageBase<T>>
-
hasNext
public boolean hasNext()True if there is another image to read and false if there are no more.- Specified by:
hasNextin interfaceSimpleImageSequence<T extends ImageBase<T>>- Returns:
- true if a new image is available.
-
next
Loads the next image into a BufferedImage and returns it. The same instance or a new instance of a BufferedImage might be returned each time. Don't rely on either behavior being consistent.- Specified by:
nextin interfaceSimpleImageSequence<T extends ImageBase<T>>- Returns:
- The next image in the sequence, which is now the current image.
-
getImage
Description copied from interface:SimpleImageSequenceReturns the currently loaded image in the sequence- Specified by:
getImagein interfaceSimpleImageSequence<T extends ImageBase<T>>
-
getGuiImage
Description copied from interface:SimpleImageSequenceReturns the image in the original format that it was read in as. When dealing with swing or any standard Java SE environment this will almost always be BufferedImage. The type has been abstracted out to provide better Android support.- Specified by:
getGuiImagein interfaceSimpleImageSequence<T extends ImageBase<T>>
-
getImageType
Description copied from interface:SimpleImageSequenceReturns the type of class used to store the output image- Specified by:
getImageTypein interfaceSimpleImageSequence<T extends ImageBase<T>>
-
getFrameNumber
public int getFrameNumber()Description copied from interface:SimpleImageSequenceReturns the number of the current frame in the sequence.- Specified by:
getFrameNumberin interfaceSimpleImageSequence<T extends ImageBase<T>>- Returns:
- Frame ID number.
-
close
public void close()Description copied from interface:SimpleImageSequenceCall when done reading the image sequence.- Specified by:
closein interfaceSimpleImageSequence<T extends ImageBase<T>>
-
reset
public void reset()Description copied from interface:SimpleImageSequenceStart reading the sequence from the start- Specified by:
resetin interfaceSimpleImageSequence<T extends ImageBase<T>>
-