APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.graphics.g2d

public Class Gdx2DPixmap

extends Object
implements Disposable
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.utils.Disposable
Imports
java.io.ByteArrayOutputStream, .IOException, .InputStream, java.nio.ByteBuffer, com.badlogic.gdx.graphics.GL20, com.badlogic.gdx.utils.Disposable, .GdxRuntimeException

Author
mzechner

Field Summary

Modifier and TypeField and Description
pack-priv long
pack-priv int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
public static final int
pack-priv int
pack-priv long[]
pack-priv ByteBuffer
pack-priv int

Constructor Summary

AccessConstructor and Description
public
Gdx2DPixmap(byte[] encodedData, int offset, int len, int requestedFormat)

public
Gdx2DPixmap(ByteBuffer encodedData, int offset, int len, int requestedFormat)

public
Gdx2DPixmap(InputStream in, int requestedFormat)

public
Gdx2DPixmap(int width, int height, int format)

public
Gdx2DPixmap(ByteBuffer pixelPtr, long[] nativeData)

Method Summary

Modifier and TypeMethod and Description
public void
clear(int color)

private static native void
clear(long pixmap, int color)

private void
convert(int requestedFormat)

public void
dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

public void
drawCircle(int x, int y, int radius, int color)

private static native void
drawCircle(long pixmap, int x, int y, int radius, int color)

public void
drawLine(int x, int y, int x2, int y2, int color)

private static native void
drawLine(long pixmap, int x, int y, int x2, int y2, int color)

public void
drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int dstX, int dstY, int width, int height)

public void
drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)

private static native void
drawPixmap(long src, long dst, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)

public void
drawRect(int x, int y, int width, int height, int color)

private static native void
drawRect(long pixmap, int x, int y, int width, int height, int color)

public void
fillCircle(int x, int y, int radius, int color)

private static native void
fillCircle(long pixmap, int x, int y, int radius, int color)

public void
fillRect(int x, int y, int width, int height, int color)

private static native void
fillRect(long pixmap, int x, int y, int width, int height, int color)

public void
fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int color)

private static native void
fillTriangle(long pixmap, int x1, int y1, int x2, int y2, int x3, int y3, int color)

private static native void
free(long pixmap)

public static native String
public int
public String
private static String
getFormatString(int format)

public int
public int
public int
public int
public int
getPixel(int x, int y)

private static native int
getPixel(long pixmap, int x, int y)

public ByteBuffer
public int
private static native ByteBuffer
load(long[] nativeData, byte[] buffer, int offset, int len)

private static native ByteBuffer
loadByteBuffer(long[] nativeData, ByteBuffer buffer, int offset, int len)

public static Gdx2DPixmap
newPixmap(InputStream in, int requestedFormat)

public static Gdx2DPixmap
newPixmap(int width, int height, int format)

private static native ByteBuffer
newPixmap(long[] nativeData, int width, int height, int format)

public void
setBlend(int blend)

private static native void
setBlend(long src, int blend)

public void
setPixel(int x, int y, int color)

private static native void
setPixel(long pixmap, int x, int y, int color)

public void
setScale(int scale)

private static native void
setScale(long src, int scale)

public static int
toGlFormat(int format)

public static int
toGlType(int format)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

basePtrback to summary
pack-priv long basePtr
formatback to summary
pack-priv int format
GDX2D_BLEND_NONEback to summary
public static final int GDX2D_BLEND_NONE
GDX2D_BLEND_SRC_OVERback to summary
public static final int GDX2D_BLEND_SRC_OVER
GDX2D_FORMAT_ALPHAback to summary
public static final int GDX2D_FORMAT_ALPHA
GDX2D_FORMAT_LUMINANCE_ALPHAback to summary
public static final int GDX2D_FORMAT_LUMINANCE_ALPHA
GDX2D_FORMAT_RGB565back to summary
public static final int GDX2D_FORMAT_RGB565
GDX2D_FORMAT_RGB888back to summary
public static final int GDX2D_FORMAT_RGB888
GDX2D_FORMAT_RGBA4444back to summary
public static final int GDX2D_FORMAT_RGBA4444
GDX2D_FORMAT_RGBA8888back to summary
public static final int GDX2D_FORMAT_RGBA8888
GDX2D_SCALE_LINEARback to summary
public static final int GDX2D_SCALE_LINEAR
GDX2D_SCALE_NEARESTback to summary
public static final int GDX2D_SCALE_NEAREST
heightback to summary
pack-priv int height
nativeDataback to summary
pack-priv long[] nativeData
pixelPtrback to summary
pack-priv ByteBuffer pixelPtr
widthback to summary
pack-priv int width

