import { EdgeRenderingMode, HorizontalAlignment, type IRenderContext, LineJoin, type OxyColor, type OxyImage, type OxyRect, type OxySize, type ScreenPoint, VerticalAlignment } from '../..'; /** * Provides an abstract base class for rendering contexts. */ export declare abstract class RenderContextBase implements IRenderContext { /** * Initializes a new instance of the RenderContextBase class. */ protected constructor(); /** * Gets a value indicating whether the specified points form a straight line (i.e. parallel to the pixel raster). * @param p1 The first point. * @param p2 The second point. * @returns true if the points form a straight line; false otherwise. */ static isStraightLine(p1: ScreenPoint, p2: ScreenPoint): boolean; /** * Gets a value indicating whether the specified points form a straight line (i.e. parallel to the pixel raster). * @param points The points. * @returns true if the points form a straight line; false otherwise. */ static isStraightLine2(points: ScreenPoint[]): boolean; /** * Gets or sets a value indicating whether the context renders to screen. */ rendersToScreen: boolean; /** * Draws an ellipse. * @param rect The rectangle. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ drawEllipse(rect: OxyRect, fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws multiple ellipses. * @param rectangles The rectangles. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ drawEllipses(rectangles: OxyRect[], fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws a line. * @param points The points. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. * @param dashArray The dash array. * @param lineJoin The line join. */ abstract drawLine(points: ScreenPoint[], stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode, dashArray?: number[], lineJoin?: LineJoin): Promise; /** * Draws line segments. * @param points The points. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. * @param dashArray The dash array. * @param lineJoin The line join. */ drawLineSegments(points: ScreenPoint[], stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode, dashArray?: number[], lineJoin?: LineJoin): Promise; /** * Draws a polygon. * @param points The points. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. * @param dashArray The dash array. * @param lineJoin The line join. */ abstract drawPolygon(points: ScreenPoint[], fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode, dashArray?: number[], lineJoin?: LineJoin): Promise; /** * Draws multiple polygons. * @param polygons The polygons. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. * @param dashArray The dash array. * @param lineJoin The line join. */ drawPolygons(polygons: ScreenPoint[][], fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode, dashArray: number[] | undefined, lineJoin: LineJoin): Promise; /** * Draws a rectangle. * @param rect The rectangle. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ drawRectangle(rect: OxyRect, fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws multiple rectangles. * @param rectangles The rectangles. * @param fill The fill color. * @param stroke The stroke color. * @param thickness The thickness. * @param edgeRenderingMode The edge rendering mode. */ drawRectangles(rectangles: OxyRect[], fill: OxyColor, stroke: OxyColor, thickness: number, edgeRenderingMode: EdgeRenderingMode): Promise; /** * Draws the text. * @param p The position of the text. * @param text The text. * @param fill The fill color. * @param fontFamily The font family. * @param fontSize Size of the font. * @param fontWeight The font weight. * @param rotation The rotation angle. * @param horizontalAlignment The horizontal alignment. * @param verticalAlignment The vertical alignment. * @param maxSize The maximum size of the text. */ abstract drawText(p: ScreenPoint, text: string, fill: OxyColor, fontFamily: string | undefined, fontSize: number, fontWeight?: number, rotation?: number, horizontalAlignment?: HorizontalAlignment, verticalAlignment?: VerticalAlignment, maxSize?: OxySize): Promise; /** * Measures the size of the specified text. * @param text The text to measure. * @param fontFamily The font family. * @param fontSize Size of the font (in device independent units, 1/96 inch). * @param fontWeight The font weight. */ abstract measureText(text: string, fontFamily: string | undefined, fontSize: number, fontWeight: number): OxySize; /** * Sets the tool tip for the following items. * @param text The text in the tooltip. */ setToolTip(text: string): void; /** * Cleans up resources not in use. * This method is called at the end of each rendering. */ cleanUp(): void; /** * Draws the specified portion of the specified OxyImage at the specified location and with the specified size. * @param source The source. * @param srcX The x-coordinate of the upper-left corner of the portion of the source image to draw. * @param srcY The y-coordinate of the upper-left corner of the portion of the source image to draw. * @param srcWidth Width of the portion of the source image to draw. * @param srcHeight Height of the portion of the source image to draw. * @param destX The x-coordinate of the upper-left corner of drawn image. * @param destY The y-coordinate of the upper-left corner of drawn image. * @param destWidth The width of the drawn image. * @param destHeight The height of the drawn image. * @param opacity The opacity. * @param interpolate Interpolate if set to true. */ abstract drawImage(source: OxyImage, srcX: number, srcY: number, srcWidth: number, srcHeight: number, destX: number, destY: number, destWidth: number, destHeight: number, opacity: number, interpolate: boolean): Promise; /** * Pops the clip. */ abstract popClip(): void; /** * Pushes the clip. * @param clippingRectangle The clipping rectangle. */ abstract pushClip(clippingRectangle: OxyRect): void; /** * Gets the clip count. */ abstract get clipCount(): number; /** * Creates an ellipse polygon. * @param rect The bounding rectangle. * @param n The number of points. * @returns The points defining the ellipse. */ protected static createEllipse(rect: OxyRect, n?: number): ScreenPoint[]; /** * Creates a rectangle polygon. * @param rect The rectangle. * @returns The points defining the rectangle. */ protected static createRectangle(rect: OxyRect): ScreenPoint[]; /** * Returns a value indicating whether antialiasing should be used for the given edge rendering mode. * @param edgeRenderingMode The edge rendering mode. * @returns true if antialiasing should be used; false otherwise. */ protected shouldUseAntiAliasingForRect(edgeRenderingMode: EdgeRenderingMode): boolean; /** * Returns a value indicating whether anti-aliasing should be used for the given edge rendering mode. * @param edgeRenderingMode The edge rendering mode. * @returns true if anti-aliasing should be used; false otherwise. */ protected shouldUseAntiAliasingForEllipse(edgeRenderingMode: EdgeRenderingMode): boolean; /** * Returns a value indicating whether anti-aliasing should be used for the given edge rendering mode. * @param edgeRenderingMode The edge rendering mode. * @points The points. * @returns true if anti-aliasing should be used; false otherwise. */ protected shouldUseAntiAliasingForLine(edgeRenderingMode: EdgeRenderingMode, points: ScreenPoint[]): boolean; } //# sourceMappingURL=RenderContextBase.d.ts.map