import type { DataPoint, IRenderContext, ITransposablePlotElement, OxyColor, OxyRect, OxySize, OxyThickness, ScreenPoint } from '../..'; import { EdgeRenderingMode, LineJoin, LineStyle, MarkerType, type OxyImage, OxyPen } from '../..'; import { type IDisposable } from '../../../patch'; /** * Provides extension methods for IRenderContext. */ export declare class RenderingExtensions { /** * The vertical distance to the bottom points of the triangles. */ private static readonly M1; /** * The vertical distance to the top points of the triangles. */ private static readonly M2; /** * The horizontal/vertical distance to the end points of the stars. */ private static readonly M3; /** * Gets the actual edge rendering mode. * @param edgeRenderingMode The edge rendering mode. * @param defaultValue The default value that is used if edgeRenderingMode is EdgeRenderingMode.Automatic. * @returns The value of edgeRenderingMode if it is not EdgeRenderingMode.Automatic; the defaultValue otherwise. */ static getActualEdgeRenderingMode(edgeRenderingMode: EdgeRenderingMode, defaultValue: EdgeRenderingMode): EdgeRenderingMode; /** * Draws a clipped polyline through the specified points. * @param rc The render context. * @param points The points defining the polyline. The polyline is drawn from point 0, to point 1, to point 2 and so on. * @param minDistSquared The minimum line segment length (squared). * @param stroke The stroke color. * @param strokeThickness The stroke thickness. * @param edgeRenderingMode The edge rendering mode. * @param dashArray The dash array. Use null to get a solid line. * @param lineJoin The line join type. * @param outputBuffer The output buffer. * @param pointsRendered The points rendered callback. */ static drawReducedLine(rc: IRenderContext, points: ScreenPoint[], minDistSquared: number, stroke: OxyColor, strokeThickness: number, edgeRenderingMode: EdgeRenderingMode, dashArray?: number[], lineJoin?: LineJoin, outputBuffer?: ScreenPoint[], pointsRendered?: (points: ScreenPoint[]) => void): Promise; /** * Draws the polygon within the specified clipping rectangle. * @param rc The render context. * @param points The points defining the polygon. * @param minDistSquared The squared minimum distance between points. * @param fill The fill color. * @param stroke The stroke color. * @param strokeThickness The stroke thickness. * @param edgeRenderingMode The edge rendering mode. * @param lineStyle The line style. * @param lineJoin The line join. */ static drawReducedPolygon(rc: IRenderContext, points: ScreenPoint[], minDistSquared: number, fill: OxyColor, stroke: OxyColor, strokeThickness: number, edgeRenderingMode: EdgeRenderingMode, lineStyle?: LineStyle, lineJoin?: LineJoin): Promise; /** * Draws the specified image. * @param rc The render context. * @param image The image. * @param x The destination X position. * @param y The destination Y position. * @param w The width. * @param h The height. * @param opacity The opacity. * @param interpolate Interpolate the image if set to true. */ static drawImage(rc: IRenderContext, image: OxyImage, x: number, y: number, w: number, h: number, opacity: number, interpolate: boolean): Promise; /** * Draws multi-line text at the specified point. * @param rc The render context. * @param point The point. * @param text The text. * @param color The text color. * @param fontFamily The font family (optional). * @param fontSize The font size (default 10). * @param fontWeight The font weight (default Normal). * @param dy The line spacing (default 12). */ static drawMultilineText(rc: IRenderContext, point: ScreenPoint, text: string, color: OxyColor, fontFamily?: string | null, fontSize?: number, fontWeight?: number, dy?: number): Promise; /** * Draws a line specified by coordinates. * @param rc The render context. * @param x0 The x-coordinate of the first point. * @param y0 The y-coordinate of the first point. * @param x1 The x-coordinate of the second point. * @param y1 The y-coordinate of the second point. * @param pen The pen. * @param edgeRenderingMode The edge rendering mode. */ static drawLine(rc: IRenderContext, x0: number, y0: number, x1: number, y1: number, pen: OxyPen | undefined, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws the line segments. * @param rc The render context. * @param points The points. * @param pen The pen. * @param edgeRenderingMode The edge rendering mode. */ static drawLineSegments(rc: IRenderContext, points: ScreenPoint[], pen: OxyPen, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Renders the marker. * @param rc The render context. * @param p The center point of the marker. * @param type The marker type. * @param outline The outline (optional). * @param size The size of the marker. * @param fill The fill color. * @param stroke The stroke color. * @param strokeThickness The stroke thickness. * @param edgeRenderingMode The edge rendering mode. */ static drawMarker(rc: IRenderContext, p: ScreenPoint, type: MarkerType, outline: ScreenPoint[] | undefined, size: number, fill: OxyColor, stroke: OxyColor, strokeThickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws a list of markers. * @param rc The render context. * @param markerPoints The marker points. * @param markerType Type of the marker. * @param markerOutline The marker outline. * @param markerSize Size of the markers. * @param markerFill The marker fill. * @param markerStroke The marker stroke. * @param markerStrokeThickness The marker stroke thickness. * @param edgeRenderingMode The edge rendering mode. * @param resolution The resolution. * @param binOffset The bin Offset. */ static drawMarkers(rc: IRenderContext, markerPoints: ScreenPoint[], markerType: MarkerType, markerOutline: ScreenPoint[] | undefined, markerSize: number[], markerFill: OxyColor, markerStroke: OxyColor, markerStrokeThickness: number, edgeRenderingMode: EdgeRenderingMode, resolution?: number, binOffset?: ScreenPoint): Promise; /** * Draws a circle at the specified position. * @param rc The render context. * @param x The center x-coordinate. * @param y The center y-coordinate. * @param r The radius. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ static drawCircle(rc: IRenderContext, x: number, y: number, r: number, fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws a circle at the specified position. * @param rc The render context. * @param center The center. * @param r The radius. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ static drawCircle2(rc: IRenderContext, center: ScreenPoint, r: number, fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Fills a circle at the specified position. * @param rc The render context. * @param center The center. * @param r The radius. * @param fill The fill color. * @param edgeRenderingMode The edge rendering mode. */ static fillCircle(rc: IRenderContext, center: ScreenPoint, r: number, fill: OxyColor, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Fills a rectangle at the specified position. * @param rc The render context. * @param rectangle The rectangle. * @param fill The fill color. * @param edgeRenderingMode The edge rendering mode. */ static fillRectangle(rc: IRenderContext, rectangle: OxyRect, fill: OxyColor, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws the outline of a rectangle with individual stroke thickness for each side. * @param rc The render context. * @param rect The rectangle. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ static drawRectangle(rc: IRenderContext, rect: OxyRect, stroke: OxyColor, thickness: OxyThickness, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Measures the size of the specified text. * @param rc The render context. * @param text The text. * @param fontFamily The font family. * @param fontSize Size of the font. * @param fontWeight The font weight. * @param angle The angle of measured text (degrees). * @returns The size of the text. */ static measureText(rc: IRenderContext, text: string, fontFamily: string, fontSize: number, fontWeight: number, angle: number): OxySize; /** * Applies the specified clipping rectangle the the render context and returns a reset token. The clipping is reset once this token is disposed. * @param rc The render context. * @param clippingRectangle The clipping rectangle. * @returns The reset token. Clipping is reset once this is disposed. */ static autoResetClip(rc: IRenderContext, clippingRectangle: OxyRect): IDisposable; /** * Adds a marker geometry to the specified collections. * @param p The position of the marker. * @param type The marker type. * @param outline The custom outline, if type is MarkerType.Custom. * @param size The size of the marker. * @param ellipses The output ellipse collection. * @param rects The output rectangle collection. * @param polygons The output polygon collection. * @param lines The output line collection. */ private static addMarkerGeometry; /** * Calculates the bounds with respect to rotation angle and horizontal/vertical alignment. * @param bounds The size of the object to calculate bounds for. * @param angle The rotation angle (degrees). * @returns A minimum bounding rectangle. */ private static measureRotatedRectangleBound; /** * Reduces the specified list of points by the specified minimum squared distance. * @param points The points that should be evaluated. * @param minDistSquared The minimum line segment length (squared). * @param outputBuffer The output buffer. Cannot be null. * Points that are closer than the specified distance will not be included in the output buffer. */ private static reducePoints; /** * Transforms the given nodes and interpolates the lines if the element exists on a logarithmic plot. * @param transposablePlotElement The plot element that defines the transformation. * @param points The data points defining the lines. * @param screenPoints The destination for the transformed and interpolated screen points. * @param maxSegmentLength The maximum length of an interpolated segment in screen space. */ static transformAndInterpolateLines(transposablePlotElement: ITransposablePlotElement, points: DataPoint[], screenPoints: ScreenPoint[], maxSegmentLength: number): void; /** * Generates points along a smooth function with a maximum separation. * @param func The smooth function evaluated. * @param screenPoints The destination for any generated screen points. * @param maxSegmentLength the maximum distance between any two points. * @param includeFirst Whether or not to include the first point. */ static interpolatePoints(func: (x: number) => ScreenPoint, screenPoints: ScreenPoint[], maxSegmentLength: number, includeFirst: boolean): void; } //# sourceMappingURL=RenderingExtensions.d.ts.map