Constructor Detail

Gdx2DPixmapback to summary
public Gdx2DPixmap(byte[] encodedData, int offset, int len, int requestedFormat) throws IOException
Gdx2DPixmapback to summary
public Gdx2DPixmap(ByteBuffer encodedData, int offset, int len, int requestedFormat) throws IOException
Gdx2DPixmapback to summary
public Gdx2DPixmap(InputStream in, int requestedFormat) throws IOException
Gdx2DPixmapback to summary
public Gdx2DPixmap(int width, int height, int format) throws GdxRuntimeException
Exceptions
GdxRuntimeException:
if allocation failed.
Gdx2DPixmapback to summary
public Gdx2DPixmap(ByteBuffer pixelPtr, long[] nativeData)

Method Detail

clearback to summary
public void clear(int color)
clearback to summary
private static native void clear(long pixmap, int color)
convertback to summary
private void convert(int requestedFormat)
disposeback to summary
public void dispose()

Implements com.badlogic.gdx.utils.Disposable.dispose.

Doc from com.badlogic.gdx.utils.Disposable.dispose.

Releases all resources of this object.

Annotations
@Override
drawCircleback to summary
public void drawCircle(int x, int y, int radius, int color)
drawCircleback to summary
private static native void drawCircle(long pixmap, int x, int y, int radius, int color)
drawLineback to summary
public void drawLine(int x, int y, int x2, int y2, int color)
drawLineback to summary
private static native void drawLine(long pixmap, int x, int y, int x2, int y2, int color)
drawPixmapback to summary
public void drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int dstX, int dstY, int width, int height)
drawPixmapback to summary
public void drawPixmap(Gdx2DPixmap src, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)
drawPixmapback to summary
private static native void drawPixmap(long src, long dst, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)
drawRectback to summary
public void drawRect(int x, int y, int width, int height, int color)
drawRectback to summary
private static native void drawRect(long pixmap, int x, int y, int width, int height, int color)
fillCircleback to summary
public void fillCircle(int x, int y, int radius, int color)
fillCircleback to summary
private static native void fillCircle(long pixmap, int x, int y, int radius, int color)
fillRectback to summary
public void fillRect(int x, int y, int width, int height, int color)
fillRectback to summary
private static native void fillRect(long pixmap, int x, int y, int width, int height, int color)
fillTriangleback to summary
public void fillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int color)
fillTriangleback to summary
private static native void fillTriangle(long pixmap, int x1, int y1, int x2, int y2, int x3, int y3, int color)
freeback to summary
private static native void free(long pixmap)
getFailureReasonback to summary
public static native String getFailureReason()
getFormatback to summary
public int getFormat()
getFormatStringback to summary
public String getFormatString()
getFormatStringback to summary
private static String getFormatString(int format)
getGLFormatback to summary
public int getGLFormat()
getGLInternalFormatback to summary
public int getGLInternalFormat()
getGLTypeback to summary
public int getGLType()
getHeightback to summary
public int getHeight()
getPixelback to summary
public int getPixel(int x, int y)
getPixelback to summary
private static native int getPixel(long pixmap, int x, int y)
getPixelsback to summary
public ByteBuffer getPixels()
getWidthback to summary
public int getWidth()
loadback to summary
private static native ByteBuffer load(long[] nativeData, byte[] buffer, int offset, int len)
loadByteBufferback to summary
private static native ByteBuffer loadByteBuffer(long[] nativeData, ByteBuffer buffer, int offset, int len)
newPixmapback to summary
public static Gdx2DPixmap newPixmap(InputStream in, int requestedFormat)
newPixmapback to summary
public static Gdx2DPixmap newPixmap(int width, int height, int format)
newPixmapback to summary
private static native ByteBuffer newPixmap(long[] nativeData, int width, int height, int format)
setBlendback to summary
public void setBlend(int blend)
setBlendback to summary
private static native void setBlend(long src, int blend)
setPixelback to summary
public void setPixel(int x, int y, int color)
setPixelback to summary
private static native void setPixel(long pixmap, int x, int y, int color)
setScaleback to summary
public void setScale(int scale)
setScaleback to summary
private static native void setScale(long src, int scale)
toGlFormatback to summary
public static int toGlFormat(int format)
toGlTypeback to summary
public static int toGlType(int format)