mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 03:12:44 +00:00 
			
		
		
		
	 06ae5b3536
			
		
	
	
		06ae5b3536
		
	
	
	
	
		
			
			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).
		
			
				
	
	
		
			29 lines
		
	
	
	
		
			413 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			29 lines
		
	
	
	
		
			413 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| /*
 | |
|  * 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;
 | |
| };
 | |
| 
 | |
| }
 |