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

LibGfx: Add BitmapMixer

With this BitmapMixer one can draw one Bitmap onto another with
different modes.
For now the only supported mixing methods implemented are Add and
Lightest (which is very naive).
This commit is contained in:
Tobias Christiansen 2022-01-03 13:48:20 +01:00 committed by Idan Horowitz
parent 9d45e5ac8f
commit 06ae5b3536
3 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,29 @@
/*
* Copyright (c) 2022, Tobias Christiansen <tobyase@serenityos.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include "Bitmap.h"
namespace Gfx {
class BitmapMixer {
public:
enum class MixingMethod {
Add,
Lightest,
};
BitmapMixer(Bitmap& bitmap)
: m_bitmap(bitmap) {};
void mix_with(Bitmap&, MixingMethod);
private:
Bitmap& m_bitmap;
};
}