1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 21:07:34 +00:00

PixelPaint: Make Bloom use InplaceFilter instead of Filter

This change affects the filter preview widget, which would get the bloom
filter applied over the same bitmap, leading to an incorrect preview.
This commit is contained in:
matcool 2023-04-02 10:24:52 -03:00 committed by Andreas Kling
parent 2259ddf937
commit 1bd8f4eb03
2 changed files with 6 additions and 6 deletions

View file

@ -16,9 +16,9 @@
namespace PixelPaint::Filters {
void Bloom::apply(Gfx::Bitmap& target_bitmap, Gfx::Bitmap const& source_bitmap) const
void Bloom::apply(Gfx::Bitmap& target_bitmap) const
{
auto intermediate_bitmap_or_error = source_bitmap.clone();
auto intermediate_bitmap_or_error = target_bitmap.clone();
if (intermediate_bitmap_or_error.is_error())
return;

View file

@ -6,20 +6,20 @@
#pragma once
#include "Filter.h"
#include "InplaceFilter.h"
namespace PixelPaint::Filters {
class Bloom final : public Filter {
class Bloom final : public InplaceFilter {
public:
virtual void apply(Gfx::Bitmap& target_bitmap, Gfx::Bitmap const& source_bitmap) const override;
virtual void apply(Gfx::Bitmap& target_bitmap) const override;
virtual ErrorOr<RefPtr<GUI::Widget>> get_settings_widget() override;
virtual StringView filter_name() const override { return "Bloom Filter"sv; }
Bloom(ImageEditor* editor)
: Filter(editor) {};
: InplaceFilter(editor) {};
private:
int m_luma_lower { 128 };