/// <summary> /// Initializes a new instance of the <see cref="ShapeGraphicsOptions"/> class. /// </summary> /// <param name="graphicsOptions">The graphic options to use</param> /// <param name="shapeOptions">The text options to use</param> public ShapeGraphicsOptions(GraphicsOptions graphicsOptions, ShapeOptions shapeOptions) { Guard.NotNull(graphicsOptions, nameof(graphicsOptions)); Guard.NotNull(shapeOptions, nameof(shapeOptions)); this.graphicsOptions = graphicsOptions; this.shapeOptions = shapeOptions; }
internal DrawingOptions( GraphicsOptions graphicsOptions, ShapeOptions shapeOptions, Matrix3x2 transform) { DebugGuard.NotNull(graphicsOptions, nameof(graphicsOptions)); DebugGuard.NotNull(shapeOptions, nameof(shapeOptions)); this.graphicsOptions = graphicsOptions; this.shapeOptions = shapeOptions; this.Transform = transform; }
/// <summary> /// Gets the default shape processing options against the image processing context. /// </summary> /// <param name="configuration">The configuration to retrieve defaults from.</param> /// <returns>The globaly configued default options.</returns> public static ShapeOptions GetShapeOptions(this Configuration configuration) { if (configuration.Properties.TryGetValue(typeof(ShapeOptions), out var options) && options is ShapeOptions go) { return(go); } var configOptions = new ShapeOptions(); // capture the fallback so the same instance will always be returned in case its mutated configuration.Properties[typeof(ShapeOptions)] = configOptions; return(configOptions); }
/// <summary> /// Initializes a new instance of the <see cref="DrawingOptions"/> class. /// </summary> public DrawingOptions() { this.graphicsOptions = new GraphicsOptions(); this.shapeOptions = new ShapeOptions(); this.Transform = Matrix3x2.Identity; }
/// <summary> /// Sets the default shape processing options against the configuration. /// </summary> /// <param name="configuration">The configuration to store default against.</param> /// <param name="options">The default options to use.</param> public static void SetShapeOptions(this Configuration configuration, ShapeOptions options) { configuration.Properties[typeof(ShapeOptions)] = options; }
/// <summary> /// Sets the default shape processing options against the image processing context. /// </summary> /// <param name="context">The image processing context to store default against.</param> /// <param name="options">The default options to use.</param> /// <returns>The passed in <paramref name="context"/> to allow chaining.</returns> public static IImageProcessingContext SetShapeOptions(this IImageProcessingContext context, ShapeOptions options) { context.Properties[typeof(ShapeOptions)] = options; return(context); }
/// <summary> /// Initializes a new instance of the <see cref="ShapeGraphicsOptions"/> class. /// </summary> public ShapeGraphicsOptions() { this.graphicsOptions = new GraphicsOptions(); this.shapeOptions = new ShapeOptions(); }