summaryrefslogtreecommitdiff
path: root/src/pixels.h
blob: 1d5effb5fa892908f58d4ac821b1f050edf9fa1b (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
#pragma once

#include <array>

#include "fuck_intel.h"

#include <QString>

#include "constants.h"
#include "typedefs.h"

struct Pixels
{
    Counters counters{};
    std::array<float, img_width> pixels{0.f};

    Pixels& operator+=(const Pixels& other);
    Pixels& operator/=(const float divider);

    // TODO: tests for everything everywhere
    /*!
     * \brief load - load binary pixels from file
     * \param filename - file path
     * \return Pixels on success, empty std::optional otherwise
     */
    [[nodiscard]] static std::optional<Pixels> load(const QString& filename);
    /*!
     * \brief save - save binary profile to file
     * \param filename - file path
     * \return - true on success, false otherwise
     */
    [[nodiscard]] bool save(const QString& filename);

    operator bool() const;
};