Package vrml.field
Class ConstSFImage
java.lang.Object
vrml.Field
vrml.ConstField
vrml.field.ConstSFImage
- All Implemented Interfaces:
Cloneable
VRML JSAI type class containing a fixed image field.
Unlike th e other fields, this field always replaces the existing array rather than copy values in. It assumes that pixel textures are not changed all that often.
- Version:
- $Revision: 1.5 $
- Author:
- Alan Hudson, Justin Couch
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intThe number of components in the image pixelsprotected intThe height of the imageprotected byte[]The raw pixel dataprotected intThe width of the imageFields inherited from class vrml.Field
valueChanged -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedConstruct an instance with default values.ConstSFImage(int width, int height, int components, byte[] pixels) Create a new image based on the given details. -
Method Summary
Modifier and TypeMethodDescriptionclone()Create a cloned copy of this node.intGet the number of components of the imageintGet the height of the image in pixels.voidgetPixels(byte[] pixels) Copy the image pixels into the user provided array.intgetWidth()Get the width of the image in pixels.toString()Create a string representation of this field.
-
Field Details
-
imageWidth
protected int imageWidthThe width of the image -
imageHeight
protected int imageHeightThe height of the image -
imageComponents
protected int imageComponentsThe number of components in the image pixels -
imagePixels
protected byte[] imagePixelsThe raw pixel data
-
-
Constructor Details
-
ConstSFImage
protected ConstSFImage()Construct an instance with default values. Not available to mere mortals. -
ConstSFImage
public ConstSFImage(int width, int height, int components, byte[] pixels) Create a new image based on the given details.- Parameters:
width- The width in pixels of the imageheight- The height in pixels of the imagecomponents- The number of components in the image [0-4]pixels- The raw pixels of the image
-
-
Method Details
-
getWidth
public int getWidth()Get the width of the image in pixels.- Returns:
- The width of the image
-
getHeight
public int getHeight()Get the height of the image in pixels.- Returns:
- The height of the image
-
getComponents
public int getComponents()Get the number of components of the image- Returns:
- The number of components [0-4]
-
getPixels
public void getPixels(byte[] pixels) Copy the image pixels into the user provided array.- Parameters:
pixels- The array to copy data into
-
toString
-
clone
-