"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "srcs/api-java/cpp/ColourInformationPropertyJNI.cpp" between
heif-3.6.0.tar.gz and heif-3.6.1.tar.gz

About: HEIF (High Efficiency Image File Format) is a visual media container format for images and image sequences (MPEG-standard). This HEIF engine demonstrates its powerful features and capabilities (under Nokia HEIF license).

ColourInformationPropertyJNI.cpp  (heif-3.6.0):ColourInformationPropertyJNI.cpp  (heif-3.6.1)
skipping to change at line 29 skipping to change at line 29
#include "DescriptiveProperty.h" #include "DescriptiveProperty.h"
#include "Helpers.h" #include "Helpers.h"
#define CLASS_NAME ColourInformationProperty #define CLASS_NAME ColourInformationProperty
extern "C" extern "C"
{ {
JNI_METHOD_ARG(jlong, createContextNative, jobject javaHEIF) JNI_METHOD_ARG(jlong, createContextNative, jobject javaHEIF)
{ {
UNUSED(self); UNUSED(self);
NATIVE_HEIF(nativeHeif, javaHEIF); NATIVE_HEIF(nativeHeif, javaHEIF);
auto *nativeObject = new HEIFPP::ColourInformationProperty(nativeHeif); auto* nativeObject = new HEIFPP::ColourInformationProperty(nativeHeif);
return reinterpret_cast<jlong>(nativeObject); return reinterpret_cast<jlong>(nativeObject);
} }
JNI_METHOD(jstring, getColourTypeNative) JNI_METHOD(jstring, getColourTypeNative)
{ {
NATIVE_SELF; NATIVE_SELF;
return env->NewStringUTF(nativeSelf->mColourInformation.colourType.value ); return env->NewStringUTF(nativeSelf->mColourInformation.colourType.value );
} }
JNI_METHOD_ARG(void, setColourTypeNative, jstring javaString) JNI_METHOD_ARG(void, setColourTypeNative, jstring javaString)
{ {
NATIVE_SELF; NATIVE_SELF;
const char *nativeString = env->GetStringUTFChars(javaS tring, nullptr); const char* nativeString = env->GetStringUTFChars(javaS tring, nullptr);
nativeSelf->mColourInformation.colourType = HEIF::FourCC(nativeString); nativeSelf->mColourInformation.colourType = HEIF::FourCC(nativeString);
env->ReleaseStringUTFChars(javaString, nativeString); env->ReleaseStringUTFChars(javaString, nativeString);
} }
JNI_METHOD(jint, getColourPrimariesNative) JNI_METHOD(jint, getColourPrimariesNative)
{ {
NATIVE_SELF; NATIVE_SELF;
return static_cast<jint>(nativeSelf->mColourInformation.colourPrimaries) ; return static_cast<jint>(nativeSelf->mColourInformation.colourPrimaries) ;
} }
skipping to change at line 105 skipping to change at line 105
JNI_METHOD(jobject, getICCProfileNative) JNI_METHOD(jobject, getICCProfileNative)
{ {
NATIVE_SELF; NATIVE_SELF;
return env->NewDirectByteBuffer(nativeSelf->mColourInformation.iccProfil e.elements, return env->NewDirectByteBuffer(nativeSelf->mColourInformation.iccProfil e.elements,
static_cast<jlong>(nativeSelf->mColourIn formation.iccProfile.size)); static_cast<jlong>(nativeSelf->mColourIn formation.iccProfile.size));
} }
JNI_METHOD_ARG(void, setICCProfileNative, jbyteArray data) JNI_METHOD_ARG(void, setICCProfileNative, jbyteArray data)
{ {
NATIVE_SELF; NATIVE_SELF;
jbyte *nativeData = env->GetByteArrayElements(da ta, nullptr); jbyte* nativeData = env->GetByteArrayElements(da ta, nullptr);
auto dataSize = static_cast<uint32_t>(env->G etArrayLength(data)); auto dataSize = static_cast<uint32_t>(env->G etArrayLength(data));
nativeSelf->mColourInformation.iccProfile = HEIF::Array<uint8_t>(dataSiz e); nativeSelf->mColourInformation.iccProfile = HEIF::Array<uint8_t>(dataSiz e);
std::memcpy(nativeSelf->mColourInformation.iccProfile.elements, nativeDa ta, dataSize); std::memcpy(nativeSelf->mColourInformation.iccProfile.elements, nativeDa ta, dataSize);
env->ReleaseByteArrayElements(data, nativeData, 0); env->ReleaseByteArrayElements(data, nativeData, 0);
} }
} }
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)