move blendMode dont export blends

This commit is contained in:
Ryan Oldenburg 2021-12-13 01:23:14 -06:00
parent 38798e503b
commit 1214861870
5 changed files with 33 additions and 34 deletions

View file

@ -1,10 +1,9 @@
import bumpy, chroma, flatty/binny, os, pixie/blends, pixie/common,
pixie/contexts, pixie/fileformats/bmp, pixie/fileformats/gif,
pixie/fileformats/jpg, pixie/fileformats/png, pixie/fileformats/svg,
pixie/fonts, pixie/images, pixie/masks, pixie/paints, pixie/paths, strutils, vmath
import bumpy, chroma, flatty/binny, os, pixie/common, pixie/contexts,
pixie/fileformats/bmp, pixie/fileformats/gif, pixie/fileformats/jpg,
pixie/fileformats/png, pixie/fileformats/svg, pixie/fonts, pixie/images,
pixie/masks, pixie/paints, pixie/paths, strutils, vmath
export blends, bumpy, chroma, common, contexts, fonts, images, masks, paints,
paths, vmath
export bumpy, chroma, common, contexts, fonts, images, masks, paints, paths, vmath
type
FileFormat* = enum

View file

@ -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
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: [].}
## Function signature returned by blender.
Masker* = proc(backdrop, source: uint8): uint8 {.gcsafe, raises: [].}

View file

@ -3,6 +3,31 @@ import bumpy, chroma, vmath
type
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: [].} =
## Linearly interpolate between a and b using t.
let t = round(t * 255).uint32

View file

@ -1,5 +1,5 @@
import bumpy, chroma, pixie/blends, pixie/common, pixie/fonts, pixie/images,
pixie/masks, pixie/paints, pixie/paths, tables, vmath
import bumpy, chroma, pixie/common, pixie/fonts, pixie/images, pixie/masks,
pixie/paints, pixie/paths, tables, vmath
## 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

View file

@ -1,4 +1,4 @@
import blends, chroma, common, images, vmath
import chroma, common, images, vmath
when defined(amd64) and not defined(pixieNoSimd):
import nimsimd/sse2