Class TextureProjected2D

    • Constructor Detail

      • TextureProjected2D

        public TextureProjected2D​(int dataSizeX,
                                  int dataSizeY,
                                  boolean useVertexZCoord)
    • Method Detail

      • getDataValue

        public double getDataValue​(double coordX,
                                   double coordY)
      • getDataValue

        public float getDataValue​(int indexX,
                                  int indexY)
      • makeProjectionDirty

        public void makeProjectionDirty()
      • getHandles

        public int[] getHandles()
        Description copied from interface: Texture
        Returns the OpenGL handle to the texture data. Most implementations will return an array with a single value. However, some implementations may split up very large data into multiple OpenGL textures. This method is necessary to support proper handling of multitexturing shaders.
        Specified by:
        getHandles in interface Texture
      • makeDirty

        public void makeDirty()
        Description copied from interface: Texture
        Most Texture implementations are backed by a buffer on the heap which acts as a staging area for data changes to the texture. Calling makeDirty() indicates that the contents of this buffer has changed and the new data should be copied to the GPU.
        Specified by:
        makeDirty in interface Texture
      • isDirty

        public boolean isDirty()
        Description copied from interface: Texture
        Indicates whether makeDirty() has been called. Once makeDirty() is called, isDirty() will return true until prepare( GL, int ) is called and the tecture data is copied to the GPU.
        Specified by:
        isDirty in interface Texture
        Returns:
        whether the cached texture data has changed
      • getNumDimension

        public int getNumDimension()
        Description copied from interface: Texture
        Returns whether the texture is a 1-dimensional, 2-dimensional, or 3-dimensional texture.
        Specified by:
        getNumDimension in interface Texture
        Returns:
        1, 2, or 3 depending on the dimension of the texture
      • getDimensionSize

        public int getDimensionSize​(int n)
        Description copied from interface: Texture
        Given a dimension index (0, 1, or 2) returns the number of data elements in the texture along that dimension.
        Specified by:
        getDimensionSize in interface Texture
        Parameters:
        n - the texture dimension to query
        Returns:
        the size of the queried dimension
      • prepare

        public boolean prepare​(GlimpseContext context,
                               int texUnit)
        Description copied from interface: Texture
        Allocates space for the texture in GPU texture memory (once, if this is the first time that prepare( GL, int) has been called), copies texture data from the heap into GPU memory (if isDirty() is true). This texture is then made active on the provided texture unit (using glActiveTexture()) and bound as the current GL_TEXTURE_1D, GL_TEXTURE_2D, or GL_TEXTURE_3D as appropriate based on getNumDimension(). Once this is complete, the texture is ready to be used by a GlimpsePainter.
        Specified by:
        prepare in interface Texture
        texUnit - the texture unit to bind to this texture
        Returns:
        whether the preparation succeeded
      • draw

        public void draw​(GlimpseContext context,
                         DrawableTextureProgram program,
                         int texUnit,
                         Collection<TextureUnit<Texture>> multiTextureList)
        Description copied from interface: DrawableTexture
        Draw the texture using the provided program.
        Specified by:
        draw in interface DrawableTexture
        Parameters:
        context - GlimpseContext for drawing
        texUnit - Texture unit to use while drawing
        multiTextureList - Other textures to activate (and their texture units) for multitexturing purposes
      • dispose

        public void dispose​(com.jogamp.opengl.GLContext context)
        Description copied from interface: Texture
        Disposes all Java heap and GPU resources associated with this texture.
        Specified by:
        dispose in interface Texture
        Parameters:
        context - the active GLContext
      • getMaxGLTextureSize

        public static int getMaxGLTextureSize​(com.jogamp.opengl.GL gl)
      • isResident

        @Deprecated
        public boolean isResident​(com.jogamp.opengl.GL2 gl)
        Deprecated.
        Relies on GL2, so may not work on platforms like OSX that don't support backward-compatible GL profiles like GLProfile.GL3bc.
      • resize

        public void resize​(int dataSizeX,
                           int dataSizeY)
        Resizes this two dimensional texture to the given new size. This deallocates any data stored on the graphics card and dirties the texture. If the texture size has been made larger, setData( ) or mutate( ) should be used to provide data for the new larger sections of the data. The dimensions of the data array argument to set data should be float[dataSizeX][dataSizeY].
        Parameters:
        dataSizeX - the number of texture elements in the 1st, or x, dimension
        dataSizeY - the number of texture elements in the 2nd, or y, dimension
      • setProjection

        public void setProjection​(Projection projection)
      • getProjection

        public Projection getProjection()