boofcv.io.wrapper.images
Class LoadFileImageSequence<T extends ImageBase>
- java.lang.Object
-
- boofcv.io.wrapper.images.LoadFileImageSequence<T>
-
- All Implemented Interfaces:
- SimpleImageSequence<T>
public class LoadFileImageSequence<T extends ImageBase> extends java.lang.Object implements SimpleImageSequence<T>
Loads all the images in a directory that have the specified suffix. If requested it can scale the images down. The order in which the images are returned is determined by Collections.sort() by file name.
-
-
Constructor Summary
Constructors Constructor and Description LoadFileImageSequence(ImageType<T> type, java.lang.String directory, java.lang.String suffix)Will load an image sequence with no modification.LoadFileImageSequence(ImageType<T> type, java.lang.String directory, java.lang.String suffix, int scalefactor)Will load an image sequence and then scale the images
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclose()Call when done reading the image sequence.intgetFrameNumber()Returns the number of the current frame in the sequence.java.awt.image.BufferedImagegetGuiImage()Returns the image in the original format that it was read in as.ImageType<T>getImageType()Returns the type of class used to store the output imageintgetIndex()intgetNextHeight()Returns the height of the next imageintgetNextWidth()Returns the width of the next imagebooleanhasNext()True if there is another image to read and false if there are no more.booleanisLoop()Tnext()Loads the next image into a BufferedImage and returns it.voidreset()Start reading the sequence from the startvoidsetIndex(int index)voidsetLoop(boolean loop)Sets if the video should loop or not
-
-
-
Constructor Detail
-
LoadFileImageSequence
public LoadFileImageSequence(ImageType<T> type, java.lang.String directory, java.lang.String suffix)
Will load an image sequence with no modification.- Parameters:
directory- The directory containing the images.suffix- The suffix that the images have.
-
LoadFileImageSequence
public LoadFileImageSequence(ImageType<T> type, java.lang.String directory, java.lang.String suffix, int scalefactor)
Will load an image sequence and then scale the images- Parameters:
directory- The directory containing the images.suffix- The suffix that the images have.scalefactor- How much the images will be scaled down by.
-
-
Method Detail
-
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>- Parameters:
loop- true for looping forever, false for once
-
isLoop
public boolean isLoop()
-
getNextWidth
public int getNextWidth()
Description copied from interface:SimpleImageSequenceReturns the width of the next image- Specified by:
getNextWidthin interfaceSimpleImageSequence<T extends ImageBase>
-
getNextHeight
public int getNextHeight()
Description copied from interface:SimpleImageSequenceReturns the height of the next image- Specified by:
getNextHeightin interfaceSimpleImageSequence<T extends ImageBase>
-
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>- Returns:
- true if a new image is available.
-
next
public T 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>- Returns:
- A BufferedImage containing the next image.
-
getGuiImage
public java.awt.image.BufferedImage 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>- Returns:
-
getImageType
public ImageType<T> getImageType()
Description copied from interface:SimpleImageSequenceReturns the type of class used to store the output image- Specified by:
getImageTypein interfaceSimpleImageSequence<T extends ImageBase>
-
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>- 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>
-
reset
public void reset()
Description copied from interface:SimpleImageSequenceStart reading the sequence from the start- Specified by:
resetin interfaceSimpleImageSequence<T extends ImageBase>
-
getIndex
public int getIndex()
-
setIndex
public void setIndex(int index)
-
-
DataMelt 3.0 © DataMelt by jWork.ORG