1
Fork 0
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:
Karol Kosek 2022-07-10 00:08:32 +02:00 committed by Andreas Kling
parent 9dbec601b0
commit ebc20f7ac3
4 changed files with 81 additions and 48 deletions

View 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,
};
};