public abstract class AbstractImageEncoder extends Object implements Encoder
| Modifier and Type | Field and Description |
|---|---|
protected Image |
img |
protected OutputStream |
ofile |
| Constructor and Description |
|---|
AbstractImageEncoder() |
| Modifier and Type | Method and Description |
|---|---|
static byte |
byteFromChar(char ochar) |
static byte |
byteFromInt(int value) |
static byte[] |
bytesFromLong(long value) |
byte |
compressColor(int clr)
Compress the given color into one 8 bit representation.
|
byte |
compressColor(int red,
int green,
int blue)
Compress the given color into one 8 bit representation.
|
byte |
createByte(int b7,
int b6,
int b5,
int b4,
int b3,
int b2,
int b1,
int b0) |
void |
encode(Component component,
OutputStream os)
Encode the specified component on the specified stream
|
void |
encode(Image image,
OutputStream os) |
protected void |
error(String msg) |
abstract void |
saveImage() |
static Image |
snapshot(Component component) |
protected Image img
protected OutputStream ofile
public void encode(Image image, OutputStream os) throws IOException, EncoderException
IOExceptionEncoderExceptionpublic void encode(Component component, OutputStream os) throws IOException, EncoderException
Encoderencode in interface Encodercomponent - componentos - an outputstreamIOException - an exceptionEncoderException - an encoder exceptionpublic abstract void saveImage()
throws IOException,
EncoderException
IOExceptionEncoderExceptionpublic byte createByte(int b7,
int b6,
int b5,
int b4,
int b3,
int b2,
int b1,
int b0)
public static byte byteFromInt(int value)
public static byte[] bytesFromLong(long value)
public static byte byteFromChar(char ochar)
public byte compressColor(int clr)
clr - integer representation of rgb value (lowest byte is blue,
second lowest byte is green, third lowest byte is red)public byte compressColor(int red,
int green,
int blue)
red - value of the red portion of the colorgreen - value of the green portion of the colorblue - value of the blue portion of the colorprotected void error(String msg) throws EncoderException
EncoderExceptionCopyright © 2018. All rights reserved.