<commit_before>/* Copyright 2015 Samsung Electronics Co., LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/***************************************************************************
 * JNI
 ***************************************************************************/

#include "compressed_texture.h"
#include "util/gvr_jni.h"

namespace gvr {
extern "C" {
JNIEXPORT jlong JNICALL
// Note that "asynchronous_textures" becomes "asynchronous_1textures"
Java_org_gearvrf_asynchronous_NativeCompressedTexture_normalConstructor(JNIEnv * env,
        jobject obj, jint target, jint internalFormat,
        jint width, jint height, jint imageSize, jbyteArray bytes, jint dataOffset,
        jintArray jtexture_parameters);

JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_1textures_NativeCompressedTexture_mipmappedConstructor(JNIEnv * env,
        jobject obj, jint target);
}
;

JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_NativeCompressedTexture_normalConstructor(JNIEnv * env,
    jobject obj, jint target, jint internalFormat,
    jint width, jint height, jint imageSize, jbyteArray bytes, jint dataOffset,
    jintArray jtexture_parameters) {

    jint* texture_parameters = env->GetIntArrayElements(jtexture_parameters,0);

    jbyte* data = env->GetByteArrayElements(bytes, 0);

    CompressedTexture* texture =
            new CompressedTexture(target, internalFormat, width, height, imageSize,
                                  (const char*)data, dataOffset, texture_parameters);

    env->ReleaseByteArrayElements(bytes, data, 0);

    env->ReleaseIntArrayElements(jtexture_parameters, texture_parameters, 0);

    return reinterpret_cast<jlong>(texture);
}

JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_1textures_NativeCompressedTexture_mipmappedConstructor(JNIEnv * env,
    jobject obj, jint target) {
    return reinterpret_cast<jlong>(new CompressedTexture(target));
}

}<commit_msg>Fix for issue #230 native mipmappedConstructor not found.<commit_after>/* Copyright 2015 Samsung Electronics Co., LTD
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/***************************************************************************
 * JNI
 ***************************************************************************/

#include "compressed_texture.h"
#include "util/gvr_jni.h"

namespace gvr {
extern "C" {
JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_NativeCompressedTexture_normalConstructor(JNIEnv * env,
        jobject obj, jint target, jint internalFormat,
        jint width, jint height, jint imageSize, jbyteArray bytes, jint dataOffset,
        jintArray jtexture_parameters);

JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_NativeCompressedTexture_mipmappedConstructor(JNIEnv * env,
        jobject obj, jint target);
}
;

JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_NativeCompressedTexture_normalConstructor(JNIEnv * env,
    jobject obj, jint target, jint internalFormat,
    jint width, jint height, jint imageSize, jbyteArray bytes, jint dataOffset,
    jintArray jtexture_parameters) {

    jint* texture_parameters = env->GetIntArrayElements(jtexture_parameters,0);

    jbyte* data = env->GetByteArrayElements(bytes, 0);

    CompressedTexture* texture =
            new CompressedTexture(target, internalFormat, width, height, imageSize,
                                  (const char*)data, dataOffset, texture_parameters);

    env->ReleaseByteArrayElements(bytes, data, 0);

    env->ReleaseIntArrayElements(jtexture_parameters, texture_parameters, 0);

    return reinterpret_cast<jlong>(texture);
}

JNIEXPORT jlong JNICALL
Java_org_gearvrf_asynchronous_NativeCompressedTexture_mipmappedConstructor(JNIEnv * env,
    jobject obj, jint target) {
    return reinterpret_cast<jlong>(new CompressedTexture(target));
}

}
{'fraction_non_alphanumeric': 0.1305428926647327, 'fraction_numerical': 0.006216328222130129, 'mean_word_length': 4.951911220715166, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 15, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1790901', 'n_tokens_mistral': 1397, 'n_tokens_neox': 1333, 'n_words': 388}