Base class for OpenGL image renderer.
More...
#include <cvb/ui/opengl_image_renderer.hpp>
Inherits QOpenGLFunctions.
Base class for OpenGL image renderer.
You dot need to use this class to render the image with CvbQtImageView. However this class is meant for convenient usage with a custom OpenGL context, in order to render the image to something different than CvbQtImageView. Please be aware that for all member function a QOpenGLContext must be current.
- Note
- The use of this class is an advanced topic and requires significant knowledge about Qt and OpenGL!
◆ BeginBufferAccess()
virtual void * BeginBufferAccess |
( |
int & |
linePad | ) |
|
|
pure virtualnoexcept |
Maps the pixel buffer to upload data.
- Parameters
-
[out] | linePad | Line padding used by the current buffer format, for convenience. |
- Returns
- Pointer to the buffer.
- Exceptions
-
Does | not throw any exception. |
◆ BufferFormat()
Returns the current buffer format.
- Returns
- The buffer format associated with the current rendering.
- Exceptions
-
Does | not throw any exception. |
◆ EndBufferAccess()
virtual void EndBufferAccess |
( |
| ) |
|
|
pure virtualnoexcept |
End the pixel buffer mapping.
- Exceptions
-
Does | not throw any exception. |
◆ MonoUploadSupported()
virtual bool MonoUploadSupported |
( |
| ) |
const |
|
pure virtualnoexcept |
Check if a mono image can be uploaded without duplicating the date in the color channels.
- Returns
- True if supported false otherwise.
- Exceptions
-
Does | not throw any exception. |
◆ Render()
void Render |
( |
const QRectF & |
viewportRect | ) |
|
|
inlinenoexcept |
Actually renders the image.
- Parameters
-
[in] | viewportRect | Visible rectangle of the image. |
- Exceptions
-
Does | not throw any exception. |
This method does not reset the OpenGL state, and does not clear anything. Make sure you are in a suitable state for rendering a texture.
◆ UpdateBufferFormat()
Updates the buffer format associated with the current rendering.
- Parameters
-
[in] | bufferFormat | The new buffer format. |
- Exceptions
-
Does | not throw any exception. |
◆ UpdateMaping()
void UpdateMaping |
( |
const QRectF & |
sourceRect, |
|
|
Size2D< int > |
textureSize |
|
) |
| |
|
inlinenoexcept |
Updates the vertex and texture coordinates before rendering.
- Parameters
-
[in] | sourceRect | Rectangle holding the vertex coordinates for the visible part of the texture. |
[in] | textureSize | Pixel size of the texture to adjust the texture coordinates for e.g. sub pixel scrolling. This is only relevant if vertex coordinates have a fractional part.
|
- Exceptions
-
Does | not throw any exception. |