cae  0.0.0
Cross-API graphics engine
Loading...
Searching...
No Matches
Image.hpp
Go to the documentation of this file.
1///
2/// @file Image.hpp
3/// @brief This file contains image struct
4/// @namespace utl
5///
6
7#pragma once
8
9#include <filesystem>
10
11namespace utl
12{
13
14 ///
15 /// @struct Image
16 /// @brief Struct for image
17 /// @namespace utl
18 ///
19 struct Image
20 {
21
22 using pixel = unsigned char *;
23
24 ///
25 /// @param path Path to the image file
26 /// @param flip Whether to flip the image vertically
27 /// @brief Load an image from a file
28 ///
29 explicit Image(const std::filesystem::path &path, bool flip = false);
30 ~Image();
31
32 pixel pixels = nullptr;
33 int width = 0;
34 int height = 0;
35 int channels = 0;
36
37 }; // struct Image
38
39} // namespace utl
Struct for image.
Definition Image.hpp:20
unsigned char * pixel
Definition Image.hpp:22
Image(const std::filesystem::path &path, bool flip=false)
Load an image from a file.
Definition image.cpp:8
int height
Definition Image.hpp:34
pixel pixels
Definition Image.hpp:32
int width
Definition Image.hpp:33
int channels
Definition Image.hpp:35