mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
LibGfx: Use enum instead of magic numbers for PNG Color and Filter types
This commit is contained in:
parent
9dbec601b0
commit
ebc20f7ac3
4 changed files with 81 additions and 48 deletions
29
Userland/Libraries/LibGfx/PNGShared.h
Normal file
29
Userland/Libraries/LibGfx/PNGShared.h
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace Gfx::PNG {
|
||||
|
||||
// https://www.w3.org/TR/PNG/#6Colour-values
|
||||
enum class ColorType : u8 {
|
||||
Greyscale = 0,
|
||||
Truecolor = 2, // RGB
|
||||
IndexedColor = 3,
|
||||
GreyscaleWithAlpha = 4,
|
||||
TruecolorWithAlpha = 6,
|
||||
};
|
||||
|
||||
// https://www.w3.org/TR/PNG/#9Filter-types
|
||||
enum class FilterType : u8 {
|
||||
None,
|
||||
Sub,
|
||||
Up,
|
||||
Average,
|
||||
Paeth,
|
||||
};
|
||||
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue