2024-01-17 12:18:46 -07:00
|
|
|
//
|
|
|
|
// MutableRawBuffer.h
|
|
|
|
// VisionCamera
|
|
|
|
//
|
|
|
|
// Created by Marc Rousavy on 17.01.24.
|
|
|
|
// Copyright © 2024 mrousavy. All rights reserved.
|
|
|
|
//
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <functional>
|
|
|
|
#include <jsi/jsi.h>
|
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
namespace vision {
|
|
|
|
|
|
|
|
using namespace facebook;
|
|
|
|
|
|
|
|
class MutableRawBuffer : public jsi::MutableBuffer {
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit MutableRawBuffer(size_t size);
|
2024-01-18 02:41:26 -07:00
|
|
|
explicit MutableRawBuffer(uint8_t* data, size_t size, bool freeOnDealloc);
|
2024-01-17 12:18:46 -07:00
|
|
|
~MutableRawBuffer();
|
|
|
|
|
|
|
|
public:
|
|
|
|
uint8_t* data() override;
|
|
|
|
size_t size() const override;
|
|
|
|
|
|
|
|
private:
|
|
|
|
uint8_t* _data;
|
|
|
|
size_t _size;
|
2024-01-18 02:41:26 -07:00
|
|
|
bool _freeOnDealloc;
|
2024-01-17 12:18:46 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace vision
|