|
|
|
@ -89,13 +89,13 @@ Java_com_xypower_camera2raw_Camera2RawFragment_makeHdr__JLjava_lang_String_2JLja
|
|
|
|
|
times.push_back((float)(exposureTime1 / 1000) / 1000000.0);
|
|
|
|
|
times.push_back((float)(exposureTime2 / 1000) / 1000000.0);
|
|
|
|
|
|
|
|
|
|
paths.push_back(jstring2string(path1));
|
|
|
|
|
paths.push_back(jstring2string(path2));
|
|
|
|
|
paths.push_back(jstring2string(env, path1));
|
|
|
|
|
paths.push_back(jstring2string(env, path2));
|
|
|
|
|
|
|
|
|
|
cv::Mat rgb;
|
|
|
|
|
if (makeHdr(times, paths, rgb))
|
|
|
|
|
{
|
|
|
|
|
std::string fileName = jstring2string(outputPath);
|
|
|
|
|
std::string fileName = jstring2string(env, outputPath);
|
|
|
|
|
if (cv::imwrite(fileName.c_str(), rgb))
|
|
|
|
|
{
|
|
|
|
|
return JNI_TRUE;
|
|
|
|
@ -108,8 +108,29 @@ Java_com_xypower_camera2raw_Camera2RawFragment_makeHdr__JLjava_lang_String_2JLja
|
|
|
|
|
extern "C"
|
|
|
|
|
JNIEXPORT jboolean JNICALL
|
|
|
|
|
Java_com_xypower_camera2raw_Camera2RawFragment_makeHdr__JLjava_lang_String_2JLjava_lang_String_2JLjava_lang_String_2Ljava_lang_String_2(
|
|
|
|
|
JNIEnv *env, jobject thiz, jlong exposure_time1, jstring path1, jlong exposure_time2,
|
|
|
|
|
jstring path2, jlong exposure_time3, jstring path3, jstring output_path) {
|
|
|
|
|
JNIEnv *env, jobject thiz, jlong exposureTime1, jstring path1, jlong exposureTime2,
|
|
|
|
|
jstring path2, jlong exposureTime3, jstring path3, jstring outputPath) {
|
|
|
|
|
|
|
|
|
|
std::vector<float> times;
|
|
|
|
|
std::vector<std::string> paths;
|
|
|
|
|
|
|
|
|
|
times.push_back((float)(exposureTime1 / 1000) / 1000000.0);
|
|
|
|
|
times.push_back((float)(exposureTime2 / 1000) / 1000000.0);
|
|
|
|
|
times.push_back((float)(exposureTime3 / 1000) / 1000000.0);
|
|
|
|
|
|
|
|
|
|
paths.push_back(jstring2string(env, path1));
|
|
|
|
|
paths.push_back(jstring2string(env, path2));
|
|
|
|
|
paths.push_back(jstring2string(env, path3));
|
|
|
|
|
|
|
|
|
|
cv::Mat rgb;
|
|
|
|
|
if (makeHdr(times, paths, rgb))
|
|
|
|
|
{
|
|
|
|
|
std::string fileName = jstring2string(env, outputPath);
|
|
|
|
|
if (cv::imwrite(fileName.c_str(), rgb))
|
|
|
|
|
{
|
|
|
|
|
return JNI_TRUE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return JNI_TRUE;
|
|
|
|
|
return JNI_FALSE;
|
|
|
|
|
}
|