Modifier and Type | Field | Description |
---|---|---|
protected static int |
CHECKSUM_SIZE |
Size of the image checksum calculated using MD5 algorithm.
|
protected POILogger |
logger |
|
protected int |
offset |
The offset to the picture in the stream
|
protected static ImagePainter[] |
painters |
Constructor | Description |
---|---|
PictureData() |
Modifier and Type | Method | Description |
---|---|---|
static PictureData |
create(int type) |
Create an instance of
PictureData by type. |
void |
draw(java.awt.Graphics2D graphics,
Picture parent) |
|
static byte[] |
getChecksum(byte[] data) |
Compute 16-byte checksum of this picture using MD5 algorithm.
|
abstract byte[] |
getData() |
Returns the binary data of this Picture
|
byte[] |
getHeader() |
Return 24 byte header which preceeds the actual picture data.
|
static ImagePainter |
getImagePainter(int type) |
Return ImagePainter for the specified image type
|
int |
getOffset() |
File offset in the 'Pictures' stream
|
byte[] |
getRawData() |
Returns the raw binary data of this Picture excluding the first 8 bytes
which hold image signature and size of the image data.
|
protected abstract int |
getSignature() |
Blip signature.
|
int |
getSize() |
Deprecated.
Use
getData().length instead. |
abstract int |
getType() |
Returns type of this picture.
|
byte[] |
getUID() |
Returns 16-byte checksum of this picture
|
abstract void |
setData(byte[] data) |
Set picture data
|
static void |
setImagePainter(int type,
ImagePainter painter) |
Register ImagePainter for the specified image type
|
void |
setOffset(int offset) |
Set offset of this picture in the 'Pictures' stream.
|
void |
setRawData(byte[] data) |
|
void |
write(java.io.OutputStream out) |
Write this picture into
OutputStream |
protected POILogger logger
protected static final int CHECKSUM_SIZE
protected int offset
protected static ImagePainter[] painters
public abstract int getType()
Picture class.
public abstract byte[] getData()
public abstract void setData(byte[] data) throws java.io.IOException
java.io.IOException
protected abstract int getSignature()
public byte[] getRawData()
public void setRawData(byte[] data)
public int getOffset()
public void setOffset(int offset)
offset
- in the 'Pictures' streampublic byte[] getUID()
public static byte[] getChecksum(byte[] data)
public void write(java.io.OutputStream out) throws java.io.IOException
OutputStream
java.io.IOException
public static PictureData create(int type)
PictureData
by type.type
- type of the picture data.
Must be one of the static constants defined in the Picture class.
PictureData
public byte[] getHeader()
The header consists of 2-byte signature, 2-byte type, 4-byte image size and 16-byte checksum of the image data.
public int getSize()
getData().length
instead.public void draw(java.awt.Graphics2D graphics, Picture parent)
public static void setImagePainter(int type, ImagePainter painter)
type
- image type, must be one of the static constants defined in the Picture class.
painter
- public static ImagePainter getImagePainter(int type)
type
- blip type, must be one of the static constants defined in the Picture class.
Copyright 2018 The Apache Software Foundation or its licensors, as applicable.