MCPcopy Create free account
hub / github.com/RobLoach/raylib-cpp / Image

Class Image

include/Image.hpp:17–581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15 * Data stored in CPU memory (RAM)
16 */
17class Image : public ::Image {
18public:
19 Image(
20 void* data = nullptr,
21 int width = 0,
22 int height = 0,
23 int mipmaps = 1,
24 int format = PIXELFORMAT_UNCOMPRESSED_R8G8B8A8)
25 : ::Image{data, width, height, mipmaps, format} {
26 // Nothing.
27 }
28
29 Image(const ::Image& image) : ::Image(image) { }
30
31 /**
32 * Load an image from the given file.
33 *
34 * @throws raylib::RaylibException Thrown if the image failed to load from the file.
35 *
36 * @see Load()
37 */
38 Image(const std::string& fileName) { Load(fileName); }
39
40 /**
41 * Load a raw image from the given file, with the provided width, height, and formats.
42 *
43 * @throws raylib::RaylibException Thrown if the image failed to load from the file.
44 *
45 * @see LoadRaw()
46 */
47 Image(const std::string& fileName, int width, int height, int format, int headerSize = 0) {
48 Load(fileName, width, height, format, headerSize);
49 }
50
51 /**
52 * Load an animation image from the given file.
53 *
54 * @throws raylib::RaylibException Thrown if the image failed to load from the file.
55 *
56 * @see LoadAnim()
57 */
58 Image(const std::string& fileName, int* frames) { Load(fileName, frames); }
59
60 /**
61 * Load an image from the given file.
62 *
63 * @throws raylib::RaylibException Thrown if the image failed to load from the file.
64 */
65 Image(const std::string& fileType, const unsigned char* fileData, int dataSize) {
66 Load(fileType, fileData, dataSize);
67 }
68
69 /**
70 * Load an image from the given file.
71 *
72 * @throws raylib::RaylibException Thrown if the image failed to load from the file.
73 */
74 Image(const ::Texture2D& texture) { Load(texture); }

Callers

nothing calls this directly

Calls 1

CopyMethod · 0.45

Tested by

no test coverage detected