| java.lang.Object com.sun.j3d.utils.image.TextureLoader
All known Subclasses: com.db.utils.NewTextureLoader,
TextureLoader | public class TextureLoader extends Object (Code) | | This class is used for loading a texture from an Image or BufferedImage.
The Image I/O API is used to load the images. (If the JAI IIO Tools
package is available, a larger set of formats can be loaded, including
TIFF, JPEG2000, and so on.)
Methods are provided to retrieve the Texture object and the associated
ImageComponent object or a scaled version of the ImageComponent object.
Default format is RGBA. Other legal formats are: RGBA, RGBA4, RGB5_A1,
RGB, RGB4, RGB5, R3_G3_B2, LUM8_ALPHA8, LUM4_ALPHA4, LUMINANCE and ALPHA
|
Field Summary | |
final public static int | ALLOW_NON_POWER_OF_TWO Optional flag - specifies that the ImageComponent2D is allowed
to have dimensions that are not a power of two. | final public static int | BY_REFERENCE | final public static int | GENERATE_MIPMAP | final public static int | Y_UP |
Constructor Summary | |
public | TextureLoader(BufferedImage bImage) | public | TextureLoader(BufferedImage bImage, String format) | public | TextureLoader(BufferedImage bImage, int flags) | public | TextureLoader(BufferedImage bImage, String format, int flags) | public | TextureLoader(Image image, Component observer) | public | TextureLoader(Image image, String format, Component observer) | public | TextureLoader(Image image, int flags, Component observer) | public | TextureLoader(Image image, String format, int flags, Component observer) | public | TextureLoader(String fname, Component observer) | public | TextureLoader(String fname, String format, Component observer) | public | TextureLoader(String fname, int flags, Component observer) | public | TextureLoader(String fname, String format, int flags, Component observer) | public | TextureLoader(URL url, Component observer) | public | TextureLoader(URL url, String format, Component observer) | public | TextureLoader(URL url, int flags, Component observer) | public | TextureLoader(URL url, String format, int flags, Component observer) |
ALLOW_NON_POWER_OF_TWO | final public static int ALLOW_NON_POWER_OF_TWO(Code) | | Optional flag - specifies that the ImageComponent2D is allowed
to have dimensions that are not a power of two. If this flag is set,
TextureLoader will not perform any scaling of images. If this flag
is not set, images will be scaled to the nearest power of two. This is
the default mode.
Note that non-power-of-two textures may not be supported by all graphics
cards. Applications should check whether a particular Canvas3D supports
non-power-of-two textures by calling the
Canvas3D.queryProperties method, and checking whether the
textureNonPowerOfTwoAvailable property is set to true.
since: Java 3D 1.5 |
BY_REFERENCE | final public static int BY_REFERENCE(Code) | | Optional flag - specifies that the ImageComponent2D will
access the image data by reference
since: Java 3D 1.2 |
GENERATE_MIPMAP | final public static int GENERATE_MIPMAP(Code) | | Optional flag - specifies that mipmaps are generated for all levels
|
Y_UP | final public static int Y_UP(Code) | | Optional flag - specifies that the ImageComponent2D will
have a y-orientation of y up, meaning the origin of the image is the
lower left
since: Java 3D 1.2 |
TextureLoader | public TextureLoader(BufferedImage bImage)(Code) | | Contructs a TextureLoader object using the specified BufferedImage
and default format RGBA
Parameters: bImage - The BufferedImage used for loading the texture exception: NullPointerException - if bImage is null |
TextureLoader | public TextureLoader(BufferedImage bImage, String format)(Code) | | Contructs a TextureLoader object using the specified BufferedImage
and format
Parameters: bImage - The BufferedImage used for loading the texture Parameters: format - The format specifies which channels to use exception: NullPointerException - if bImage is null |
TextureLoader | public TextureLoader(BufferedImage bImage, int flags)(Code) | | Contructs a TextureLoader object using the specified BufferedImage,
option flags and default format RGBA
Parameters: bImage - The BufferedImage used for loading the texture Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) exception: NullPointerException - if bImage is null |
TextureLoader | public TextureLoader(BufferedImage bImage, String format, int flags)(Code) | | Contructs a TextureLoader object using the specified BufferedImage,
format and option flags
Parameters: bImage - The BufferedImage used for loading the texture Parameters: format - The format specifies which channels to use Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) exception: NullPointerException - if bImage is null |
TextureLoader | public TextureLoader(Image image, Component observer)(Code) | | Contructs a TextureLoader object using the specified Image
and default format RGBA
Parameters: image - The Image used for loading the texture Parameters: observer - The associated image observer exception: NullPointerException - if image is null exception: ImageException - if there is a problem loading the image |
TextureLoader | public TextureLoader(Image image, String format, Component observer)(Code) | | Contructs a TextureLoader object using the specified Image
and format
Parameters: image - The Image used for loading the texture Parameters: format - The format specifies which channels to use Parameters: observer - The associated image observer exception: NullPointerException - if image is null exception: ImageException - if there is a problem loading the image |
TextureLoader | public TextureLoader(Image image, int flags, Component observer)(Code) | | Contructs a TextureLoader object using the specified Image
flags and default format RGBA
Parameters: image - The Image used for loading the texture Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) Parameters: observer - The associated image observer exception: NullPointerException - if image is null exception: ImageException - if there is a problem loading the image |
TextureLoader | public TextureLoader(Image image, String format, int flags, Component observer)(Code) | | Contructs a TextureLoader object using the specified Image
format and option flags
Parameters: image - The Image used for loading the texture Parameters: format - The format specifies which channels to use Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) Parameters: observer - The associated image observer exception: NullPointerException - if image is null exception: ImageException - if there is a problem loading the image |
TextureLoader | public TextureLoader(String fname, Component observer)(Code) | | Contructs a TextureLoader object using the specified file
and default format RGBA
Parameters: fname - The file that specifies an Image to load the texture with Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(String fname, String format, Component observer)(Code) | | Contructs a TextureLoader object using the specified file,
and format
Parameters: fname - The file that specifies an Image to load the texture with Parameters: format - The format specifies which channels to use Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(String fname, int flags, Component observer)(Code) | | Contructs a TextureLoader object using the specified file,
option flags and default format RGBA
Parameters: fname - The file that specifies an Image to load the texture with Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(String fname, String format, int flags, Component observer)(Code) | | Contructs a TextureLoader object using the specified file,
format and option flags
Parameters: fname - The file that specifies an Image to load the texture with Parameters: format - The format specifies which channels to use Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(URL url, Component observer)(Code) | | Contructs a TextureLoader object using the specified URL
and default format RGBA
Parameters: url - The URL that specifies an Image to load the texture with Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(URL url, String format, Component observer)(Code) | | Contructs a TextureLoader object using the specified URL,
and format
Parameters: url - The URL that specifies an Image to load the texture with Parameters: format - The format specifies which channels to use Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(URL url, int flags, Component observer)(Code) | | Contructs a TextureLoader object using the specified URL,
option flags and default format RGBA
Parameters: url - The URL that specifies an Image to load the texture with Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
TextureLoader | public TextureLoader(URL url, String format, int flags, Component observer)(Code) | | Contructs a TextureLoader object using the specified URL,
format and option flags
Parameters: url - The url that specifies an Image to load the texture with Parameters: format - The format specifies which channels to use Parameters: flags - The flags specify what options to use in texture loading (generate mipmap etc) Parameters: observer - The associated image observer exception: ImageException - if there is a problem reading the image |
getImage | public ImageComponent2D getImage()(Code) | | Returns the associated ImageComponent2D object
The associated ImageComponent2D object |
getScaledImage | public ImageComponent2D getScaledImage(float xScale, float yScale)(Code) | | Returns the scaled ImageComponent2D object
Parameters: xScale - The X scaling factor Parameters: yScale - The Y scaling factor The scaled ImageComponent2D object |
getScaledImage | public ImageComponent2D getScaledImage(int width, int height)(Code) | | Returns the scaled ImageComponent2D object
Parameters: width - The desired width Parameters: height - The desired height The scaled ImageComponent2D object |
getTexture | public Texture getTexture()(Code) | | Returns the associated Texture object.
The associated Texture object |
|
|