当前位置: 首页>>代码示例>>Java>>正文


Java Format.RGBA8888属性代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.Pixmap.Format.RGBA8888属性的典型用法代码示例。如果您正苦于以下问题:Java Format.RGBA8888属性的具体用法?Java Format.RGBA8888怎么用?Java Format.RGBA8888使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.badlogic.gdx.graphics.Pixmap.Format的用法示例。


在下文中一共展示了Format.RGBA8888属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createHighlightingGraphic

private Texture createHighlightingGraphic(TextureRegion textureRegion)
{
	TextureData textureData = textureRegion.getTexture().getTextureData();
	textureData.prepare();
	Pixmap sourcePixmap = textureData.consumePixmap();
	Pixmap destinationPixmap = new Pixmap(textureRegion.getRegionWidth(), textureRegion.getRegionHeight(), Format.RGBA8888);
	Color color = new Color();

	for (int x = 0; x < textureRegion.getRegionWidth(); x++)
	{
		for (int y = 0; y < textureRegion.getRegionHeight(); y++)
		{
			int colorInt = sourcePixmap.getPixel(textureRegion.getRegionX() + x, textureRegion.getRegionY() + y);
			Color.rgba8888ToColor(color, colorInt);
			destinationPixmap.setColor(1.0f, 1f, 1.0f, 1);
			if (color.a > 0.004f)
				destinationPixmap.drawPixel(x, y);
		}
	}
	Texture result = new Texture(destinationPixmap);
	textureData.disposePixmap();
	destinationPixmap.dispose();
	return result;
}
 
开发者ID:MMORPG-Prototype,项目名称:MMORPG_Prototype,代码行数:24,代码来源:GameObjectHighlightGraphic.java

示例2: LightMap

public LightMap(RayHandler rayHandler, int fboWidth, int fboHeight) {
	this.rayHandler = rayHandler;

	if (fboWidth <= 0)
		fboWidth = 1;
	if (fboHeight <= 0)
		fboHeight = 1;
	frameBuffer = new FrameBuffer(Format.RGBA8888, fboWidth,
			fboHeight, false);
	pingPongBuffer = new FrameBuffer(Format.RGBA8888, fboWidth,
			fboHeight, false);

	lightMapMesh = createLightMapMesh();

	shadowShader = ShadowShader.createShadowShader();
	diffuseShader = DiffuseShader.createShadowShader();

	withoutShadowShader = WithoutShadowShader.createShadowShader();

	blurShader = Gaussian.createBlurShader(fboWidth, fboHeight);

}
 
开发者ID:bitbrain,项目名称:rbcgj-2016,代码行数:22,代码来源:LightMap.java

示例3: PowerLUT

/** W power will be in luminance, and H power will be in alpha**/
public PowerLUT(float powerW, float intensityW, float powerH, float intensityH, int width, int height){

	Pixmap pixmap = new Pixmap(width, height, Format.RGBA8888);
	for (int i=0; i<width; i++){
		float valueW = (float)Math.pow((float)i/width, powerW) * intensityW;
           for (int j = 0; j < height; j++) {
               float valueH = (float)Math.pow((float)j/height, powerH) * intensityH;
               pixmap.setColor(valueW, valueH, 1.0f, 1.0f);
               pixmap.drawPixel(i, j);
           }
	}
	
	PixmapTextureData data = new PixmapTextureData(pixmap, Format.RGBA8888, false, false, true);
	
	texture = new Texture(data);
	texture.setWrap(TextureWrap.ClampToEdge, TextureWrap.ClampToEdge);
	texture.setFilter(TextureFilter.Linear, TextureFilter.Linear);
}
 
开发者ID:CypherCove,项目名称:DoubleHelix,代码行数:19,代码来源:PowerLUT.java

示例4: OrthogonalTiledMapRendererWithObjects

public OrthogonalTiledMapRendererWithObjects(TiledMap map) {
    super(map);
    
    
    this.occlusionFbo = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth() / 2, Gdx.graphics.getHeight() / 2, false);
    this.shadowmapFbo = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth() / 2, 1, false);
    
    this.shadowmapTex = shadowmapFbo.getColorBufferTexture();
    this.shadowmapTex.setFilter(TextureFilter.Linear, TextureFilter.Linear);
    this.shadowmapTex.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
    
    //this.orthoCam = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    //this.orthoCam.setToOrtho(Y_DOWN);
    
    this.lights = new ArrayList<Light>();
    this.mouseLight = new Light(0, 0, Color.WHITE);
}
 
开发者ID:kibertoad,项目名称:swampmachine,代码行数:17,代码来源:OrthogonalTiledMapRendererWithObjects.java

示例5: testFlipVertical

@Test
public void testFlipVertical() {
    Pixmap flip = new Pixmap(2, 3, Format.RGBA8888);
    flip.drawPixel(0, 0, 0xAABBCCDD);
    flip.drawPixel(1, 2, 0x11223344);
    PixmapUtil.flipVertical(flip);

    Pixmap expected = new Pixmap(2, 3, Format.RGBA8888);
    expected.drawPixel(0, 2, 0xAABBCCDD);
    expected.drawPixel(1, 0, 0x11223344);

    pixmapEquals.assertEquals(expected, flip);

    flip.dispose();
    expected.dispose();
}
 
开发者ID:anonl,项目名称:nvlist,代码行数:16,代码来源:PixmapUtilTest.java

示例6: saveScreenshot

private static void saveScreenshot() throws IOException {
	int w = Gdx.graphics.getWidth();
	int h = Gdx.graphics.getHeight();				
	final Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Format.RGBA8888);
	ByteBuffer pixels = pixmap.getPixels();
	Gdx.gl.glReadPixels(0, 0, w, h, GL20.GL_RGBA, GL20.GL_UNSIGNED_BYTE, pixels);
	final int numBytes = w * h * 4;
	byte[] lines = new byte[numBytes];
	final int numBytesPerLine = w * 4;
	for (int i = 0; i < h; i++) {
		pixels.position((h - i - 1) * numBytesPerLine);
		pixels.get(lines, i * numBytesPerLine, numBytesPerLine);
	}
	pixels.clear();
	pixels.put(lines);
	System.out.println("Captured.");
	PixmapIO.writePNG(new FileHandle(androidDir+(++photoNumber)+".png"), pixmap);
}
 
开发者ID:randombot,项目名称:gametemplate,代码行数:18,代码来源:MarketUtils.java

示例7: toWhite

public static Pixmap toWhite(Pixmap img) {
    Pixmap alpha = new Pixmap(img.getWidth(), img.getHeight(), Format.RGBA8888);        
    //alpha.drawPixmap(img, 0, 0);
        
    int width = alpha.getWidth();
    int height = alpha.getHeight();
            
    //alpha.setColor(0xff00009f);
    for (int y = 0; y < height; y++) {
        for (int x = 0; x < width; x++) {
            int col = img.getPixel(x, y);
            Color color = new Color(col);
            if ( color.a > 0.2f ) {
                alpha.drawPixel(x, y, Color.WHITE.toIntBits());
            }
        }
    }
    
    img.dispose();
    
    return alpha;
}
 
开发者ID:tonysparks,项目名称:seventh,代码行数:22,代码来源:TextureUtil.java

示例8: ShaderTest

/**
     * 
     */
    public ShaderTest() {        
        ShaderProgram.pedantic = false;
        
        vertBlur = loadShader("blurv.frag");
        horBlur = loadShader("blurh.frag");
        light = loadShader("light.frag");
        
        shader = loadShader("inprint.frag");
        
        this.camera = new OrthographicCamera(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
        this.camera.setToOrtho(true, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
//        camera.setToOrtho(false);
        transform = new Matrix4();
        camera.update();
        batch = new SpriteBatch();//1024, shader);
        batch.setShader(null);
        batch.setProjectionMatrix(camera.combined);
        batch.setTransformMatrix(transform);
        
        this.buffer = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);    
        
        this.fboPing = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);
        this.fboPong = new FrameBuffer(Format.RGBA8888, Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), false);
    }
 
开发者ID:tonysparks,项目名称:seventh,代码行数:27,代码来源:ShaderTest.java

示例9: DungeonMeter

public DungeonMeter(DungeonKeeper target) {
        this.target = target;
        currentValue = 1f;
         Pixmap map = new Pixmap(128, 128, Format.RGBA8888);
         Color color = new Color(Color.BLACK);
         color.a = 0.3f;
 map.setColor(color);
 map.fill();

 Texture texture = new Texture(map);
 map.dispose();
 
 background = new Sprite(texture);
 
 map = new Pixmap(128, 128, Format.RGBA8888);
 map.setColor(Color.valueOf("99aa66"));
 map.fill();

 texture = new Texture(map);
 map.dispose();
 
 life = new Sprite(texture);
 
 padding = 5;
}
 
开发者ID:bitbrain,项目名称:maze,代码行数:25,代码来源:DungeonMeter.java

