This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
struct String | |
{ | |
using CppType = std::string; | |
using JniType = jstring; | |
using Boxed = String; | |
static CppType toCpp(JNIEnv* jniEnv, JniType j) | |
{ | |
assert(j != nullptr); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: byte_buffer | |
typedef: 'record' | |
params: [] | |
prefix: '' | |
cpp: | |
typename: 'int8_t*' | |
header: '<string>' | |
byValue: true | |
objc: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
calculator = interface +c { | |
# ... | |
update_rgb_frame(rgb_buffer: byte_buffer); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AUTOGENERATED FILE - DO NOT MODIFY! | |
// This file generated by Djinni from calculator.djinni | |
public abstract class Calculator { | |
//.... | |
public abstract void updateRgbFrame(java.nio.ByteBuffer rgbBuffer); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AUTOGENERATED FILE - DO NOT MODIFY! | |
// This file generated by Djinni from calculator.djinni | |
CJNIEXPORT void JNICALL Java_com_jtliew_Calculator_00024CppProxy_native_1updateRgbFrame(JNIEnv* jniEnv, jobject /*this*/, jlong nativeRef, ::djinni::ByteBuffer::JniType j_rgbBuffer) | |
{ | |
try { | |
DJINNI_FUNCTION_PROLOGUE1(jniEnv, nativeRef); | |
const auto& ref = ::djinni::objectFromHandleAddress<::jtliew::Calculator>(nativeRef); | |
ref->updateRgbFrame(::djinni::ByteBuffer::toCpp(jniEnv, j_rgbBuffer)); | |
} JNI_TRANSLATE_EXCEPTIONS_RETURN(jniEnv, ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// AUTOGENERATED FILE - DO NOT MODIFY! | |
// This file generated by Djinni from calculator.djinni | |
namespace calculator { | |
class Calculator { | |
public: | |
virtual void updateRgbFrame(int8_t* rgb_buffer) = 0; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SCameraController { | |
.... | |
private final ImageReader.OnImageAvailableListener mOnImageAvailableListener | |
= new ImageReader.OnImageAvailableListener() { | |
@Override | |
public void onImageAvailable(ImageReader reader) { | |
Image image = reader.acquireNextImage(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void CalculatorImpl::updateRgbFrame(int8_t *rgb_buffer) { | |
ImageInfo imageInfo; | |
Calculator::UpdateCaptureFrameBGRA(imageInfo, rgb_buffer); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace calculator { | |
class CalculatorImpl : public calculator::Calculator { | |
public: | |
//... | |
void updateRgbFrame(int8_t *rgb_buffer) override; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.netvirta.curvecapturescanner | |
import android.graphics.ImageFormat | |
import android.renderscript.Allocation | |
import android.renderscript.Element | |
import android.renderscript.RenderScript | |
import android.renderscript.ScriptIntrinsicYuvToRGB | |
import android.renderscript.Type | |
import android.util.Log | |
import android.util.Size |