Class SupDvdUtil

java.lang.Object
bdsup2sub.supstream.dvd.SupDvdUtil

public final class SupDvdUtil extends Object
  • Field Details

    • configuration

      private static final Configuration configuration
    • logger

      private static final Logger logger
  • Constructor Details

    • SupDvdUtil

      private SupDvdUtil()
  • Method Details

    • encodeLines

      public static byte[] encodeLines(Bitmap bm, boolean even)
      Compress bitmap to RLE buffer
      Parameters:
      bm - bitmap to compress
      even - true: encode even lines, false: encode odd lines
      Returns:
      RLE buffer
    • decodePalette

      public static Palette decodePalette(SubPictureDVD pic, Palette pal)
      create fitting four color palette for the given caption
      Parameters:
      pic - SubPicture object containing info about the caption
      pal - 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 caption
      transIdx - 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 buffer
      srcOfs - offset in source buffer
      srcLen - length of bytes to decode in source buffer
      trg - target buffer for uncompressed data
      trgOfs - offset in target buffer
      width - image width of encoded caption
      maxPixels - maximum number of pixels in caption