| 63 | }; |
| 64 | |
| 65 | class Buffer final : public Component { |
| 66 | public: |
| 67 | Buffer(const std::shared_ptr<GameObject>& game_object, |
| 68 | const std::shared_ptr<RenderCanvas>& gl_canvas); |
| 69 | |
| 70 | ~Buffer() noexcept override; |
| 71 | |
| 72 | Buffer(const Buffer&) = delete; |
| 73 | |
| 74 | Buffer& operator=(const Buffer&) = delete; |
| 75 | |
| 76 | Buffer(Buffer&&) = delete; |
| 77 | |
| 78 | Buffer& operator=(Buffer&&) = delete; |
| 79 | |
| 80 | static constexpr int max_texture_size = BufferConstants::MAX_TEXTURE_SIZE; |
| 81 | |
| 82 | std::vector<GLuint> buff_tex{}; |
| 83 | |
| 84 | static const std::array<float, 8> no_ac_params; |
| 85 | |
| 86 | float buffer_width_f{}; |
| 87 | float buffer_height_f{}; |
| 88 | |
| 89 | int channels{}; |
| 90 | int step{}; |
| 91 | |
| 92 | BufferType type{BufferType::UnsignedByte}; |
| 93 | |
| 94 | std::span<const std::byte> buffer_{}; |
| 95 | |
| 96 | bool transpose{}; |
| 97 | |
| 98 | [[nodiscard]] bool buffer_update() override; |
| 99 | |
| 100 | void recompute_min_color_values(); |
| 101 | |
| 102 | void recompute_max_color_values(); |
| 103 | |
| 104 | void reset_contrast_brightness_parameters(); |
| 105 | |
| 106 | void compute_contrast_brightness_parameters(); |
| 107 | |
| 108 | [[nodiscard]] int sub_texture_id_at_coord(int x, int y) const; |
| 109 | |
| 110 | void set_pixel_layout(const std::string& pixel_layout); |
| 111 | |
| 112 | [[nodiscard]] const char* get_pixel_layout() const; |
| 113 | |
| 114 | void set_display_channel_mode(int display_channels); |
| 115 | |
| 116 | [[nodiscard]] int get_display_channel_mode() const; |
| 117 | |
| 118 | // Returns the channel index (0=R, 1=G, 2=B) based on current pixel layout |
| 119 | [[nodiscard]] int get_selected_channel_index() const; |
| 120 | |
| 121 | void configure(const BufferParams& params); |
| 122 |
nothing calls this directly
no outgoing calls
no test coverage detected