#include <Image.h>
Definition at line 33 of file Image.h.
save the FrameBuffer to file using current built in I/O
- Parameters
-
_fname | the name / path of the file to save _x the x position into the framebuffer This location is the lower left corner of a rectangular block of pixels _y the y position into the framebuffer This location is the lower left corner of a rectangular block of pixels _width of the rectangle _height the height of the rectangle _mode RGB or RGBA image |
Definition at line 74 of file Image.h.
ctor passing in filename
- Parameters
-
_fname | the name of the file to load. |
Definition at line 41 of file Image.cpp.
References load().
ngl::Image::Image |
( |
const Image & |
_i | ) |
|
dtor as we use a smart pointer the data will release automatically
GLuint ngl::Image::channels |
( |
| ) |
const |
|
inlinenoexcept |
gets the number of channels
- Returns
- usually 3 (RGB) or 4 (RGBA) but can handle others depending on libl
Definition at line 95 of file Image.h.
GLuint ngl::Image::format |
( |
| ) |
const |
|
inlinenoexcept |
Get the pixel format.
- Returns
- pixel format of the texture
Definition at line 90 of file Image.h.
get the colour value from X,Y co-ordinates (image absolute 0,0 = top Left)
- Parameters
-
[in] | _x | the x position in the image |
[in] | _y | the y position in the image |
Definition at line 56 of file Image.cpp.
References m_channels, m_data, m_height, m_width, and NGL_ASSERT.
Colour ngl::Image::getColour |
( |
const Real |
_uvX, |
|
|
const Real |
_uvY |
|
) |
| const |
|
noexcept |
unsigned char* ngl::Image::getPixels |
( |
| ) |
const |
|
inlinenoexcept |
raw access to unsigned char pixel data
- Returns
- a pointer to the first image pixel element.
Definition at line 64 of file Image.h.
GLuint ngl::Image::height |
( |
| ) |
const |
|
inlinenoexcept |
Get the height of the texture.
- Returns
- height of the texture
Definition at line 85 of file Image.h.
load the image data, this will clear the previous data and attempt to load the new image data
- Parameters
-
_fname | name of the file to load |
- Returns
- true is loaded ok, else false
Definition at line 105 of file Image.cpp.
References GL_RGB, GL_RGBA, GL_UNSIGNED_BYTE, glReadPixels(), load(), m_channels, m_data, m_format, m_hasAlpha, m_height, m_width, NGL_ASSERT, and RGBA.
GLuint ngl::Image::width |
( |
| ) |
const |
|
inlinenoexcept |
Get the width of the texture.
- Returns
- width of the texture
Definition at line 80 of file Image.h.
GLuint ngl::Image::m_channels =3 |
|
private |
bits per pixel (RGB / RGBA)
Definition at line 126 of file Image.h.
std::unique_ptr<unsigned char[] > ngl::Image::m_data |
|
private |
the actual image data loaded packed in r,g,b,(a) format in contiguous memory stored in a smart_pointer for safety
Definition at line 114 of file Image.h.
image format, use GL types for this as we are going to use this class mainly for OpenGL
Definition at line 130 of file Image.h.
bool ngl::Image::m_hasAlpha =false |
|
private |
do we have an alpha channel
Definition at line 138 of file Image.h.
GLuint ngl::Image::m_height =0 |
|
private |
the size of the image in the Y direction
Definition at line 122 of file Image.h.
bool ngl::Image::m_loaded =false |
|
private |
loaded flag
Definition at line 134 of file Image.h.
the size of the image in the X direction
Definition at line 118 of file Image.h.
The documentation for this class was generated from the following files: