"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "srcs/api-java/cpp/PixelInformationPropertyJNI.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).

PixelInformationPropertyJNI.cpp  (heif-3.6.0):PixelInformationPropertyJNI.cpp  (heif-3.6.1)
skipping to change at line 30 skipping to change at line 30
#include "Helpers.h" #include "Helpers.h"
#define CLASS_NAME PixelInformationProperty #define CLASS_NAME PixelInformationProperty
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::PixelInformationProperty(nativeHeif); auto* nativeObject = new HEIFPP::PixelInformationProperty(nativeHeif);
return reinterpret_cast<jlong>(nativeObject); return reinterpret_cast<jlong>(nativeObject);
} }
JNI_METHOD(jobject, getPixelInformationNative) JNI_METHOD(jobject, getPixelInformationNative)
{ {
NATIVE_SELF; NATIVE_SELF;
return env->NewDirectByteBuffer(nativeSelf->mPixelInformation.bitsPerCha nnel.elements, return env->NewDirectByteBuffer(nativeSelf->mPixelInformation.bitsPerCha nnel.elements,
static_cast<jlong>(nativeSelf->mPixelInf ormation.bitsPerChannel.size)); static_cast<jlong>(nativeSelf->mPixelInf ormation.bitsPerChannel.size));
} }
JNI_METHOD_ARG(void, setPixelInformationNative, jbyteArray data) JNI_METHOD_ARG(void, setPixelInformationNative, jbyteArray data)
{ {
NATIVE_SELF; NATIVE_SELF;
jbyte *nativeData = env->GetByteArrayElements(data, nullptr); jbyte* nativeData = env->GetByteArrayElements(data, nullptr);
auto dataSize = static_cast<uint32_t>(env->GetArrayLength(data)); auto dataSize = static_cast<uint32_t>(env->GetArrayLength(data));
nativeSelf->mPixelInformation.bitsPerChannel = HEIF::Array<uint8_t>(data Size); nativeSelf->mPixelInformation.bitsPerChannel = HEIF::Array<uint8_t>(data Size);
std::memcpy(nativeSelf->mPixelInformation.bitsPerChannel.elements, nativ eData, dataSize); std::memcpy(nativeSelf->mPixelInformation.bitsPerChannel.elements, nativ eData, dataSize);
env->ReleaseByteArrayElements(data, nativeData, 0); env->ReleaseByteArrayElements(data, nativeData, 0);
} }
} }
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added

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