當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。