- All Implemented Interfaces:
SubtitleStream
Reading of HD-DVD captions demuxed from EVO transport streams (HD-DVD-SUP).
-
Field Summary
Fields
bitmap of the last decoded caption
FileBuffer to read from the file
color palette of the last decoded caption
private int
index of dominant color for the current caption
ArrayList of captions contained in the current file
-
Constructor Summary
Constructors
-
Method Summary
void
void
private void
decode caption from the input stream
private static void
decode one line from the RLE buffer
decode palette from the input stream
Return the Bitmap of the current (last decoded) frame.
long
Get end time stamp of given frame.
int
Get number of forced frames in the currently loaded subtitle stream.
int
Get number of frames in the currently loaded subtitle stream.
Return current (last decoded) frame
Return given Bitmap as BufferedImage (using current Palette).
Return the Palette of the current (last decoded) frame.
int
Get index of most dominant opaque color (for DVD subtitle export).
long
Get start offset (in input stream) of given frame.
long
Get start time stamp of given frame.
Get SubPicture of given frame.
boolean
Get forced flag of given frame.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
-
logger
private static final Logger logger
-
subPictures
ArrayList of captions contained in the current file
-
palette
color palette of the last decoded caption
-
bitmap
bitmap of the last decoded caption
-
buffer
FileBuffer to read from the file
-
primaryColorIndex
private int primaryColorIndex
index of dominant color for the current caption
-
-
Method Details
-
-
-
decodeImage
decode caption from the input stream
- Parameters:
pic
- SubPicture object containing info about the caption
transIdx
- index of the transparent color
- Returns:
- bitmap of the decoded caption
- Throws:
CoreException
-
decodePalette
decode palette from the input stream
- Parameters:
pic
- SubPicture object containing info about the caption
- Returns:
- decoded palette
- Throws:
CoreException
-
decode
decode given picture
- Parameters:
pic
- SubPicture object containing info about caption
- Throws:
CoreException
-
-
getPalette
Return the Palette of the current (last decoded) frame.
- Specified by:
getPalette
in interface SubtitleStream
- Returns:
- Palette of the current frame
-
getBitmap
Return the Bitmap of the current (last decoded) frame.
- Specified by:
getBitmap
in interface SubtitleStream
- Returns:
- Bitmap of the current frame
-
getImage
Return current (last decoded) frame
- Specified by:
getImage
in interface SubtitleStream
- Returns:
- Current (last decoded) frame
-
getImage
Return given Bitmap as BufferedImage (using current Palette).
- Specified by:
getImage
in interface SubtitleStream
- Parameters:
bm
- Bitmap to convert.
- Returns:
- BufferedImage of given bitmap
-
getPrimaryColorIndex
public int getPrimaryColorIndex()
Get index of most dominant opaque color (for DVD subtitle export).
- Specified by:
getPrimaryColorIndex
in interface SubtitleStream
- Returns:
- Index of most dominant opaque color
-
getSubPicture
Get SubPicture of given frame.
- Specified by:
getSubPicture
in interface SubtitleStream
- Parameters:
index
- Index of caption
- Returns:
- SubPicture of caption
-
getFrameCount
public int getFrameCount()
Get number of frames in the currently loaded subtitle stream.
- Specified by:
getFrameCount
in interface SubtitleStream
- Returns:
- Number of frames
-
getForcedFrameCount
public int getForcedFrameCount()
Get number of forced frames in the currently loaded subtitle stream.
- Specified by:
getForcedFrameCount
in interface SubtitleStream
- Returns:
- Number of forced frames
-
isForced
public boolean isForced(int index)
Get forced flag of given frame.
- Specified by:
isForced
in interface SubtitleStream
- Parameters:
index
- Index of caption
- Returns:
- Forced flag of given frame
-
getEndTime
public long getEndTime(int index)
Get end time stamp of given frame.
- Specified by:
getEndTime
in interface SubtitleStream
- Parameters:
index
- Index of caption
- Returns:
- End time stamp of given frame in 90kHz resolution
-
getStartTime
public long getStartTime(int index)
Get start time stamp of given frame.
- Specified by:
getStartTime
in interface SubtitleStream
- Parameters:
index
- Index of caption
- Returns:
- Start time stamp of given frame in 90kHz resolution
-
getStartOffset
public long getStartOffset(int index)
Get start offset (in input stream) of given frame.
- Specified by:
getStartOffset
in interface SubtitleStream
- Parameters:
index
- Index of caption
- Returns:
- Start offset of given frame in input stream