de.matthiasmann.twl.renderer
Interface DynamicImage

All Superinterfaces:
Image, Resource
All Known Implementing Classes:
LWJGLDynamicImage

public interface DynamicImage
extends Image, Resource

A dynamic image is created at runtime by the application and can be updated any time.


Nested Class Summary
static class DynamicImage.Format
           
 
Method Summary
 void update(java.nio.ByteBuffer data, DynamicImage.Format format)
          Updates the complete image.
 void update(java.nio.ByteBuffer data, int stride, DynamicImage.Format format)
          Updates the complete image.
 void update(int xoffset, int yoffset, int width, int height, java.nio.ByteBuffer data, DynamicImage.Format format)
          Updates a region of the image with new data.
 void update(int xoffset, int yoffset, int width, int height, java.nio.ByteBuffer data, int stride, DynamicImage.Format format)
          Updates a region of the image with new data.
 
Methods inherited from interface de.matthiasmann.twl.renderer.Image
createTintedVersion, draw, draw, getHeight, getWidth
 
Methods inherited from interface de.matthiasmann.twl.renderer.Resource
destroy
 

Method Detail

update

void update(java.nio.ByteBuffer data,
            DynamicImage.Format format)
Updates the complete image.

Parameters:
data - The new texels
format - The format of the texel data
Throws:
java.lang.IllegalArgumentException - if the ByteBuffer does not contain enough data

update

void update(java.nio.ByteBuffer data,
            int stride,
            DynamicImage.Format format)
Updates the complete image.

Parameters:
data - The new texels
stride - The number of bytes from one row to the next
format - The format of the texel data
Throws:
java.lang.IllegalArgumentException - if the ByteBuffer does not contain enough data or the stride is not a multiple of the bytes per pixel of specifed format

update

void update(int xoffset,
            int yoffset,
            int width,
            int height,
            java.nio.ByteBuffer data,
            DynamicImage.Format format)
Updates a region of the image with new data.

Parameters:
xoffset - Specifies a texel offset in the x direction within the image
yoffset - Specifies a texel offset in the y direction within the image
width - Specifies the width of the update area
height - Specifies the height of the update area
data - The new texels
format - The format of the texel data
Throws:
java.lang.IllegalArgumentException - if the update area is not within the image bounds or the ByteBuffer does not contain enough data

update

void update(int xoffset,
            int yoffset,
            int width,
            int height,
            java.nio.ByteBuffer data,
            int stride,
            DynamicImage.Format format)
Updates a region of the image with new data.

Parameters:
xoffset - Specifies a texel offset in the x direction within the image
yoffset - Specifies a texel offset in the y direction within the image
width - Specifies the width of the update area
height - Specifies the height of the update area
data - The new texels
stride - The number of bytes from one row to the next
format - The format of the texel data
Throws:
java.lang.IllegalArgumentException - if the update area is not within the image bounds or the ByteBuffer does not contain enough data or the stride is not a multiple of the bytes per pixel of specifed format