Class FixedIntervalBufferedImageSampler
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.flow.transformer.movieimagesampler.AbstractMovieImageSampler<adams.data.image.BufferedImageContainer>
-
- adams.flow.transformer.movieimagesampler.AbstractBufferedImageMovieImageSampler
-
- adams.flow.transformer.movieimagesampler.FixedIntervalBufferedImageSampler
-
- All Implemented Interfaces:
adams.core.Destroyable,adams.core.GlobalInfoSupporter,adams.core.logging.LoggingLevelHandler,adams.core.logging.LoggingSupporter,adams.core.option.OptionHandler,adams.core.SizeOfHandler,adams.core.Stoppable,Serializable
public class FixedIntervalBufferedImageSampler extends AbstractBufferedImageMovieImageSampler
Generates a specified number of image samples at fixed intervals.
-logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel) The logging level for outputting errors and debugging output. default: WARNING
-offset <adams.core.base.BaseTimeMsec> (property: offset) The offset for the samples, i.e., before starting the sampling. default: -INF
-interval <int> (property: interval) The interval in milli-seconds between samples. default: 1000 minimum: 1
-num-samples <int> (property: numSamples) The number of samples to take. default: 10 minimum: 1
- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intm_Intervalthe interval in msec between the .protected longm_LastPtsWritethe last frame write.protected com.xuggle.mediatool.MediaListenerAdapterm_Listenerthe listener to use.protected longm_MicroSecondsBetweenFramesthe interval for the frames.protected intm_NumSamplesthe number of samples to generate.protected adams.core.base.BaseTimeMsecm_Offsetthe offset.protected com.xuggle.mediatool.IMediaReaderm_Readerthe reader to use.protected List<adams.data.image.BufferedImageContainer>m_Samplesthe samples.protected intm_VideoStreamIndexThe video stream index, used to ensure we display frames from one and only one video stream from the media container.-
Fields inherited from class adams.flow.transformer.movieimagesampler.AbstractMovieImageSampler
m_Stopped
-
-
Constructor Summary
Constructors Constructor Description FixedIntervalBufferedImageSampler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected adams.data.image.BufferedImageContainer[]doSample(File file)Samples images from a movie file.intgetInterval()Returns the interval between samples in milli-seconds.intgetNumSamples()Returns the number of samples to take.adams.core.base.BaseTimeMsecgetOffset()Returns the offset for the samples.StringglobalInfo()Returns a string describing the object.StringintervalTipText()Returns the tip text for this property.StringnumSamplesTipText()Returns the tip text for this property.StringoffsetTipText()Returns the tip text for this property.voidsetInterval(int value)Sets the interval in milli-seconds between samples.voidsetNumSamples(int value)Sets the number of samples to take.voidsetOffset(adams.core.base.BaseTimeMsec value)Sets the offset for the samples.-
Methods inherited from class adams.flow.transformer.movieimagesampler.AbstractBufferedImageMovieImageSampler
generates
-
Methods inherited from class adams.flow.transformer.movieimagesampler.AbstractMovieImageSampler
check, sample, stopExecution
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, reset, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
-
-
-
Field Detail
-
m_NumSamples
protected int m_NumSamples
the number of samples to generate.
-
m_Offset
protected adams.core.base.BaseTimeMsec m_Offset
the offset.
-
m_Interval
protected int m_Interval
the interval in msec between the .
-
m_Reader
protected transient com.xuggle.mediatool.IMediaReader m_Reader
the reader to use.
-
m_Listener
protected transient com.xuggle.mediatool.MediaListenerAdapter m_Listener
the listener to use.
-
m_LastPtsWrite
protected long m_LastPtsWrite
the last frame write.
-
m_MicroSecondsBetweenFrames
protected long m_MicroSecondsBetweenFrames
the interval for the frames.
-
m_VideoStreamIndex
protected int m_VideoStreamIndex
The video stream index, used to ensure we display frames from one and only one video stream from the media container.
-
m_Samples
protected List<adams.data.image.BufferedImageContainer> m_Samples
the samples.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceadams.core.GlobalInfoSupporter- Specified by:
globalInfoin classadams.core.option.AbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceadams.core.option.OptionHandler- Overrides:
defineOptionsin classadams.core.option.AbstractOptionHandler
-
setOffset
public void setOffset(adams.core.base.BaseTimeMsec value)
Sets the offset for the samples.- Parameters:
value- the offset
-
getOffset
public adams.core.base.BaseTimeMsec getOffset()
Returns the offset for the samples.- Returns:
- the offset
-
offsetTipText
public String offsetTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setInterval
public void setInterval(int value)
Sets the interval in milli-seconds between samples.- Parameters:
value- the interval
-
getInterval
public int getInterval()
Returns the interval between samples in milli-seconds.- Returns:
- the interval
-
intervalTipText
public String intervalTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
setNumSamples
public void setNumSamples(int value)
Sets the number of samples to take.- Parameters:
value- the number
-
getNumSamples
public int getNumSamples()
Returns the number of samples to take.- Returns:
- the number
-
numSamplesTipText
public String numSamplesTipText()
Returns the tip text for this property.- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doSample
protected adams.data.image.BufferedImageContainer[] doSample(File file)
Samples images from a movie file.- Specified by:
doSamplein classAbstractMovieImageSampler<adams.data.image.BufferedImageContainer>- Parameters:
file- the movie to sample- Returns:
- the samples
-
-