![]() |
Murl Engine API
Version 2018.3
|
The video surface interface. More...
#include <murl_i_video_surface.h>
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.
Public Member Functions | |
virtual | ~IVideoSurface () |
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=0, 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=0, 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=0, 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 | ApplyMatte (const Color &matteColor, Real matteThreshold=0)=0 |
Apply a matte color using a specified alpha threshold value. More... | |
virtual Bool | ApplyMatte (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... | |
|
pure virtual |
Create a clone of the surface with a specified pixel format.
pixelFormat | The pixel format of the new surface. |
Implemented in Murl::Util::VideoSurface.
|
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.
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. |
Implemented in Murl::Util::VideoSurface.
|
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.
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. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Create a clone of the surface with a specified orientation.
orientation | The orientation of the new surface. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Create a clone of the surface with a specified orientation and pixel format.
orientation | The orientation of the new surface. |
pixelFormat | The pixel format of the new surface. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Create a surface and copy a specified rectangular region.
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. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the number of horizontal pixels.
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the number of vertical pixels.
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the number of bytes per line.
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the number of bytes per pixel.
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the pixel format of the surface.
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the data object which is holding the pixels.
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Get the mutable data object which is holding the pixels.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
pure virtual |
Get the color of a pixel.
positionX | The pixel x-position. |
positionY | The pixel y-position. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Set the color of a pixel.
positionX | The pixel x-position. |
positionY | The pixel y-position. |
color | The color of the pixel to set. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Horizontally flip the surface.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
pure virtual |
Vertically flip the surface.
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
pure virtual |
Copy a source surface to a specified position.
All cases of overlapping are supported.
source | The source surface. |
destPositionX | The destination x-position. |
destPositionY | The destination y-position. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Copy a rectangular region from a source surface to a specified position.
All cases of overlapping are supported.
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. |
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
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.
source | The source surface. |
scaler | Pointer to a scaler object or null to scale using the BoxVideoScaler. |
gamma | The gamma value used during scaling. |
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
Clear the surface.
clearColor | The clear color to apply. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Clear a rectangular region of the surface.
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. |
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
Perform a Gauss blur operation on the surface.
strength | The blur filter strength. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Perform a Gauss blur operation on the surface.
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. |
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
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 is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8, IEnums::PIXEL_FORMAT_L8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
matteColor | The matte color to apply. |
matteThreshold | The alpha threshold in range [0.0 .. 1.0]. |
Implemented in Murl::Util::VideoSurface.
|
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 is supported for IEnums::PIXEL_FORMAT_R8_G8_B8_A8, IEnums::PIXEL_FORMAT_L8_A8 and IEnums::PIXEL_FORMAT_R5_G5_B5_A1 only.
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]. |
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
pure virtual |
Render some text into the surface using a given font.
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. |
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
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.
column | The zero-based column. |
threshold | The alpha threshold in range [0.0 .. 1.0]. |
Implemented in Murl::Util::VideoSurface.
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.
row | The zero-based row. |
threshold | The alpha threshold in range [0.0 .. 1.0]. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Clip the width relative to a position and the right border of the surface.
positionX | The x-position. |
sizeX | The number of horzontal pixels. |
Implemented in Murl::Util::VideoSurface.
|
pure virtual |
Clip the height relative to a position and the bottom border of the surface.
positionY | The y-position. |
sizeY | The number of vertical pixels. |
Implemented in Murl::Util::VideoSurface.
|
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().
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.
|
pure virtual |
Restore evictable resoures freed by Evict().
Implemented in Murl::Util::VideoSurface, and Murl::Util::EvictableVideoSurface.