The video surface interface. More...
#include "murl_i_video_surface.h"
Public Member Functions | |
~IVideoSurface () override | |
The destructor. | |
virtual IVideoSurface * | Clone (IEnums::PixelFormat pixelFormat) const =0 |
Create a clone of the surface with a specified pixel format. More... | |
virtual IVideoSurface * | Clone (UInt32 pixelSizeX, UInt32 pixelSizeY, const IVideoScaler *scaler=nullptr, Real gamma=1.0f) const =0 |
Create a clone of the surface with a specified size. More... | |
virtual IVideoSurface * | Clone (IEnums::PixelFormat pixelFormat, UInt32 pixelSizeX, UInt32 pixelSizeY, const IVideoScaler *scaler=nullptr, Real gamma=1.0f) const =0 |
Create a clone of the surface with a specified pixel format and size. More... | |
virtual IVideoSurface * | CloneRotated (IEnums::Orientation orientation) const =0 |
Create a clone of the surface with a specified orientation. More... | |
virtual IVideoSurface * | CloneRotated (IEnums::Orientation orientation, IEnums::PixelFormat pixelFormat) const =0 |
Create a clone of the surface with a specified orientation and pixel format. More... | |
virtual IVideoSurface * | CloneFrame (SInt32 positionX, SInt32 positionY, UInt32 pixelSizeX, UInt32 pixelSizeY) const =0 |
Create a surface and copy a specified rectangular region. More... | |
virtual UInt32 | GetPixelSizeX () const =0 |
Get the number of horizontal pixels. More... | |
virtual UInt32 | GetPixelSizeY () const =0 |
Get the number of vertical pixels. More... | |
virtual UInt32 | GetBytesPerLine () const =0 |
Get the number of bytes per line. More... | |
virtual UInt32 | GetBytesPerPixel () const =0 |
Get the number of bytes per pixel. More... | |
virtual IEnums::PixelFormat | GetPixelFormat () const =0 |
Get the pixel format of the surface. More... | |
virtual const ConstData & | GetPixels () const =0 |
Get the data object which is holding the pixels. More... | |
virtual const MutableData & | GetMutablePixels ()=0 |
Get the mutable data object which is holding the pixels. More... | |
virtual Color | GetPixel (SInt32 positionX, SInt32 positionY) const =0 |
Get the color of a pixel. More... | |
virtual Bool | SetPixel (SInt32 positionX, SInt32 positionY, const Color &color)=0 |
Set the color of a pixel. More... | |
virtual Bool | FlipX ()=0 |
Horizontally flip the surface. More... | |
virtual Bool | FlipY ()=0 |
Vertically flip the surface. More... | |
virtual Bool | Blit (const IVideoSurface *source, SInt32 destPositionX, SInt32 destPositionY)=0 |
Copy a source surface to a specified position. More... | |
virtual Bool | Blit (const IVideoSurface *source, SInt32 sourcePositionX, SInt32 sourcePositionY, SInt32 destPositionX, SInt32 destPositionY, UInt32 pixelSizeX, UInt32 pixelSizeY)=0 |
Copy a rectangular region from a source surface to a specified position. More... | |
virtual Bool | BlitScaled (const IVideoSurface *source, const IVideoScaler *scaler=nullptr, Real gamma=1.0f)=0 |
Copy a source surface of different size. More... | |
virtual Bool | Clear (const Color &clearColor)=0 |
Clear the surface. More... | |
virtual Bool | Clear (SInt32 positionX, SInt32 positionY, UInt32 pixelSizeX, UInt32 pixelSizeY, const Color &clearColor)=0 |
Clear a rectangular region of the surface. More... | |
virtual Bool | GaussBlur (Real strength)=0 |
Perform a Gauss blur operation on the surface. More... | |
virtual Bool | GaussBlur (SInt32 positionX, SInt32 positionY, UInt32 pixelSizeX, UInt32 pixelSizeY, Real strength)=0 |
Perform a Gauss blur operation on the surface. More... | |
virtual Bool | Dither (UInt32 redBits, UInt32 greenBits, UInt32 blueBits, UInt32 alphaBits)=0 |
Apply Floyd-Steinberg dithering on the surface. More... | |
virtual Bool | Dither (SInt32 positionX, SInt32 positionY, UInt32 pixelSizeX, UInt32 pixelSizeY, UInt32 redBits, UInt32 greenBits, UInt32 blueBits, UInt32 alphaBits)=0 |
Apply Floyd-Steinberg dithering on the surface. More... | |
virtual Bool | ApplyMatteFringe (UInt32 matteFringe, Real matteThreshold=0)=0 |
Apply a matte fringe using a specified alpha threshold value. More... | |
virtual Bool | ApplyMatteFringe (SInt32 positionX, SInt32 positionY, UInt32 pixelSizeX, UInt32 pixelSizeY, UInt32 matteFringe, Real matteThreshold=0)=0 |
Apply a matte color to a rectangular region using a specified alpha threshold value. More... | |
virtual Bool | ApplyMatteColor (const Color &matteColor, Real matteThreshold=0)=0 |
Apply a matte color using a specified alpha threshold value. More... | |
virtual Bool | ApplyMatteColor (SInt32 positionX, SInt32 positionY, UInt32 pixelSizeX, UInt32 pixelSizeY, const Color &matteColor, Real matteThreshold=0)=0 |
Apply a matte color to a rectangular region using a specified alpha threshold value. More... | |
virtual Bool | RenderText (const IFont *font, const String &text, const Color &textColor, const Color &backgroundColor, Bool clearSurface, Bool enableWordWrap, Real containerPosX, Real containerPosY, Real containerSizeX, Real containerSizeY, IEnums::TextAlignmentX alignX, IEnums::TextAlignmentY alignY)=0 |
Render some text into the surface using a given font. More... | |
virtual Bool | IsColumnEmpty (UInt32 column, Real threshold) const =0 |
Check if a column is empty using a specified alpha threshold value. More... | |
virtual Bool | IsRowEmpty (UInt32 row, Real threshold) const =0 |
Check if a row is empty using a specified alpha threshold value. More... | |
virtual SInt32 | ClipSizeXRight (SInt32 positionX, SInt32 sizeX) const =0 |
Clip the width relative to a position and the right border of the surface. More... | |
virtual SInt32 | ClipSizeYBottom (SInt32 positionY, SInt32 sizeY) const =0 |
Clip the height relative to a position and the bottom border of the surface. More... | |
virtual Bool | Evict ()=0 |
Evict restoreable resoures. More... | |
virtual Bool | Restore ()=0 |
Restore evictable resoures freed by Evict(). More... | |
Detailed Description
The video surface interface.
The video surface stores properties and pixel data of a graphic image. The video surface offers cloning of surfaces of different pixel format and size, copying rectangular regions from other video surfaces and applying matte colors.
Member Function Documentation
◆ Clone() [1/3]
|
pure virtual |
Create a clone of the surface with a specified pixel format.
- Parameters
-
pixelFormat The pixel format of the new surface.
- Returns
- The new surface or null if conversion is not available.
Implemented in Murl::Util::VideoSurface.
◆ Clone() [2/3]
|
pure virtual |
Create a clone of the surface with a specified size.
Scaling to different size is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8 and IEnums::PIXEL_FORMAT_R8_G8_B8 only.
- Parameters
-
pixelSizeX The number of horizontal pixels of the new surface. pixelSizeY The number of vertical pixels of the new surface. scaler Pointer to a scaler object or null to scale using the BoxVideoScaler. gamma The gamma value used during cloning.
- Returns
- The new surface or null if conversion is not available.
Implemented in Murl::Util::VideoSurface.
◆ Clone() [3/3]
|
pure virtual |
Create a clone of the surface with a specified pixel format and size.
Scaling to different size is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8 and IEnums::PIXEL_FORMAT_R8_G8_B8 only.
- Parameters
-
pixelFormat The pixel format of the new surface. pixelSizeX The number of horizontal pixels of the new surface. pixelSizeY The number of vertical pixels of the new surface. scaler Pointer to a scaler object or null to scale using the BoxVideoScaler. gamma The gamma value used during cloning.
- Returns
- The new surface or null if conversion is not available.
Implemented in Murl::Util::VideoSurface.
◆ CloneRotated() [1/2]
|
pure virtual |
Create a clone of the surface with a specified orientation.
- Parameters
-
orientation The orientation of the new surface.
- Returns
- The new surface or null if conversion is not available.
Implemented in Murl::Util::VideoSurface.
◆ CloneRotated() [2/2]
|
pure virtual |
Create a clone of the surface with a specified orientation and pixel format.
- Parameters
-
orientation The orientation of the new surface. pixelFormat The pixel format of the new surface.
- Returns
- The new surface or null if conversion is not available.
Implemented in Murl::Util::VideoSurface.
◆ CloneFrame()
|
pure virtual |
Create a surface and copy a specified rectangular region.
- Parameters
-
positionX The source x-position of the region. positionY The source y-position of the region. pixelSizeX The number of horizontal pixels of the region. pixelSizeY The number of vertical pixels of the region.
- Returns
- The new surface with the specified region's size.
Implemented in Murl::Util::VideoSurface.
◆ GetPixelSizeX()
|
pure virtual |
Get the number of horizontal pixels.
- Returns
- The number of horizontal pixels.
Implemented in Murl::Util::VideoSurface.
◆ GetPixelSizeY()
|
pure virtual |
Get the number of vertical pixels.
- Returns
- The number of vertical pixels.
Implemented in Murl::Util::VideoSurface.
◆ GetBytesPerLine()
|
pure virtual |
Get the number of bytes per line.
- Returns
- The number of bytes per line.
Implemented in Murl::Util::VideoSurface.
◆ GetBytesPerPixel()
|
pure virtual |
Get the number of bytes per pixel.
- Returns
- The number of bytes per pixel.
Implemented in Murl::Util::VideoSurface.
◆ GetPixelFormat()
|
pure virtual |
Get the pixel format of the surface.
- Returns
- The pixel format of the surface.
Implemented in Murl::Util::VideoSurface.
◆ GetPixels()
|
pure virtual |
Get the data object which is holding the pixels.
- Returns
- The data object which is holding the pixels.
Implemented in Murl::Util::VideoSurface.
◆ GetMutablePixels()
|
pure virtual |
Get the mutable data object which is holding the pixels.
- Returns
- The mutable data object which is holding the pixels.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ GetPixel()
|
pure virtual |
Get the color of a pixel.
- Parameters
-
positionX The pixel x-position. positionY The pixel y-position.
- Returns
- The color of the pixel at the specified position.
Implemented in Murl::Util::VideoSurface.
◆ SetPixel()
|
pure virtual |
Set the color of a pixel.
- Parameters
-
positionX The pixel x-position. positionY The pixel y-position. color The color of the pixel to set.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ FlipX()
|
pure virtual |
Horizontally flip the surface.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ FlipY()
|
pure virtual |
Vertically flip the surface.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ Blit() [1/2]
|
pure virtual |
Copy a source surface to a specified position.
All cases of overlapping are supported.
- Parameters
-
source The source surface. destPositionX The destination x-position. destPositionY The destination y-position.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ Blit() [2/2]
|
pure virtual |
Copy a rectangular region from a source surface to a specified position.
All cases of overlapping are supported.
- Parameters
-
source The source surface. sourcePositionX The source x-position. sourcePositionY The source y-position. destPositionX The destination x-position. destPositionY The destination y-position. pixelSizeX The number of horizontal pixels to copy. pixelSizeY The number of vertical pixels to copy.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ BlitScaled()
|
pure virtual |
Copy a source surface of different size.
Scaling to different size is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8 and IEnums::PIXEL_FORMAT_R8_G8_B8 only.
- Parameters
-
source The source surface. scaler Pointer to a scaler object or null to scale using the BoxVideoScaler. gamma The gamma value used during scaling.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ Clear() [1/2]
Clear the surface.
- Parameters
-
clearColor The clear color to apply.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ Clear() [2/2]
|
pure virtual |
Clear a rectangular region of the surface.
- Parameters
-
positionX The source x-position of the region. positionY The source y-position of the region. pixelSizeX The number of horizontal pixels of the region. pixelSizeY The number of vertical pixels of the region. clearColor The clear color to apply.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ GaussBlur() [1/2]
Perform a Gauss blur operation on the surface.
- Parameters
-
strength The blur filter strength.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ GaussBlur() [2/2]
|
pure virtual |
Perform a Gauss blur operation on the surface.
- Parameters
-
positionX The x-position of the region. positionY The y-position of the region. pixelSizeX The number of horizontal pixels of the region. pixelSizeY The number of vertical pixels of the region. strength The blur filter strength.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ Dither() [1/2]
|
pure virtual |
Apply Floyd-Steinberg dithering on the surface.
The given bit counts represent the actual number of significant integer bits for each color component. For floating-point formats, the given normalized component value is first multiplied by 255.
- Parameters
-
redBits The number of significant bits for the red component. greenBits The number of significant bits for the green component. blueBits The number of significant bits for the blue component. alphaBits The number of significant bits for the alpha component.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ Dither() [2/2]
|
pure virtual |
Apply Floyd-Steinberg dithering on the surface.
The given bit counts represent the actual number of significant integer bits for each color component. For floating-point formats, the given normalized component value is first multiplied by 255.
- Parameters
-
positionX The x-position of the region. positionY The y-position of the region. pixelSizeX The number of horizontal pixels of the region. pixelSizeY The number of vertical pixels of the region. redBits The number of significant bits for the red component. greenBits The number of significant bits for the green component. blueBits The number of significant bits for the blue component. alphaBits The number of significant bits for the alpha component.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ ApplyMatteFringe() [1/2]
|
pure virtual |
Apply a matte fringe using a specified alpha threshold value.
This operation affects all pixels whose alpha value is below or equal the given threshold. For these pixels, an average color value is calculated from all pixels within X/Y distance of "matteFringe" with alpha also nonzero. Applying matte fringe is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8, IEnums::PIXEL_FORMAT_L8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
- Parameters
-
matteFringe The matte fringe size to apply. matteThreshold The alpha threshold in range [0.0 .. 1.0].
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ ApplyMatteFringe() [2/2]
|
pure virtual |
Apply a matte color to a rectangular region using a specified alpha threshold value.
This operation affects all pixels whose alpha value is below or equal the given threshold. For these pixels, an average color value is calculated from all pixels within X/Y distance of "matteFringe" with alpha also nonzero. Applying matte fringe is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8, IEnums::PIXEL_FORMAT_L8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
- Parameters
-
positionX The source x-position of the region. positionY The source y-position of the region. pixelSizeX The number of horizontal pixels of the region. pixelSizeY The number of vertical pixels of the region. matteFringe The matte fringe size to apply. matteThreshold The alpha threshold in range [0.0 .. 1.0].
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ ApplyMatteColor() [1/2]
|
pure virtual |
Apply a matte color using a specified alpha threshold value.
The matte color's RGB values are set to all pixels which alpha values are less or equal to the specified alpha threshold value. Applying matte color is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8, IEnums::PIXEL_FORMAT_L8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
- Parameters
-
matteColor The matte color to apply. matteThreshold The alpha threshold in range [0.0 .. 1.0].
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface.
◆ ApplyMatteColor() [2/2]
|
pure virtual |
Apply a matte color to a rectangular region using a specified alpha threshold value.
The matte color's RGB values are set to all pixels which alpha values are less or equal to the specified alpha threshold value. Applying matte color is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8, IEnums::PIXEL_FORMAT_L8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
- Parameters
-
positionX The source x-position of the region. positionY The source y-position of the region. pixelSizeX The number of horizontal pixels of the region. pixelSizeY The number of vertical pixels of the region. matteColor The matte color to apply. matteThreshold The alpha threshold in range [0.0 .. 1.0].
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ RenderText()
|
pure virtual |
Render some text into the surface using a given font.
- Parameters
-
font The font used for rendering. text The text to render. textColor The text color to render. backgroundColor The text background color to render. clearSurface If true, the output surface is cleared before rendering. enableWordWrap If true, word wrapping is enabled. containerPosX The horizontal text position in the video stream. containerPosY The vertical text position in the video stream. containerSizeX The horizontal size of the text rectangle, or 0 if the video stream's X size should be used containerSizeY The vertical size of the text rectangle, or 0 if the video stream's Y size should be used alignX The horizontal text alignment. alignY The vertical text alignment.
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ IsColumnEmpty()
|
pure virtual |
Check if a column is empty using a specified alpha threshold value.
Checking is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
- Parameters
-
column The zero-based column. threshold The alpha threshold in range [0.0 .. 1.0].
- Returns
- true if all alpha values in the column are less or equal to the threshold.
Implemented in Murl::Util::VideoSurface.
◆ IsRowEmpty()
Check if a row is empty using a specified alpha threshold value.
Checking is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
- Parameters
-
row The zero-based row. threshold The alpha threshold in range [0.0 .. 1.0].
- Returns
- true if all alpha values in the row are less or equal to the threshold.
Implemented in Murl::Util::VideoSurface.
◆ ClipSizeXRight()
|
pure virtual |
Clip the width relative to a position and the right border of the surface.
- Parameters
-
positionX The x-position. sizeX The number of horzontal pixels.
- Returns
- The clipped width.
Implemented in Murl::Util::VideoSurface.
◆ ClipSizeYBottom()
|
pure virtual |
Clip the height relative to a position and the bottom border of the surface.
- Parameters
-
positionY The y-position. sizeY The number of vertical pixels.
- Returns
- The clipped height.
Implemented in Murl::Util::VideoSurface.
◆ Evict()
|
pure virtual |
Evict restoreable resoures.
Evictable surfaces can free resources e.g. on memory low warnings. These resources can be restored later by calling Restore().
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
◆ Restore()
|
pure virtual |
Restore evictable resoures freed by Evict().
- Returns
- true if successful.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
The documentation for this interface was generated from the following file:
- murl_i_video_surface.h