|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.knime.core.data.image.png.PNGImageContent
public class PNGImageContent
Content of a PNG image. It only wraps a byte[] which is supposed to be
PNG content. The rendering methods will delegate all work to
BufferedImage.
| Field Summary | |
|---|---|
static DataType |
TYPE
Type for PNG cells. |
| Constructor Summary | |
|---|---|
PNGImageContent()
Framework constructor for restoring content. |
|
PNGImageContent(byte[] imageBytes)
Creates PNG image content from byte array. |
|
PNGImageContent(InputStream is)
Reads image content from a stream. |
|
| Method Summary | |
|---|---|
(package private) static PNGImageContent |
deserialize(DataCellDataInput input)
Deserialize method for DataCell implementation. |
byte[] |
getByteArray()
Get a copy of the underlying byte array. |
byte[] |
getByteArrayReference()
Get a reference to the underlying byte array. |
Image |
getImage()
Get the image represented by this object. |
Dimension |
getPreferredSize()
Preferred dimension, width and height, for the given image to be rendered. |
String |
getSummary()
|
void |
paint(Graphics2D g,
int width,
int height)
Render image into argument graphics object. |
void |
save(OutputStream output)
Save the image content to an output stream. |
void |
serialize(DataCellDataOutput output)
Serialize method for image content. |
DataCell |
toImageCell()
Factory method to generate cell implementation. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final DataType TYPE
| Constructor Detail |
|---|
public PNGImageContent()
public PNGImageContent(byte[] imageBytes)
imageBytes - The image bytes.
NullPointerException - If the argument is null.
IllegalArgumentException - If the argument does not represent a
valid png byte stream (according to ImageIO.read(InputStream).
public PNGImageContent(InputStream is)
throws IOException
is - The input stream.
IOException - If reading from the stream fails.
NullPointerException - If the argument is null;
IllegalArgumentException - If the argument does not represent a
valid png byte stream (according to ImageIO.read(InputStream).| Method Detail |
|---|
public byte[] getByteArrayReference()
getByteArray()
if necessary.
public byte[] getByteArray()
getByteArrayReference()public Image getImage()
IllegalStateException - If the image can't be read from the
internal memory representation (the Image is not actually stored
as part of this cell but kept in a SoftReference)
public void paint(Graphics2D g,
int width,
int height)
paint in interface ImageContentg - To paint to.width - image maximum widthheight - image maximum height
public void save(OutputStream output)
throws IOException
save in interface ImageContentoutput - To save to.
IOException - If that fails.
static PNGImageContent deserialize(DataCellDataInput input)
throws IOException
input - To read from.
IOException - If that fails.
public void serialize(DataCellDataOutput output)
throws IOException
output - To save to.
IOException - If that fails for any reason.public DataCell toImageCell()
toImageCell in interface ImageContentpublic Dimension getPreferredSize()
getPreferredSize in interface ImageContentpublic String getSummary()
getSummary in interface ImageContent
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||