File: image_lut.cpp

package info (click to toggle)
satdump 1.2.2%2Bgb79af48-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 81,648 kB
  • sloc: cpp: 276,768; ansic: 164,598; lisp: 1,219; sh: 283; xml: 106; makefile: 7
file content (38 lines) | stat: -rw-r--r-- 1,035 bytes parent folder | download | duplicates (2)
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
#include <limits>
#include "image_lut.h"

namespace image
{
    template <typename T>
    Image create_lut(int channels, int width, int points, std::vector<T> data)
    {
        Image out(data.data(), sizeof(T) * 8, points, 1, channels);
        out.resize_bilinear(width, 1, false);
        return out;
    }

    template <typename T>
    Image LUT_jet()
    {
        return create_lut<T>(3,
            256,
            4,
            { 0,
             0,
             std::numeric_limits<T>::max(),
             std::numeric_limits<T>::max(),
             0,
             std::numeric_limits<T>::max(),
             std::numeric_limits<T>::max(),
             0,
             std::numeric_limits<T>::max(),
             std::numeric_limits<T>::max(),
             0,
             0 });
    }

    template Image create_lut<uint8_t>(int, int, int, std::vector<uint8_t>);
    template Image create_lut<uint16_t>(int, int, int, std::vector<uint16_t>);
    template Image LUT_jet<uint8_t>();
    template Image LUT_jet<uint16_t>();
}