mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-21 08:48:57 +00:00
LibSoftGPU: Add methods to read and write image data
This adds two methods, write_texels and read_texels, to the Image class. Conversion between image formats happens automatically. The layout of the client image data is passed in via ImageDataLayout struct.
This commit is contained in:
parent
2a72d14336
commit
b41ad28654
Notes:
sideshowbarker
2024-07-17 22:16:13 +09:00
Author: https://github.com/sunverwerth
Commit: b41ad28654
Pull-request: https://github.com/SerenityOS/serenity/pull/11288
Reviewed-by: https://github.com/Quaker762 ✅
Reviewed-by: https://github.com/gmta
3 changed files with 62 additions and 0 deletions
|
@ -10,6 +10,7 @@
|
|||
#include <AK/Vector.h>
|
||||
#include <LibGfx/Vector3.h>
|
||||
#include <LibGfx/Vector4.h>
|
||||
#include <LibSoftGPU/ImageDataLayout.h>
|
||||
#include <LibSoftGPU/ImageFormat.h>
|
||||
|
||||
namespace SoftGPU {
|
||||
|
@ -38,6 +39,9 @@ public:
|
|||
pack_color(color, texel_pointer(layer, level, x, y, z), m_format);
|
||||
}
|
||||
|
||||
void write_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void const* data, ImageDataLayout const& layout);
|
||||
void read_texels(unsigned layer, unsigned level, Vector3<unsigned> const& offset, Vector3<unsigned> const& size, void* data, ImageDataLayout const& layout) const;
|
||||
|
||||
private:
|
||||
void const* texel_pointer(unsigned layer, unsigned level, unsigned x, unsigned y, unsigned z) const
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue