Package org.apache.commons.imaging.formats.webp.chunks

# Class WebPChunkVp8x

java.lang.Object
org.apache.commons.imaging.common.BinaryFileParser
org.apache.commons.imaging.formats.webp.chunks.AbstractWebPChunk
org.apache.commons.imaging.formats.webp.chunks.WebPChunkVp8x

public final class WebPChunkVp8x extends AbstractWebPChunk
VP8X (descriptions of features used) chunk.

      0                   1                   2                   3
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                                                               |
     |                   WebP file header (12 bytes)                 |
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      ChunkHeader('VP8X')                      |
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |Rsv|I|L|E|X|A|R|                   Reserved                    |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |          Canvas Width Minus One               |             ...
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ...  Canvas Height Minus One    |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Since:
  1.0.0-alpha4
See Also:
  - Extended File Format

- ## Field Summary

  ### Fields inherited from class org.apache.commons.imaging.formats.webp.chunks.AbstractWebPChunk

  `bytes`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `WebPChunkVp8x(int type, int size, byte[] bytes)`
  Create a VP8x chunk.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dump(PrintWriter pw, int offset)`
  Print the chunk to the given stream.
  `int`
  `getCanvasHeight()`
  `int`
  `getCanvasWidth()`
  `boolean`
  `hasAlpha()`
  `boolean`
  `hasAnimation()`
  `boolean`
  `hasExif()`
  `boolean`
  `hasIcc()`
  `boolean`
  `hasXmp()`

  ### Methods inherited from class org.apache.commons.imaging.formats.webp.chunks.AbstractWebPChunk

  `getBytes, getChunkSize, getPayloadSize, getType, getTypeDescription`

  ### Methods inherited from class org.apache.commons.imaging.common.BinaryFileParser

  `debugNumber, debugNumber, getByteOrder, setByteOrder`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Constructor Details

  - ### WebPChunkVp8x

    public WebPChunkVp8x(int type, int size, byte[] bytes) throws ImagingException
    Create a VP8x chunk.
    Parameters:
      `type` - VP8X chunk type
      `size` - VP8X chunk size
      `bytes` - VP8X chunk data
    Throws:
      `ImagingException` - if the chunk data and the size provided do not match, or if the other parameters provided are invalid.

- ## Method Details

  - ### dump

    public void dump(PrintWriter pw, int offset) throws ImagingException, IOException
    Description copied from class: `AbstractWebPChunk`
    Print the chunk to the given stream.
    Overrides:
      `dump` in class `AbstractWebPChunk`
    Parameters:
      `pw` - a stream to write to.
      `offset` - chunk offset.
    Throws:
      `ImagingException` - if the image is invalid.
      `IOException` - if it fails to write to the given stream.

  - ### getCanvasHeight

    public int getCanvasHeight()
    Returns:
      the canvas height.

  - ### getCanvasWidth

    public int getCanvasWidth()
    Returns:
      the canvas width.

  - ### hasAlpha

    public boolean hasAlpha()
    Returns:
      whether the chunk has alpha enabled.

  - ### hasAnimation

    public boolean hasAnimation()
    Returns:
      if the chunk contains an animation.

  - ### hasExif

    public boolean hasExif()
    Returns:
      whether the chunk has EXIF data.

  - ### hasIcc

    public boolean hasIcc()
    Returns:
      whether the chunk has ICC enabled.

  - ### hasXmp

    public boolean hasXmp()
    Returns:
      whether the chunk has XMP.