p6::Image
Section: Image
Inherits from p6::ImageOrCanvas
Summary
| Name | |
|---|---|
Image(ImageSize size, const uint8_t * data, glpp::TextureLayout texture_layout = {glpp::InternalFormat::RGBA8, glpp::Channels::RGBA, glpp::TexelDataType::UnsignedByte})Creates an Image filled with data.  | |
| ImageSize | size() const Returns the size in pixels.  | 
| virtual float | aspect_ratio() const override Returns the aspect ratio ( width / height) | 
| float | inverse_aspect_ratio() const Returns the inverse aspect ratio ( height / width) | 
| virtual const glpp::Texture2D & | texture() const override | 
Details
Image()
Image(
ImageSizesize,const uint8_t *data,glpp::TextureLayouttexture_layout ={glpp::InternalFormat::RGBA8, glpp::Channels::RGBA, glpp::TexelDataType::UnsignedByte});
Creates an Image filled with data.
This is for advanced uses; prefer using p6::load_image(). data must be an array of size size.width() * size.height() * 4, with R, G, B and A channels, starting with the bottom left pixel, and going row by row. texture_layout is an advanced setting; it controls how the pixels are gonna be stored on the GPU. 
size()
ImageSizesize() const;
Returns the size in pixels.
aspect_ratio()
floataspect_ratio() const override;
Returns the aspect ratio (width / height) 
Reimplements: p6::ImageOrCanvas::aspect_ratio
inverse_aspect_ratio()
floatinverse_aspect_ratio() const;
Returns the inverse aspect ratio (height / width) 
texture()
const glpp::Texture2D &texture() const override;
Reimplements: p6::ImageOrCanvas::texture
Updated on 2024 October 24