|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.proteinshader.graphics.typography.Glyph
public class Glyph
Stores a 2D array of bytes that form a graphical representation of a character. The bytes are ultimately intended to be copied into a region of an OpenGL texture object.
Constructor Summary | |
---|---|
Glyph(String name,
int x1,
int y1,
int x2,
int y2,
int bytesPerPixel)
Constructs a Glyph. |
Method Summary | |
---|---|
void |
extractGlyphImage(byte[][] glyphSetImage)
Extracts the glyph from the texture image given as an argument. |
int |
getBytesPerPixel()
Returns the number of bytes per pixel, which should be in the range of 1 to 4. |
int |
getHeight()
Returns the height of the glyph in pixels. |
byte[][] |
getImage()
Returns the 2D byte array with the glyph image in it. |
String |
getName()
Returns the name of the glyph. |
int |
getWidth()
Returns the width of the glyph in pixels. |
int |
getX1()
Returns the x-coordinate of the top left corner of the glyph (this coordinate is used for extracting the glyph from the larger image file with several glyphs). |
int |
getX2()
Returns the x-coordinate of the bottom right corner of the glyph (this coordinate is used for extracting the glyph from the larger image file with several glyphs). |
int |
getY1()
Returns the y-coordinate of the top left corner of the glyph (this coordinate is used for extracting the glyph from the larger image file with several glyphs). |
int |
getY2()
Returns the y-coordinate of the bottom right corner of the glyph (this coordinate is used for extracting the glyph from the larger image file with several glyphs). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Glyph(String name, int x1, int y1, int x2, int y2, int bytesPerPixel)
name
- the name of a glyph is usually a single character.x1
- x-coordinate of upper left corner of the glyph.y1
- y-coordinate of upper left corner of the glyph.x2
- x-coordinate of lower right corner of the glyph.y2
- y-coordinate of lower right corner of the glyph.bytesPerPixel
- there can be 1 to 4 bytes per pixel.Method Detail |
---|
public void extractGlyphImage(byte[][] glyphSetImage) throws GlyphImageException
glyphSetImage
- an image containing a set of glyphs.
GlyphImageException
- if the glyph image cannot be
extracted from the larger glyph set
image.public byte[][] getImage()
public String getName()
public int getX1()
public int getY1()
public int getX2()
public int getY2()
public int getBytesPerPixel()
public int getWidth()
public int getHeight()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |