org.knime.core.data.image
Interface ImageContent

All Known Implementing Classes:
PNGImageContent

public interface ImageContent

Generic content of an image. Such content objects are used in (individual) data cell implementations and generic port objects.

Note: Objects of this interface must be read-only! Implementations are required to provide at least a constructor with an InputStream as only argument, which is used by the framework to restore the image content.

Author:
Thomas Gabriel, KNIME.com, Zurich, Switzerland

Method Summary
 Dimension getPreferredSize()
          Preferred dimension, width and height, for the given image to be rendered.
 String getSummary()
           
 void paint(Graphics2D g, int maxWidth, int maxHeight)
          Render image into argument graphics object.
 void save(OutputStream out)
          Save the image content to an output stream.
 DataCell toImageCell()
          Factory method to generate cell implementation.
 

Method Detail

paint

void paint(Graphics2D g,
           int maxWidth,
           int maxHeight)
Render image into argument graphics object. The aspect ration of the image must be retained, i.e. the width and height are maximum values that do not need to be fulfilled both at the same time.

Parameters:
g - To paint to.
maxWidth - image maximum width
maxHeight - image maximum height

getPreferredSize

Dimension getPreferredSize()
Preferred dimension, width and height, for the given image to be rendered.

Returns:
preferred dimension

toImageCell

DataCell toImageCell()
Factory method to generate cell implementation.

Returns:
A (likely new) cell representing this image.

save

void save(OutputStream out)
          throws IOException
Save the image content to an output stream.

Parameters:
out - To save to.
Throws:
IOException - If that fails.

getSummary

String getSummary()
Returns:
short summary representing this image content object.


Copyright, 2003 - 2012. All rights reserved.
University of Konstanz, Germany.
Chair for Bioinformatics and Information Mining, Prof. Dr. Michael R. Berthold.
You may not modify, publish, transmit, transfer or sell, reproduce, create derivative works from, distribute, perform, display, or in any way exploit any of the content, in whole or in part, except as otherwise expressly permitted in writing by the copyright owner or as specified in the license file distributed with this product.