/* SPDX-License-Identifier: GPL-2.0-or-later */ /* * Copyright (C) 2019, Google Inc. * * buffer_writer.h - Buffer writer */ #ifndef __CAM_BUFFER_WRITER_H__ #define __CAM_BUFFER_WRITER_H__ #include #include #include class BufferWriter { public: BufferWriter(const std::string &pattern = ""); ~BufferWriter(); void mapBuffer(libcamera::FrameBuffer *buffer); int write(libcamera::FrameBuffer *buffer, const std::string &streamName); private: std::string pattern_; std::map> mappedBuffers_; }; #endif /* __CAM_BUFFER_WRITER_H__ */ /> index : libcamera/vivid.git
libcamera pipeline handler for VIVIDgit repository hosting on libcamera.org
summaryrefslogtreecommitdiff
blob: 344a07a3d4432d63898b0511b82f1144e8c8d9f0 (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
66
67
68
69
70
71
72
# SPDX-License-Identifier: BSD-2-Clause
#
# Copyright (C) 2019, Raspberry Pi Ltd
# Copyright (C) 2022, Paul Elder <paul.elder@ideasonboard.com>

from ..module import Module

import libtuning as lt
import libtuning.utils as utils

import numpy as np


class LSC(Module):
    type = 'lsc'
    hr_name = 'LSC (Base)'
    out_name = 'GenericLSC'

    def __init__(self, *,
                 debug: list,
                 sector_shape: tuple,
                 sector_x_gradient: lt.Gradient,
                 sector_y_gradient: lt.Gradient,
                 sector_average_function: lt.Average,
                 smoothing_function: lt.Smoothing):
        super().__init__()

        self.debug = debug

        self.sector_shape = sector_shape
        self.sector_x_gradient = sector_x_gradient
        self.sector_y_gradient = sector_y_gradient
        self.sector_average_function = sector_average_function

        self.smoothing_function = smoothing_function

    def _enumerate_lsc_images(self, images):
        for image in images:
            if image.lsc_only:
                yield image

    def _get_grid(self, channel, img_w, img_h):
        # List of number of pixels in each sector