javax.media.format
Class IndexedColorFormat

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

public class IndexedColorFormat
extends VideoFormat

Describes indexed color video data.

Since:
JMF 2.0
See Also:
Serialized Form

Field Summary
protected  byte[] blueValues
           
protected  byte[] greenValues
           
protected  int lineStride
          Increment value of the array index from the first pixel on line n to the first pixel on line n+1.
protected  int mapSize
           
protected  byte[] redValues
           
 
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
IndexedColorFormat(java.awt.Dimension size, int maxDataLength, java.lang.Class dataType, float frameRate, int lineStride, int mapSize, byte[] red, byte[] green, byte[] blue)
          Constructs an IndexedColorFormat object with the specified parameters.
 
Method Summary
 java.lang.Object clone()
          Creates a clone of this IndexedColorFormat by copying each format attribute to the clone.
protected  void copy(Format f)
          Copies the attributes from the specified Format into this H261Format.
 boolean equals(java.lang.Object format)
          Compares the specified Format with this H261Format.
 byte[] getBlueValues()
          Gets the mask for the blue component.
 byte[] getGreenValues()
          Gets the mask for the green component.
 int getLineStride()
          Gets the line stride--the number of array elements between adjacent rows of pixels.
 int getMapSize()
          Gets the number of bits required per pixel.
 byte[] getRedValues()
          Gets the mask for the red component.
 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 H261Format.
 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.
 
Methods inherited from class javax.media.format.VideoFormat
getFrameRate, getMaxDataLength, getSize, toString
 
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

lineStride

protected int lineStride
Increment value of the array index from the first pixel on line n to the first pixel on line n+1.

redValues

protected byte[] redValues

greenValues

protected byte[] greenValues

blueValues

protected byte[] blueValues

mapSize

protected int mapSize
Constructor Detail

IndexedColorFormat

public IndexedColorFormat(java.awt.Dimension size,
                          int maxDataLength,
                          java.lang.Class dataType,
                          float frameRate,
                          int lineStride,
                          int mapSize,
                          byte[] red,
                          byte[] green,
                          byte[] blue)
Constructs an IndexedColorFormat object with the specified parameters.
Parameters:
size - A Dimension that specifies the frame size.
maxDataLength - The maximum size of a data chunk.
dataType - The type of data. For example, byte array.
frameRate - The frame rate.
lineStride - The number elements between adjacent rows of pixels.
mapSize - The number of bits required per pixel.
red - The mask for the red component.
green - The mask for the green component.
blue - The mask for the blue component.
Method Detail

getMapSize

public int getMapSize()
Gets the number of bits required per pixel.
Returns:
An integer representing the number of bits per pixel.

getRedValues

public byte[] getRedValues()
Gets the mask for the red component.
Returns:
A byte array containing the mask for the red component.

getGreenValues

public byte[] getGreenValues()
Gets the mask for the green component.
Returns:
A byte array containing the mask for the green component.

getBlueValues

public byte[] getBlueValues()
Gets the mask for the blue component.
Returns:
A byte array containing the mask for the blue component.

getLineStride

public int getLineStride()
Gets the line stride--the number of array elements between adjacent rows of pixels.
Returns:
An integer representing the line stride.

clone

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

copy

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

equals

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.
Overrides:
equals in class VideoFormat
Parameters:
format - The Format to compare.
Returns:
true if the specified Format is the same as this one.

matches

public boolean matches(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.)

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 H261Format.
Returns:
A Format object with its attributes set to those attributes common to both Format objects.
See Also:
matches(javax.media.Format)

relax

public 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.
Overrides:
relax in class VideoFormat
Returns:
A Format that's less restrictive than the this 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.