Modifier and Type | Field and 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 and Description |
---|
PictureData() |
Modifier and Type | Method and Description |
---|---|
static PictureData |
create(int type)
Create an instance of
PictureData by type. |
void |
draw(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(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 IOException
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(OutputStream out) throws IOException
OutputStream
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(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 © 2020. All rights reserved.