summaryrefslogtreecommitdiff
path: root/src/camera/icamera.h
blob: 44ed4b3ce85a7941620e179be2fd198bcd65693a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#pragma once

#ifdef emit
#define emit_backup emit
#undef emit
#endif

#ifdef slots
#define slots_backup slots
#undef slots
#endif

#include <libcamera/base/signal.h>

#ifdef emit_backup
#define emit emit_backup
#endif

#ifdef slots_backup
#define slots slots_backup
#endif

// cpp
#include <chrono>

// orpheus
#include "image.h"

class ICamera
{
public:
    virtual ~ICamera() = default;

public:
    virtual bool set_autoExposure(const bool enable) = 0;
    /*!
     * \brief get_autoExposure - check if auto exposure is enabled
     * \param ok - indicates successful read
     * \return true if enabled, false otherwise
     */

    /*!
     * \brief get_autoExposure - check if auto exposure is enabled
     * \return non-empty value on success, empty value on failure
     */
    virtual std::optional<bool> get_autoExposure() = 0;

    virtual bool set_exposureTime(const std::chrono::microseconds us) = 0;
    virtual std::optional<const std::chrono::microseconds> get_exposureTime() = 0;

    virtual bool set_autoGain(const bool enable) = 0;
    virtual std::optional<bool> get_autoGain() = 0;

    virtual bool set_gain(const float value) = 0;
    virtual std::optional<float> get_gain() = 0;

    virtual bool getImage(Image *image) = 0;

public:
    std::function<void(std::shared_ptr<Pixels>)> newPixelsCallback;
    std::function<void(Image &)> newImageCallback;

public:
    virtual bool startStream() = 0;
};