pixie/common

Source   Edit  

Types

BlendMode = enum
  NormalBlend, DarkenBlend, MultiplyBlend, ColorBurnBlend, LightenBlend,
  ScreenBlend, ColorDodgeBlend, OverlayBlend, SoftLightBlend, HardLightBlend,
  DifferenceBlend, ExclusionBlend, HueBlend, SaturationBlend, ColorBlend,
  LuminosityBlend, MaskBlend, ## Special blend mode that is used for masking
  OverwriteBlend,           ## Special blend mode that just copies pixels
  SubtractMaskBlend,        ## Inverse mask
  ExcludeMaskBlend
Source   Edit  
Image = ref object
  width*, height*: int
  data*: seq[ColorRGBX]
Image object that holds bitmap data in premultiplied alpha RGBA format. Source   Edit  
ImageDimensions = object
  width*, height*: int
Source   Edit  
PixieError = object of CatchableError
Raised if an operation fails. Source   Edit  

Procs

proc `*`(color: ColorRGBX; opacity: float32): ColorRGBX {....raises: [], tags: [],
    forbids: [].}
Source   Edit  
proc `*`(rgbx: ColorRGBX; opacity: uint8): ColorRGBX {.inline, ...raises: [],
    tags: [], forbids: [].}
Source   Edit  
proc copy(image: Image): Image {....raises: [], tags: [], forbids: [].}
Copies the image data into a new image. Source   Edit  
proc mix(a, b: ColorRGBX; t: float32): ColorRGBX {.inline, ...raises: [], tags: [],
    forbids: [].}
Linearly interpolate between a and b using t. Source   Edit  
proc newImage(width, height: int): Image {....raises: [PixieError], tags: [],
    forbids: [].}
Creates a new image with the parameter dimensions. Source   Edit  
proc snapToPixels(rect: Rect): Rect {....raises: [], tags: [], forbids: [].}
Source   Edit  

Templates

template dataIndex(image: Image; x, y: int): int
Source   Edit