org.norther.tammi.sprig.chart.encode
Interface Encoder

All Known Implementing Classes:
GIFEncoder, JFreeEncoder, JpegEncoder, PNGEncoder

public interface Encoder

An interface to chart encoders.

Author:
Ilkka Priha

Method Summary
 byte[] encode(ChartLayout layout)
          Encodes the specified layout as a byte buffer.
 int getQuality()
          Gets the image quality.
 boolean isEncodeAlpha()
          Checks the encode alpha visibity option.
 void setEncodeAlpha(boolean flag)
          Sets the encode alpha visibity option.
 void setQuality(int q)
          Sets the image quality.
 void write(ChartLayout layout, File file)
          Writes the specified layout to a file.
 void write(ChartLayout layout, OutputStream output)
          Writes the specified layout to a stream.
 

Method Detail

isEncodeAlpha

boolean isEncodeAlpha()
Checks the encode alpha visibity option.

Returns:
true to encode alpha visibity, false otherwise.

setEncodeAlpha

void setEncodeAlpha(boolean flag)
Sets the encode alpha visibity option.

Parameters:
flag - true to encode alpha visibity, false otherwise.

getQuality

int getQuality()
Gets the image quality.

Returns:
the quality.

setQuality

void setQuality(int q)
Sets the image quality.

Parameters:
q - the quality (0 - 100 %).

encode

byte[] encode(ChartLayout layout)
              throws LogException
Encodes the specified layout as a byte buffer.

Parameters:
layout - the chart layout.
Returns:
the encoded chart.
Throws:
LogException - on errors.

write

void write(ChartLayout layout,
           File file)
           throws LogException
Writes the specified layout to a file.

Parameters:
layout - the chart layout.
file - the output file.
Throws:
LogException - on errors.

write

void write(ChartLayout layout,
           OutputStream output)
           throws LogException
Writes the specified layout to a stream.

Parameters:
layout - the chart layout.
output - the output stream.
Throws:
LogException - on errors.


Copyright © 2004 The Norther Organization. All rights reserved.