sincerely
Singaporean
If you have not done so, read this full tutorial on how to use SGEXTN to build an application.
class SGRImage;
part of SGEXTN module SG_Widgets
represents an image
list of all including inherited members
preprocessor file inclusion directive: #include ‹SGRImage.h›
CMake target for BuildLah: SGEXTN::SG_Widgets
see this link for more information about BuildLah
parent class: (none)
children classes: (none)
SGRImage(int w, int h, SGXColourRGBA c);
SGRImage(const SGXString& filePath);
SGRImage(int w, int h);
[[nodiscard]] SGXColourRGBA colourAt(int x, int y) const;
[[nodiscard]] int height() const;
[[nodiscard]] SGXColourRGBA interpolatedColourAt(float x, float y) const;
void saveToFile(const SGXString& filePath) const;
void setColourAt(int x, int y, SGXColourRGBA c) const;
[[nodiscard]] int width() const;
SGRImage stores and allows modification to any image. The image uses 8bit RGBA, consistent with SGXColourRGBA.
wraps QImage
Creates a SGRImage with width w pixels, height h pixels, and with every pixel initialised to c.
Negative w or h will crash.
Creates a SGRImage using the image found at filePath.
Nonexistent filePath is undefined behaviour.
The matching file must exist in the resource system. To ensure that, put the image in the assets folder. For more information about the resource system, see this tutorial.
Creates a SGRImage with width w pixels, height h pixels, containing uninitialised nonsense.
Accessing the colours of this SGRImage before setting them is undefined behaviour.
Negative w or h will crash.
Returns the SGXColourRGBA of the pixel at (x, y).
x below zero, x more than or equal to the width, y below zero, y more than or equal to the height will crash. If you want image sampling, use SGRImage::interpolatedColourAt instead.
Returns the height of this SGRImage.
Returns the SGXColourRGBA of the pixel at (x, y). If either coordinate is not integer, linear sampling is used. If either coordinate is out of bounds, wrap around is used.
This matches the sampling mode used by SG - RI ⁽㈳㈴㈳㈮㈱㈨㈠㈫ ㈧㈤㈱㈤⁾.
Saves this SGRImage to file at filePath in PNG format.
If filePath is not a valid file path, this is undefined behaviour.
Sets the SGXColourRGBA of the pixel at (x, y) to c.
x below zero, x more than or equal to the width, y below zero, y more than or equal to the height will crash
Returns the width of this SGRImage.
©2025 05524F.sg (Singapore)