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

# Class WebPChunkVp8

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

public final class WebPChunkVp8 extends AbstractWebPChunk
VP8 (bitstream) 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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     |                      ChunkHeader('VP8 ')                      |
     |                                                               |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     :                           VP8 data                            :
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

Since:
  1.0.0-alpha4
See Also:
  - Simple File Format (Lossy)
  - VP8 Data Format and Decoding Guide

- ## Field Summary

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

  `bytes`

- ## Constructor Summary

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

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `dump(PrintWriter pw, int offset)`
  Print the chunk to the given stream.
  `int`
  `getHeight()`
  `int`
  `getHorizontalScale()`
  `int`
  `getVersionNumber()`
  `int`
  `getVerticalScale()`
  `int`
  `getWidth()`

  ### 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

  - ### WebPChunkVp8

    public WebPChunkVp8(int type, int size, byte[] bytes) throws ImagingException
    Create a VP8 chunk.
    Parameters:
      `type` - chunk type.
      `size` - chunk size.
      `bytes` - chunk data.
    Throws:
      `ImagingException` - if the chunk data and the size provided do not match.

- ## 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.

  - ### getHeight

    public int getHeight()
    Returns:
      the height.

  - ### getHorizontalScale

    public int getHorizontalScale()
    Returns:
      the horizontal scale.

  - ### getVersionNumber

    public int getVersionNumber()
    Returns:
      the version number.

  - ### getVerticalScale

    public int getVerticalScale()
    Returns:
      the vertical scale.

  - ### getWidth

    public int getWidth()
    Returns:
      the width.