|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.faceless.graph.output.Output
org.faceless.graph.output.ImageOutput
org.faceless.graph.output.GIFOutput
public class GIFOutput
The GIFOutput
class is concrete subclass of GraphicsOutput
which creates a GIF image when it's rendered.
The GIF creation is done using the Acme.JPM.Encoders.GifEncoder
class, which needs to be installed separately. It is available from
http://www.acme.com/java. Unisys have a
patent on LZW compression, which may or may not apply to the Acme library
in your country. This class does not contain any code implementing the
LZW algorithm.
Since version 1.0.8 of the package, GIF images may have transparent
backgrounds. See PNGOutput
for more information.
Constructor Summary | |
---|---|
GIFOutput(int width,
int height,
Color color,
OutputStream out)
Create a new GIFOutput of the specified width and height
and background color. |
|
GIFOutput(int width,
int height,
OutputStream out)
Create a new GIFOutput of the specified width and height. |
Method Summary | |
---|---|
void |
render(Graph gr)
Render the Graph to this Output object. |
void |
setNumColors(int numcolors)
The number of distinct colors to use in the image. |
Methods inherited from class org.faceless.graph.output.ImageOutput |
---|
canPattern, canRotate, getCanvas, getGraph, getImage, getReducedColorImage, getTextBox, line, poly, setColor, setFontMap, setLineDash, setLineThickness, setMargin, setRenderingHint, text |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GIFOutput(int width, int height, OutputStream out)
GIFOutput
of the specified width and height.
This constructor creates a GIF of up to 256 colours with a
white background.
width
- the width of the output GIF in pixelsheight
- the height of the output GIF in pixelsout
- the OutputStream to render the GIF image to (the stream is left open)public GIFOutput(int width, int height, Color color, OutputStream out)
GIFOutput
of the specified width and height
and background color. This constructor creates a GIF with
up to 256 colours.
width
- the width of the output GIF in pixelsheight
- the height of the output GIF in pixelscolor
- the background colour of the GIFout
- the OutputStream to render the GIF image to (the stream is left open)Method Detail |
---|
public void setNumColors(int numcolors)
The number of distinct colors to use in the image. By default, all GIF images are limited to 256 colors, which the maximum allowed by the GIF specification. Smaller files can be obtained by setting this value to value between 2 and 255, at the expense of lower quality and slightly longer rendering time.
num
- the maximum number of colors to use in the image, from 2 to 256public void render(Graph gr) throws IOException
Output
render
in class ImageOutput
IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |