public class TextureLoader extends Object
Modifier and Type | Field and Description |
---|---|
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.
|
static int |
BY_REFERENCE
Optional flag - specifies that the ImageComponent2D will
access the image data by reference
|
static int |
GENERATE_MIPMAP
Optional flag - specifies that mipmaps are generated for all levels
|
static int |
Y_UP
Optional flag - specifies that the ImageComponent2D will
have a y-orientation of y up, meaning the origin of the image is the
lower left
|
Constructor and Description |
---|
TextureLoader(BufferedImage bImage)
Contructs a TextureLoader object using the specified BufferedImage
and default format RGBA
|
TextureLoader(BufferedImage bImage,
int flags)
Contructs a TextureLoader object using the specified BufferedImage,
option flags and default format RGBA
|
TextureLoader(BufferedImage bImage,
String format)
Contructs a TextureLoader object using the specified BufferedImage
and format
|
TextureLoader(BufferedImage bImage,
String format,
int flags)
Contructs a TextureLoader object using the specified BufferedImage,
format and option flags
|
TextureLoader(Image image,
Component observer)
Contructs a TextureLoader object using the specified Image
and default format RGBA
|
TextureLoader(Image image,
int flags,
Component observer)
Contructs a TextureLoader object using the specified Image
flags and default format RGBA
|
TextureLoader(Image image,
String format,
Component observer)
Contructs a TextureLoader object using the specified Image
and format
|
TextureLoader(Image image,
String format,
int flags,
Component observer)
Contructs a TextureLoader object using the specified Image
format and option flags
|
TextureLoader(String fname,
Component observer)
Contructs a TextureLoader object using the specified file
and default format RGBA
|
TextureLoader(String fname,
int flags,
Component observer)
Contructs a TextureLoader object using the specified file,
option flags and default format RGBA
|
TextureLoader(String fname,
String format,
Component observer)
Contructs a TextureLoader object using the specified file,
and format
|
TextureLoader(String fname,
String format,
int flags,
Component observer)
Contructs a TextureLoader object using the specified file,
format and option flags
|
TextureLoader(URL url,
Component observer)
Contructs a TextureLoader object using the specified URL
and default format RGBA
|
TextureLoader(URL url,
int flags,
Component observer)
Contructs a TextureLoader object using the specified URL,
option flags and default format RGBA
|
TextureLoader(URL url,
String format,
Component observer)
Contructs a TextureLoader object using the specified URL,
and format
|
TextureLoader(URL url,
String format,
int flags,
Component observer)
Contructs a TextureLoader object using the specified URL,
format and option flags
|
Modifier and Type | Method and Description |
---|---|
ImageComponent2D |
getImage()
Returns the associated ImageComponent2D object
|
ImageComponent2D |
getScaledImage(float xScale,
float yScale)
Returns the scaled ImageComponent2D object
|
ImageComponent2D |
getScaledImage(int width,
int height)
Returns the scaled ImageComponent2D object
|
Texture |
getTexture()
Returns the associated Texture object.
|
public static final int GENERATE_MIPMAP
public static final int BY_REFERENCE
public static final int Y_UP
public static final int ALLOW_NON_POWER_OF_TWO
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.
public TextureLoader(BufferedImage bImage)
bImage
- The BufferedImage used for loading the textureNullPointerException
- if bImage is nullpublic TextureLoader(BufferedImage bImage, String format)
bImage
- The BufferedImage used for loading the textureformat
- The format specifies which channels to useNullPointerException
- if bImage is nullpublic TextureLoader(BufferedImage bImage, int flags)
bImage
- The BufferedImage used for loading the textureflags
- The flags specify what options to use in texture loading (generate mipmap etc)NullPointerException
- if bImage is nullpublic TextureLoader(BufferedImage bImage, String format, int flags)
bImage
- The BufferedImage used for loading the textureformat
- The format specifies which channels to useflags
- The flags specify what options to use in texture loading (generate mipmap etc)NullPointerException
- if bImage is nullpublic TextureLoader(Image image, Component observer)
image
- The Image used for loading the textureobserver
- The associated image observerNullPointerException
- if image is nullImageException
- if there is a problem loading the imagepublic TextureLoader(Image image, String format, Component observer)
image
- The Image used for loading the textureformat
- The format specifies which channels to useobserver
- The associated image observerNullPointerException
- if image is nullImageException
- if there is a problem loading the imagepublic TextureLoader(Image image, int flags, Component observer)
image
- The Image used for loading the textureflags
- The flags specify what options to use in texture loading (generate mipmap etc)observer
- The associated image observerNullPointerException
- if image is nullImageException
- if there is a problem loading the imagepublic TextureLoader(Image image, String format, int flags, Component observer)
image
- The Image used for loading the textureformat
- The format specifies which channels to useflags
- The flags specify what options to use in texture loading (generate mipmap etc)observer
- The associated image observerNullPointerException
- if image is nullImageException
- if there is a problem loading the imagepublic TextureLoader(String fname, Component observer)
fname
- The file that specifies an Image to load the texture withobserver
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(String fname, String format, Component observer)
fname
- The file that specifies an Image to load the texture withformat
- The format specifies which channels to useobserver
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(String fname, int flags, Component observer)
fname
- The file that specifies an Image to load the texture withflags
- The flags specify what options to use in texture loading (generate mipmap etc)observer
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(String fname, String format, int flags, Component observer)
fname
- The file that specifies an Image to load the texture withformat
- The format specifies which channels to useflags
- The flags specify what options to use in texture loading (generate mipmap etc)observer
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(URL url, Component observer)
url
- The URL that specifies an Image to load the texture withobserver
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(URL url, String format, Component observer)
url
- The URL that specifies an Image to load the texture withformat
- The format specifies which channels to useobserver
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(URL url, int flags, Component observer)
url
- The URL that specifies an Image to load the texture withflags
- The flags specify what options to use in texture loading (generate mipmap etc)observer
- The associated image observerImageException
- if there is a problem reading the imagepublic TextureLoader(URL url, String format, int flags, Component observer)
url
- The url that specifies an Image to load the texture withformat
- The format specifies which channels to useflags
- The flags specify what options to use in texture loading (generate mipmap etc)observer
- The associated image observerImageException
- if there is a problem reading the imagepublic ImageComponent2D getImage()
public ImageComponent2D getScaledImage(float xScale, float yScale)
xScale
- The X scaling factoryScale
- The Y scaling factorpublic ImageComponent2D getScaledImage(int width, int height)
width
- The desired widthheight
- The desired heightpublic Texture getTexture()
Copyright © 2016–2022 SciJava. All rights reserved.