mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:37:35 +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
3 changed files with 62 additions and 0 deletions
20
Userland/Libraries/LibSoftGPU/ImageDataLayout.h
Normal file
20
Userland/Libraries/LibSoftGPU/ImageDataLayout.h
Normal file
|
@ -0,0 +1,20 @@
|
|||
/*
|
||||
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <LibSoftGPU/ImageFormat.h>
|
||||
|
||||
namespace SoftGPU {
|
||||
|
||||
struct ImageDataLayout final {
|
||||
ImageFormat format;
|
||||
size_t column_stride;
|
||||
size_t row_stride;
|
||||
size_t depth_stride;
|
||||
};
|
||||
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue