Class ImageSequenceReference
- All Implemented Interfaces:
java.lang.AutoCloseable
public class ImageSequenceReference extends MediaReference
Image sequences can have URLs with discontinuous frame numbers, for instance if you've only rendered every other frame in a sequence, your frame numbers may be 1, 3, 5, etc. This is configured using the ``frame_step`` attribute. In this case, the 0th image in the sequence is frame 1 and the 1st image in the sequence is frame 3. Because of this there are two numbering concepts in the image sequence, the image number and the frame number.
Frame numbers are the integer numbers used in the frame file name. Image numbers are the 0-index based numbers of the frames available in the reference. Frame numbers can be discontinuous, image numbers will always be zero to the total count of frames minus 1.
Negative startFrame is also handled. eg: - "file:///show/sequence/shot/sample_image_sequence.-0001.exr" - "file:///show/sequence/shot/sample_image_sequence.0000.exr" - "file:///show/sequence/shot/sample_image_sequence.0001.exr"
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ImageSequenceReference.ImageSequenceReferenceBuilder
static class
ImageSequenceReference.MissingFramePolicy
enum ImageSequenceReference.MissingFramePolicy directive for how frames in sequence not found on disk should be handled.Nested classes/interfaces inherited from class io.opentimeline.opentimelineio.MediaReference
MediaReference.MediaReferenceBuilder
Nested classes/interfaces inherited from class io.opentimeline.opentimelineio.SerializableObjectWithMetadata
SerializableObjectWithMetadata.SerializableObjectWithMetadataBuilder
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
ImageSequenceReference()
ImageSequenceReference(ImageSequenceReference.ImageSequenceReferenceBuilder imageSequenceReferenceBuilder)
ImageSequenceReference(java.lang.String targetURLBase, java.lang.String namePrefix, java.lang.String nameSuffix, int startFrame, int frameStep, double rate, int frameZeroPadding, ImageSequenceReference.MissingFramePolicy missingFramePolicy, TimeRange availableRange, AnyDictionary metadata)
-
Method Summary
Modifier and Type Method Description java.lang.String
getAbstractTargetURL(java.lang.String symbol)
Generates a target url for a frame where `symbol` is used in place of the frame number.int
getEndFrame()
int
getFrameForTime(RationalTime rationalTime, ErrorStatus errorStatus)
Pair<java.lang.Integer,java.lang.Integer>
getFrameRangeForTimeRange(TimeRange timeRange, ErrorStatus errorStatus)
Returns a Pair<Integer, Integer> containing the first and last frame numbers for the given time range in the reference.int
getFrameStep()
int
getFrameZeroPadding()
ImageSequenceReference.MissingFramePolicy
getMissingFramePolicy()
java.lang.String
getNamePrefix()
java.lang.String
getNameSuffix()
int
getNumberOfImagesInSequence()
double
getRate()
int
getStartFrame()
java.lang.String
getTargetURLBase()
java.lang.String
getTargetURLForImageNumber(int imageNumber, ErrorStatus errorStatus)
RationalTime
presentationTimeForImageNumber(int imageNumber, ErrorStatus errorStatus)
void
setFrameStep(int frameStep)
void
setFrameZeroPadding(int frameZeroPadding)
void
setMissingFramePolicy(ImageSequenceReference.MissingFramePolicy missingFramePolicy)
void
setNamePrefix(java.lang.String namePrefix)
void
setNameSuffix(java.lang.String nameSuffix)
void
setRate(double rate)
void
setStartFrame(int startFrame)
void
setTargetURLBase(java.lang.String targetURLBase)
java.lang.String
toString()
Methods inherited from class io.opentimeline.opentimelineio.MediaReference
getAvailableRange, isMissingReference, setAvailableRange
Methods inherited from class io.opentimeline.opentimelineio.SerializableObjectWithMetadata
getMetadata, getName, setMetadata, setName
Methods inherited from class io.opentimeline.opentimelineio.SerializableObject
clone, currentRefCount, dynamicFields, equals, fromJSONFile, fromJSONString, isEquivalentTo, isUnknownSchema, schemaName, schemaVersion, toJSONFile, toJSONFile, toJSONString, toJSONString
-
Constructor Details
-
ImageSequenceReference
protected ImageSequenceReference() -
ImageSequenceReference
public ImageSequenceReference(java.lang.String targetURLBase, java.lang.String namePrefix, java.lang.String nameSuffix, int startFrame, int frameStep, double rate, int frameZeroPadding, ImageSequenceReference.MissingFramePolicy missingFramePolicy, TimeRange availableRange, AnyDictionary metadata)- Parameters:
targetURLBase
- Everything leading up to the file name in the target_url.namePrefix
- Everything in the file name leading up to the frame number.nameSuffix
- Everything after the frame number in the file name.startFrame
- The first frame number used in file names.frameStep
- Step between frame numbers in file names.rate
- Frame rate if every frame in the sequence were played back.frameZeroPadding
- Number of digits to pad zeros out to in frame numbers.missingFramePolicy
- enum ImageSequenceReference.MissingFramePolicy directive for how frames in sequence not found on disk should be handled.availableRange
- available rangemetadata
- metadata dictionary
-
ImageSequenceReference
public ImageSequenceReference(ImageSequenceReference.ImageSequenceReferenceBuilder imageSequenceReferenceBuilder)
-
-
Method Details
-
getTargetURLBase
public java.lang.String getTargetURLBase() -
setTargetURLBase
public void setTargetURLBase(java.lang.String targetURLBase) -
getNamePrefix
public java.lang.String getNamePrefix() -
setNamePrefix
public void setNamePrefix(java.lang.String namePrefix) -
getNameSuffix
public java.lang.String getNameSuffix() -
setNameSuffix
public void setNameSuffix(java.lang.String nameSuffix) -
getStartFrame
public int getStartFrame() -
setStartFrame
public void setStartFrame(int startFrame) -
getFrameStep
public int getFrameStep() -
setFrameStep
public void setFrameStep(int frameStep) -
getRate
public double getRate() -
setRate
public void setRate(double rate) -
getFrameZeroPadding
public int getFrameZeroPadding() -
setFrameZeroPadding
public void setFrameZeroPadding(int frameZeroPadding) -
getMissingFramePolicy
-
setMissingFramePolicy
-
getEndFrame
public int getEndFrame() -
getNumberOfImagesInSequence
public int getNumberOfImagesInSequence() -
getFrameForTime
-
getTargetURLForImageNumber
-
presentationTimeForImageNumber
-
getAbstractTargetURL
public java.lang.String getAbstractTargetURL(java.lang.String symbol)Generates a target url for a frame where `symbol` is used in place of the frame number. This is often used to generate wildcard target urls.- Parameters:
symbol
- symbol to be used instead of frame number- Returns:
- target URL with symbol on place of frame number
-
getFrameRangeForTimeRange
public Pair<java.lang.Integer,java.lang.Integer> getFrameRangeForTimeRange(TimeRange timeRange, ErrorStatus errorStatus)Returns a Pair<Integer, Integer> containing the first and last frame numbers for the given time range in the reference.- Parameters:
timeRange
- range fore which first and last frame numbers are to be founderrorStatus
- errorStatus to report error while fetching frame numbers- Returns:
- pair of frame numbers
-
toString
public java.lang.String toString()- Overrides:
toString
in classMediaReference
-