nxdk_pgraph_tests
A collection of tests for the Xbox nv2a graphics processor
 
Loading...
Searching...
No Matches
image_resource.h
1#ifndef NXDK_PGRAPH_TESTS_SRC_IMAGERESOURCE_H_
2#define NXDK_PGRAPH_TESTS_SRC_IMAGERESOURCE_H_
3
4#include <cstdint>
5#include <memory>
6
8 uint8_t *data{nullptr};
9 uint32_t width{0};
10 uint32_t height{0};
11 uint32_t pitch{0};
12 uint32_t bytes_per_pixel{0};
13
14 ImageResource() = default;
15
16 explicit ImageResource(const std::string &source_path) { LoadPNG(source_path); }
17
18 virtual ~ImageResource();
19
23 void LoadPNG(const std::string &source_path);
24
26 void CopyTo(uint8_t *target) const;
27
30 void SwizzleTo(uint8_t *target) const;
31};
32
33#endif // NXDK_PGRAPH_TESTS_SRC_IMAGERESOURCE_H_
Definition image_resource.h:7
void CopyTo(uint8_t *target) const
Copies the image data to the given target, which must be allocated and sufficiently large.
Definition image_resource.cpp:35
void SwizzleTo(uint8_t *target) const
Definition image_resource.cpp:37
void LoadPNG(const std::string &source_path)
Definition image_resource.cpp:16