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


Java Format.RGB888属性代码示例

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


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

示例1: create

@Override
public void create () {
	FileHandle file = Gdx.files.internal("data/bobargb8888-32x32.png");
	nonMipMapped[0] = new Texture(file, Format.Alpha, false);
	nonMipMapped[1] = new Texture(file, Format.LuminanceAlpha, false);
	nonMipMapped[2] = new Texture(file, Format.RGB888, false);
	nonMipMapped[3] = new Texture(file, Format.RGB565, false);
	nonMipMapped[4] = new Texture(file, Format.RGBA8888, false);
	nonMipMapped[5] = new Texture(file, Format.RGBA4444, false);

	mipMapped[0] = new Texture(file, Format.Alpha, true);
	mipMapped[1] = new Texture(file, Format.LuminanceAlpha, true);
	mipMapped[2] = new Texture(file, Format.RGB888, true);
	mipMapped[3] = new Texture(file, Format.RGB565, true);
	mipMapped[4] = new Texture(file, Format.RGBA8888, true);
	mipMapped[5] = new Texture(file, Format.RGBA4444, true);

	batch = new SpriteBatch();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:19,代码来源:TextureFormatTest.java

示例2: init

@Override
public void init() {
	
	//Initialize the libgdx objects
	spriteBatch = new SpriteBatch();
	background = new Texture(width,height,Format.RGB888);
	
	//Initialize the image buffers
	image = new byte[width*height*3];
	imageByteBuffer = ByteBuffer.allocateDirect(width*height*3);

	//Initialize the device camera interface
	camera = Webcam.getDefault();
	camera.setViewSize(new Dimension(width,height));
	camera.open();

	//Launch the device camera listener
	cameraThread = new Thread(){
		@Override
		public void run(){
			webcamRunner();
		}
	};
	running = true;
	cameraThread.start();
}
 
开发者ID:chili-epfl,项目名称:libgdx-sample,代码行数:26,代码来源:DesktopCameraController.java

示例3: 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

示例4: makeSkybox

public static Pixmap[] makeSkybox(String string) {
	Pixmap big = new Pixmap( // right
			Gdx.files.internal("data/textures/" + string));

	Pixmap[] texturesSkyBoxNight = new Pixmap[6];
	int res = big.getHeight() / 3;

	texturesSkyBoxNight[0] = new Pixmap(res, res, Format.RGB888);
	texturesSkyBoxNight[0].drawPixmap(big, 0, 0, res, res, res, res);
	texturesSkyBoxNight[1] = new Pixmap(res, res, Format.RGB888);
	texturesSkyBoxNight[1].drawPixmap(big, 0, 0, res * 3, res, res, res);
	texturesSkyBoxNight[2] = new Pixmap(res, res, Format.RGB888);
	texturesSkyBoxNight[2].drawPixmap(big, 0, 0, res, 0, res, res);
	texturesSkyBoxNight[3] = new Pixmap(res, res, Format.RGB888);
	texturesSkyBoxNight[3].drawPixmap(big, 0, 0, res, res * 2, res, res);
	texturesSkyBoxNight[4] = new Pixmap(res, res, Format.RGB888);
	texturesSkyBoxNight[4].drawPixmap(big, 0, 0, res * 2, res, res, res);
	texturesSkyBoxNight[5] = new Pixmap(res, res, Format.RGB888);
	texturesSkyBoxNight[5].drawPixmap(big, 0, 0, 0, res, res, res);

	texturesSkyBoxNight[0] = flipPixmap(texturesSkyBoxNight[0]);
	texturesSkyBoxNight[1] = flipPixmap(texturesSkyBoxNight[1]);
	texturesSkyBoxNight[2] = rotatePixmap(texturesSkyBoxNight[2]);
	texturesSkyBoxNight[3] = rotatePixmap(texturesSkyBoxNight[3]);
	texturesSkyBoxNight[4] = flipPixmap(texturesSkyBoxNight[4]);
	texturesSkyBoxNight[5] = flipPixmap(texturesSkyBoxNight[5]);

	return texturesSkyBoxNight;
}
 
开发者ID:Osaris31,项目名称:exterminate,代码行数:29,代码来源:Skybox.java

示例5: PostProcessor

/**
 * Construct a new PostProcessor with the given parameters and the specified texture wrap mode
 */
public PostProcessor(int fboWidth, int fboHeight, boolean useDepth, 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);
   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:bitbrain,项目名称:braingdx,代码行数:34,代码来源:PostProcessor.java

示例6: ColoredRenderLayer

public ColoredRenderLayer() {
   batch = new SpriteBatch();
   camera = new OrthographicCamera();
   camera.setToOrtho(false, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
   camera.update();
   Pixmap pixmap = new Pixmap(Gdx.graphics.getWidth(), Gdx.graphics.getHeight(), Format.RGB888);
   pixmap.setColor(Color.WHITE);
   pixmap.fill();
   texture = new Texture(pixmap);
   pixmap.dispose();
}
 
开发者ID:bitbrain,项目名称:braingdx,代码行数:11,代码来源:ColoredRenderLayer.java

示例7: createTile

public static Texture createTile(Color c) {
	pixmap = new Pixmap(1, 1, Format.RGB888);
	pixmap.setColor(c);
	pixmap.fill();

	Texture tex = new Texture(pixmap);
	pixmap.dispose();
	return tex;
}
 
开发者ID:0XDE57,项目名称:SpaceProject,代码行数:9,代码来源:TextureFactory.java

示例8: processFile

@Override
protected void processFile (Entry entry) throws Exception {
	System.out.println("Processing " + entry.inputFile);
	Pixmap pixmap = new Pixmap(new FileHandle(entry.inputFile));
	if (pixmap.getFormat() != Format.RGB888 && pixmap.getFormat() != Format.RGB565) {
		System.out.println("Converting from " + pixmap.getFormat() + " to RGB888!");
		Pixmap tmp = new Pixmap(pixmap.getWidth(), pixmap.getHeight(), Format.RGB888);
		tmp.drawPixmap(pixmap, 0, 0, 0, 0, pixmap.getWidth(), pixmap.getHeight());
		pixmap.dispose();
		pixmap = tmp;
	}
	ETC1.encodeImagePKM(pixmap).write(new FileHandle(entry.outputFile));
	pixmap.dispose();
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:14,代码来源:ETC1Compressor.java

示例9: generateSky

void generateSky() {
	Pixmap skyMap = new Pixmap(50, 50, Format.RGB888);
	skyMap.setColor(Color.valueOf(Resources.COLOR_SKY));
	skyMap.fill();
	sky = new Sprite(new Texture(skyMap));
	skyMap.dispose();
	sky.setBounds(0, 0, Gdx.graphics.getWidth(), street.getY());
}
 
开发者ID:bitbrain,项目名称:pretender,代码行数:8,代码来源:IngameScreen.java

示例10: createTexture

private static Texture createTexture(Color color) {
  Pixmap pm = new Pixmap(SIZE, SIZE, Format.RGB888);
  pm.setColor(color);
  pm.fillRectangle(0, 0, SIZE, SIZE);
  Texture texture = new Texture(pm);
  pm.dispose();
  return texture;
}
 
开发者ID:guillaume-alvarez,项目名称:ShapeOfThingsThatWere,代码行数:8,代码来源:CounterRenderSystem.java

示例11: createEmptyImage

/**
 * erstelle ein leeres Bild. von der größe der Puzzleteils wird für das
 * "leere" Bild benötigt
 */
private void createEmptyImage() {
	Pixmap pixel = new Pixmap(puzzleWidth, puzzleHeight, Format.RGB888);
	pixel.setColor(Color.MAGENTA);
	pixel.fill();
	emptyImage = new Image(new Texture(pixel));
	emptyImage.setSize(puzzleWidth, puzzleHeight);
	emptyImage.setName("emptyImage");
	pixel.dispose();
}
 
开发者ID:PhilippGrulich,项目名称:HAW-SE2-projecthorse,代码行数:13,代码来源:Puzzle.java

示例12: getFrameBuffer

public FrameBuffer getFrameBuffer(int w, int h) {
    String key = getKey(w, h);
    if (!fbmap.containsKey(key)) {
        FrameBuffer fb = new FrameBuffer(Format.RGB888, w, h, true);
        fbmap.put(key, fb);
    }
    return fbmap.get(key);
}
 
开发者ID:langurmonkey,项目名称:gaiasky,代码行数:8,代码来源:GaiaSky.java

示例13: resize

@Override
public void resize(int width, int height) {
	if (width != previousWidth && height != previousHeight) {
		positionUI();
		Viewport viewport = Env.game.getViewport();
		fbo = new FrameBuffer(Format.RGB888, viewport.getViewportWidth(),
				viewport.getViewportHeight(), false);
		fboRegion = new TextureRegion(fbo.getColorBufferTexture());
		fboRegion.flip(false, true);
		
		previousWidth = width;
		previousHeight = height;
	}
}
 
开发者ID:saltares,项目名称:ludumdare-29,代码行数:14,代码来源:GameScreen.java

示例14: createPixmap

private void createPixmap () {
	Pixmap whitePixmap = new Pixmap(2, 2, Format.RGB888);
	whitePixmap.setColor(Color.WHITE);
	whitePixmap.drawRectangle(0, 0, 2, 2);
	whiteTexture = new Texture(whitePixmap);
	whiteTexture.setWrap(TextureWrap.Repeat, TextureWrap.Repeat);
	whitePixmap.dispose();
}
 
开发者ID:kotcrab,项目名称:vis-editor,代码行数:8,代码来源:PickerCommons.java

示例15: createSolidTexture

public static final Texture createSolidTexture (Color color, int width, int height) {
	Pixmap map = new Pixmap(width, height, Format.RGB888);
	map.setColor(color);
	map.fill();
	Texture texture = new Texture(map);
	map.dispose();
	return texture;
}
 
开发者ID:Portals,项目名称:Pong,代码行数:8,代码来源:Util.java


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