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

The following examples show how to use com.badlogic.gdx.graphics.Pixmap#Format . These examples are extracted from open source projects. 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 Project: gdx-vfx   File: MotionBlurEffect.java    License: 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 Project: gdx-vfx   File: VfxRenderContext.java    License: 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 Project: gdx-vfx   File: VfxFrameBufferPool.java    License: 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 Project: gdx-vfx   File: VfxFrameBufferQueue.java    License: 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 5
Source Project: Norii   File: GifDecoder.java    License: 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 6
@LmlAction("onEncodingChanged") void onEncodingChanged() {
    if (model == null) return;
    if (ignoreViewChangeEvents) return;

    Pixmap.Format encoding = cboEncoding.getSelected();
    model.setEncoding(encoding);
}
 
Example 7
@LmlAction("onEncodingChanged") void onEncodingChanged() {
    if (model == null) return;
    if (ignoreViewChangeEvents) return;

    Pixmap.Format encoding = cboEncoding.getSelected();
    model.setEncoding(encoding);
}
 
Example 8
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 9
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 10
public void setEncoding(Pixmap.Format encoding) {
    this.encoding = encoding;

    if (eventDispatcher != null) {
        eventDispatcher.postEvent(new FileTypePropertyChangedEvent(this, Property.PNG_ENCODING));
    }
}
 
Example 11
Source Project: gdx-vfx   File: VfxWidgetGroup.java    License: 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);
}
 
Example 12
Source Project: gdx-vfx   File: VfxRenderContext.java    License: Apache License 2.0 4 votes vote down vote up
public Pixmap.Format getPixelFormat() {
    return pixelFormat;
}
 
Example 13
Source Project: gdx-vfx   File: VfxFrameBuffer.java    License: Apache License 2.0 4 votes vote down vote up
public VfxFrameBuffer(Pixmap.Format pixelFormat) {
    this.pixelFormat = pixelFormat;
}
 
Example 14
Source Project: gdx-vfx   File: VfxFrameBuffer.java    License: Apache License 2.0 4 votes vote down vote up
public Pixmap.Format getPixelFormat() {
    return pixelFormat;
}
 
Example 15
Source Project: Norii   File: GifDecoder.java    License: 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 16
private void updateEncoding() {
    if (model == null) return;

    Pixmap.Format encoding = model.getEncoding();
    cboEncoding.setSelected(encoding);
}
 
Example 17
public Pixmap.Format getEncoding() {
    return encoding;
}
 
Example 18
public Pixmap.Format getEncoding() {
    return encoding;
}
 
Example 19
public LibgdxFrameBufferWrapper(Pixmap.Format format, int width, int height, boolean hasDepth, boolean hasStencil) {
	super(format, width, height, hasDepth, hasStencil);
}
 
Example 20
Source Project: libgdx-snippets   File: PixmapRegion.java    License: MIT License 4 votes vote down vote up
public Pixmap.Format getFormat() {
	return pixmap.getFormat();
}