move blendMode dont export blends
This commit is contained in:
parent
38798e503b
commit
1214861870
5 changed files with 33 additions and 34 deletions
|
@ -1,10 +1,9 @@
|
||||||
import bumpy, chroma, flatty/binny, os, pixie/blends, pixie/common,
|
import bumpy, chroma, flatty/binny, os, pixie/common, pixie/contexts,
|
||||||
pixie/contexts, pixie/fileformats/bmp, pixie/fileformats/gif,
|
pixie/fileformats/bmp, pixie/fileformats/gif, pixie/fileformats/jpg,
|
||||||
pixie/fileformats/jpg, pixie/fileformats/png, pixie/fileformats/svg,
|
pixie/fileformats/png, pixie/fileformats/svg, pixie/fonts, pixie/images,
|
||||||
pixie/fonts, pixie/images, pixie/masks, pixie/paints, pixie/paths, strutils, vmath
|
pixie/masks, pixie/paints, pixie/paths, strutils, vmath
|
||||||
|
|
||||||
export blends, bumpy, chroma, common, contexts, fonts, images, masks, paints,
|
export bumpy, chroma, common, contexts, fonts, images, masks, paints, paths, vmath
|
||||||
paths, vmath
|
|
||||||
|
|
||||||
type
|
type
|
||||||
FileFormat* = enum
|
FileFormat* = enum
|
||||||
|
|
|
@ -9,31 +9,6 @@ when defined(amd64) and not defined(pixieNoSimd):
|
||||||
# See https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_blend_equation_advanced.txt
|
# See https://www.khronos.org/registry/OpenGL/extensions/KHR/KHR_blend_equation_advanced.txt
|
||||||
|
|
||||||
type
|
type
|
||||||
BlendMode* = enum
|
|
||||||
bmNormal
|
|
||||||
bmDarken
|
|
||||||
bmMultiply
|
|
||||||
# bmLinearBurn
|
|
||||||
bmColorBurn
|
|
||||||
bmLighten
|
|
||||||
bmScreen
|
|
||||||
# bmLinearDodge
|
|
||||||
bmColorDodge
|
|
||||||
bmOverlay
|
|
||||||
bmSoftLight
|
|
||||||
bmHardLight
|
|
||||||
bmDifference
|
|
||||||
bmExclusion
|
|
||||||
bmHue
|
|
||||||
bmSaturation
|
|
||||||
bmColor
|
|
||||||
bmLuminosity
|
|
||||||
|
|
||||||
bmMask ## Special blend mode that is used for masking
|
|
||||||
bmOverwrite ## Special blend mode that just copies pixels
|
|
||||||
bmSubtractMask ## Inverse mask
|
|
||||||
bmExcludeMask
|
|
||||||
|
|
||||||
Blender* = proc(backdrop, source: ColorRGBX): ColorRGBX {.gcsafe, raises: [].}
|
Blender* = proc(backdrop, source: ColorRGBX): ColorRGBX {.gcsafe, raises: [].}
|
||||||
## Function signature returned by blender.
|
## Function signature returned by blender.
|
||||||
Masker* = proc(backdrop, source: uint8): uint8 {.gcsafe, raises: [].}
|
Masker* = proc(backdrop, source: uint8): uint8 {.gcsafe, raises: [].}
|
||||||
|
|
|
@ -3,6 +3,31 @@ import bumpy, chroma, vmath
|
||||||
type
|
type
|
||||||
PixieError* = object of ValueError ## Raised if an operation fails.
|
PixieError* = object of ValueError ## Raised if an operation fails.
|
||||||
|
|
||||||
|
BlendMode* = enum
|
||||||
|
bmNormal
|
||||||
|
bmDarken
|
||||||
|
bmMultiply
|
||||||
|
# bmLinearBurn
|
||||||
|
bmColorBurn
|
||||||
|
bmLighten
|
||||||
|
bmScreen
|
||||||
|
# bmLinearDodge
|
||||||
|
bmColorDodge
|
||||||
|
bmOverlay
|
||||||
|
bmSoftLight
|
||||||
|
bmHardLight
|
||||||
|
bmDifference
|
||||||
|
bmExclusion
|
||||||
|
bmHue
|
||||||
|
bmSaturation
|
||||||
|
bmColor
|
||||||
|
bmLuminosity
|
||||||
|
|
||||||
|
bmMask ## Special blend mode that is used for masking
|
||||||
|
bmOverwrite ## Special blend mode that just copies pixels
|
||||||
|
bmSubtractMask ## Inverse mask
|
||||||
|
bmExcludeMask
|
||||||
|
|
||||||
proc mix*(a, b: uint8, t: float32): uint8 {.inline, raises: [].} =
|
proc mix*(a, b: uint8, t: float32): uint8 {.inline, raises: [].} =
|
||||||
## Linearly interpolate between a and b using t.
|
## Linearly interpolate between a and b using t.
|
||||||
let t = round(t * 255).uint32
|
let t = round(t * 255).uint32
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import bumpy, chroma, pixie/blends, pixie/common, pixie/fonts, pixie/images,
|
import bumpy, chroma, pixie/common, pixie/fonts, pixie/images, pixie/masks,
|
||||||
pixie/masks, pixie/paints, pixie/paths, tables, vmath
|
pixie/paints, pixie/paths, tables, vmath
|
||||||
|
|
||||||
## This file provides a Nim version of the Canvas 2D API commonly used on the
|
## This file provides a Nim version of the Canvas 2D API commonly used on the
|
||||||
## web. The goal is to make picking up Pixie easy for developers familiar with
|
## web. The goal is to make picking up Pixie easy for developers familiar with
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import blends, chroma, common, images, vmath
|
import chroma, common, images, vmath
|
||||||
|
|
||||||
when defined(amd64) and not defined(pixieNoSimd):
|
when defined(amd64) and not defined(pixieNoSimd):
|
||||||
import nimsimd/sse2
|
import nimsimd/sse2
|
||||||
|
|
Loading…
Reference in a new issue