Class HSLFPictureData

    • Field Detail

      • CHECKSUM_SIZE

        protected static final int CHECKSUM_SIZE
        Size of the image checksum calculated using MD5 algorithm.
        See Also:
        Constant Field Values
    • Method Detail

      • getSignature

        protected abstract int getSignature()
        Blip signature.
      • setSignature

        public abstract void setSignature​(int signature)
      • getUIDInstanceCount

        protected int getUIDInstanceCount()
        The instance type/signatures defines if one or two UID instances will be included
      • setUIDInstanceCount

        protected void setUIDInstanceCount​(int uidInstanceCount)
        The instance type/signatures defines if one or two UID instances will be included
        Parameters:
        uidInstanceCount - the number of uid sequences
      • getOffset

        public int getOffset()
        File offset in the 'Pictures' stream
        Returns:
        offset in the 'Pictures' stream
      • setOffset

        @Deprecated
        @Removal(version="5.3")
        public void setOffset​(int offset)
        Deprecated.
        This function was only intended for POI internal use. If you have a use case you're concerned about, please open an issue in the POI issue tracker.
        Set offset of this picture in the 'Pictures' stream. We need to set it when a new picture is created.
        Parameters:
        offset - in the 'Pictures' stream
      • getUID

        public byte[] getUID()
        Returns 16-byte checksum of this picture
      • getChecksum

        public static byte[] getChecksum​(byte[] data)
        Compute 16-byte checksum of this picture using MD5 algorithm.
      • 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 picture.
        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
      • formatImageForSlideshow

        protected abstract byte[] formatImageForSlideshow​(byte[] data)
        Formats the picture data for storage in the slideshow.

        Images stored in HSLFSlideShows are represented differently than when they are standalone files. The exact formatting differs for each image type.

        Parameters:
        data - Original image data. If these bytes were written to a disk, a common image viewer would be able to render the image.
        Returns:
        Formatted image representation.