Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.jempeg.empeg.logoedit
Class LogoFormatUtils  view LogoFormatUtils download LogoFormatUtils.java

java.lang.Object
  extended byorg.jempeg.empeg.logoedit.LogoFormatUtils

public class LogoFormatUtils
extends java.lang.Object

A set of utilities for manipulating Empeg Logo Format data.


Field Summary
static int DEFAULT_CUTOFF_0
           
static int DEFAULT_CUTOFF_1
           
static int DEFAULT_CUTOFF_2
           
static int[] DEFAULT_CUTOFFS
           
static int DEFAULT_GRAY_VALUE_0
           
static int DEFAULT_GRAY_VALUE_1
           
static int DEFAULT_GRAY_VALUE_2
           
static int DEFAULT_GRAY_VALUE_3
           
static int[] DEFAULT_GRAY_VALUES
           
static int DEFAULT_HEIGHT
           
static int DEFAULT_WIDTH
           
 
Constructor Summary
LogoFormatUtils()
           
 
Method Summary
static int from4bpp(byte[] _empegData, int _pixel)
          Converts a logo 4bpp pixel to an index in the color array.
static int from4bpp(byte[] _empegData, int _x, int _y)
          Converts a logo 4bpp pixel to an index in the color array.
static void fromLogo(java.io.OutputStream _os, Logo _logo, int[] _cutoffs)
          Creates a byte array in the format that the Empeg expects for home and car logos.
static java.awt.Image fromLogoFormat(byte[] _logoData, int _width, int _height, int[] _grayValues)
          Creates a java.awt.Image from the given Empeg logo data.
static byte to4bpp(int _grayValue, int[] _cutoffs)
          Converts the given gray value to an Empeg color index based on the given set of cutoffs.
static Logo toLogo(java.io.InputStream _is, int[] _grayValues)
          Creates a Logo from a byte array.
static byte[] toLogoFormat(byte[] _logoGrayValues, int _width, int _height)
          Converts a byte array of values {0, 1, 2, 3} that correspond to the four valid Empeg gray values.
static byte[] toLogoFormat(java.awt.Image _image, int _width, int _height, int[] _cutoffs)
          Converts a java.awt.Image to an Empeg logo format byte array.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_WIDTH

public static final int DEFAULT_WIDTH
See Also:
Constant Field Values

DEFAULT_HEIGHT

public static final int DEFAULT_HEIGHT
See Also:
Constant Field Values

DEFAULT_GRAY_VALUE_0

public static final int DEFAULT_GRAY_VALUE_0
See Also:
Constant Field Values

DEFAULT_GRAY_VALUE_1

public static final int DEFAULT_GRAY_VALUE_1
See Also:
Constant Field Values

DEFAULT_GRAY_VALUE_2

public static final int DEFAULT_GRAY_VALUE_2
See Also:
Constant Field Values

DEFAULT_GRAY_VALUE_3

public static final int DEFAULT_GRAY_VALUE_3
See Also:
Constant Field Values

DEFAULT_CUTOFF_0

public static final int DEFAULT_CUTOFF_0
See Also:
Constant Field Values

DEFAULT_CUTOFF_1

public static final int DEFAULT_CUTOFF_1
See Also:
Constant Field Values

DEFAULT_CUTOFF_2

public static final int DEFAULT_CUTOFF_2
See Also:
Constant Field Values

DEFAULT_GRAY_VALUES

public static final int[] DEFAULT_GRAY_VALUES

DEFAULT_CUTOFFS

public static final int[] DEFAULT_CUTOFFS
Constructor Detail

LogoFormatUtils

public LogoFormatUtils()
Method Detail

fromLogo

public static void fromLogo(java.io.OutputStream _os,
                            Logo _logo,
                            int[] _cutoffs)
                     throws java.io.IOException
Creates a byte array in the format that the Empeg expects for home and car logos.


toLogo

public static Logo toLogo(java.io.InputStream _is,
                          int[] _grayValues)
                   throws java.io.IOException
Creates a Logo from a byte array.


toLogoFormat

public static byte[] toLogoFormat(java.awt.Image _image,
                                  int _width,
                                  int _height,
                                  int[] _cutoffs)
Converts a java.awt.Image to an Empeg logo format byte array.


to4bpp

public static byte to4bpp(int _grayValue,
                          int[] _cutoffs)
Converts the given gray value to an Empeg color index based on the given set of cutoffs.


from4bpp

public static int from4bpp(byte[] _empegData,
                           int _x,
                           int _y)
Converts a logo 4bpp pixel to an index in the color array.


from4bpp

public static int from4bpp(byte[] _empegData,
                           int _pixel)
Converts a logo 4bpp pixel to an index in the color array.


fromLogoFormat

public static java.awt.Image fromLogoFormat(byte[] _logoData,
                                            int _width,
                                            int _height,
                                            int[] _grayValues)
Creates a java.awt.Image from the given Empeg logo data.


toLogoFormat

public static byte[] toLogoFormat(byte[] _logoGrayValues,
                                  int _width,
                                  int _height)
Converts a byte array of values {0, 1, 2, 3} that correspond to the four valid Empeg gray values.