/*
 * Copyright © Dynamsoft Corporation. All rights reserved.
 */

#ifndef ImageDataHostObject_hpp
#define ImageDataHostObject_hpp

#include <stdio.h>
#import <jsi/jsi.h>

using namespace facebook::jsi;
using namespace facebook;

class JSI_EXPORT ImageDataHostObject : public HostObject {
  public:
    int width = 0;
    int height = 0;
    int stride = 0;
    int format = 0;
    int orientation = 0;

    uint8_t *buffer = nullptr;
    int bufferSize = 0;

    explicit ImageDataHostObject() = default;
    explicit ImageDataHostObject(int width, int height, int stride, int format, int orientation, uint8_t *buffer, int bufferSize);

    Value get(Runtime &, const PropNameID &name) override;
    void set(Runtime &, const PropNameID &name, const Value &value) override;
    std::vector<PropNameID> getPropertyNames(Runtime &rt) override;

    static ImageDataHostObject getHOFromObject(Runtime &runtime, Object &jsObj);
};

#endif /* ImageDataHostObject_hpp */
