|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface VImage
Represent a buffered image. Use ValueUtil.toImage(org.epics.pvmanager.data.VImage)
and ValueUtil.toVImage(java.awt.image.BufferedImage)
to convert objects
of this class to and from awt images.
The data is currently encoded as 3 bytes for each pixel (RGB). To read the buffer in AWT use the following code:
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); System.arraycopy(buffer, 0, ((DataBufferByte) image.getRaster().getDataBuffer()).getData(), 0, 100*100*3);
To read in SWT:
ImageData imageData = new ImageData(width, height, 24, new PaletteData(0xFF, 0xFF00, 0xFF0000), width*3, buffer); Image image = new Image(gc.getDevice(), imageData);
To prepare an image using Java2D:
BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_3BYTE_BGR); Graphics2D g = image.createGraphics(); ... byte[] buffer = ((DataBufferByte) image.getRaster().getDataBuffer()).getData();
Method Summary | |
---|---|
byte[] |
getData()
Image buffer; |
int |
getHeight()
Height of the image in pixels. |
int |
getWidth()
Width of the image in pixels. |
Method Detail |
---|
int getHeight()
int getWidth()
byte[] getData()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |