texHeight = ktx.getHeight(); } else if (file.name().toLowerCase().endsWith(".etc1")) { etc1 = new ETC1Data(file); nLevels = 1; texWidth = etc1.width; ByteBuffer ktxData = ktx.getData(level, ktxFace); if (ktxData != null && ktx.getGlInternalFormat() == ETC1.ETC1_RGB8_OES) levelETCData = new ETC1Data(levelWidth, levelHeight, ktxData, 0); facePixmap = ETC1.decodeImage(new ETC1Data(levelWidth, levelHeight, ktxData, 0), Format.RGB888);
texHeight = ktx.getHeight(); } else if (file.name().toLowerCase().endsWith(".etc1")) { etc1 = new ETC1Data(file); nLevels = 1; texWidth = etc1.width; ByteBuffer ktxData = ktx.getData(level, ktxFace); if (ktxData != null && ktx.getGlInternalFormat() == ETC1.ETC1_RGB8_OES) levelETCData = new ETC1Data(levelWidth, levelHeight, ktxData, 0); facePixmap = ETC1.decodeImage(new ETC1Data(levelWidth, levelHeight, ktxData, 0), Format.RGB888);
if (glInternalFormat == ETC1.ETC1_RGB8_OES) { if (!Gdx.graphics.supportsExtension("GL_OES_compressed_ETC1_RGB8_texture")) { ETC1Data etcData = new ETC1Data(pixelWidth, pixelHeight, data, 0); Pixmap pixmap = ETC1.decodeImage(etcData, Format.RGB888); Gdx.gl.glTexImage2D(target + face, level, pixmap.getGLInternalFormat(), pixmap.getWidth(),
texHeight = ktx.getHeight(); } else if (file.name().toLowerCase().endsWith(".etc1")) { etc1 = new ETC1Data(file); nLevels = 1; texWidth = etc1.width; ByteBuffer ktxData = ktx.getData(level, ktxFace); if (ktxData != null && ktx.getGlInternalFormat() == ETC1.ETC1_RGB8_OES) levelETCData = new ETC1Data(levelWidth, levelHeight, ktxData, 0); facePixmap = ETC1.decodeImage(new ETC1Data(levelWidth, levelHeight, ktxData, 0), Format.RGB888);
texHeight = ktx.getHeight(); } else if (file.name().toLowerCase().endsWith(".etc1")) { etc1 = new ETC1Data(file); nLevels = 1; texWidth = etc1.width; ByteBuffer ktxData = ktx.getData(level, ktxFace); if (ktxData != null && ktx.getGlInternalFormat() == ETC1.ETC1_RGB8_OES) levelETCData = new ETC1Data(levelWidth, levelHeight, ktxData, 0); facePixmap = ETC1.decodeImage(new ETC1Data(levelWidth, levelHeight, ktxData, 0), Format.RGB888);
if (glInternalFormat == ETC1.ETC1_RGB8_OES) { if (!Gdx.graphics.supportsExtension("GL_OES_compressed_ETC1_RGB8_texture")) { ETC1Data etcData = new ETC1Data(pixelWidth, pixelHeight, data, 0); Pixmap pixmap = ETC1.decodeImage(etcData, Format.RGB888); Gdx.gl.glTexImage2D(target + face, level, pixmap.getGLInternalFormat(), pixmap.getWidth(),
@Override public void prepare () { if (isPrepared) throw new GdxRuntimeException("Already prepared"); if (file == null && data == null) throw new GdxRuntimeException("Can only load once from ETC1Data"); if (file != null) { data = new ETC1Data(file); } width = data.width; height = data.height; isPrepared = true; }
/** Encodes the image via the ETC1 compression scheme. Only {@link Format#RGB565} and {@link Format#RGB888} are supported. Adds * a PKM header in front of the compressed image data. * @param pixmap the {@link Pixmap} * @return the {@link ETC1Data} */ public static ETC1Data encodeImagePKM (Pixmap pixmap) { int pixelSize = getPixelSize(pixmap.getFormat()); ByteBuffer compressedData = encodeImagePKM(pixmap.getPixels(), 0, pixmap.getWidth(), pixmap.getHeight(), pixelSize); BufferUtils.newUnsafeByteBuffer(compressedData); return new ETC1Data(pixmap.getWidth(), pixmap.getHeight(), compressedData, 16); }
/** Encodes the image via the ETC1 compression scheme. Only {@link Format#RGB565} and {@link Format#RGB888} are supported. * @param pixmap the {@link Pixmap} * @return the {@link ETC1Data} */ public static ETC1Data encodeImage (Pixmap pixmap) { int pixelSize = getPixelSize(pixmap.getFormat()); ByteBuffer compressedData = encodeImage(pixmap.getPixels(), 0, pixmap.getWidth(), pixmap.getHeight(), pixelSize); BufferUtils.newUnsafeByteBuffer(compressedData); return new ETC1Data(pixmap.getWidth(), pixmap.getHeight(), compressedData, 0); }
if (glInternalFormat == ETC1.ETC1_RGB8_OES) { if (!Gdx.graphics.supportsExtension("GL_OES_compressed_ETC1_RGB8_texture")) { ETC1Data etcData = new ETC1Data(pixelWidth, pixelHeight, data, 0); Pixmap pixmap = ETC1.decodeImage(etcData, Format.RGB888); Gdx.gl.glTexImage2D(target + face, level, pixmap.getGLInternalFormat(), pixmap.getWidth(),
@Override public void prepare () { if (isPrepared) throw new GdxRuntimeException("Already prepared"); if (file == null && data == null) throw new GdxRuntimeException("Can only load once from ETC1Data"); if (file != null) { data = new ETC1Data(file); } width = data.width; height = data.height; isPrepared = true; }
/** Encodes the image via the ETC1 compression scheme. Only {@link Format#RGB565} and {@link Format#RGB888} are supported. Adds * a PKM header in front of the compressed image data. * @param pixmap the {@link Pixmap} * @return the {@link ETC1Data} */ public static ETC1Data encodeImagePKM (Pixmap pixmap) { int pixelSize = getPixelSize(pixmap.getFormat()); ByteBuffer compressedData = encodeImagePKM(pixmap.getPixels(), 0, pixmap.getWidth(), pixmap.getHeight(), pixelSize); BufferUtils.newUnsafeByteBuffer(compressedData); return new ETC1Data(pixmap.getWidth(), pixmap.getHeight(), compressedData, 16); }
@Override public void prepare () { if (isPrepared) throw new GdxRuntimeException("Already prepared"); if (file == null && data == null) throw new GdxRuntimeException("Can only load once from ETC1Data"); if (file != null) { data = new ETC1Data(file); } width = data.width; height = data.height; isPrepared = true; }
/** Encodes the image via the ETC1 compression scheme. Only {@link Format#RGB565} and {@link Format#RGB888} are supported. Adds * a PKM header in front of the compressed image data. * @param pixmap the {@link Pixmap} * @return the {@link ETC1Data} */ public static ETC1Data encodeImagePKM (Pixmap pixmap) { int pixelSize = getPixelSize(pixmap.getFormat()); ByteBuffer compressedData = encodeImagePKM(pixmap.getPixels(), 0, pixmap.getWidth(), pixmap.getHeight(), pixelSize); BufferUtils.newUnsafeByteBuffer(compressedData); return new ETC1Data(pixmap.getWidth(), pixmap.getHeight(), compressedData, 16); }
/** Encodes the image via the ETC1 compression scheme. Only {@link Format#RGB565} and {@link Format#RGB888} are supported. * @param pixmap the {@link Pixmap} * @return the {@link ETC1Data} */ public static ETC1Data encodeImage (Pixmap pixmap) { int pixelSize = getPixelSize(pixmap.getFormat()); ByteBuffer compressedData = encodeImage(pixmap.getPixels(), 0, pixmap.getWidth(), pixmap.getHeight(), pixelSize); BufferUtils.newUnsafeByteBuffer(compressedData); return new ETC1Data(pixmap.getWidth(), pixmap.getHeight(), compressedData, 0); }
/** Encodes the image via the ETC1 compression scheme. Only {@link Format#RGB565} and {@link Format#RGB888} are supported. * @param pixmap the {@link Pixmap} * @return the {@link ETC1Data} */ public static ETC1Data encodeImage (Pixmap pixmap) { int pixelSize = getPixelSize(pixmap.getFormat()); ByteBuffer compressedData = encodeImage(pixmap.getPixels(), 0, pixmap.getWidth(), pixmap.getHeight(), pixelSize); BufferUtils.newUnsafeByteBuffer(compressedData); return new ETC1Data(pixmap.getWidth(), pixmap.getHeight(), compressedData, 0); }