Java Code Examples for com.badlogic.gdx.graphics.Pixmap#Format

The following examples show how to use com.badlogic.gdx.graphics.Pixmap#Format . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: MotionBlurEffect.java    From gdx-vfx with Apache License 2.0 5 votes vote down vote up
public MotionBlurEffect(Pixmap.Format pixelFormat, MixEffect.Method mixMethod, float blurFactor) {
	mixFilter = register(new MixEffect(mixMethod));
	mixFilter.setMixFactor(blurFactor);

	copyFilter = register(new CopyEffect());

	localBuffer = new VfxFrameBufferQueue(pixelFormat,
			// On WebGL (GWT) we cannot render from/into the same texture simultaneously.
			// Will use ping-pong approach to avoid "writing into itself".
			Gdx.app.getType() == Application.ApplicationType.WebGL ? 2 : 1
	);
}
 
Example 2
Source File: VfxRenderContext.java    From gdx-vfx with Apache License 2.0 5 votes vote down vote up
public VfxRenderContext(Pixmap.Format pixelFormat, int bufferWidth, int bufferHeight) {
    this.bufferPool = new VfxFrameBufferPool(pixelFormat, bufferWidth, bufferHeight, 8);
    this.bufferRenderer = new VfxFrameBufferRenderer();
    this.pixelFormat = pixelFormat;
    this.bufferWidth = bufferWidth;
    this.bufferHeight = bufferHeight;
}
 
Example 3
Source File: VfxFrameBufferPool.java    From gdx-vfx with Apache License 2.0 5 votes vote down vote up
public VfxFrameBufferPool(Pixmap.Format pixelFormat, int width, int height, int initialCapacity) {
    this.width = width;
    this.height = height;
    this.pixelFormat = pixelFormat;

    this.managedBuffers = new Array<>(false, initialCapacity);
    this.freeBuffers = new Array<>(false, initialCapacity);
}
 
Example 4
Source File: PngFileTypeModel.java    From gdx-texture-packer-gui with Apache License 2.0 5 votes vote down vote up
public void setEncoding(Pixmap.Format encoding) {
    this.encoding = encoding;

    if (eventDispatcher != null) {
        eventDispatcher.postEvent(new FileTypePropertyChangedEvent(this, Property.PNG_ENCODING));
    }
}
 
Example 5
Source File: VfxFrameBufferQueue.java    From gdx-vfx with Apache License 2.0 5 votes vote down vote up
public VfxFrameBufferQueue(Pixmap.Format pixelFormat, int fboAmount) {
    if (fboAmount < 1) {
        throw new IllegalArgumentException("FBO amount should be a positive number.");
    }
    buffers = new Array<>(true, fboAmount);
    for (int i = 0; i < fboAmount; i++) {
        buffers.add(new VfxFrameBuffer(pixelFormat));
    }
}
 
Example 6
Source File: JpegFileTypeModel.java    From gdx-texture-packer-gui with Apache License 2.0 5 votes vote down vote up
public void setEncoding(Pixmap.Format encoding) {
    if (this.encoding == encoding) return;

    this.encoding = encoding;

    if (eventDispatcher != null) {
        eventDispatcher.postEvent(new FileTypePropertyChangedEvent(this, FileTypePropertyChangedEvent.Property.JPEG_ENCODING));
    }
}
 
Example 7
Source File: GifDecoder.java    From Norii with Apache License 2.0 5 votes vote down vote up
DixieMap(final int[] data, final int w, final int h, final Pixmap.Format f) {
	super(w, h, f);

	int x, y;

	for (y = 0; y < h; y++) {
		for (x = 0; x < w; x++) {
			final int pxl_ARGB8888 = data[x + y * w];
			final int pxl_RGBA8888 = ((pxl_ARGB8888 >> 24) & 0x000000ff) | ((pxl_ARGB8888 << 8) & 0xffffff00);
			// convert ARGB8888 > RGBA8888
			drawPixel(x, y, pxl_RGBA8888);
		}
	}
}
 
Example 8
Source File: PngFileTypeController.java    From gdx-texture-packer-gui with Apache License 2.0 5 votes vote down vote up
@LmlAction("onEncodingChanged") void onEncodingChanged() {
    if (model == null) return;
    if (ignoreViewChangeEvents) return;

    Pixmap.Format encoding = cboEncoding.getSelected();
    model.setEncoding(encoding);
}
 
Example 9
Source File: JpegFileTypeController.java    From gdx-texture-packer-gui with Apache License 2.0 5 votes vote down vote up
@LmlAction("onEncodingChanged") void onEncodingChanged() {
    if (model == null) return;
    if (ignoreViewChangeEvents) return;

    Pixmap.Format encoding = cboEncoding.getSelected();
    model.setEncoding(encoding);
}
 
Example 10
Source File: LibgdxTextureAtlasWrapper.java    From mini2Dx with Apache License 2.0 5 votes vote down vote up
public Page (FileHandle handle, float width, float height, boolean useMipMaps, Pixmap.Format format, Texture.TextureFilter minFilter,
			 Texture.TextureFilter magFilter, Texture.TextureWrap uWrap, Texture.TextureWrap vWrap) {
	this.width = width;
	this.height = height;
	this.textureFile = handle;
	this.useMipMaps = useMipMaps;
	this.format = format;
	this.minFilter = minFilter;
	this.magFilter = magFilter;
	this.uWrap = uWrap;
	this.vWrap = vWrap;
}
 
Example 11
Source File: PixmapRegion.java    From libgdx-snippets with MIT License 4 votes vote down vote up
public Pixmap.Format getFormat() {
	return pixmap.getFormat();
}
 
Example 12
Source File: LibgdxFrameBufferWrapper.java    From mini2Dx with Apache License 2.0 4 votes vote down vote up
public LibgdxFrameBufferWrapper(Pixmap.Format format, int width, int height, boolean hasDepth, boolean hasStencil) {
	super(format, width, height, hasDepth, hasStencil);
}
 
Example 13
Source File: PngFileTypeModel.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
public Pixmap.Format getEncoding() {
    return encoding;
}
 
Example 14
Source File: JpegFileTypeModel.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
public Pixmap.Format getEncoding() {
    return encoding;
}
 
Example 15
Source File: JpegFileTypeController.java    From gdx-texture-packer-gui with Apache License 2.0 4 votes vote down vote up
private void updateEncoding() {
    if (model == null) return;

    Pixmap.Format encoding = model.getEncoding();
    cboEncoding.setSelected(encoding);
}
 
Example 16
Source File: GifDecoder.java    From Norii with Apache License 2.0 4 votes vote down vote up
DixieMap(final int w, final int h, final Pixmap.Format f) {
	super(w, h, f);
}
 
Example 17
Source File: VfxFrameBuffer.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public Pixmap.Format getPixelFormat() {
    return pixelFormat;
}
 
Example 18
Source File: VfxFrameBuffer.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public VfxFrameBuffer(Pixmap.Format pixelFormat) {
    this.pixelFormat = pixelFormat;
}
 
Example 19
Source File: VfxRenderContext.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public Pixmap.Format getPixelFormat() {
    return pixelFormat;
}
 
Example 20
Source File: VfxWidgetGroup.java    From gdx-vfx with Apache License 2.0 4 votes vote down vote up
public VfxWidgetGroup(Pixmap.Format pixelFormat) {
    vfxManager = new VfxManager(pixelFormat);
    rendererAdapter = new CustomRendererAdapter();
    super.setTransform(false);
}