public abstract class HSLFPictureData extends java.lang.Object implements PictureData, GenericRecord
PictureData.PictureType
Modifier and Type | Field and Description |
---|---|
protected static int |
CHECKSUM_SIZE
Size of the image checksum calculated using MD5 algorithm.
(使用 MD5 算法计算的图像校验和的大小。)
|
Constructor and Description |
---|
HSLFPictureData() |
Modifier and Type | Method and Description |
---|---|
static HSLFPictureData |
create(PictureData.PictureType type)
Create an instance of
PictureData by type.
(按类型创建 PictureData 的实例。)
|
byte[] |
getChecksum()
Gets the checksum - the checksum can be of various length - mostly it's 8 (XSLF) or 16 (HSLF) bytes long.
(获取校验和 - 校验和可以有各种长度 - 大部分是 8 (XSLF) 或 16 (HSLF) 字节长。)
|
static byte[] |
getChecksum(byte[] data)
Compute 16-byte checksum of this picture using MD5 algorithm.
(使用 MD5 算法计算这张图片的 16 字节校验和。)
|
java.lang.String |
getContentType()
Returns content type (mime type) of this picture.
(返回此图片的内容类型(mime 类型)。)
|
java.util.Map<java.lang.String,java.util.function.Supplier<?>> |
getGenericProperties() |
byte[] |
getHeader()
Return 24 byte header which preceeds the actual picture data.
(返回实际图片数据之前的 24 字节标头。)
|
java.awt.Dimension |
getImageDimensionInPixels()
Return the original image dimensions in pixels
(返回以像素为单位的原始图像尺寸)
|
int |
getIndex() |
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.
(返回此图片的原始二进制数据,不包括保存图像签名和图像数据大小的前 8 个字节。)
|
protected abstract int |
getSignature()
Blip signature.
(昙花一现的签名。)
|
byte[] |
getUID()
Returns 16-byte checksum of this picture
(返回此图片的 16 字节校验和)
|
protected int |
getUIDInstanceCount()
The instance type/signatures defines if one or two UID instances will be included
(实例类型/签名定义是否包含一个或两个 UID 实例)
|
void |
setIndex(int index) |
void |
setOffset(int offset)
Set offset of this picture in the 'Pictures' stream.
(在“图片”流中设置此图片的偏移量。)
|
void |
setRawData(byte[] data) |
abstract void |
setSignature(int signature) |
protected void |
setUIDInstanceCount(int uidInstanceCount)
The instance type/signatures defines if one or two UID instances will be included
(实例类型/签名定义是否包含一个或两个 UID 实例)
|
void |
write(java.io.OutputStream out)
Write this picture into
OutputStream
(将此图片写入OutputStream)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getData, getImageDimension, getType, setData
getGenericChildren, getGenericRecordType
protected static final int CHECKSUM_SIZE
protected abstract int getSignature()
public abstract void setSignature(int signature)
protected int getUIDInstanceCount()
protected void setUIDInstanceCount(int uidInstanceCount)
uidInstanceCount
- the number of uid sequences
(uidInstanceCount - uid 序列的数量)
public byte[] getRawData()
public void setRawData(byte[] data)
public int getOffset()
public void setOffset(int offset)
offset
- in the 'Pictures' stream
(偏移量 - 在“图片”流中)
public byte[] getUID()
public byte[] getChecksum()
PictureData
getChecksum
in interface
PictureData
(接口 PictureData 中的 getChecksum)
public static byte[] getChecksum(byte[] data)
public void write(java.io.OutputStream out) throws java.io.IOException
OutputStream
(将此图片写入OutputStream)
java.io.IOException
(java.io.IOException)
public static HSLFPictureData create(PictureData.PictureType type)
PictureData
by type.
(按类型创建 PictureData 的实例。)
type
- type of the picture data. Must be one of the static constants defined in the
Picture class.
(type - 图片数据的类型。必须是 Picture 类中定义的静态常量之一。)
-
Returns:
-
concrete instance of
PictureData
(返回: PictureData 的具体实例)
-
getHeader
public byte[] getHeader()
Return 24 byte header which preceeds the actual picture data.
The header consists of 2-byte signature, 2-byte type, 4-byte image size and 16-byte checksum of the image data.
-
Returns:
-
the 24 byte header which preceeds the actual picture data.
-
getIndex
public int getIndex()
-
Returns:
-
the 1-based index of this pictures within the pictures stream
-
setIndex
public void setIndex(int index)
-
Parameters:
-
index
- sets the 1-based index of this pictures within the pictures stream
-
getContentType
public final java.lang.String getContentType()
Description copied from interface: PictureData
Returns content type (mime type) of this picture.
-
Specified by:
-
getContentType
in interface
PictureData
-
Returns:
-
content type of this picture.
-
getImageDimensionInPixels
public java.awt.Dimension getImageDimensionInPixels()
Description copied from interface: PictureData
Return the original image dimensions in pixels
-
Specified by:
-
getImageDimensionInPixels
in interface
PictureData
-
See Also:
-
PictureData.getImageDimension()
-
getGenericProperties
public java.util.Map<java.lang.String,java.util.function.Supplier<?>> getGenericProperties()
-
Specified by:
-
getGenericProperties
in interface
GenericRecord
Copyright 2021 The Apache Software Foundation or its licensors, as applicable.