blend2d/context

Search:
Group by:

Procs

proc add(ctx: Context; c: Circle; color: BLRgba) {....raises: [], tags: [],
    forbids: [].}
Add a colored Circle pointer to current Context
proc add(ctx: Context; c: Circle; color: ColorHex) {....raises: [], tags: [],
    forbids: [].}
Add a colored Circle pointer to current Context
proc add(ctx: Context; circle: Circle) {....raises: [], tags: [], forbids: [].}
Add a Circle pointer to current Context
proc add(ctx: Context; font: Font; content: string; x, y: int32 = 0;
         color: ColorHex = colWhite): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
Add a new text to Context
proc add(ctx: Context; img: Image): Context {.discardable, ...raises: [], tags: [],
    forbids: [].}
Add an Image to current Context
proc add(ctx: Context; img: Image; p: sink BLPoint): Context {.discardable,
    ...raises: [], tags: [], forbids: [].}
Add an Image to current Context using BLPointI position origin
proc add(ctx: Context; img: Image; p: sink BLPoint; r: sink BLRectI): Context {.
    discardable, ...raises: [], tags: [], forbids: [].}
Add an Image to current Context using BLPointI as position origin and BLRectI as image area
proc add(ctx: Context; img: Image; p: sink BLPointI): Context {.discardable,
    ...raises: [], tags: [], forbids: [].}
Add an Image to current Context using BLPointI position origin
proc add(ctx: Context; img: Image; p: sink BLPointI; r: sink BLRectI): Context {.
    discardable, ...raises: [], tags: [], forbids: [].}
Add an Image to current Context using BLPointI as position origin and BLRectI as image area
proc add(ctx: Context; img: Image; r: sink BLRectI): Context {.discardable,
    ...raises: [], tags: [], forbids: [].}
Add an Image to current Context using BLRectI image area
proc add(ctx: Context; r: BLRectI) {....raises: [], tags: [], forbids: [].}
Add a BLRectI to Context
proc add(ctx: Context; r: BLRectI; color: BLRgba) {....raises: [], tags: [],
    forbids: [].}
Add a BLRectI to Context
proc add(ctx: Context; rr: RoundRect; color: ColorHex) {....raises: [], tags: [],
    forbids: [].}
Add a colored BLRoundRect to current Context
proc add(ctx: Context; rr: RoundRect; color: Gradient) {....raises: [], tags: [],
    forbids: [].}
Add a BLRoundRect to ctx with color Gradient
proc blend(ctx: Context; img: Image; p: ptr BLPointI; r: ptr BLRectI;
           mode: BLCompOp = BLCompOpSrcOver): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendClear(ctx`gensym38: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendColorBurn(ctx`gensym84: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendColorDodge(ctx`gensym82: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDarken(ctx`gensym74: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDarken(ctx`gensym78: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDifference(ctx`gensym96: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDstAtop(ctx`gensym58: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDstCopy(ctx`gensym52: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDstIn(ctx`gensym54: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDstOut(ctx`gensym56: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendDstOver(ctx`gensym50: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendExclusion(ctx`gensym98: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendHardLight(ctx`gensym92: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendLighten(ctx`gensym76: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendLighten(ctx`gensym80: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendLinearBurn(ctx`gensym86: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendLinearLight(ctx`gensym88: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendMinus(ctx`gensym64: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendModulate(ctx`gensym66: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendMultiply(ctx`gensym68: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendOverlay(ctx`gensym72: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendPinLight(ctx`gensym90: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendPlus(ctx`gensym62: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendScreen(ctx`gensym70: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendSoftLight(ctx`gensym94: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendSrcAtop(ctx`gensym48: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendSrcCopy(ctx`gensym42: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendSrcIn(ctx`gensym44: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendSrcOut(ctx`gensym46: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendSrcOver(ctx`gensym40: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc blendXor(ctx`gensym60: Context): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
proc clearAll(ctx: Context) {.inline, ...raises: [], tags: [], forbids: [].}
proc endContext(ctx: Context) {....raises: [], tags: [], forbids: [].}
Ends the ctx Context
proc fill(ctx: Context; color: ColorHex): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
Fills the entire Context using color ColorHex
proc fill(ctx: Context; gradient: ptr BLGradientCore): Context {.discardable,
    ...raises: [], tags: [], forbids: [].}
Fills the entire Context with the gradient color
proc fill(ctx: Context; rgba: BLRgba): Context {.discardable, ...raises: [],
    tags: [], forbids: [].}
Fills the entire Context using rgba color
proc fillStyle(ctx: Context; color: ColorHex = colWhite): Context {.discardable,
    ...raises: [], tags: [], forbids: [].}
Fill Context with ColorHex
proc mask(ctx: Context; origin: PointI; mask: Image; maskArea: RectI): Context {.
    discardable, ...raises: [], tags: [], forbids: [].}
proc newContext(img: Image; compOp: BLCompOp = BL_COMP_OP_SRC_OVER): Context {.
    ...raises: [], tags: [], forbids: [].}
Creates a new Context
proc opacity(ctx: Context; alpha: range[0.0 .. 1.0]): Context {.discardable,
    ...raises: [], tags: [], forbids: [].}
Applies blContextSetGlobalAlpha using alpha
proc resetTransform(ctx: Context) {....raises: [], tags: [], forbids: [].}
Reset applied transformations
proc rotate(ctx: Context; angle: range[-1.0 .. 1.0]) {....raises: [], tags: [],
    forbids: [].}
proc scale(ctx: Context; x, y: float64) {....raises: [], tags: [], forbids: [].}
proc setCompOp(ctx: Context; compOp: BLCompOp) {.inline, ...raises: [], tags: [],
    forbids: [].}
proc skew(ctx: Context; x, y: float64) {....raises: [], tags: [], forbids: [].}
proc stroke(ctx: Context; c: BLCircle; width: float; color: BLRgba = White): Context {.
    discardable, ...raises: [], tags: [], forbids: [].}
Add a stroke to BLCircle using ctx Context
proc translate(ctx: Context; x, y: float64) {....raises: [], tags: [], forbids: [].}

Macros

macro applyBlendClear(stmts`gensym39: untyped): untyped
macro applyBlendColorBurn(stmts`gensym85: untyped): untyped
macro applyBlendColorDodge(stmts`gensym83: untyped): untyped
macro applyBlendDarken(stmts`gensym75: untyped): untyped
macro applyBlendDarken(stmts`gensym79: untyped): untyped
macro applyBlendDifference(stmts`gensym97: untyped): untyped
macro applyBlendDstAtop(stmts`gensym59: untyped): untyped
macro applyBlendDstCopy(stmts`gensym53: untyped): untyped
macro applyBlendDstIn(stmts`gensym55: untyped): untyped
macro applyBlendDstOut(stmts`gensym57: untyped): untyped
macro applyBlendDstOver(stmts`gensym51: untyped): untyped
macro applyBlendExclusion(stmts`gensym99: untyped): untyped
macro applyBlendHardLight(stmts`gensym93: untyped): untyped
macro applyBlendLighten(stmts`gensym77: untyped): untyped
macro applyBlendLighten(stmts`gensym81: untyped): untyped
macro applyBlendLinearBurn(stmts`gensym87: untyped): untyped
macro applyBlendLinearLight(stmts`gensym89: untyped): untyped
macro applyBlendMinus(stmts`gensym65: untyped): untyped
macro applyBlendModulate(stmts`gensym67: untyped): untyped
macro applyBlendMultiply(stmts`gensym69: untyped): untyped
macro applyBlendOverlay(stmts`gensym73: untyped): untyped
macro applyBlendPinLight(stmts`gensym91: untyped): untyped
macro applyBlendPlus(stmts`gensym63: untyped): untyped
macro applyBlendScreen(stmts`gensym71: untyped): untyped
macro applyBlendSoftLight(stmts`gensym95: untyped): untyped
macro applyBlendSrcAtop(stmts`gensym49: untyped): untyped
macro applyBlendSrcCopy(stmts`gensym43: untyped): untyped
macro applyBlendSrcIn(stmts`gensym45: untyped): untyped
macro applyBlendSrcOut(stmts`gensym47: untyped): untyped
macro applyBlendSrcOver(stmts`gensym41: untyped): untyped
macro applyBlendXor(stmts`gensym61: untyped): untyped
macro ctx(img: typed; contextStmt: untyped): untyped

Macro utility to create a new nestable context.

Use this identifier to access the Context pointer. An endContext call is injected at the end of the statement.

Templates

template opacity(alpha: range[0.0 .. 1.0]; stmts: untyped) {.dirty.}
A template that applies blContextSetGlobalAlpha using alpha to stmts then reset back to 1.0
template stroke(c: BLCircle; width: float; color: BLRgba = White)
Add a stroke to BLCircle while in a ctx Context