discuss removed todo
This commit is contained in:
parent
1ad2f3e05f
commit
711f1f19b6
1 changed files with 4 additions and 7 deletions
|
@ -1,5 +1,7 @@
|
||||||
import chroma, blends, vmath, common, nimsimd/sse2
|
import chroma, blends, vmath, common, nimsimd/sse2
|
||||||
|
|
||||||
|
const h = 0.5.float32
|
||||||
|
|
||||||
type
|
type
|
||||||
Image* = ref object
|
Image* = ref object
|
||||||
## Main image object that holds the bitmap data in RGBA format.
|
## Main image object that holds the bitmap data in RGBA format.
|
||||||
|
@ -198,9 +200,7 @@ proc fromAlphy*(image: Image) =
|
||||||
|
|
||||||
proc getRgbaSmooth*(image: Image, x, y: float32): ColorRGBA {.inline.} =
|
proc getRgbaSmooth*(image: Image, x, y: float32): ColorRGBA {.inline.} =
|
||||||
## Gets a pixel as (x, y) floats.
|
## Gets a pixel as (x, y) floats.
|
||||||
var
|
let
|
||||||
x = x # TODO: look at maybe +0.5
|
|
||||||
y = y # TODO: look at maybe +0.5
|
|
||||||
minX = x.floor.int
|
minX = x.floor.int
|
||||||
difX = x - x.floor
|
difX = x - x.floor
|
||||||
minY = y.floor.int
|
minY = y.floor.int
|
||||||
|
@ -387,8 +387,7 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
|
||||||
## Draws one image onto another using matrix with color blending.
|
## Draws one image onto another using matrix with color blending.
|
||||||
var
|
var
|
||||||
matInv = mat.inverse()
|
matInv = mat.inverse()
|
||||||
# compute movement vectors
|
# Compute movement vectors
|
||||||
h = 0.5.float32
|
|
||||||
p = matInv * vec2(0 + h, 0 + h)
|
p = matInv * vec2(0 + h, 0 + h)
|
||||||
dx = matInv * vec2(1 + h, 0 + h) - p
|
dx = matInv * vec2(1 + h, 0 + h) - p
|
||||||
dy = matInv * vec2(0 + h, 1 + h) - p
|
dy = matInv * vec2(0 + h, 1 + h) - p
|
||||||
|
@ -421,8 +420,6 @@ proc drawCorrect*(a, b: Image, mat: Mat3, blendMode: BlendMode) =
|
||||||
b[xFloat.round.int, yFloat.round.int]
|
b[xFloat.round.int, yFloat.round.int]
|
||||||
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
a.setRgbaUnsafe(x, y, mixer(rgba, rgba2))
|
||||||
|
|
||||||
const h = 0.5.float32
|
|
||||||
|
|
||||||
proc drawUber(
|
proc drawUber(
|
||||||
a, b: Image,
|
a, b: Image,
|
||||||
p, dx, dy: Vec2,
|
p, dx, dy: Vec2,
|
||||||
|
|
Loading…
Reference in a new issue