Methods Summary |
---|
public java.lang.Object | clone()Creates a clone of this IndexedColorFormat by copying each format
attribute to the clone.
IndexedColorFormat f = new IndexedColorFormat(size,
maxDataLength,
dataType,
frameRate,
lineStride,
mapSize,
redValues,
greenValues,
blueValues);
f.copy(this);
return f;
|
protected void | copy(javax.media.Format f)Copies the attributes from the specified Format into
this H261Format .
super.copy(f);
if (f instanceof IndexedColorFormat) {
IndexedColorFormat other = (IndexedColorFormat) f;
mapSize = other.mapSize;
redValues = other.redValues;
greenValues = other.greenValues;
blueValues = other.blueValues;
lineStride = other.lineStride;
}
|
public boolean | equals(java.lang.Object format)Compares the specified Format with this H261Format .
Returns true only if the specified Format
is a H261Format object and all of
its attributes are identical to
the attributes in this H261Format .
if (format instanceof IndexedColorFormat) {
IndexedColorFormat other = (IndexedColorFormat) format;
return super.equals(format) &&
mapSize == other.mapSize &&
redValues == other.redValues &&
greenValues == other.greenValues &&
blueValues == other.blueValues &&
lineStride == other.lineStride;
} else
return false;
|
public byte[] | getBlueValues()Gets the mask for the blue component.
return blueValues;
|
public byte[] | getGreenValues()Gets the mask for the green component.
return greenValues;
|
public int | getLineStride()Gets the line stride--the number of array elements between adjacent rows of pixels.
return lineStride;
|
public int | getMapSize()Gets the number of bits required per pixel.
return mapSize;
|
public byte[] | getRedValues()Gets the mask for the red component.
return redValues;
|
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 IndexedColorFormat))
return fmt;
IndexedColorFormat other = (IndexedColorFormat)format;
IndexedColorFormat res = (IndexedColorFormat)fmt;
res.mapSize = (mapSize != NOT_SPECIFIED ?
mapSize : other.mapSize);
res.redValues = (redValues != null ?
redValues : other.redValues);
res.greenValues = (greenValues != null ?
greenValues : other.greenValues);
res.blueValues = (blueValues != null ?
blueValues : other.blueValues);
res.lineStride = (lineStride != NOT_SPECIFIED ?
lineStride : other.lineStride);
return res;
|
public boolean | matches(javax.media.Format format)Checks whether or not the specified Format matches
this H261Format .
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 IndexedColorFormat))
return true;
IndexedColorFormat other = (IndexedColorFormat) format;
return
(mapSize == NOT_SPECIFIED || other.mapSize == NOT_SPECIFIED ||
mapSize == other.mapSize) &&
(redValues == null || other.redValues == null ||
redValues.equals(other.redValues)) &&
(greenValues == null || other.greenValues == null ||
greenValues.equals(other.greenValues)) &&
(blueValues == null || other.blueValues == null ||
blueValues.equals(other.blueValues)) &&
(lineStride == NOT_SPECIFIED || other.lineStride == NOT_SPECIFIED ||
lineStride == other.lineStride) ;
|
public javax.media.Format | relax()Generate a format that's less restrictive than this format but
contains the basic attributes that will make this resulting format
useful for format matching.
IndexedColorFormat fmt;
if ((fmt = (IndexedColorFormat)super.relax()) == null)
return null;
fmt.lineStride = NOT_SPECIFIED;
return fmt;
|