Interface IPlatformRenderInterface
Defines the main platform-specific interface for the rendering subsystem.
[Unstable]
[PrivateApi]
public interface IPlatformRenderInterface
Properties
DefaultAlphaFormat
Default AlphaFormat used on this platform.
AlphaFormat DefaultAlphaFormat { get; }
Property Value
DefaultPixelFormat
Default PixelFormat used on this platform.
PixelFormat DefaultPixelFormat { get; }
Property Value
SupportsIndividualRoundRects
Gets a value indicating whether the platform directly supports rectangles with rounded corners.
bool SupportsIndividualRoundRects { get; }
Property Value
Remarks
Some platform renderers can't directly handle rounded corners on rectangles. In this case, code that requires rounded corners must generate and retain a geometry instead.
SupportsRegions
bool SupportsRegions { get; }
Property Value
Methods
BuildGlyphRunGeometry(GlyphRun)
Created a geometry implementation for the glyph run.
IGeometryImpl BuildGlyphRunGeometry(GlyphRun glyphRun)
Parameters
glyphRun
GlyphRunThe glyph run to build a geometry from.
Returns
- IGeometryImpl
The geometry returned contains the combined geometry of all glyphs in the glyph run.
CreateBackendContext(IPlatformGraphicsContext?)
Creates a backend-specific object using a low-level API graphics context
IPlatformRenderInterfaceContext CreateBackendContext(IPlatformGraphicsContext? graphicsApiContext)
Parameters
graphicsApiContext
IPlatformGraphicsContextAn underlying low-level graphics context (e. g. wrapped OpenGL context, Vulkan device, D3DDevice, etc)
Returns
CreateCombinedGeometry(GeometryCombineMode, IGeometryImpl, IGeometryImpl)
Creates a geometry group implementation.
IGeometryImpl CreateCombinedGeometry(GeometryCombineMode combineMode, IGeometryImpl g1, IGeometryImpl g2)
Parameters
combineMode
GeometryCombineModeThe combine mode
g1
IGeometryImplThe first geometry.
g2
IGeometryImplThe second geometry.
Returns
- IGeometryImpl
A combined geometry.
CreateEllipseGeometry(Rect)
Creates an ellipse geometry implementation.
IGeometryImpl CreateEllipseGeometry(Rect rect)
Parameters
rect
RectThe bounds of the ellipse.
Returns
- IGeometryImpl
An ellipse geometry.
CreateGeometryGroup(FillRule, IReadOnlyList<IGeometryImpl>)
Creates a geometry group implementation.
IGeometryImpl CreateGeometryGroup(FillRule fillRule, IReadOnlyList<IGeometryImpl> children)
Parameters
fillRule
FillRuleThe fill rule.
children
IReadOnlyList<IGeometryImpl>The geometries to group.
Returns
- IGeometryImpl
A combined geometry.
CreateGlyphRun(IGlyphTypeface, double, IReadOnlyList<GlyphInfo>, Point)
Creates a platform implementation of a glyph run.
IGlyphRunImpl CreateGlyphRun(IGlyphTypeface glyphTypeface, double fontRenderingEmSize, IReadOnlyList<GlyphInfo> glyphInfos, Point baselineOrigin)
Parameters
glyphTypeface
IGlyphTypefaceThe glyph typeface.
fontRenderingEmSize
doubleThe font rendering em size.
glyphInfos
IReadOnlyList<GlyphInfo>The list of glyphs.
baselineOrigin
PointThe baseline origin of the run. Can be null.
Returns
CreateLineGeometry(Point, Point)
Creates a line geometry implementation.
IGeometryImpl CreateLineGeometry(Point p1, Point p2)
Parameters
Returns
- IGeometryImpl
A line geometry.
CreateRectangleGeometry(Rect)
Creates a rectangle geometry implementation.
IGeometryImpl CreateRectangleGeometry(Rect rect)
Parameters
rect
RectThe bounds of the rectangle.
Returns
- IGeometryImpl
A rectangle.
CreateRegion()
IPlatformRenderInterfaceRegion CreateRegion()
Returns
CreateRenderTargetBitmap(PixelSize, Vector)
Creates a render target bitmap implementation.
IRenderTargetBitmapImpl CreateRenderTargetBitmap(PixelSize size, Vector dpi)
Parameters
Returns
CreateStreamGeometry()
Creates a stream geometry implementation.
IStreamGeometryImpl CreateStreamGeometry()
Returns
CreateWriteableBitmap(PixelSize, Vector, PixelFormat, AlphaFormat)
Creates a writeable bitmap implementation.
IWriteableBitmapImpl CreateWriteableBitmap(PixelSize size, Vector dpi, PixelFormat format, AlphaFormat alphaFormat)
Parameters
size
PixelSizeThe size of the bitmap in device pixels.
dpi
VectorThe DPI of the bitmap.
format
PixelFormatPixel format.
alphaFormat
AlphaFormatAlpha format .
Returns
IsSupportedBitmapPixelFormat(PixelFormat)
bool IsSupportedBitmapPixelFormat(PixelFormat format)
Parameters
format
PixelFormat
Returns
LoadBitmap(PixelFormat, AlphaFormat, nint, PixelSize, Vector, int)
Loads a bitmap implementation from a pixels in memory.
IBitmapImpl LoadBitmap(PixelFormat format, AlphaFormat alphaFormat, nint data, PixelSize size, Vector dpi, int stride)
Parameters
format
PixelFormatThe pixel format.
alphaFormat
AlphaFormatThe alpha format.
data
nintThe pointer to source bytes.
size
PixelSizeThe size of the bitmap in device pixels.
dpi
VectorThe DPI of the bitmap.
stride
intThe number of bytes per row.
Returns
LoadBitmap(Stream)
Loads a bitmap implementation from a file..
IBitmapImpl LoadBitmap(Stream stream)
Parameters
stream
StreamThe stream to read the bitmap from.
Returns
LoadBitmap(string)
Loads a bitmap implementation from a file..
IBitmapImpl LoadBitmap(string fileName)
Parameters
fileName
stringThe filename of the bitmap.
Returns
LoadBitmapToHeight(Stream, int, BitmapInterpolationMode)
Loads a bitmap implementation from a stream to a specified height maintaining aspect ratio.
IBitmapImpl LoadBitmapToHeight(Stream stream, int height, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality)
Parameters
stream
StreamThe stream to read the bitmap from.
height
intThe desired height of the resulting bitmap.
interpolationMode
BitmapInterpolationModeThe BitmapInterpolationMode to use should resizing be required.
Returns
LoadBitmapToWidth(Stream, int, BitmapInterpolationMode)
Loads a bitmap implementation from a stream to a specified width maintaining aspect ratio.
IBitmapImpl LoadBitmapToWidth(Stream stream, int width, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality)
Parameters
stream
StreamThe stream to read the bitmap from.
width
intThe desired width of the resulting bitmap.
interpolationMode
BitmapInterpolationModeThe BitmapInterpolationMode to use should resizing be required.
Returns
LoadWriteableBitmap(Stream)
Loads a WriteableBitmap implementation from a file.
IWriteableBitmapImpl LoadWriteableBitmap(Stream stream)
Parameters
stream
StreamThe stream to read the bitmap from.
Returns
LoadWriteableBitmap(string)
Loads a WriteableBitmap implementation from a file.
IWriteableBitmapImpl LoadWriteableBitmap(string fileName)
Parameters
fileName
stringThe filename of the bitmap.
Returns
LoadWriteableBitmapToHeight(Stream, int, BitmapInterpolationMode)
Loads a WriteableBitmap implementation from a stream to a specified height maintaining aspect ratio.
IWriteableBitmapImpl LoadWriteableBitmapToHeight(Stream stream, int height, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality)
Parameters
stream
StreamThe stream to read the bitmap from.
height
intThe desired height of the resulting bitmap.
interpolationMode
BitmapInterpolationModeThe BitmapInterpolationMode to use should resizing be required.
Returns
LoadWriteableBitmapToWidth(Stream, int, BitmapInterpolationMode)
Loads a WriteableBitmap implementation from a stream to a specified width maintaining aspect ratio.
IWriteableBitmapImpl LoadWriteableBitmapToWidth(Stream stream, int width, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality)
Parameters
stream
StreamThe stream to read the bitmap from.
width
intThe desired width of the resulting bitmap.
interpolationMode
BitmapInterpolationModeThe BitmapInterpolationMode to use should resizing be required.
Returns
ResizeBitmap(IBitmapImpl, PixelSize, BitmapInterpolationMode)
IBitmapImpl ResizeBitmap(IBitmapImpl bitmapImpl, PixelSize destinationSize, BitmapInterpolationMode interpolationMode = BitmapInterpolationMode.HighQuality)
Parameters
bitmapImpl
IBitmapImpldestinationSize
PixelSizeinterpolationMode
BitmapInterpolationMode