javax.media.format
Class JPEGFormat

java.lang.Object
  |
  +--javax.media.Format
        |
        +--javax.media.format.VideoFormat
              |
              +--javax.media.format.JPEGFormat

public class JPEGFormat
extends VideoFormat

Describes JPEG compressed video data.

Since:
JMF 2.0
See Also:
Serialized Form

Field Summary
static int DEC_402
          JPEG 402 decimation.
static int DEC_411
          JPEG 411 decimation.
static int DEC_420
          JPEG 420 decimation.
static int DEC_422
          JPEG 422 decimation.
static int DEC_444
          JPEG 444 decimation.
 
Fields inherited from class javax.media.format.VideoFormat
CINEPAK, frameRate, H261, H261_RTP, H263, H263_RTP, INDEO32, INDEO41, INDEO50, IRGB, JPEG, JPEG_RTP, maxDataLength, MJPEGA, MJPEGB, MJPG, MPEG, MPEG_RTP, RGB, RLE, RPZA, size, SMC, YUV
 
Fields inherited from class javax.media.Format
byteArray, clz, dataType, encoding, FALSE, formatArray, intArray, NOT_SPECIFIED, shortArray, TRUE
 
Constructor Summary
JPEGFormat()
          Constructs a default JPEGFormat object.
JPEGFormat(java.awt.Dimension size, int maxDataLength, java.lang.Class dataType, float frameRate, int q, int dec)
          Constructs a JPEGFormat with the specified parameters.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of this JPEGFormat by copying each format attribute to the clone.
protected  void copy(Format f)
          Copies the attributes from the specified Format into this JPEGFormat.
 boolean equals(java.lang.Object format)
          Compares the specified Format with this JPEGFormat.
 int getDecimation()
          Gets the decimation of the video.
 int getQFactor()
          Gets the JPEG quality factor for this JPEGFormat.
 Format intersects(Format format)
          Finds the attributes shared by two matching Format objects.
 boolean matches(Format format)
          Checks whether or not the specified Format matches this JPEGFormat.
 java.lang.String toString()
          Gets a String representation of the attributes of this JPEGFormat.
 
Methods inherited from class javax.media.format.VideoFormat
getFrameRate, getMaxDataLength, getSize, relax
 
Methods inherited from class javax.media.Format
getDataType, getEncoding
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEC_422

public static final int DEC_422
JPEG 422 decimation.

DEC_420

public static final int DEC_420
JPEG 420 decimation.

DEC_444

public static final int DEC_444
JPEG 444 decimation.

DEC_402

public static final int DEC_402
JPEG 402 decimation.

DEC_411

public static final int DEC_411
JPEG 411 decimation.
Constructor Detail

JPEGFormat

public JPEGFormat()
Constructs a default JPEGFormat object.

JPEGFormat

public JPEGFormat(java.awt.Dimension size,
                  int maxDataLength,
                  java.lang.Class dataType,
                  float frameRate,
                  int q,
                  int dec)
Constructs a JPEGFormat with the specified parameters.
Parameters:
size - A Dimension that specifies the frame size.
maxDataLength - The maximum size of the compressed data array.
dataType - The class type of the data.
frameRate - The frame rate of the video.
q - The JPEG quality factor. This is a value from 0 to 100, where 0 is the lowest quality and 100 is the highest.
dec - The JPEG decimation used.
Method Detail

getQFactor

public int getQFactor()
Gets the JPEG quality factor for this JPEGFormat.
Returns:
An integer in the range 0 to 100, where 0 is the lowest quality and 100 is the highest.

getDecimation

public int getDecimation()
Gets the decimation of the video.
Returns:
An integer that indicates the decimation of this Format: DEC_422, DEC_420, DEC_444, DEC_402, or DEC_411.

clone

public java.lang.Object clone()
Creates a clone of this JPEGFormat by copying each format attribute to the clone.
Overrides:
clone in class VideoFormat
Returns:
A clone of this JPEGFormat.

copy

protected void copy(Format f)
Copies the attributes from the specified Format into this JPEGFormat.
Overrides:
copy in class VideoFormat
Parameters:
f - The Format to copy the attributes from.

toString

public java.lang.String toString()
Gets a String representation of the attributes of this JPEGFormat. For example: "JPEG, 352x240, ...".
Overrides:
toString in class VideoFormat
Returns:
A String that describes the JPEGFormat attributes.

equals

public boolean equals(java.lang.Object format)
Compares the specified Format with this JPEGFormat. Returns true only if the specified Format is an JPEGFormat and all of its attributes are identical to this JPEGFormat.
Overrides:
equals in class VideoFormat
Parameters:
format - The Format to compare with this one.
Returns:
true if the specified Format is the same, false if it is not.

matches

public boolean matches(Format format)
Checks whether or not the specified Format matches this JPEGFormat. Matches only compares the attributes that are defined in the specified Format, unspecified attributes are ignored.

The two Format objects do not have to be of the same class to match. For example, if "A" are "B" are being compared, a match is possible if "A" is derived from "B" or "B" is derived from "A". (The compared attributes must still match, or matches fails.)

Overrides:
matches in class VideoFormat
Parameters:
format - The Format to compare with this one.
Returns:
true if the specified Format matches this one, false if it does not.

intersects

public Format intersects(Format format)
Finds the attributes shared by two matching Format objects. If the specified Format does not match this one, the result is undefined.
Overrides:
intersects in class VideoFormat
Parameters:
The - matching Format to intersect with this JPEGFormat.
Returns:
A Format object with its attributes set to those attributes common to both Format objects.
See Also:
matches(javax.media.Format)


Submit a bug or feature
Copyright 1999-2000 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved. See the Specification License for more details.
Sun, Sun Microsystems, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.