mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10:00
We already store these glPixelStorei() parameters in m_unpacking_parameters/m_packing_parameters, but didn't do anything with them. Setting these parameters is equivalent to offsetting the input/output texture data pointer by a constant offset.
54 lines
1.1 KiB
C++
54 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2021, Stephan Unverwerth <[email protected]>
|
|
* Copyright (c) 2022, Jelle Raaijmakers <[email protected]>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibGPU/ImageFormat.h>
|
|
|
|
namespace GPU {
|
|
|
|
// Order of bytes within a single component
|
|
enum class ComponentBytesOrder {
|
|
Normal,
|
|
Reversed,
|
|
};
|
|
|
|
struct PackingSpecification final {
|
|
u32 depth_stride { 0 };
|
|
u32 row_stride { 0 };
|
|
u32 skip_rows { 0 };
|
|
u32 skip_pixels { 0 };
|
|
u8 byte_alignment { 1 };
|
|
ComponentBytesOrder component_bytes_order { ComponentBytesOrder::Normal };
|
|
};
|
|
|
|
// Full dimensions of the image
|
|
struct DimensionSpecification final {
|
|
u32 width;
|
|
u32 height;
|
|
u32 depth;
|
|
};
|
|
|
|
// Subselection (source or target) within the image
|
|
struct ImageSelection final {
|
|
i32 offset_x { 0 };
|
|
i32 offset_y { 0 };
|
|
i32 offset_z { 0 };
|
|
u32 width;
|
|
u32 height;
|
|
u32 depth;
|
|
};
|
|
|
|
struct ImageDataLayout final {
|
|
PixelType pixel_type;
|
|
PackingSpecification packing {};
|
|
DimensionSpecification dimensions;
|
|
ImageSelection selection;
|
|
};
|
|
|
|
}
|