Java Doc for ImageComponent.java in  » 6.0-JDK-Modules » java-3d » javax » media » j3d » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » java 3d » javax.media.j3d 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   javax.media.j3d.SceneGraphObject
      javax.media.j3d.NodeComponent
         javax.media.j3d.ImageComponent

All known Subclasses:   javax.media.j3d.ImageComponent3D,  javax.media.j3d.ImageComponent2D,
ImageComponent
abstract public class ImageComponent extends NodeComponent (Code)
Abstract class that is used to define 2D or 3D ImageComponent classes used in a Java 3D scene graph. This is used for texture images, background images and raster components of Shape3D nodes.

Image data may be passed to this ImageComponent object in one of two ways: by copying the image data into this object or by accessing the image data by reference.

  • By Copying: By default, the set and get image methods copy the image data into or out of this ImageComponent object. This is appropriate for many applications, since the application may reuse the RenderedImage object after copying it to the ImageComponent.
  • By Reference: A new feature in Java 3D version 1.2 allows image data to be accessed by reference, directly from the RenderedImage object. To use this feature, you need to construct an ImageComponent object with the byReference flag set to true. In this mode, a reference to the input data is saved, but the data itself is not necessarily copied (although it may be, depending on the value of the yUp flag, the format of the ImageComponent, and the format of the RenderedImage). Image data referenced by an ImageComponent object can only be modified via the updateData method. Applications must exercise care not to violate this rule. If any referenced RenderedImage is modified outside the updateData method after it has been passed to an ImageComponent object, the results are undefined. Another restriction in by-reference mode is that if the specified RenderedImage is not an instance of BufferedImage, then this ImageComponent cannot be used for readRaster or off-screen rendering operations, since these operations modify the ImageComponent data.

An image component object also specifies whether the orientation of its image data is "y-up" or "y-down" (the default). Y-up mode causes images to be interpreted as having their origin at the lower left (rather than the default upper left) of a texture or raster image with successive scan lines moving up. This is more consistent with texture mapping data onto a surface, and maps directly into the the way textures are used in OpenGL and other 3D APIs. Setting the yUp flag to true in conjunction with setting the byReference flag to true makes it possible for Java 3D to avoid copying the texture map in some cases.

Note that all color fields are treated as unsigned values, even though Java does not directly support unsigned variables. This means, for example, that an ImageComponent using a format of FORMAT_RGB5 can represent red, green, and blue values between 0 and 31, while an ImageComponent using a format of FORMAT_RGB8 can represent color values between 0 and 255. Even when byte values are used to create a RenderedImage with 8-bit color components, the resulting colors (bytes) are interpreted as if they were unsigned. Values greater than 127 can be assigned to a byte variable using a type cast. For example:

    byteVariable = (byte) intValue; // intValue can be > 127
If intValue is greater than 127, then byteVariable will be negative. The correct value will be extracted when it is used (by masking off the upper bits).

Inner Class :public enum ImageClass

Field Summary
final public static  intALLOW_FORMAT_READ
     Specifies that this ImageComponent object allows reading its format component information.
final public static  intALLOW_IMAGE_READ
     Specifies that this ImageComponent object allows reading its image component information.
final public static  intALLOW_IMAGE_WRITE
     Specifies that this ImageComponent object allows writing its image component information.
final public static  intALLOW_SIZE_READ
     Specifies that this ImageComponent object allows reading its size component information (width, height, and depth).
final public static  intFORMAT_CHANNEL8
     Specifies that each pixel contains 1 8-bit channel: it can be used for only luminance or only alpha or only intensity.
final public static  intFORMAT_LUM4_ALPHA4
     Specifies that each pixel contains 2 4-bit channels: one each for luminance and alpha.
final public static  intFORMAT_LUM8_ALPHA8
     Specifies that each pixel contains 2 8-bit channels: one each for luminance and alpha.
final public static  intFORMAT_R3_G3_B2
     Specifies that each pixel contains 2 3-bit channels: one each for red, green, and 1 2-bit channel for blue.
final public static  intFORMAT_RGB
     Specifies that each pixel contains 3 8-bit channels: one each for red, green, blue.
final public static  intFORMAT_RGB4
     Specifies that each pixel contains 3 4-bit channels: one each for red, green, blue.
final public static  intFORMAT_RGB5
     Specifies that each pixel contains 3 5-bit channels: one each for red, green, blue.
final public static  intFORMAT_RGB5_A1
     Specifies that each pixel contains 3 5-bit channels: one each for red, green, blue and 1 1-bit channel for alpha.
final public static  intFORMAT_RGB8
     Specifies that each pixel contains 3 8-bit channels: one each for red, green, blue.
final public static  intFORMAT_RGBA
     Specifies that each pixel contains 4 8-bit channels: one each for red, green, blue, alpha.
final public static  intFORMAT_RGBA4
     Specifies that each pixel contains 4 4-bit channels: one each for red, green, blue, alpha.
final public static  intFORMAT_RGBA8
     Specifies that each pixel contains 4 8-bit channels: one each for red, green, blue, alpha.
final static  intFORMAT_TOTAL
    

Constructor Summary
 ImageComponent()
    
public  ImageComponent(int format, int width, int height)
     Constructs an image component object using the specified format, width, and height.
public  ImageComponent(int format, int width, int height, boolean byReference, boolean yUp)
     Constructs an image component object using the specified format, width, height, byReference flag, and yUp flag.
Parameters:
  format - the image component format, one of: FORMAT_RGB,FORMAT_RGBA etc.
Parameters:
  width - the number of columns of pixels in this image componentobject
Parameters:
  height - the number of rows of pixels in this image componentobject
Parameters:
  byReference - a flag that indicates whether the data is copiedinto this image component object or is accessed by reference.
Parameters:
  yUp - a flag that indicates the y-orientation of this imagecomponent.

Method Summary
public  intgetFormat()
     Retrieves the format of this image component object.
public  intgetHeight()
     Retrieves the height of this image component object.
public  ImageClassgetImageClass()
     Retrieves the image class of this ImageComponent object.
public  intgetWidth()
     Retrieves the width of this image component object.
public  booleanisByReference()
     Retrieves the data access mode for this ImageComponent object.
public  booleanisYUp()
     Retrieves the y-orientation for this ImageComponent object.
public  voidsetYUp(boolean yUp)
     Sets the y-orientation of this ImageComponent object to y-up or y-down.
Parameters:
  yUp - a flag that indicates the y-orientation of this imagecomponent.

Field Detail
ALLOW_FORMAT_READ
final public static int ALLOW_FORMAT_READ(Code)
Specifies that this ImageComponent object allows reading its format component information.



ALLOW_IMAGE_READ
final public static int ALLOW_IMAGE_READ(Code)
Specifies that this ImageComponent object allows reading its image component information.



ALLOW_IMAGE_WRITE
final public static int ALLOW_IMAGE_WRITE(Code)
Specifies that this ImageComponent object allows writing its image component information.
since:
   Java 3D 1.3



ALLOW_SIZE_READ
final public static int ALLOW_SIZE_READ(Code)
Specifies that this ImageComponent object allows reading its size component information (width, height, and depth).



FORMAT_CHANNEL8
final public static int FORMAT_CHANNEL8(Code)
Specifies that each pixel contains 1 8-bit channel: it can be used for only luminance or only alpha or only intensity.



FORMAT_LUM4_ALPHA4
final public static int FORMAT_LUM4_ALPHA4(Code)
Specifies that each pixel contains 2 4-bit channels: one each for luminance and alpha.



FORMAT_LUM8_ALPHA8
final public static int FORMAT_LUM8_ALPHA8(Code)
Specifies that each pixel contains 2 8-bit channels: one each for luminance and alpha.



FORMAT_R3_G3_B2
final public static int FORMAT_R3_G3_B2(Code)
Specifies that each pixel contains 2 3-bit channels: one each for red, green, and 1 2-bit channel for blue.



FORMAT_RGB
final public static int FORMAT_RGB(Code)
Specifies that each pixel contains 3 8-bit channels: one each for red, green, blue. Same as FORMAT_RGB8.



FORMAT_RGB4
final public static int FORMAT_RGB4(Code)
Specifies that each pixel contains 3 4-bit channels: one each for red, green, blue.



FORMAT_RGB5
final public static int FORMAT_RGB5(Code)
Specifies that each pixel contains 3 5-bit channels: one each for red, green, blue.



FORMAT_RGB5_A1
final public static int FORMAT_RGB5_A1(Code)
Specifies that each pixel contains 3 5-bit channels: one each for red, green, blue and 1 1-bit channel for alpha.



FORMAT_RGB8
final public static int FORMAT_RGB8(Code)
Specifies that each pixel contains 3 8-bit channels: one each for red, green, blue. Same as FORMAT_RGB.



FORMAT_RGBA
final public static int FORMAT_RGBA(Code)
Specifies that each pixel contains 4 8-bit channels: one each for red, green, blue, alpha. Same as FORMAT_RGBA8.



FORMAT_RGBA4
final public static int FORMAT_RGBA4(Code)
Specifies that each pixel contains 4 4-bit channels: one each for red, green, blue, alpha.



FORMAT_RGBA8
final public static int FORMAT_RGBA8(Code)
Specifies that each pixel contains 4 8-bit channels: one each for red, green, blue, alpha. Same as FORMAT_RGBA.



FORMAT_TOTAL
final static int FORMAT_TOTAL(Code)




Constructor Detail
ImageComponent
ImageComponent()(Code)
Not a public constructor, for internal use



ImageComponent
public ImageComponent(int format, int width, int height)(Code)
Constructs an image component object using the specified format, width, and height. Default values are used for all other parameters. The default values are as follows:
    byReference : false
    yUp : false

Parameters:
  format - the image component format, one of: FORMAT_RGB,FORMAT_RGBA etc.
Parameters:
  width - the number of columns of pixels in this image componentobject
Parameters:
  height - the number of rows of pixels in this image componentobject
exception:
  IllegalArgumentException - if format is invalid, or ifwidth or height are not positive.



ImageComponent
public ImageComponent(int format, int width, int height, boolean byReference, boolean yUp)(Code)
Constructs an image component object using the specified format, width, height, byReference flag, and yUp flag.
Parameters:
  format - the image component format, one of: FORMAT_RGB,FORMAT_RGBA etc.
Parameters:
  width - the number of columns of pixels in this image componentobject
Parameters:
  height - the number of rows of pixels in this image componentobject
Parameters:
  byReference - a flag that indicates whether the data is copiedinto this image component object or is accessed by reference.
Parameters:
  yUp - a flag that indicates the y-orientation of this imagecomponent. If yUp is set to true, the origin of the image isthe lower left; otherwise, the origin of the image is the upperleft.
exception:
  IllegalArgumentException - if format is invalid, or ifwidth or height are not positive.
since:
   Java 3D 1.2




Method Detail
getFormat
public int getFormat()(Code)
Retrieves the format of this image component object. the format of this image component object
exception:
  CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph



getHeight
public int getHeight()(Code)
Retrieves the height of this image component object. the height of this image component object
exception:
  CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph



getImageClass
public ImageClass getImageClass()(Code)
Retrieves the image class of this ImageComponent object. the image class of this ImageComponent,one of: ImageClass.BUFFERED_IMAGE,ImageClass.RENDERED_IMAGE, or ImageClass.NIO_IMAGE_BUFFER.
since:
   Java 3D 1.5



getWidth
public int getWidth()(Code)
Retrieves the width of this image component object. the width of this image component object
exception:
  CapabilityNotSetException - if appropriate capability isnot set and this object is part of live or compiled scene graph



isByReference
public boolean isByReference()(Code)
Retrieves the data access mode for this ImageComponent object. true if the data access mode for thisImageComponent object is by-reference;false if the data access mode is by-copying.
since:
   Java 3D 1.2



isYUp
public boolean isYUp()(Code)
Retrieves the y-orientation for this ImageComponent object. true if the y-orientation of thisImageComponent object is y-up; false if they-orientation of this ImageComponent object is y-down.
since:
   Java 3D 1.2



setYUp
public void setYUp(boolean yUp)(Code)
Sets the y-orientation of this ImageComponent object to y-up or y-down.
Parameters:
  yUp - a flag that indicates the y-orientation of this imagecomponent. If yUp is set to true, the origin of the image isthe lower left; otherwise, the origin of the image is the upperleft.
exception:
  RestrictedAccessException - if the method is calledwhen this object is part of live or compiled scene graph.
exception:
  IllegalStateException - if the image class of this objectis ImageClass.NIO_IMAGE_BUFFER.
since:
   Java 3D 1.2



Fields inherited from javax.media.j3d.NodeComponent
boolean forceDuplicate(Code)(Java Doc)

Methods inherited from javax.media.j3d.NodeComponent
final void checkDuplicateNodeComponent(NodeComponent originalNodeComponent)(Code)(Java Doc)
public NodeComponent cloneNodeComponent()(Code)(Java Doc)
public NodeComponent cloneNodeComponent(boolean forceDuplicate)(Code)(Java Doc)
void createRetained()(Code)(Java Doc)
void duplicateAttributes(NodeComponent originalNode, boolean forceDuplicate)(Code)(Java Doc)
boolean duplicateChild()(Code)(Java Doc)
public void duplicateNodeComponent(NodeComponent originalNodeComponent)(Code)(Java Doc)
public void duplicateNodeComponent(NodeComponent originalNodeComponent, boolean forceDuplicate)(Code)(Java Doc)
public boolean getDuplicateOnCloneTree()(Code)(Java Doc)
public void setDuplicateOnCloneTree(boolean duplicate)(Code)(Java Doc)
void validateImageIllegalSharing(ImageComponent image)(Code)(Java Doc)

Fields inherited from javax.media.j3d.SceneGraphObject
Hashtable nodeHashtable(Code)(Java Doc)
SceneGraphObjectRetained retained(Code)(Java Doc)

Methods inherited from javax.media.j3d.SceneGraphObject
final boolean capabilityBitsEmpty()(Code)(Java Doc)
final void checkForLiveOrCompiled()(Code)(Java Doc)
final public void clearCapability(int bit)(Code)(Java Doc)
final public void clearCapabilityIsFrequent(int bit)(Code)(Java Doc)
final void clearLive()(Code)(Java Doc)
void createRetained()(Code)(Java Doc)
protected void duplicateSceneGraphObject(SceneGraphObject originalNode)(Code)(Java Doc)
final public boolean getCapability(int bit)(Code)(Java Doc)
final public boolean getCapabilityIsFrequent(int bit)(Code)(Java Doc)
public String getName()(Code)(Java Doc)
String getNamePrefix()(Code)(Java Doc)
NodeComponent getNodeComponent(NodeComponent originalNodeComponent, boolean forceDuplicate, Hashtable hashtable)(Code)(Java Doc)
public Object getUserData()(Code)(Java Doc)
final public boolean isCompiled()(Code)(Java Doc)
final public boolean isLive()(Code)(Java Doc)
final boolean isLiveOrCompiled()(Code)(Java Doc)
final public void setCapability(int bit)(Code)(Java Doc)
final public void setCapabilityIsFrequent(int bit)(Code)(Java Doc)
final void setCompiled()(Code)(Java Doc)
void setDefaultReadCapabilities(int[] bits)(Code)(Java Doc)
final void setLive()(Code)(Java Doc)
public void setName(String name)(Code)(Java Doc)
public void setUserData(Object userData)(Code)(Java Doc)
public String toString()(Code)(Java Doc)
public void updateNodeReferences(NodeReferenceTable referenceTable)(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.