class CommandStream
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
CommandStream()
Create an empty CommandStream with a default initial size.
|
CommandStream(int initSize)
Create an empty CommandStream with the given initial size.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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
CommandStream()
CommandStream(int initSize)
initSize - initial capacity of CommandStream in bytesvoid 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()
Copyright 1996-2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms.