#pragma once

#include <vector>
#include <string>
#include "../include/hwscapture.h"

// Keep this module outside SDK. It uses OpenCV DLLs and returns SDK-friendly RGB32 frames.
enum OpenCvProcessMode
{
    OCV_MODE_EDGE = 0,
    OCV_MODE_SHARPEN = 1,
    OCV_MODE_GRAY = 2,
    OCV_MODE_BLUR = 3
};

const char* OpenCvProcessModeName(OpenCvProcessMode mode);

class OpenCvFrameProcessor
{
public:
    bool ProcessRgb32(const HWS_VIDEO_FRAME* frame,
                      OpenCvProcessMode mode,
                      std::vector<unsigned char>& output,
                      int* outputStride);

    const char* LastError() const { return m_lastError.c_str(); }

private:
    void SetError(const char* text);
    std::string m_lastError;
};
