mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 08:07:34 +00:00
PixelPaint: Add level sliders for brightness, contrast and gamma
This patch adds a basic dialog to change brightness, contrast and gamma correction for the selected layer.
This commit is contained in:
parent
69c451e485
commit
5aeb6552f0
9 changed files with 303 additions and 0 deletions
38
Userland/Applications/PixelPaint/LevelsDialog.h
Normal file
38
Userland/Applications/PixelPaint/LevelsDialog.h
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Torsten Engelmann <engelTorsten@gmx.de>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "ImageEditor.h"
|
||||
#include "Layer.h"
|
||||
#include <LibGUI/Dialog.h>
|
||||
|
||||
namespace PixelPaint {
|
||||
|
||||
class LevelsDialog final : public GUI::Dialog {
|
||||
C_OBJECT(LevelsDialog);
|
||||
|
||||
public:
|
||||
void revert_possible_changes();
|
||||
|
||||
private:
|
||||
LevelsDialog(GUI::Window* parent_window, ImageEditor*);
|
||||
|
||||
ImageEditor* m_editor { nullptr };
|
||||
RefPtr<Gfx::Bitmap> m_reference_bitmap { nullptr };
|
||||
RefPtr<GUI::ValueSlider> m_brightness_slider = { nullptr };
|
||||
RefPtr<GUI::ValueSlider> m_contrast_slider = { nullptr };
|
||||
RefPtr<GUI::ValueSlider> m_gamma_slider = { nullptr };
|
||||
bool m_did_change = false;
|
||||
int m_precomputed_color_correction[256];
|
||||
|
||||
ErrorOr<void> ensure_reference_bitmap();
|
||||
void generate_new_image();
|
||||
void cleanup_resources();
|
||||
void generate_precomputed_color_correction();
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue