|
stmm-games-doc
0.32.0
|
Public Member Functions | |
| Image (const File &oImageFile) noexcept | |
| Image from a file constructor. More... | |
| Image (const shared_ptr< Image > &refImage, const NRect &oSubRect) noexcept | |
| Sub-image of another image constructor. More... | |
| Image (const shared_ptr< Image > &refImage, int32_t nSubX, int32_t nSubY, int32_t nSubW, int32_t nSubH) noexcept | |
| Sub-image of another image constructor. More... | |
| ~Image () noexcept | |
| Non virtual destructor. More... | |
| void | draw (const Cairo::RefPtr< Cairo::Context > &refCc, int32_t nX, int32_t nY, int32_t nW, int32_t nH) noexcept |
| Draws the image within a rectangle. More... | |
| bool | isLoaded () const noexcept |
| Whether the image is already loaded into memory. More... | |
| bool | load () noexcept |
| Loads the image into memory. More... | |
| NSize | getNaturalSize () noexcept |
| The natural size of the image. More... | |
| void | addCachedSize (int32_t nW, int32_t nH) noexcept |
| Add a cached size. More... | |
| void | addCachedSize (NSize oSize) noexcept |
| Add a cached size. More... | |
| void | releaseCachedSize (int32_t nW, int32_t nH) noexcept |
| Release a cached size. More... | |
| void | releaseCachedSize (NSize oSize) noexcept |
| Release a cached size. More... | |
| Cairo::RefPtr< Cairo::Surface > | getAsSurface (int32_t nW, int32_t nH) noexcept |
| Gets a surface of a given size with the image painted on it. More... | |
| const Cairo::RefPtr< Cairo::Surface > & | getAsCachedSurface (int32_t nW, int32_t nH) noexcept |
| Gets a cached surface with the image painted on it. More... | |
| Cairo::RefPtr< Cairo::Surface > | getAsMaskSurface (int32_t nW, int32_t nH) noexcept |
| Gets a mask surface of a given size with the image painted on it. More... | |
| const Cairo::RefPtr< Cairo::Surface > & | getAsCachedMaskSurface (int32_t nW, int32_t nH) noexcept |
| Gets a cached mask surface with the image painted on it. More... | |
Image class.
Can explicitely cache specific sizes of the image.
|
explicitnoexcept |
Image from a file constructor.
| oImageFile | The file. Must be defined. |
Sub-image of another image constructor.
| refImage | The master image. Cannot be null. |
| oSubRect | The rectangle within the master image in pixels. Width and height must be positive numbers. |
|
noexcept |
Sub-image of another image constructor.
| refImage | The master image. Cannot be null. |
| nSubX | The rectangle's x within the master image in pixels. |
| nSubY | The rectangle's y within the master image in pixels. |
| nSubW | The rectangle's w within the master image in pixels. Must be positive. |
| nSubH | The rectangle's h within the master image in pixels. Must be positive. |
|
noexcept |
Non virtual destructor.
|
noexcept |
Add a cached size.
Cached sizes are reference counted. Remember to call releaseCachedSize() when no longer needed.
| nW | The width in pixels. |
| nH | The height in pixels. |
|
noexcept |
Add a cached size.
Cached sizes are reference counted. Remember to call releaseCachedSize() when no longer needed.
| oSize | The size in pixel. |
|
noexcept |
Draws the image within a rectangle.
The image is loaded if necessary. The image is stretched over the rectangle. If the image cannot be loaded draws nothing.
| refCc | The context. Cannot be null. |
| nX | The rectangle's x in pixels. |
| nY | The rectangle's y in pixels. |
| nW | The rectangle's w in pixels. |
| nH | The rectangle's h in pixels. |
|
noexcept |
Gets a cached mask surface with the image painted on it.
The addCachedSize() function must have been called for the size.
| nW | The width. Must be > 0. |
| nH | The height. Must be > 0. |
|
noexcept |
Gets a cached surface with the image painted on it.
The addCachedSize() function must have been called for the size.
| nW | The width. Must be > 0. |
| nH | The height. Must be > 0. |
|
noexcept |
Gets a mask surface of a given size with the image painted on it.
If the requested size is cached the cached surface is returned.
| nW | The width in pixels. |
| nH | The height in pixels. |
|
noexcept |
Gets a surface of a given size with the image painted on it.
If the requested size is cached the cached surface is returned.
| nW | The width in pixels. |
| nH | The height in pixels. |
|
noexcept |
The natural size of the image.
|
noexcept |
Whether the image is already loaded into memory.
|
noexcept |
Loads the image into memory.
|
noexcept |
Release a cached size.
If the reference count reaches 0 the cached image is removed.
| nW | The width in pixels. |
| nH | The height in pixels. |
|
noexcept |
Release a cached size.
If the reference count reaches 0 the cached image is removed.
| oSize | The size in pixel. |
1.8.13