CYD-UI
A C++ library for building native graphic user interfaces
Loading...
Searching...
No Matches
pixelmap.cppm
Go to the documentation of this file.
1
// Copyright (c) 2024, Víctor Castillo Agüero.
2
// SPDX-License-Identifier: GPL-3.0-or-later
3
4
export
module
cydui.graphics.types:pixelmap
;
5
6
import
std;
7
8
import
fabric.memory.multidim_data;
9
import
fabric.type_aliases;
10
11
export
{
12
struct
__attribute__
((packed)) pixel_t {
13
u8 b;
14
u8 g;
15
u8 r;
16
u8 a;
17
};
18
19
struct
pixelmap_t
:
public
md_buffer_t<pixel_t, 2> {
20
pixelmap_t
(
unsigned
long
w,
unsigned
long
h): md_buffer_t<pixel_t, 2>({w, h}) {
21
}
22
pixelmap_t
(
unsigned
long
w,
unsigned
long
h, pixel_t*& data): md_buffer_t<pixel_t, 2>({w, h}, data) {
23
}
24
25
[[nodiscard]]
size_t
width
()
const
{
26
return
size[0];
27
}
28
29
[[nodiscard]]
size_t
height
()
const
{
30
return
size[1];
31
}
32
};
33
34
using
image_t
=
pixelmap_t
;
35
36
}
cydui.graphics.types
pixelmap_t
Definition
pixelmap.cppm:19
pixelmap_t::width
size_t width() const
Definition
pixelmap.cppm:25
pixelmap_t::height
size_t height() const
Definition
pixelmap.cppm:29
pixelmap_t::pixelmap_t
pixelmap_t(unsigned long w, unsigned long h, pixel_t *&data)
Definition
pixelmap.cppm:22
pixelmap_t::pixelmap_t
pixelmap_t(unsigned long w, unsigned long h)
Definition
pixelmap.cppm:20
__attribute__
struct __attribute__((packed)) pixel_t
Definition
pixelmap.cppm:12
image_t
pixelmap_t image_t
Definition
pixelmap.cppm:34
include
cyd_ui
graphics
types
pixelmap.cppm
Generated by
1.13.2