Class AbstractBrush
Supports all classes in the .NET class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all .NET classes; it is the root of the type hierarchy.
Inheritance
Inherited Members
Namespace: RGB.NET.Core
Assembly: RGB.NET.Core.dll
Syntax
public abstract class AbstractBrush : AbstractDecoratable<IBrushDecorator>, IBindable, IBrush, IDecoratable<IBrushDecorator>, IDecoratable, INotifyPropertyChanged
Constructors
| Edit this page View SourceAbstractBrush(float, float)
Initializes a new instance of the AbstractBrush class.
Declaration
protected AbstractBrush(float brightness = 1, float opacity = 1)
Parameters
Type | Name | Description |
---|---|---|
float | brightness | The overall percentage brightness of the brush. (default: 1.0) |
float | opacity | The overall percentage opacity of the brush. (default: 1.0) |
Properties
| Edit this page View SourceBrightness
Gets or sets the overall percentage brightness of the IBrush.
Declaration
public float Brightness { get; set; }
Property Value
Type | Description |
---|---|
float |
CalculationMode
Gets or sets the calculation mode used for the rectangle/points used for color-selection in brushes.
Declaration
public RenderMode CalculationMode { get; set; }
Property Value
Type | Description |
---|---|
RenderMode |
IsEnabled
Gets or sets if the IBrush is enabled and will be drawn on an update.
Declaration
public bool IsEnabled { get; set; }
Property Value
Type | Description |
---|---|
bool |
Opacity
Gets or sets the overall percentage opacity of the IBrush.
Declaration
public float Opacity { get; set; }
Property Value
Type | Description |
---|---|
float |
Methods
| Edit this page View SourceApplyDecorators(in Rectangle, in RenderTarget, ref Color)
Applies all attached and enabled decorators to the brush.
Declaration
protected virtual void ApplyDecorators(in Rectangle rectangle, in RenderTarget renderTarget, ref Color color)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rectangle | The rectangle in which the brush should be drawn. |
RenderTarget | renderTarget | The target (key/point) from which the color should be taken. |
Color | color | The Color to be modified. |
FinalizeColor(ref Color)
Finalizes the color by appliing the overall brightness and opacity.
Declaration
protected virtual void FinalizeColor(ref Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color | The color to finalize. |
GetColorAtPoint(in Rectangle, in RenderTarget)
Gets the color at an specific point assuming the brush is drawn into the specified rectangle.
Declaration
protected abstract Color GetColorAtPoint(in Rectangle rectangle, in RenderTarget renderTarget)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rectangle | The rectangle in which the brush should be drawn. |
RenderTarget | renderTarget | The target (key/point) from which the color should be taken. |
Returns
Type | Description |
---|---|
Color | The color at the specified point. |
Render(Rectangle, IEnumerable<RenderTarget>)
Renders the brush to the specified list of RenderTarget.
Declaration
public virtual IEnumerable<(RenderTarget renderTarget, Color color)> Render(Rectangle rectangle, IEnumerable<RenderTarget> renderTargets)
Parameters
Type | Name | Description |
---|---|---|
Rectangle | rectangle | The bounding box the brush is rendered in. |
IEnumerable<RenderTarget> | renderTargets | The targets to render to. |
Returns
Type | Description |
---|---|
IEnumerable<(RenderTarget renderTarget, Color color)> | A enumerable containing the rendered Color for each RenderTarget. |