JNIEXPORT void JNICALL Java_org_ebookdroid_common_bitmaps_RawBitmap_nativeHq3x(JNIEnv* env, jclass classObject, jintArray srcArray, jintArray dstArray, jint width, jint height) { jint* src; jint* dst; src = (*env)->GetIntArrayElements(env, srcArray, 0); dst = (*env)->GetIntArrayElements(env, dstArray, 0); hq3x_32(src, dst, width, height); (*env)->ReleaseIntArrayElements(env, srcArray, src, 0); (*env)->ReleaseIntArrayElements(env, dstArray, dst, 0); }
bool Image::scaleHq3x(void) { if (_pixels.size() == 0) { return false; } int newWidth = _width * 3; int newHeight = _height * 3; std::vector<Color> newPixels(newWidth * newHeight); hq3x_32((uint32_t*)&_pixels.front(), (uint32_t*)&newPixels.front(), _width, _height); _pixels.resize(newWidth * newHeight); std::copy(newPixels.begin(), newPixels.end(), _pixels.begin()); _width = newWidth; _height = newHeight; return true; }