2021-06-27 12:37:54 +02:00
|
|
|
//
|
2023-07-22 00:15:11 +02:00
|
|
|
// Created by Marc on 21.07.2023.
|
2021-06-27 12:37:54 +02:00
|
|
|
//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2023-12-29 14:09:56 +01:00
|
|
|
#include "JOrientation.h"
|
|
|
|
#include "JPixelFormat.h"
|
2023-09-01 12:58:32 +02:00
|
|
|
#include <fbjni/fbjni.h>
|
|
|
|
#include <jni.h>
|
2021-06-27 12:37:54 +02:00
|
|
|
|
2023-10-03 13:18:41 +02:00
|
|
|
#include <android/hardware_buffer.h>
|
|
|
|
|
2021-06-27 12:37:54 +02:00
|
|
|
namespace vision {
|
|
|
|
|
2021-09-29 12:30:50 +02:00
|
|
|
using namespace facebook;
|
2023-09-01 12:20:17 +02:00
|
|
|
using namespace jni;
|
2021-09-29 12:30:50 +02:00
|
|
|
|
2023-09-01 12:20:17 +02:00
|
|
|
struct JFrame : public JavaClass<JFrame> {
|
2023-07-22 00:15:11 +02:00
|
|
|
static constexpr auto kJavaDescriptor = "Lcom/mrousavy/camera/frameprocessor/Frame;";
|
2021-06-27 12:37:54 +02:00
|
|
|
|
2023-09-01 12:58:32 +02:00
|
|
|
public:
|
2023-09-01 12:20:17 +02:00
|
|
|
int getWidth() const;
|
|
|
|
int getHeight() const;
|
|
|
|
bool getIsValid() const;
|
|
|
|
bool getIsMirrored() const;
|
|
|
|
int getPlanesCount() const;
|
|
|
|
int getBytesPerRow() const;
|
|
|
|
jlong getTimestamp() const;
|
2023-12-29 14:09:56 +01:00
|
|
|
local_ref<JOrientation> getOrientation() const;
|
|
|
|
local_ref<JPixelFormat> getPixelFormat() const;
|
2023-10-03 13:18:41 +02:00
|
|
|
#if __ANDROID_API__ >= 26
|
2023-09-29 21:54:04 +02:00
|
|
|
AHardwareBuffer* getHardwareBuffer() const;
|
2023-10-03 13:18:41 +02:00
|
|
|
#endif
|
|
|
|
|
2023-08-21 12:50:14 +02:00
|
|
|
void incrementRefCount();
|
|
|
|
void decrementRefCount();
|
2021-06-27 12:37:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace vision
|