// Convert ETC1 functions to our function signatures
static bool compress_etc1_565(uint8_t* dst, const uint8_t* src,
                              int width, int height, size_t rowBytes) {
#ifndef SK_IGNORE_ETC1_SUPPORT
    return 0 == etc1_encode_image(src, width, height, 2, SkToInt(rowBytes), dst);
#else
    return false;
#endif
}
Example #2
0
JNIEXPORT jobject JNICALL Java_com_badlogic_gdx_graphics_glutils_ETC1_encodeImage
  (JNIEnv *env, jclass, jobject imageData, jint offset, jint width, jint height, jint pixelSize) {
	etc1_byte* imgPtr = (etc1_byte*)env->GetDirectBufferAddress(imageData) + offset;
	int compressedSize = etc1_get_encoded_data_size(width, height);
	etc1_byte* comprPtr = (etc1_byte*)malloc(compressedSize);
	etc1_encode_image(imgPtr, width, height, pixelSize, width * pixelSize, comprPtr);
	return env->NewDirectByteBuffer(comprPtr, compressedSize);
}
static inline jobject wrapped_Java_com_badlogic_gdx_graphics_glutils_ETC1_encodeImage
(JNIEnv* env, jclass clazz, jobject obj_imageData, jint offset, jint width, jint height, jint pixelSize, char* imageData) {

//@line:260

		int compressedSize = etc1_get_encoded_data_size(width, height);
		etc1_byte* compressedData = (etc1_byte*)malloc(compressedSize);
		etc1_encode_image((etc1_byte*)imageData + offset, width, height, pixelSize, width * pixelSize, compressedData);
		return env->NewDirectByteBuffer(compressedData, compressedSize);
	
}