|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.typography.TextLabel
public class TextLabel
Stores a byte buffer with the bitmap for a text label that can be
applied to the curved surface of a 3D tube or ribbon.
The bitmap will be WIDTH x HEIGHT pixels and is intended to hold a
text label of a few to several characters such as 'A 234' or 'G 37'
(for alanine at position 234 or glycine at position 37). The bytes
will later be copied into the midde of an existing OpenGL texture
object by using glTexSubImage2D(). The texture map will then be used
to paste labels onto curved surfaces.
Field Summary | |
---|---|
static int |
HEIGHT
The height is 32 pixels. |
static int |
WIDTH
The width is 128 pixels. |
Constructor Summary | |
---|---|
TextLabel(String name,
int format,
int dataType,
int width,
int height,
int bytesPerPixel,
ByteBuffer image)
Constructs a TextLabel. |
Method Summary | |
---|---|
int |
getBytesPerPixel()
Returns the number of bytes per pixel. |
int |
getDataType()
Returns the OpenGL data type (such as GL_UNSIGNED_BYTE). |
int |
getFormat()
Returns the number of bytes per pixel. |
int |
getHeight()
Returns the height of the glyph in pixels. |
ByteBuffer |
getImage()
Returns the buffer with the text image in it. |
String |
getName()
Returns the name of the glyph. |
int |
getWidth()
Returns the width of the glyph in pixels. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int WIDTH
public static final int HEIGHT
Constructor Detail |
---|
public TextLabel(String name, int format, int dataType, int width, int height, int bytesPerPixel, ByteBuffer image)
name
- the text string the label corresponds to.format
- the number of bytes per pixel.dataType
- an OpenGL data type such as GL_UNSIGNED_BYTE.width
- the width of the bitmap in pixels.height
- the height of the bitmap in pixels.image
- a byte buffer created by combining glyphs.bytesPerPixel
- the number of byte per pixel.Method Detail |
---|
public ByteBuffer getImage()
public String getName()
public int getFormat()
public int getDataType()
public int getWidth()
public int getHeight()
public int getBytesPerPixel()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |