mirror of
https://github.com/Artemis-RGB/Artemis
synced 2026-11-12 20:06:33 +00:00
Noise brush - Greatly improved performance on large layouts
Profiles core - Pass real delta time brushes/effects Profiles core - Allow main segment to be disabled on layers General module - Removed test data model General module - Removed expensive open window scan, was fun to try :P Profile editor - Refactored segments Profile editor - Updated segment visuals to scale well when really narrow
This commit is contained in:
1 parent
64a1010100
commit
beff2a0788
13 files changed
+584
-396
No files matched your search
@@ -73,6 +73,19 @@ namespace Artemis.Plugins.LayerBrushes.Noise
|
||||
var height = (int) Math.Floor(path.Bounds.Height * _renderScale);
|
||||
|
||||
CreateBitmap(width, height);
|
||||
|
||||
var clipPath = new SKPath(Layer.Path);
|
||||
Layer.ExcludePathFromTranslation(clipPath);
|
||||
clipPath = new SKPath(clipPath);
|
||||
clipPath.Transform(SKMatrix.MakeTranslation(Layer.Path.Bounds.Left * -1, Layer.Path.Bounds.Top * -1));
|
||||
|
||||
// Fill a canvas matching the final area that will be rendered
|
||||
using var bitmapCanvas = new SKCanvas(_bitmap);
|
||||
using var clipPaint = new SKPaint {Color = new SKColor(0, 0, 0, 255)};
|
||||
bitmapCanvas.Clear();
|
||||
bitmapCanvas.Scale(_renderScale);
|
||||
bitmapCanvas.DrawPath(clipPath, clipPaint);
|
||||
|
||||
for (var y = 0; y < height; y++)
|
||||
{
|
||||
for (var x = 0; x < width; x++)
|
||||
@@ -84,6 +97,10 @@ namespace Artemis.Plugins.LayerBrushes.Noise
|
||||
if (double.IsInfinity(evalX) || double.IsNaN(evalX) || double.IsNaN(evalY) || double.IsInfinity(evalY))
|
||||
continue;
|
||||
|
||||
var pixel = _bitmap.GetPixel(x, y);
|
||||
if (pixel.Alpha != 255)
|
||||
continue;
|
||||
|
||||
var v = (float) _noise.Evaluate(evalX, evalY, _z) * hardness;
|
||||
var amount = Math.Max(0f, Math.Min(1f, v));
|
||||
if (Properties.ColorType.BaseValue == ColorMappingType.Simple)
|
||||
|
||||
Reference in new issue
Block a user