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 intGDX2D_BLEND_NONEstatic intGDX2D_BLEND_SRC_OVERstatic intGDX2D_FORMAT_ALPHAstatic intGDX2D_FORMAT_LUMINANCE_ALPHAstatic intGDX2D_FORMAT_RGB565static intGDX2D_FORMAT_RGB888static intGDX2D_FORMAT_RGBA4444static intGDX2D_FORMAT_RGBA8888static intGDX2D_SCALE_LINEARstatic intGDX2D_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 voidclear(int color)voiddispose()Releases all resources of this object.voiddrawCircle(int x, int y, int radius, int color)voiddrawLine(int x, int y, int x2, int y2, int color)voiddrawPixmap(Gdx2DPixmap src, int srcX, int srcY, int dstX, int dstY, int width, int height)voiddrawPixmap(Gdx2DPixmap src, int srcX, int srcY, int srcWidth, int srcHeight, int dstX, int dstY, int dstWidth, int dstHeight)voiddrawRect(int x, int y, int width, int height, int color)voidfillCircle(int x, int y, int radius, int color)voidfillRect(int x, int y, int width, int height, int color)voidfillTriangle(int x1, int y1, int x2, int y2, int x3, int y3, int color)static java.lang.StringgetFailureReason()intgetFormat()java.lang.StringgetFormatString()intgetGLFormat()intgetGLInternalFormat()intgetGLType()intgetHeight()intgetPixel(int x, int y)java.nio.ByteBuffergetPixels()intgetWidth()static Gdx2DPixmapnewPixmap(int width, int height, int format)static Gdx2DPixmapnewPixmap(java.io.InputStream in, int requestedFormat)voidsetBlend(int blend)voidsetPixel(int x, int y, int color)voidsetScale(int scale)static inttoGlFormat(int format)static inttoGlType(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:DisposableReleases all resources of this object.- Specified by:
disposein 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()
-
-