本文整理匯總了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();
}
示例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();
}
示例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);
}
示例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;
}
示例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);
}
示例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();
}
示例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;
}
示例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();
}
示例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());
}
示例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;
}
示例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();
}
示例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);
}
示例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;
}
}
示例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();
}
示例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;
}