mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 21:17:45 +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:
parent
2259ddf937
commit
1bd8f4eb03
2 changed files with 6 additions and 6 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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 };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue