org.stellarium.ui.render
Class STextureNoGlpng

java.lang.Object
  extended by org.stellarium.ui.render.STextureNoGlpng
All Implemented Interfaces:
STexture

 class STextureNoGlpng
extends java.lang.Object
implements STexture

Stellarium Texture

See C++ version of this file.

TODO: migrate to 0.8.1 and find a substitute for glpng?

Version:
Java
Author:
Jerome Beau

Field Summary
private  int loadType
           
private  int loadType2
           
private static java.lang.String texDir
           
private  int texID
           
private  java.lang.String textureName
           
private  boolean wholePath
           
 
Fields inherited from interface org.stellarium.ui.render.STexture
TEX_LOAD_TYPE_PNG_ALPHA, TEX_LOAD_TYPE_PNG_BLEND1, TEX_LOAD_TYPE_PNG_BLEND3, TEX_LOAD_TYPE_PNG_BLEND4, TEX_LOAD_TYPE_PNG_BLEND8, TEX_LOAD_TYPE_PNG_REPEAT, TEX_LOAD_TYPE_PNG_SOLID, TEX_LOAD_TYPE_PNG_SOLID_REPEAT
 
Constructor Summary
STextureNoGlpng(boolean fullPath, java.lang.String _textureName, int _loadType)
           
STextureNoGlpng(boolean fullPath, java.lang.String _textureName, int _loadType, boolean mipmap)
           
STextureNoGlpng(java.lang.String someTextureName)
           
STextureNoGlpng(java.lang.String _textureName, int _loadType)
           
STextureNoGlpng(java.lang.String _textureName, int _loadType, boolean mipmap)
           
 
Method Summary
 void close()
           
protected  void finalize()
           
private  int genTexture()
           
 float getAverageLuminance()
           
 int[] getDimensions()
           
 int getID()
           
 int getSize()
           
private  void initTexture(java.lang.String _textureName, int _loadType)
           
private  void initTexture(java.lang.String _textureName, int _loadType, boolean fullPath)
           
(package private)  boolean load(java.lang.String fullName)
           
(package private)  boolean load(java.lang.String fullName, boolean mipmap)
           
private  void makeRGBTexture(java.awt.image.BufferedImage img, int target, boolean mipmapped)
           
private  java.awt.image.BufferedImage readPNGImage(java.io.File file)
           
private  java.awt.image.BufferedImage readPNGImage(java.lang.String resourceName)
           
(package private)  void reload()
           
static void setTexDir(java.lang.String _texDir)
           
(package private)  void unload()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

textureName

private java.lang.String textureName

texID

private int texID

loadType

private int loadType

loadType2

private int loadType2

texDir

private static java.lang.String texDir

wholePath

private boolean wholePath
Constructor Detail

STextureNoGlpng

public STextureNoGlpng(java.lang.String someTextureName)
                throws StellariumException
Throws:
StellariumException

STextureNoGlpng

public STextureNoGlpng(java.lang.String _textureName,
                       int _loadType)
                throws StellariumException
Throws:
StellariumException

STextureNoGlpng

public STextureNoGlpng(boolean fullPath,
                       java.lang.String _textureName,
                       int _loadType)
                throws StellariumException
Throws:
StellariumException

STextureNoGlpng

public STextureNoGlpng(boolean fullPath,
                       java.lang.String _textureName,
                       int _loadType,
                       boolean mipmap)
                throws StellariumException
Throws:
StellariumException

STextureNoGlpng

public STextureNoGlpng(java.lang.String _textureName,
                       int _loadType,
                       boolean mipmap)
                throws StellariumException
Throws:
StellariumException
Method Detail

initTexture

private void initTexture(java.lang.String _textureName,
                         int _loadType,
                         boolean fullPath)

initTexture

private void initTexture(java.lang.String _textureName,
                         int _loadType)

finalize

protected void finalize()
                 throws java.lang.Throwable
Overrides:
finalize in class java.lang.Object
Throws:
java.lang.Throwable

load

boolean load(java.lang.String fullName)
       throws StellariumException
Throws:
StellariumException

load

boolean load(java.lang.String fullName,
             boolean mipmap)
       throws StellariumException
Throws:
StellariumException

genTexture

private int genTexture()

readPNGImage

private java.awt.image.BufferedImage readPNGImage(java.lang.String resourceName)

readPNGImage

private java.awt.image.BufferedImage readPNGImage(java.io.File file)

makeRGBTexture

private void makeRGBTexture(java.awt.image.BufferedImage img,
                            int target,
                            boolean mipmapped)

unload

void unload()

reload

void reload()
      throws StellariumException
Throws:
StellariumException

getSize

public int getSize()
Specified by:
getSize in interface STexture
Returns:
the texture size in pixels

getAverageLuminance

public float getAverageLuminance()
Specified by:
getAverageLuminance in interface STexture
Returns:
the average texture luminance : 0 is black, 1 is white

getDimensions

public int[] getDimensions()
Specified by:
getDimensions in interface STexture

close

public void close()
Specified by:
close in interface STexture

getID

public int getID()
Specified by:
getID in interface STexture
Returns:
the pointer ID used in OpenGL

setTexDir

public static void setTexDir(java.lang.String _texDir)