示例10: LifeBar

public LifeBar(GameObject target, TweenManager tweenManager) {
	this.target = target;

	Texture lifeTexture = Resources.get(Resources.LIFE, Texture.class);

	currentPoints = target.getCurrentLife();
	this.tweenManager = tweenManager;

	Pixmap map = new Pixmap(20, 100, Format.RGBA8888);
	map.setColor(Color.BLACK);
	map.fill();

	Texture backgroundTexture = new Texture(map);
	map.dispose();
	life = new Sprite(lifeTexture);
	background = new Sprite(backgroundTexture);

	padding = 10;

	getColor().a = 0.5f;
}
 
开发者ID:bitbrain,项目名称:plox,代码行数:21,代码来源:LifeBar.java

示例11: setupEye

private void setupEye(Eye eye, int width, int height, boolean hasStencil) {
	FrameBuffer buffer = new FrameBuffer(Format.RGBA8888, width, height, true, hasStencil);
	TextureRegion region = new TextureRegion(buffer.getColorBufferTexture());
	region.flip(false, true);
	VRCamera camera = new VRCamera(this, eye);
	camera.near = 0.1f;
	camera.far = 1000f;
	perEyeData[eye.index] = new VRPerEyeData(buffer, region, camera);
}
 
开发者ID:justinmarentette11,项目名称:Tower-Defense-Galaxy,代码行数:9,代码来源:VRContext.java

示例12: Create1x1ColorTexture

private Texture Create1x1ColorTexture(Color color)
{
	Pixmap pixmap = new Pixmap(1, 1, Format.RGBA8888);
	pixmap.setColor(color);
	pixmap.fill();
	return new Texture(pixmap);
}
 
开发者ID:bp2008,项目名称:blueirisviewer,代码行数:7,代码来源:BlueIrisViewer.java

示例13: Outline

public Outline (int width, int height, float viewportWidth, float viewportHeight) {
	buffer = new BouncingBuffer(Format.RGBA8888, width, height, false);

	superimpose = new Superimpose();

	filter = new OutlineFilter();
	filter.setViewportInverse(1f / viewportWidth, 1f / viewportHeight);
}
 
开发者ID:spookygames,项目名称:gdx-gfx,代码行数:8,代码来源:Outline.java

示例14: PostProcessor

/** Construct a new PostProcessor with the given parameters and the specified texture wrap mode */
public PostProcessor (int fboWidth, int fboHeight, boolean useDepth, boolean fsaa, boolean useAlphaChannel, boolean use32Bits,
	TextureWrap u, TextureWrap v) {
	if (use32Bits) {
		if (useAlphaChannel) {
			fbFormat = Format.RGBA8888;
		} else {
			fbFormat = Format.RGB888;
		}
	} else {
		if (useAlphaChannel) {
			fbFormat = Format.RGBA4444;
		} else {
			fbFormat = Format.RGB565;
		}
	}

	composite = newPingPongBuffer(fboWidth, fboHeight, fbFormat, useDepth, fsaa);
	setBufferTextureWrap(u, v);

	pipelineState = new PipelineState();

	capturing = false;
	hasCaptured = false;
	enabled = true;
	this.useDepth = useDepth;
	if (useDepth) {
		clearBits |= GL20.GL_DEPTH_BUFFER_BIT;
	}

	setViewport(null);
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:32,代码来源:PostProcessor.java

示例15: export

public void export() {
	float world[][] = this.world;

	Pixmap pixmap = new Pixmap(world.length, world.length, Format.RGBA8888);
	float maxh = 0;

	for (int i = 0; i < world.length; i++) {
		for (int j = 0; j < world.length; j++) {
			maxh = Math.max(maxh, world[i][j]);
		}
	}

	for (int i = 0; i < world.length; i++) {
		for (int j = 0; j < world.length; j++) {
			pixmap.setColor(world[i][j] / maxh, world[i][j] / maxh,
					world[i][j] / maxh, 1);
			if (world[i][j] < IslandManager.hauteurEau) {
				pixmap.setColor(world[i][j] / maxh, world[i][j] / maxh,
						0.8f, 1);

			}
			pixmap.drawPixel(i, j);
		}
	}
	FileHandle f = new FileHandle("map.png");
	PixmapIO.writePNG(f, pixmap);
	System.out.println("map exported. " + f.path());
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:28,代码来源:Island.java


注:本文中的com.badlogic.gdx.graphics.Pixmap.Format.RGBA8888属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。