RGBAComponent (Media Authoring with Java API)
Date: 2016-02-05

tv.amwa.maj.record

## Interface RGBAComponent

- All Superinterfaces:
    Cloneable
  All Known Implementing Classes:
    RGBAComponentImpl

      public interface RGBAComponent
      extends Cloneable

  Specifies an element of an array representing the order and size of the component values within a pixel value as part of an RGBA Layout. The RGB layout type type is a fixed-size 8 element array, where each element consists of an RGBA component value. Each RGBA component has with the following fields:

  - `code` - RGBA component kind enumerated value specifying the component kind.
  - `size` - Java byte specifying the number of bits.

  A `fill` component indicates unused bits. After the components have been specified, the remaining `code` and `size` fields should be set to `RGBAComponentKind.None` and `0` respectively.

  To make values of this type, use the following methods from the MAJ forge:

  - From its code and size: `Forge.makeRGBAComponent(RGBAComponentKind, byte)`;
  - A zero default value: `Forge.zeroRGBAComponent()`;
  - From a pseudo-XML string representation as generated by `toString()`: `Forge.parseRGBAComponent(String)`.
  See Also:
    `TypeDefinitions.RGBAComponent`, `TypeDefinitions.RGBALayout`, `RGBADescriptor`

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `RGBAComponent` | `clone()` Create a cloned copy of this RGBA component value.
    `RGBAComponentKind` | `getCode()` Returns the type of an RGBA component.
    `byte` | `getComponentSize()` Returns the size, measured in bits, of the RGBA component.
    `void` | `setCode(RGBAComponentKind code)` Sets the type of an RGBA component.
    `void` | `setComponentSize(byte size)` Sets the size, measured in bits, of the RGBA component.
    `String` | `toString()` Formats a pseudo-XML string representation of this RGBA component value.

- - ### Method Detail

    - #### getCode

          RGBAComponentKind getCode()

      Returns the type of an RGBA component.

      Returns:
        Type of an RGBA component.

    - #### setCode

          void setCode(RGBAComponentKind code)
                throws NullPointerException

      Sets the type of an RGBA component.

      Parameters:
        `code` - Type of an RGBA component.
      Throws:
        `NullPointerException` - The given component kind is `null`.

    - #### getComponentSize

          @UInt8
          byte getComponentSize()

      Returns the size, measured in bits, of the RGBA component.

      Returns:
        Size of the RGBA component.

    - #### setComponentSize

          void setComponentSize(@UInt8
                                byte size)
                         throws IllegalArgumentException

      Sets the size, measured in bits, of the RGBA component.

      Parameters:
        `size` - Size of the RGBA component.
      Throws:
        `IllegalArgumentException` - The size value is negative.

    - #### clone

          RGBAComponent clone()

      Create a cloned copy of this RGBA component value.

      Returns:
        Cloned copy of this RGBA component value.

    - #### toString

          String toString()

      Formats a pseudo-XML string representation of this RGBA component value. The representation consists of a `RGBAComponent` element with `Code` and `Size` sub-elements. For example, an 8-bit red component is represented as follows:

             <RGBAComponent>
               <Code>CompRed</Code>
               <ComponentSize>8</ComponentSize>
             </RGBAComponent>

      This representation can be parsed by `Forge.parseRGBAComponent(String)`.

      Overrides:
        `toString` in class `Object`
      Returns:
        Pseudo-XML representation of this RGBA component value.
      See Also:
        `Forge.parseRGBAComponent(String)`

(c)2007-2016 Richard Cartwright, all rights reserved. Licensed under Apache 2 license and subject to the AMWA IPR policy.