mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-02 14:19:15 +00:00
LibGL+LibGPU+LibSoftGPU: Move ImageFormat.h to LibGPU
This commit is contained in:
parent
24d420312c
commit
4e0643ae97
Notes:
sideshowbarker
2024-07-17 14:23:33 +09:00
Author: https://github.com/sunverwerth
Commit: 4e0643ae97
Pull-request: https://github.com/SerenityOS/serenity/pull/13294
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/creator1creeper1
Reviewed-by: https://github.com/gmta
8 changed files with 172 additions and 172 deletions
43
Userland/Libraries/LibGPU/ImageFormat.h
Normal file
43
Userland/Libraries/LibGPU/ImageFormat.h
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
* Copyright (c) 2022, the SerenityOS developers.
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
|
||||
namespace GPU {
|
||||
|
||||
enum class ImageFormat {
|
||||
RGB565,
|
||||
RGB888,
|
||||
BGR888,
|
||||
RGBA8888,
|
||||
BGRA8888,
|
||||
L8,
|
||||
L8A8,
|
||||
};
|
||||
|
||||
static constexpr size_t element_size(ImageFormat format)
|
||||
{
|
||||
switch (format) {
|
||||
case ImageFormat::L8:
|
||||
return 1;
|
||||
case ImageFormat::RGB565:
|
||||
case ImageFormat::L8A8:
|
||||
return 2;
|
||||
case ImageFormat::RGB888:
|
||||
case ImageFormat::BGR888:
|
||||
return 3;
|
||||
case ImageFormat::RGBA8888:
|
||||
case ImageFormat::BGRA8888:
|
||||
return 4;
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue