JPEGFormatpublic class JPEGFormat extends VideoFormat Describes JPEG compressed video data. |
Fields Summary |
---|
public static final int | DEC_422JPEG 422 decimation. | public static final int | DEC_420JPEG 420 decimation. | public static final int | DEC_444JPEG 444 decimation. | public static final int | DEC_402JPEG 402 decimation. | public static final int | DEC_411JPEG 411 decimation. | int | qFactorJPEG encoding parameter quality factor. | int | decimationIndicates whether or not JPEG decimation is used. |
Constructors Summary |
---|
public JPEGFormat()Constructs a default JPEGFormat object.
super(VideoFormat.JPEG);
| public JPEGFormat(Dimension size, int maxDataLength, Class dataType, float frameRate, int q, int dec)Constructs a JPEGFormat with the specified parameters.
super(VideoFormat.JPEG, size, maxDataLength, dataType, frameRate);
this.qFactor = q;
this.decimation = dec;
|
Methods Summary |
---|
public java.lang.Object | clone()Creates a clone of this JPEGFormat by copying each format
attribute to the clone.
JPEGFormat f = new JPEGFormat(getSize(), getMaxDataLength(),
getDataType(), getFrameRate(),
qFactor, decimation);
f.copy(this);
return f;
| protected void | copy(javax.media.Format f)Copies the attributes from the specified Format into
this JPEGFormat .
super.copy(f);
JPEGFormat jf = (JPEGFormat)f;
qFactor = jf.qFactor;
decimation = jf.decimation;
| 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 .
if (format instanceof JPEGFormat) {
JPEGFormat vf = (JPEGFormat)format;
return super.equals(format) &&
qFactor == vf.qFactor &&
decimation == vf.decimation;
}
return false;
| public int | getDecimation()Gets the decimation of the video.
return decimation;
| public int | getQFactor()Gets the JPEG quality factor for this JPEGFormat .
return qFactor;
| public javax.media.Format | intersects(javax.media.Format format)Finds the attributes shared by two matching Format objects.
If the specified Format does not match this one, the result is
undefined.
Format fmt;
if ((fmt = super.intersects(format)) == null)
return null;
if (!(format instanceof JPEGFormat))
return fmt;
JPEGFormat other = (JPEGFormat)format;
JPEGFormat res = (JPEGFormat)fmt;
res.qFactor = (qFactor != NOT_SPECIFIED ?
qFactor : other.qFactor);
res.decimation = (decimation != NOT_SPECIFIED ?
decimation : other.decimation);
return res;
| public boolean | matches(javax.media.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.)
if (!super.matches(format))
return false;
if (!(format instanceof JPEGFormat))
return true;
JPEGFormat vf = (JPEGFormat)format;
return
(qFactor == NOT_SPECIFIED || vf.qFactor == NOT_SPECIFIED ||
qFactor == vf.qFactor) &&
(decimation == NOT_SPECIFIED || vf.decimation == NOT_SPECIFIED ||
decimation == vf.decimation);
| public java.lang.String | toString()Gets a String representation of the attributes of this
JPEGFormat . For example: "JPEG, 352x240, ...".
String s = getEncoding() + " video format:";
if (size != null)
s += " size = " + size.width + "x" + size.height;
if (frameRate != NOT_SPECIFIED)
s += " FrameRate = " + frameRate;
if (maxDataLength != NOT_SPECIFIED)
s += " maxDataLength = " + maxDataLength;
if (dataType != null)
s += " dataType = " + dataType;
if (qFactor != NOT_SPECIFIED)
s += " q factor = " + qFactor;
if (decimation != NOT_SPECIFIED)
s += " decimation = " + decimation;
return s;
|
|