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:
parent
9d45e5ac8f
commit
06ae5b3536
3 changed files with 78 additions and 0 deletions
29
Userland/Libraries/LibGfx/BitmapMixer.h
Normal file
29
Userland/Libraries/LibGfx/BitmapMixer.h
Normal 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;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue