Package bdsup2sub.supstream.dvd
Class SupDvdUtil
java.lang.Object
bdsup2sub.supstream.dvd.SupDvdUtil
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Bitmap
decodeImage
(SubPictureDVD pic, FileBuffer fBuf, int transIdx) decode caption from the input streamprivate static void
decodeLine
(byte[] src, int srcOfs, int srcLen, byte[] trg, int trgOfs, int width, int maxPixels) decode one line from the RLE bufferstatic Palette
decodePalette
(SubPictureDVD pic, Palette pal) create fitting four color palette for the given captionstatic byte[]
encodeLines
(Bitmap bm, boolean even) Compress bitmap to RLE buffer
-
Field Details
-
configuration
-
logger
-
-
Constructor Details
-
SupDvdUtil
private SupDvdUtil()
-
-
Method Details
-
encodeLines
Compress bitmap to RLE buffer- Parameters:
bm
- bitmap to compresseven
- true: encode even lines, false: encode odd lines- Returns:
- RLE buffer
-
decodePalette
create fitting four color palette for the given caption- Parameters:
pic
- SubPicture object containing info about the captionpal
- base palette- Returns:
- decoded palette
-
decodeImage
public static Bitmap decodeImage(SubPictureDVD pic, FileBuffer fBuf, int transIdx) throws CoreException decode caption from the input stream- Parameters:
pic
- SubPicture object containing info about the captiontransIdx
- index of the transparent color- Returns:
- bitmap of the decoded caption
- Throws:
CoreException
-
decodeLine
private static void decodeLine(byte[] src, int srcOfs, int srcLen, byte[] trg, int trgOfs, int width, int maxPixels) decode one line from the RLE buffer- Parameters:
src
- source buffersrcOfs
- offset in source buffersrcLen
- length of bytes to decode in source buffertrg
- target buffer for uncompressed datatrgOfs
- offset in target bufferwidth
- image width of encoded captionmaxPixels
- maximum number of pixels in caption
-