|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.j3d.utils.compression.CommandStream
class CommandStream
This class is used to build the bit-level compression command stream which is the final result of the compression process. It defines the bit representations of the compression commands and provides a mechanism for the interleaving and forwarding of command headers and bodies required by the geometry compression specification.
Field Summary | |
---|---|
private int |
bitOffset
|
private int |
byteOffset
|
private byte[] |
bytes
|
(package private) static int |
COLOR_TABLE
|
private long |
lastBody
|
private int |
lastBodyLength
|
(package private) static int |
MESH_B_R
|
(package private) static int |
NORMAL_TABLE
|
(package private) static int |
POSITION_TABLE
|
(package private) static int |
SET_COLOR
|
(package private) static int |
SET_NORM
|
(package private) static int |
SET_STATE
|
(package private) static int |
SET_TABLE
|
(package private) static int |
V_NO_OP
|
(package private) static int |
VERTEX
|
Constructor Summary | |
---|---|
CommandStream()
Create an empty CommandStream with a default initial size. |
|
CommandStream(int initSize)
Create an empty CommandStream with the given initial size. |
Method Summary | |
---|---|
private void |
addByte(int b,
int bitCount)
|
(package private) void |
addCommand(int header,
int headerLength,
long body,
int bodyLength)
Add a compression command to this instance. |
private void |
addLong(long l,
int bitCount)
|
(package private) void |
clear()
Mark the CommandStream as empty so that its storage will be reused. |
(package private) void |
end()
Add a no-op and the last command body. |
(package private) int |
getByteCount()
Get the number of bytes in the compression command stream. |
(package private) byte[] |
getBytes()
Get the bytes composing the compression command stream. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
static final int SET_NORM
static final int SET_COLOR
static final int VERTEX
static final int MESH_B_R
static final int SET_STATE
static final int SET_TABLE
static final int V_NO_OP
static final int POSITION_TABLE
static final int COLOR_TABLE
static final int NORMAL_TABLE
private byte[] bytes
private int byteOffset
private int bitOffset
private long lastBody
private int lastBodyLength
Constructor Detail |
---|
CommandStream()
CommandStream(int initSize)
initSize
- initial capacity of CommandStream in bytesMethod Detail |
---|
void clear()
void addCommand(int header, int headerLength, long body, int bodyLength)
A compression command includes an 8-bit header and can range up to 72 bits in length. The command with the maximum length is a 2-bit color command with a 6-bit tag in the header, followed by four 16-bit color components of data.
A subcommand is either a position, normal, or color, though in practice a position subcommand can only be part of a vertex command. Normal and color subcommands can be parts of separate global normal and color commands as well as parts of a vertex command.
A subcommand includes a 6-bit header. Its length is 2 bits less than the length of the corresponding command.
header
- contains compression command header bits, right-justified
within the bits of the intheaderLength
- number of bits in header, either 8 for commands or
6 for subcommandsbody
- contains the body of the compression command,
right-justified within the bits of the longbodyLength
- number of bits in the bodyprivate void addByte(int b, int bitCount)
private void addLong(long l, int bitCount)
void end()
int getByteCount()
byte[] getBytes()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |