2021-12-22 18:07:01 +01:00
|
|
|
/*
|
|
|
|
|
* Copyright (c) 2021, Stephan Unverwerth <s.unverwerth@serenityos.org>
|
2022-08-24 23:47:49 +02:00
|
|
|
* Copyright (c) 2022, Jelle Raaijmakers <jelle@gmta.nl>
|
2021-12-22 18:07:01 +01:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2022-03-15 13:19:03 +01:00
|
|
|
#include <LibGPU/ImageFormat.h>
|
2021-12-22 18:07:01 +01:00
|
|
|
|
2022-03-15 13:26:31 +01:00
|
|
|
namespace GPU {
|
2021-12-22 18:07:01 +01:00
|
|
|
|
2022-08-24 23:47:49 +02:00
|
|
|
// Order of bytes within a single component
|
|
|
|
|
enum class ComponentBytesOrder {
|
|
|
|
|
Normal,
|
|
|
|
|
Reversed,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct PackingSpecification final {
|
|
|
|
|
u32 depth_stride { 0 };
|
|
|
|
|
u32 row_stride { 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;
|
|
|
|
|
};
|
|
|
|
|
|
2021-12-22 18:07:01 +01:00
|
|
|
struct ImageDataLayout final {
|
2022-08-24 23:47:49 +02:00
|
|
|
PixelType pixel_type;
|
|
|
|
|
PackingSpecification packing {};
|
|
|
|
|
DimensionSpecification dimensions;
|
|
|
|
|
ImageSelection selection;
|
2021-12-22 18:07:01 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
}
|