|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objecttv.amwa.maj.embeddable.RGBAComponent
public final class RGBAComponent
Implements 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.
TypeDefinitionRecord.RGBAComponent,
RGBADescriptor,
RGBAComponentKind,
RGBALayout,
Serialized Form| Nested Class Summary | |
|---|---|
static class |
RGBAComponent.XMLHandler
XML parser event handler for converting RGBA component elements into RGBA component values. |
| Field Summary | |
|---|---|
static String |
RGBACOMPONENT_TAG
|
| Constructor Summary | |
|---|---|
RGBAComponent()
Create a new RGBA component with a RGBAComponentKind.Null code and
a size of 0. |
|
RGBAComponent(RGBAComponentKind code,
byte size)
Create an element of an RGBAComponent array. |
|
| Method Summary | |
|---|---|
void |
appendXMLChildren(Node parent)
Append child elements to the given parent node to serialize the value of an object to an XML fragment. |
static RGBAComponent |
castFromInterface(RGBAComponent component)
Cast a tv.amwa.maj.record.RGBAComponent
value from the generic interface to this implementation of
the interface. |
RGBAComponent |
clone()
Creates a cloned deep copy of this embeddable value. |
boolean |
equals(Object o)
Tests to see if the given object is equal to this embeddable value. |
RGBAComponentKind |
getCode()
Returns the type of an RGBA component. |
byte |
getSize()
Returns the size, measured in bits, of the RGBA component. |
int |
hashCode()
Returns a hash code value for this embeddable object. |
void |
setCode(RGBAComponentKind code)
Sets the type of an RGBA component. |
void |
setPropertiesFromInterface(RGBAComponent castFrom)
Set the properties of this value from those available in the given value, which is specified by the RGBA component interface. |
void |
setSize(byte size)
Sets the size, measured in bits, of the RGBA component. |
String |
toString()
Creates a pseudo-XML string representation of this RGBA component value. |
| Methods inherited from class java.lang.Object |
|---|
getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String RGBACOMPONENT_TAG
| Constructor Detail |
|---|
public RGBAComponent()
Create a new RGBA component with a RGBAComponentKind.Null code and
a size of 0.
This constructor is public to allow the
TypeDefinitionRecord.getObject(tv.amwa.maj.iface.PropertyValue, Class)
method to create new instances of objects from record property values.
public RGBAComponent(RGBAComponentKind code,
@UInt8
byte size)
throws NullPointerException,
IllegalArgumentException
Create an element of an RGBAComponent array.
code - Code for the component.size - Size of the component in bits.
NullPointerException - The code argument is null.
IllegalArgumentException - The size argument is negative.| Method Detail |
|---|
public static final RGBAComponent castFromInterface(RGBAComponent component)
throws NullPointerException
Cast a tv.amwa.maj.record.RGBAComponent
value from the generic interface to this implementation of
the interface. If the given value is not this
MAJ API implementation, a copy will be instantiated of this type and with an equivalent
value.
component - A potentially alien implementation of an instance of the RGBA component
interface.
NullPointerException - The given alien rational value is null.setPropertiesFromInterface(tv.amwa.maj.record.RGBAComponent)public final void setPropertiesFromInterface(RGBAComponent castFrom)
Set the properties of this value from those available in the given value, which is specified by the RGBA component interface.
castFrom - Value to extract properties from.
NullPointerException - The given value to use to set this value is null.castFromInterface(tv.amwa.maj.record.RGBAComponent)public final RGBAComponentKind getCode()
RGBAComponentReturns the type of an RGBA component.
getCode in interface RGBAComponent
public final void setCode(RGBAComponentKind code)
throws NullPointerException
RGBAComponentSets the type of an RGBA component.
setCode in interface RGBAComponentcode - Type of an RGBA component.
NullPointerException - The given component kind is null.@UInt8 public final byte getSize()
RGBAComponentReturns the size, measured in bits, of the RGBA component.
getSize in interface RGBAComponent
public final void setSize(@UInt8
byte size)
throws IllegalArgumentException
RGBAComponentSets the size, measured in bits, of the RGBA component.
setSize in interface RGBAComponentsize - Size of the RGBA component.
IllegalArgumentException - The size value is negative.public final boolean equals(Object o)
MAJCommonTests to see if the given object is equal to this embeddable value. To be equal, the given value must be not null, share the same interface to its value and each of the properties of the value must each be equal.
equals in interface MAJCommonequals in class Objecto - Object to test for equality with.
Object.equals(Object)public final String toString()
Creates 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>
<Size>8</Size>
</RGBAComponent>
toString in interface MAJCommontoString in class ObjectRGBAComponent.XMLHandlerpublic final RGBAComponent clone()
MAJCommonCreates a cloned deep copy of this embeddable value. The clone will be initialized to have the same value as this value but exists independently from then on. Changes to this value will not effect the clone and changes to the clone will not effect this. MAJ API clones are true deep clones with no shared references to areas of memory within the original.
This method does not throw a CloneNotSupportedException as all
embeddable values must implement the Cloneable interface.
clone in interface MAJCommonclone in class ObjectObject.clone()public int hashCode()
MAJCommonReturns a hash code value for this embeddable object.
hashCode in interface MAJCommonhashCode in class ObjectObject.hashCode()public void appendXMLChildren(Node parent)
XMLSerializableAppend child elements to the given parent node to serialize the value of an object
to an XML fragment. Methods of the XMLBuilder class are provided to help with this
process.
appendXMLChildren in interface XMLSerializableparent - XML parent element to append child nodes to.
|
Media Authoring with Java API |
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||