mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
LibGPU+LibSoftGPU: Add PixelFormat::Intensity
This commit is contained in:
parent
e615af886e
commit
6c80d12111
Notes:
sideshowbarker
2024-07-17 07:41:44 +09:00
Author: https://github.com/gmta Commit: https://github.com/SerenityOS/serenity/commit/6c80d12111 Pull-request: https://github.com/SerenityOS/serenity/pull/15007 Reviewed-by: https://github.com/sunverwerth ✅
@ -21,6 +21,7 @@ enum class PixelFormat {
|
||||
ColorIndex,
|
||||
DepthComponent,
|
||||
Green,
|
||||
Intensity,
|
||||
Luminance,
|
||||
LuminanceAlpha,
|
||||
Red,
|
||||
@ -77,6 +78,7 @@ static constexpr int number_of_components(PixelFormat format)
|
||||
case PixelFormat::ColorIndex:
|
||||
case PixelFormat::DepthComponent:
|
||||
case PixelFormat::Green:
|
||||
case PixelFormat::Intensity:
|
||||
case PixelFormat::Luminance:
|
||||
case PixelFormat::Red:
|
||||
case PixelFormat::StencilIndex:
|
||||
|
@ -45,6 +45,8 @@ static constexpr FloatVector4 decode_component_order_for_format(FloatVector4 con
|
||||
return { components[0], 0.f, 0.f, 0.f };
|
||||
case GPU::PixelFormat::Green:
|
||||
return { 0.f, components[0], 0.f, 1.f };
|
||||
case GPU::PixelFormat::Intensity:
|
||||
return { components[0], components[0], components[0], components[0] };
|
||||
case GPU::PixelFormat::Luminance:
|
||||
return { components[0], components[0], components[0], 1.f };
|
||||
case GPU::PixelFormat::LuminanceAlpha:
|
||||
@ -72,6 +74,7 @@ static constexpr FloatVector4 encode_component_order_for_format(FloatVector4 con
|
||||
return { components[2], 0.f, 0.f, 0.f };
|
||||
case GPU::PixelFormat::ColorIndex:
|
||||
case GPU::PixelFormat::DepthComponent:
|
||||
case GPU::PixelFormat::Intensity:
|
||||
case GPU::PixelFormat::Luminance:
|
||||
case GPU::PixelFormat::Red:
|
||||
case GPU::PixelFormat::RGB:
|
||||
|
Loading…
Reference in New Issue
Block a user