Package com.badlogic.gdx.graphics.g2d
Class Gdx2DPixmap
- java.lang.Object
-
- com.badlogic.gdx.graphics.g2d.Gdx2DPixmap
-
- All Implemented Interfaces:
Disposable
public class Gdx2DPixmap extends java.lang.Object implements Disposable
-
-
Field Summary
Fields Modifier and Type Field Description static int
GDX2D_BLEND_NONE
static int
GDX2D_BLEND_SRC_OVER
static int
GDX2D_FORMAT_ALPHA
static int
GDX2D_FORMAT_LUMINANCE_ALPHA
static int
GDX2D_FORMAT_RGB565
static int
GDX2D_FORMAT_RGB888
static int
GDX2D_FORMAT_RGBA4444
static int
GDX2D_FORMAT_RGBA8888
static int
GDX2D_SCALE_LINEAR
static int
GDX2D_SCALE_NEAREST
-
Constructor Summary
Constructors Constructor Description Gdx2DPixmap(byte[] encodedData, int offset, int len, int requestedFormat)
Gdx2DPixmap(int width, int height, int format)
Gdx2DPixmap(java.io.InputStream in, int requestedFormat)
Gdx2DPixmap(java.nio.ByteBuffer encodedData, int offset, int len, int requestedFormat)
Gdx2DPixmap(java.nio.ByteBuffer pixelPtr, long[] nativeData)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clear(int color)
void
dispose()
Releases all resources of this object.void
drawCircle(int x, int y, int radius, int color)
void
drawLine(int x, int y, int x2, int y2, int color)
void
drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int dstX, int dstY, int width, int height)
void
drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)
void
drawRect(int x, int y, int width, int height, int color)
void
fillCircle(int x, int y, int radius, int color)
void
fillRect(int x, int y, int width, int height, int color)
void
fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int color)
static java.lang.String
getFailureReason()
int
getFormat()
java.lang.String
getFormatString()
int
getGLFormat()
int
getGLInternalFormat()
int
getGLType()
int
getHeight()
int
getPixel(int x, int y)
java.nio.ByteBuffer
getPixels()
int
getWidth()
static Gdx2DPixmap
newPixmap(int width, int height, int format)
static Gdx2DPixmap
newPixmap(java.io.InputStream in, int requestedFormat)
void
setBlend(int blend)
void
setPixel(int x, int y, int color)
void
setScale(int scale)
static int
toGlFormat(int format)
static int
toGlType(int format)
-
-
-
Field Detail
-
GDX2D_FORMAT_ALPHA
public static final int GDX2D_FORMAT_ALPHA
- See Also:
- Constant Field Values
-
GDX2D_FORMAT_LUMINANCE_ALPHA
public static final int GDX2D_FORMAT_LUMINANCE_ALPHA
- See Also:
- Constant Field Values
-
GDX2D_FORMAT_RGB888
public static final int GDX2D_FORMAT_RGB888
- See Also:
- Constant Field Values
-
GDX2D_FORMAT_RGBA8888
public static final int GDX2D_FORMAT_RGBA8888
- See Also:
- Constant Field Values
-
GDX2D_FORMAT_RGB565
public static final int GDX2D_FORMAT_RGB565
- See Also:
- Constant Field Values
-
GDX2D_FORMAT_RGBA4444
public static final int GDX2D_FORMAT_RGBA4444
- See Also:
- Constant Field Values
-
GDX2D_SCALE_NEAREST
public static final int GDX2D_SCALE_NEAREST
- See Also:
- Constant Field Values
-
GDX2D_SCALE_LINEAR
public static final int GDX2D_SCALE_LINEAR
- See Also:
- Constant Field Values
-
GDX2D_BLEND_NONE
public static final int GDX2D_BLEND_NONE
- See Also:
- Constant Field Values
-
GDX2D_BLEND_SRC_OVER
public static final int GDX2D_BLEND_SRC_OVER
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Gdx2DPixmap
public Gdx2DPixmap(byte[] encodedData, int offset, int len, int requestedFormat) throws java.io.IOException
- Throws:
java.io.IOException
-
Gdx2DPixmap
public Gdx2DPixmap(java.nio.ByteBuffer encodedData, int offset, int len, int requestedFormat) throws java.io.IOException
- Throws:
java.io.IOException
-
Gdx2DPixmap
public Gdx2DPixmap(java.io.InputStream in, int requestedFormat) throws java.io.IOException
- Throws:
java.io.IOException
-
Gdx2DPixmap
public Gdx2DPixmap(int width, int height, int format) throws GdxRuntimeException
- Throws:
GdxRuntimeException
- if allocation failed.
-
Gdx2DPixmap
public Gdx2DPixmap(java.nio.ByteBuffer pixelPtr, long[] nativeData)
-
-
Method Detail
-
toGlFormat
public static int toGlFormat(int format)
-
toGlType
public static int toGlType(int format)
-
dispose
public void dispose()
Description copied from interface:Disposable
Releases all resources of this object.- Specified by:
dispose
in interfaceDisposable
-
clear
public void clear(int color)
-
setPixel
public void setPixel(int x, int y, int color)
-
getPixel
public int getPixel(int x, int y)
-
drawLine
public void drawLine(int x, int y, int x2, int y2, int color)
-
drawRect
public void drawRect(int x, int y, int width, int height, int color)
-
drawCircle
public void drawCircle(int x, int y, int radius, int color)
-
fillRect
public void fillRect(int x, int y, int width, int height, int color)
-
fillCircle
public void fillCircle(int x, int y, int radius, int color)
-
fillTriangle
public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int color)
-
drawPixmap
public void drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int dstX, int dstY, int width, int height)
-
drawPixmap
public void drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)
-
setBlend
public void setBlend(int blend)
-
setScale
public void setScale(int scale)
-
newPixmap
public static Gdx2DPixmap newPixmap(java.io.InputStream in, int requestedFormat)
-
newPixmap
public static Gdx2DPixmap newPixmap(int width, int height, int format)
-
getPixels
public java.nio.ByteBuffer getPixels()
-
getHeight
public int getHeight()
-
getWidth
public int getWidth()
-
getFormat
public int getFormat()
-
getGLInternalFormat
public int getGLInternalFormat()
-
getGLFormat
public int getGLFormat()
-
getGLType
public int getGLType()
-
getFormatString
public java.lang.String getFormatString()
-
getFailureReason
public static java.lang.String getFailureReason()
-
-