From d57ecc9cb97ffd8c79fa112cd71e469f53552825 Mon Sep 17 00:00:00 2001 From: Elias Batek Date: Sun, 24 Dec 2023 00:01:48 +0100 Subject: [PATCH] Improve documentation --- pixelpresenter.d | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/pixelpresenter.d b/pixelpresenter.d index 52b2e41..3977ca5 100644 --- a/pixelpresenter.d +++ b/pixelpresenter.d @@ -160,10 +160,11 @@ import arsd.simpledisplay; - Minimum window size - or something similar - to ensure `Scaling.integer` doesn’t break “unexpectedly” + - Add my fast&accurate int8 alphaBlending() + - add unittests + - benchmark vs. CPUblit */ -private enum hasTimer = is(Timer == class); - /// alias Pixel = Color; @@ -179,6 +180,9 @@ alias Point = arsd.color.Point; // verify assumption(s) static assert(Pixel.sizeof == uint.sizeof); +// is the Timer class available on this platform? +private enum hasTimer = is(Timer == class); + /// casts value `v` to type `T` auto ref T typeCast(T, S)(auto ref S v) { return cast(T) v; @@ -266,13 +270,13 @@ struct PixelBuffer { return (width * int(Pixel.sizeof)); } - /// Clears the buffers contents (by setting each pixel to the same color) + /// Clears the buffer’s contents (by setting each pixel to the same color) void clear(Pixel value) { data[] = value; } } -@safe pure nothrow @nogc { +private @safe pure nothrow @nogc { // keep aspect ratio (contain) bool karContainNeedsDownscaling(const Size drawing, const Size canvas) { @@ -361,10 +365,10 @@ enum Scaling { keepAspectRatio = contain, /// // CSS `object-fit` style aliases - cssNone = none, /// - cssContain = contain, /// - cssFill = stretch, /// - cssCover = cover, /// + cssNone = none, /// equivalent CSS: `object-fit: none;` + cssContain = contain, /// equivalent CSS: `object-fit: contain;` + cssFill = stretch, /// equivalent CSS: `object-fit: fill;` + cssCover = cover, /// equivalent CSS: `object-fit: cover;` } ///