move image, mask to common
This commit is contained in:
parent
06005de85c
commit
dabe456af9
|
@ -31,6 +31,16 @@ type
|
|||
ImageDimensions* = object
|
||||
width*, height*: int
|
||||
|
||||
Image* = ref object
|
||||
## Image object that holds bitmap data in premultiplied alpha RGBA format.
|
||||
width*, height*: int
|
||||
data*: seq[ColorRGBX]
|
||||
|
||||
Mask* = ref object
|
||||
## Mask object that holds mask opacity data.
|
||||
width*, height*: int
|
||||
data*: seq[uint8]
|
||||
|
||||
proc mix*(a, b: uint8, t: float32): uint8 {.inline, raises: [].} =
|
||||
## Linearly interpolate between a and b using t.
|
||||
let t = round(t * 255).uint32
|
||||
|
|
|
@ -8,13 +8,7 @@ when allowSimd:
|
|||
|
||||
const h = 0.5.float32
|
||||
|
||||
type
|
||||
Image* = ref object
|
||||
## Image object that holds bitmap data in RGBA format.
|
||||
width*, height*: int
|
||||
data*: seq[ColorRGBX]
|
||||
|
||||
UnsafeImage = distinct Image
|
||||
type UnsafeImage = distinct Image
|
||||
|
||||
when defined(release):
|
||||
{.push checks: off.}
|
||||
|
|
|
@ -6,13 +6,7 @@ when allowSimd:
|
|||
when defined(amd64):
|
||||
import nimsimd/sse2
|
||||
|
||||
type
|
||||
Mask* = ref object
|
||||
## Mask object that holds mask opacity data.
|
||||
width*, height*: int
|
||||
data*: seq[uint8]
|
||||
|
||||
UnsafeMask = distinct Mask
|
||||
type UnsafeMask = distinct Mask
|
||||
|
||||
when defined(release):
|
||||
{.push checks: off.}
|
||||
|
|
Loading…
Reference in a new issue