From 5e3e489f619f465051c3faf253d45db50872d1b6 Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg <guzba8@gmail.com> Date: Thu, 25 Feb 2021 12:14:58 -0600 Subject: [PATCH 1/2] internal.nim --- src/pixie/blends.nim | 52 +++++++----------------------------------- src/pixie/images.nim | 2 +- src/pixie/internal.nim | 38 ++++++++++++++++++++++++++++++ src/pixie/paths.nim | 3 ++- 4 files changed, 49 insertions(+), 46 deletions(-) create mode 100644 src/pixie/internal.nim diff --git a/src/pixie/blends.nim b/src/pixie/blends.nim index aca4bbc..72c7246 100644 --- a/src/pixie/blends.nim +++ b/src/pixie/blends.nim @@ -35,10 +35,10 @@ type bmIntersectMask bmExcludeMask - Blender* = proc(backdrop, source: ColorRGBA): ColorRGBA ## Function signature - ## returned by blender. - Masker* = proc(backdrop, source: uint8): uint8 ## Function signature returned - ## by masker. + Blender* = proc(backdrop, source: ColorRGBA): ColorRGBA + ## Function signature returned by blender. + Masker* = proc(backdrop, source: uint8): uint8 + ## Function signature returned by masker. when defined(release): {.push checks: off.} @@ -515,46 +515,10 @@ when defined(amd64) and not defined(pixieNoSimd): import nimsimd/sse2 type - BlenderSimd* = proc(blackdrop, source: M128i): M128i ## Function signature - ## returned by blenderSimd. - MaskerSimd* = proc(blackdrop, source: M128i): M128i ## Function signature - ## returned by maskerSimd. - - proc packAlphaValues*(v: M128i): M128i {.inline.} = - ## Shuffle the alpha values for these 4 colors to the first 4 bytes - result = mm_srli_epi32(v, 24) - let - i = mm_srli_si128(result, 3) - j = mm_srli_si128(result, 6) - k = mm_srli_si128(result, 9) - first32 = cast[M128i]([uint32.high, 0, 0, 0]) - result = mm_or_si128(mm_or_si128(result, i), mm_or_si128(j, k)) - result = mm_and_si128(result, first32) - - proc unpackAlphaValues*(v: M128i): M128i {.inline.} = - ## Unpack the first 32 bits into 4 rgba(0, 0, 0, value) - let - first32 = cast[M128i]([uint32.high, 0, 0, 0]) # First 32 bits - alphaMask = mm_set1_epi32(cast[int32](0xff000000)) # Only `a` - - result = mm_shuffle_epi32(v, MM_SHUFFLE(0, 0, 0, 0)) - - var - i = mm_and_si128(result, first32) - j = mm_and_si128(result, mm_slli_si128(first32, 4)) - k = mm_and_si128(result, mm_slli_si128(first32, 8)) - l = mm_and_si128(result, mm_slli_si128(first32, 12)) - - # Shift the values to `a` - i = mm_slli_si128(i, 3) - j = mm_slli_si128(j, 2) - k = mm_slli_si128(k, 1) - # l = mm_slli_si128(l, 0) - - result = mm_and_si128( - mm_or_si128(mm_or_si128(i, j), mm_or_si128(k, l)), - alphaMask - ) + BlenderSimd* = proc(blackdrop, source: M128i): M128i + ## Function signature returned by blenderSimd. + MaskerSimd* = proc(blackdrop, source: M128i): M128i + ## Function signature returned by maskerSimd. proc blendNormalSimd(backdrop, source: M128i): M128i = let diff --git a/src/pixie/images.nim b/src/pixie/images.nim index 6bd4d59..bf908c2 100644 --- a/src/pixie/images.nim +++ b/src/pixie/images.nim @@ -1,4 +1,4 @@ -import blends, bumpy, chroma, common, masks, system/memory, vmath +import blends, bumpy, chroma, common, masks, pixie/internal, system/memory, vmath when defined(amd64) and not defined(pixieNoSimd): import nimsimd/sse2 diff --git a/src/pixie/internal.nim b/src/pixie/internal.nim new file mode 100644 index 0000000..c2fc581 --- /dev/null +++ b/src/pixie/internal.nim @@ -0,0 +1,38 @@ +when defined(amd64) and not defined(pixieNoSimd): + import nimsimd/sse2 + + proc packAlphaValues*(v: M128i): M128i {.inline.} = + ## Shuffle the alpha values for these 4 colors to the first 4 bytes + result = mm_srli_epi32(v, 24) + let + i = mm_srli_si128(result, 3) + j = mm_srli_si128(result, 6) + k = mm_srli_si128(result, 9) + first32 = cast[M128i]([uint32.high, 0, 0, 0]) + result = mm_or_si128(mm_or_si128(result, i), mm_or_si128(j, k)) + result = mm_and_si128(result, first32) + + proc unpackAlphaValues*(v: M128i): M128i {.inline.} = + ## Unpack the first 32 bits into 4 rgba(0, 0, 0, value) + let + first32 = cast[M128i]([uint32.high, 0, 0, 0]) # First 32 bits + alphaMask = mm_set1_epi32(cast[int32](0xff000000)) # Only `a` + + result = mm_shuffle_epi32(v, MM_SHUFFLE(0, 0, 0, 0)) + + var + i = mm_and_si128(result, first32) + j = mm_and_si128(result, mm_slli_si128(first32, 4)) + k = mm_and_si128(result, mm_slli_si128(first32, 8)) + l = mm_and_si128(result, mm_slli_si128(first32, 12)) + + # Shift the values to `a` + i = mm_slli_si128(i, 3) + j = mm_slli_si128(j, 2) + k = mm_slli_si128(k, 1) + # l = mm_slli_si128(l, 0) + + result = mm_and_si128( + mm_or_si128(mm_or_si128(i, j), mm_or_si128(k, l)), + alphaMask + ) diff --git a/src/pixie/paths.nim b/src/pixie/paths.nim index 66af2df..777c9da 100644 --- a/src/pixie/paths.nim +++ b/src/pixie/paths.nim @@ -1,4 +1,5 @@ -import blends, bumpy, chroma, common, images, masks, paints, strutils, vmath +import blends, bumpy, chroma, common, images, masks, paints, pixie/internal, + strutils, vmath when defined(amd64) and not defined(pixieNoSimd): import nimsimd/sse2 From 44a4f903318a67b08c6781637be0351e12a67f9e Mon Sep 17 00:00:00 2001 From: Ryan Oldenburg <guzba8@gmail.com> Date: Thu, 25 Feb 2021 12:16:04 -0600 Subject: [PATCH 2/2] updated docs --- docs/pixie.html | 4 +- docs/pixie/blends.html | 26 +----- docs/pixie/blends.idx | 2 - docs/pixie/common.html | 2 +- docs/pixie/fileformats/bmp.html | 2 +- docs/pixie/fileformats/jpg.html | 2 +- docs/pixie/fileformats/png.html | 2 +- docs/pixie/fileformats/svg.html | 2 +- docs/pixie/images.html | 4 +- docs/pixie/internal.html | 152 ++++++++++++++++++++++++++++++++ docs/pixie/internal.idx | 2 + docs/pixie/masks.html | 2 +- docs/pixie/paints.html | 2 +- docs/pixie/paths.html | 4 +- docs/theindex.html | 8 +- 15 files changed, 172 insertions(+), 44 deletions(-) create mode 100644 docs/pixie/internal.html create mode 100644 docs/pixie/internal.idx diff --git a/docs/pixie.html b/docs/pixie.html index 11511a2..9b5b344 100644 --- a/docs/pixie.html +++ b/docs/pixie.html @@ -528,7 +528,7 @@ Strokes a polygon. <div class="section" id="19"> <h1><a class="toc-backref" href="#19">Exports</a></h1> <dl class="item"> -<a href="pixie/blends.html#unpackAlphaValues,M128i"><span class="Identifier">unpackAlphaValues</span></a>, <a href="pixie/blends.html#Masker"><span class="Identifier">Masker</span></a>, <a href="pixie/blends.html#maskerSimd,BlendMode"><span class="Identifier">maskerSimd</span></a>, <a href="pixie/blends.html#blender,BlendMode"><span class="Identifier">blender</span></a>, <a href="pixie/blends.html#hasSimdBlender,BlendMode"><span class="Identifier">hasSimdBlender</span></a>, <a href="pixie/blends.html#Blender"><span class="Identifier">Blender</span></a>, <a href="pixie/blends.html#BlenderSimd"><span class="Identifier">BlenderSimd</span></a>, <a href="pixie/blends.html#MaskerSimd"><span class="Identifier">MaskerSimd</span></a>, <a href="pixie/blends.html#packAlphaValues,M128i"><span class="Identifier">packAlphaValues</span></a>, <a href="pixie/blends.html#blenderSimd,BlendMode"><span class="Identifier">blenderSimd</span></a>, <a href="pixie/blends.html#hasSimdMasker,BlendMode"><span class="Identifier">hasSimdMasker</span></a>, <a href="pixie/blends.html#masker,BlendMode"><span class="Identifier">masker</span></a>, <a href="pixie/blends.html#BlendMode"><span class="Identifier">BlendMode</span></a>, <a href="pixie/blends.html#blendAlpha,uint8,uint8"><span class="Identifier">blendAlpha</span></a>, <a href="pixie/common.html#toPremultipliedAlpha,ColorRGBA"><span class="Identifier">toPremultipliedAlpha</span></a>, <a href="pixie/common.html#toPremultipliedAlpha,Color"><span class="Identifier">toPremultipliedAlpha</span></a>, <a href="pixie/common.html#toStraightAlpha,Color"><span class="Identifier">toStraightAlpha</span></a>, <a href="pixie/common.html#PixieError"><span class="Identifier">PixieError</span></a>, <a href="pixie/common.html#lerp,Color,Color,float32"><span class="Identifier">lerp</span></a>, <a href="pixie/common.html#lerp,uint8,uint8,float32"><span class="Identifier">lerp</span></a>, <a href="pixie/common.html#fractional,float32"><span class="Identifier">fractional</span></a>, <a href="pixie/common.html#toStraightAlpha,ColorRGBA"><span class="Identifier">toStraightAlpha</span></a>, <a href="pixie/common.html#lerp,ColorRGBA,ColorRGBA,float32"><span class="Identifier">lerp</span></a>, <a href="pixie/images.html#getRgbaUnsafe,Image,int,int"><span class="Identifier">getRgbaUnsafe</span></a>, <a href="pixie/images.html#draw,Image,Mask,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#[]=,Image,int,int,ColorRGBA"><span class="Identifier">[]=</span></a>, <a href="pixie/images.html#Image"><span class="Identifier">Image</span></a>, <a href="pixie/images.html#copy,Image"><span class="Identifier">copy</span></a>, <a href="pixie/images.html#wh,Image"><span class="Identifier">wh</span></a>, <a href="pixie/images.html#setRgbaUnsafe,Image,int,int,ColorRGBA"><span class="Identifier">setRgbaUnsafe</span></a>, <a href="pixie/images.html#getRgbaSmooth,Image,float32,float32"><span class="Identifier">getRgbaSmooth</span></a>, <a href="pixie/images.html#invert"><span class="Identifier">invert</span></a>, <a href="pixie/images.html#flipVertical,Image"><span class="Identifier">flipVertical</span></a>, <a href="pixie/images.html#magnifyBy2,Image,int"><span class="Identifier">magnifyBy2</span></a>, <a href="pixie/images.html#draw,Mask,Mask"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#draw,Image,Mask"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#flipHorizontal,Image"><span class="Identifier">flipHorizontal</span></a>, <a href="pixie/images.html#shadow,Image,Vec2,float32,float32,ColorRGBA"><span class="Identifier">shadow</span></a>, <a href="pixie/images.html#subImage,Image,int,int,int,int"><span class="Identifier">subImage</span></a>, <a href="pixie/images.html#inside,Image,int,int"><span class="Identifier">inside</span></a>, <a href="pixie/images.html#$,Image"><span class="Identifier">$</span></a>, <a href="pixie/images.html#draw,Mask,Image,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#shift,,Vec2"><span class="Identifier">shift</span></a>, <a href="pixie/images.html#dataIndex,Image,int,int"><span class="Identifier">dataIndex</span></a>, <a href="pixie/images.html#minifyBy2,Image,int"><span class="Identifier">minifyBy2</span></a>, <a href="pixie/images.html#draw,Image,Image"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#draw,Image,Image,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#fill,Image,ColorRGBA"><span class="Identifier">fill</span></a>, <a href="pixie/images.html#draw,Mask,Mask,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#newMask,Image"><span class="Identifier">newMask</span></a>, <a href="pixie/images.html#blur,,float32,uint32"><span class="Identifier">blur</span></a>, <a href="pixie/images.html#newImage,int,int"><span class="Identifier">newImage</span></a>, <a href="pixie/images.html#toPremultipliedAlpha,Image"><span class="Identifier">toPremultipliedAlpha</span></a>, <a href="pixie/images.html#drawTiled,Image,Image,Mat3"><span class="Identifier">drawTiled</span></a>, <a href="pixie/images.html#applyOpacity,,float32"><span class="Identifier">applyOpacity</span></a>, <a href="pixie/images.html#resize,Image,int,int"><span class="Identifier">resize</span></a>, <a href="pixie/images.html#superImage,Image,int,int,int,int"><span class="Identifier">superImage</span></a>, <a href="pixie/images.html#fillUnsafe,seq[ColorRGBA],ColorRGBA,int,int"><span class="Identifier">fillUnsafe</span></a>, <a href="pixie/images.html#draw,Mask,Image"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#toStraightAlpha,Image"><span class="Identifier">toStraightAlpha</span></a>, <a href="pixie/images.html#[],Image,int,int"><span class="Identifier">[]</span></a>, <a href="pixie/masks.html#$,Mask"><span class="Identifier">$</span></a>, <a href="pixie/masks.html#setValueUnsafe,Mask,int,int,uint8"><span class="Identifier">setValueUnsafe</span></a>, <a href="pixie/masks.html#ceil,Mask"><span class="Identifier">ceil</span></a>, <a href="pixie/masks.html#dataIndex,Mask,int,int"><span class="Identifier">dataIndex</span></a>, <a href="pixie/masks.html#[]=,Mask,int,int,uint8"><span class="Identifier">[]=</span></a>, <a href="pixie/masks.html#spread,Mask,float32"><span class="Identifier">spread</span></a>, <a href="pixie/masks.html#copy,Mask"><span class="Identifier">copy</span></a>, <a href="pixie/masks.html#wh,Mask"><span class="Identifier">wh</span></a>, <a href="pixie/masks.html#newMask,int,int"><span class="Identifier">newMask</span></a>, <a href="pixie/masks.html#minifyBy2,Mask,int"><span class="Identifier">minifyBy2</span></a>, <a href="pixie/masks.html#fill,Mask,uint8"><span class="Identifier">fill</span></a>, <a href="pixie/masks.html#Mask"><span class="Identifier">Mask</span></a>, <a href="pixie/masks.html#getValueUnsafe,Mask,int,int"><span class="Identifier">getValueUnsafe</span></a>, <a href="pixie/masks.html#getValueSmooth,Mask,float32,float32"><span class="Identifier">getValueSmooth</span></a>, <a href="pixie/masks.html#fillUnsafe,seq[uint8],uint8,int,int"><span class="Identifier">fillUnsafe</span></a>, <a href="pixie/masks.html#inside,Mask,int,int"><span class="Identifier">inside</span></a>, <a href="pixie/masks.html#[],Mask,int,int"><span class="Identifier">[]</span></a>, <a href="pixie/paints.html#ColorStop"><span class="Identifier">ColorStop</span></a>, <a href="pixie/paints.html#PaintKind"><span class="Identifier">PaintKind</span></a>, <a href="pixie/paints.html#fillLinearGradient,Image,Vec2,Vec2,seq[ColorStop]"><span class="Identifier">fillLinearGradient</span></a>, <a href="pixie/paints.html#fillRadialGradient,Image,Vec2,Vec2,Vec2,seq[ColorStop]"><span class="Identifier">fillRadialGradient</span></a>, <a href="pixie/paints.html#fillAngularGradient,Image,Vec2,Vec2,Vec2,seq[ColorStop]"><span class="Identifier">fillAngularGradient</span></a>, <a href="pixie/paints.html#Paint"><span class="Identifier">Paint</span></a>, <a href="pixie/paths.html#bezierCurveTo,Path,float32,float32,float32,float32,float32,float32"><span class="Identifier">bezierCurveTo</span></a>, <a href="pixie/paths.html#LineCap"><span class="Identifier">LineCap</span></a>, <a href="pixie/paths.html#arcTo,Path,Vec2,Vec2,float32"><span class="Identifier">arcTo</span></a>, <a href="pixie/paths.html#LineJoin"><span class="Identifier">LineJoin</span></a>, <a href="pixie/paths.html#rect,Path,Vec2,Vec2"><span class="Identifier">rect</span></a>, <a href="pixie/paths.html#bezierCurveTo,Path,Vec2,Vec2,Vec2"><span class="Identifier">bezierCurveTo</span></a>, <a href="pixie/paths.html#SomePath"><span class="Identifier">SomePath</span></a>, <a href="pixie/paths.html#strokePath,Mask,SomePath,,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#$,Path"><span class="Identifier">$</span></a>, <a href="pixie/paths.html#parsePath,string"><span class="Identifier">parsePath</span></a>, <a href="pixie/paths.html#fillPath,Image,SomePath,Paint"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#lineTo,Path,float32,float32"><span class="Identifier">lineTo</span></a>, <a href="pixie/paths.html#polygon,Path,Vec2,float32,int"><span class="Identifier">polygon</span></a>, <a href="pixie/paths.html#roundedRect,Path,float32,float32,float32,float32,float32,float32,float32,float32"><span class="Identifier">roundedRect</span></a>, <a href="pixie/paths.html#quadraticCurveTo,Path,Vec2,Vec2"><span class="Identifier">quadraticCurveTo</span></a>, <a href="pixie/paths.html#fillPath,Image,SomePath,ColorRGBA"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#strokePath,Image,SomePath,ColorRGBA,,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#ellipticalArcTo,Path,float32,float32,float32,bool,bool,float32,float32"><span class="Identifier">ellipticalArcTo</span></a>, <a href="pixie/paths.html#Path"><span class="Identifier">Path</span></a>, <a href="pixie/paths.html#lineTo,Path,Vec2"><span class="Identifier">lineTo</span></a>, <a href="pixie/paths.html#ellipse,Path,Vec2,float32,float32"><span class="Identifier">ellipse</span></a>, <a href="pixie/paths.html#quadraticCurveTo,Path,float32,float32,float32,float32"><span class="Identifier">quadraticCurveTo</span></a>, <a href="pixie/paths.html#arcTo,Path,float32,float32,float32,float32,float32"><span class="Identifier">arcTo</span></a>, <a href="pixie/paths.html#moveTo,Path,float32,float32"><span class="Identifier">moveTo</span></a>, <a href="pixie/paths.html#roundedRect,Path,Rect,float32,float32,float32,float32"><span class="Identifier">roundedRect</span></a>, <a href="pixie/paths.html#PathCommandKind"><span class="Identifier">PathCommandKind</span></a>, <a href="pixie/paths.html#polygon,Path,float32,float32,float32,int"><span class="Identifier">polygon</span></a>, <a href="pixie/paths.html#strokePath,Image,SomePath,ColorRGBA,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#transform,Path,Mat3"><span class="Identifier">transform</span></a>, <a href="pixie/paths.html#PathCommand"><span class="Identifier">PathCommand</span></a>, <a href="pixie/paths.html#roundedRect,Path,Vec2,Vec2,float32,float32,float32,float32"><span class="Identifier">roundedRect</span></a>, <a href="pixie/paths.html#rect,Path,Rect"><span class="Identifier">rect</span></a>, <a href="pixie/paths.html#fillPath,Image,SomePath,ColorRGBA,"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#segments.i,seq[Vec2]"><span class="Identifier">segments</span></a>, <a href="pixie/paths.html#closePath,Path"><span class="Identifier">closePath</span></a>, <a href="pixie/paths.html#addPath,Path,Path"><span class="Identifier">addPath</span></a>, <a href="pixie/paths.html#rect,Path,float32,float32,float32,float32"><span class="Identifier">rect</span></a>, <a href="pixie/paths.html#strokePath,Mask,SomePath,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#commandsToShapes,Path,float32"><span class="Identifier">commandsToShapes</span></a>, <a href="pixie/paths.html#ellipse,Path,float32,float32,float32,float32"><span class="Identifier">ellipse</span></a>, <a href="pixie/paths.html#WindingRule"><span class="Identifier">WindingRule</span></a>, <a href="pixie/paths.html#fillPath,Mask,SomePath,"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#moveTo,Path,Vec2"><span class="Identifier">moveTo</span></a>, <a href="pixie/paths.html#fillPath,Mask,SomePath"><span class="Identifier">fillPath</span></a> +<a href="pixie/blends.html#maskerSimd,BlendMode"><span class="Identifier">maskerSimd</span></a>, <a href="pixie/blends.html#Masker"><span class="Identifier">Masker</span></a>, <a href="pixie/blends.html#blender,BlendMode"><span class="Identifier">blender</span></a>, <a href="pixie/blends.html#hasSimdBlender,BlendMode"><span class="Identifier">hasSimdBlender</span></a>, <a href="pixie/blends.html#Blender"><span class="Identifier">Blender</span></a>, <a href="pixie/blends.html#BlenderSimd"><span class="Identifier">BlenderSimd</span></a>, <a href="pixie/blends.html#MaskerSimd"><span class="Identifier">MaskerSimd</span></a>, <a href="pixie/blends.html#blenderSimd,BlendMode"><span class="Identifier">blenderSimd</span></a>, <a href="pixie/blends.html#hasSimdMasker,BlendMode"><span class="Identifier">hasSimdMasker</span></a>, <a href="pixie/blends.html#masker,BlendMode"><span class="Identifier">masker</span></a>, <a href="pixie/blends.html#BlendMode"><span class="Identifier">BlendMode</span></a>, <a href="pixie/blends.html#blendAlpha,uint8,uint8"><span class="Identifier">blendAlpha</span></a>, <a href="pixie/common.html#toPremultipliedAlpha,ColorRGBA"><span class="Identifier">toPremultipliedAlpha</span></a>, <a href="pixie/common.html#toPremultipliedAlpha,Color"><span class="Identifier">toPremultipliedAlpha</span></a>, <a href="pixie/common.html#toStraightAlpha,Color"><span class="Identifier">toStraightAlpha</span></a>, <a href="pixie/common.html#PixieError"><span class="Identifier">PixieError</span></a>, <a href="pixie/common.html#lerp,Color,Color,float32"><span class="Identifier">lerp</span></a>, <a href="pixie/common.html#lerp,uint8,uint8,float32"><span class="Identifier">lerp</span></a>, <a href="pixie/common.html#fractional,float32"><span class="Identifier">fractional</span></a>, <a href="pixie/common.html#toStraightAlpha,ColorRGBA"><span class="Identifier">toStraightAlpha</span></a>, <a href="pixie/common.html#lerp,ColorRGBA,ColorRGBA,float32"><span class="Identifier">lerp</span></a>, <a href="pixie/images.html#getRgbaUnsafe,Image,int,int"><span class="Identifier">getRgbaUnsafe</span></a>, <a href="pixie/images.html#draw,Image,Mask,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#[]=,Image,int,int,ColorRGBA"><span class="Identifier">[]=</span></a>, <a href="pixie/images.html#Image"><span class="Identifier">Image</span></a>, <a href="pixie/images.html#copy,Image"><span class="Identifier">copy</span></a>, <a href="pixie/images.html#wh,Image"><span class="Identifier">wh</span></a>, <a href="pixie/images.html#setRgbaUnsafe,Image,int,int,ColorRGBA"><span class="Identifier">setRgbaUnsafe</span></a>, <a href="pixie/images.html#getRgbaSmooth,Image,float32,float32"><span class="Identifier">getRgbaSmooth</span></a>, <a href="pixie/images.html#invert"><span class="Identifier">invert</span></a>, <a href="pixie/images.html#flipVertical,Image"><span class="Identifier">flipVertical</span></a>, <a href="pixie/images.html#magnifyBy2,Image,int"><span class="Identifier">magnifyBy2</span></a>, <a href="pixie/images.html#draw,Mask,Mask"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#draw,Image,Mask"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#flipHorizontal,Image"><span class="Identifier">flipHorizontal</span></a>, <a href="pixie/images.html#shadow,Image,Vec2,float32,float32,ColorRGBA"><span class="Identifier">shadow</span></a>, <a href="pixie/images.html#subImage,Image,int,int,int,int"><span class="Identifier">subImage</span></a>, <a href="pixie/images.html#inside,Image,int,int"><span class="Identifier">inside</span></a>, <a href="pixie/images.html#$,Image"><span class="Identifier">$</span></a>, <a href="pixie/images.html#draw,Mask,Image,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#shift,,Vec2"><span class="Identifier">shift</span></a>, <a href="pixie/images.html#dataIndex,Image,int,int"><span class="Identifier">dataIndex</span></a>, <a href="pixie/images.html#minifyBy2,Image,int"><span class="Identifier">minifyBy2</span></a>, <a href="pixie/images.html#draw,Image,Image"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#draw,Image,Image,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#fill,Image,ColorRGBA"><span class="Identifier">fill</span></a>, <a href="pixie/images.html#draw,Mask,Mask,Mat3"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#newMask,Image"><span class="Identifier">newMask</span></a>, <a href="pixie/images.html#blur,,float32,uint32"><span class="Identifier">blur</span></a>, <a href="pixie/images.html#newImage,int,int"><span class="Identifier">newImage</span></a>, <a href="pixie/images.html#toPremultipliedAlpha,Image"><span class="Identifier">toPremultipliedAlpha</span></a>, <a href="pixie/images.html#drawTiled,Image,Image,Mat3"><span class="Identifier">drawTiled</span></a>, <a href="pixie/images.html#applyOpacity,,float32"><span class="Identifier">applyOpacity</span></a>, <a href="pixie/images.html#resize,Image,int,int"><span class="Identifier">resize</span></a>, <a href="pixie/images.html#superImage,Image,int,int,int,int"><span class="Identifier">superImage</span></a>, <a href="pixie/images.html#fillUnsafe,seq[ColorRGBA],ColorRGBA,int,int"><span class="Identifier">fillUnsafe</span></a>, <a href="pixie/images.html#draw,Mask,Image"><span class="Identifier">draw</span></a>, <a href="pixie/images.html#toStraightAlpha,Image"><span class="Identifier">toStraightAlpha</span></a>, <a href="pixie/images.html#[],Image,int,int"><span class="Identifier">[]</span></a>, <a href="pixie/masks.html#$,Mask"><span class="Identifier">$</span></a>, <a href="pixie/masks.html#setValueUnsafe,Mask,int,int,uint8"><span class="Identifier">setValueUnsafe</span></a>, <a href="pixie/masks.html#ceil,Mask"><span class="Identifier">ceil</span></a>, <a href="pixie/masks.html#dataIndex,Mask,int,int"><span class="Identifier">dataIndex</span></a>, <a href="pixie/masks.html#[]=,Mask,int,int,uint8"><span class="Identifier">[]=</span></a>, <a href="pixie/masks.html#spread,Mask,float32"><span class="Identifier">spread</span></a>, <a href="pixie/masks.html#copy,Mask"><span class="Identifier">copy</span></a>, <a href="pixie/masks.html#wh,Mask"><span class="Identifier">wh</span></a>, <a href="pixie/masks.html#newMask,int,int"><span class="Identifier">newMask</span></a>, <a href="pixie/masks.html#minifyBy2,Mask,int"><span class="Identifier">minifyBy2</span></a>, <a href="pixie/masks.html#fill,Mask,uint8"><span class="Identifier">fill</span></a>, <a href="pixie/masks.html#Mask"><span class="Identifier">Mask</span></a>, <a href="pixie/masks.html#getValueUnsafe,Mask,int,int"><span class="Identifier">getValueUnsafe</span></a>, <a href="pixie/masks.html#getValueSmooth,Mask,float32,float32"><span class="Identifier">getValueSmooth</span></a>, <a href="pixie/masks.html#fillUnsafe,seq[uint8],uint8,int,int"><span class="Identifier">fillUnsafe</span></a>, <a href="pixie/masks.html#inside,Mask,int,int"><span class="Identifier">inside</span></a>, <a href="pixie/masks.html#[],Mask,int,int"><span class="Identifier">[]</span></a>, <a href="pixie/paints.html#ColorStop"><span class="Identifier">ColorStop</span></a>, <a href="pixie/paints.html#PaintKind"><span class="Identifier">PaintKind</span></a>, <a href="pixie/paints.html#fillLinearGradient,Image,Vec2,Vec2,seq[ColorStop]"><span class="Identifier">fillLinearGradient</span></a>, <a href="pixie/paints.html#fillRadialGradient,Image,Vec2,Vec2,Vec2,seq[ColorStop]"><span class="Identifier">fillRadialGradient</span></a>, <a href="pixie/paints.html#fillAngularGradient,Image,Vec2,Vec2,Vec2,seq[ColorStop]"><span class="Identifier">fillAngularGradient</span></a>, <a href="pixie/paints.html#Paint"><span class="Identifier">Paint</span></a>, <a href="pixie/paths.html#bezierCurveTo,Path,float32,float32,float32,float32,float32,float32"><span class="Identifier">bezierCurveTo</span></a>, <a href="pixie/paths.html#LineCap"><span class="Identifier">LineCap</span></a>, <a href="pixie/paths.html#arcTo,Path,Vec2,Vec2,float32"><span class="Identifier">arcTo</span></a>, <a href="pixie/paths.html#LineJoin"><span class="Identifier">LineJoin</span></a>, <a href="pixie/paths.html#rect,Path,Vec2,Vec2"><span class="Identifier">rect</span></a>, <a href="pixie/paths.html#bezierCurveTo,Path,Vec2,Vec2,Vec2"><span class="Identifier">bezierCurveTo</span></a>, <a href="pixie/paths.html#SomePath"><span class="Identifier">SomePath</span></a>, <a href="pixie/paths.html#strokePath,Mask,SomePath,,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#$,Path"><span class="Identifier">$</span></a>, <a href="pixie/paths.html#parsePath,string"><span class="Identifier">parsePath</span></a>, <a href="pixie/paths.html#fillPath,Image,SomePath,Paint"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#lineTo,Path,float32,float32"><span class="Identifier">lineTo</span></a>, <a href="pixie/paths.html#polygon,Path,Vec2,float32,int"><span class="Identifier">polygon</span></a>, <a href="pixie/paths.html#roundedRect,Path,float32,float32,float32,float32,float32,float32,float32,float32"><span class="Identifier">roundedRect</span></a>, <a href="pixie/paths.html#quadraticCurveTo,Path,Vec2,Vec2"><span class="Identifier">quadraticCurveTo</span></a>, <a href="pixie/paths.html#fillPath,Image,SomePath,ColorRGBA"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#strokePath,Image,SomePath,ColorRGBA,,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#ellipticalArcTo,Path,float32,float32,float32,bool,bool,float32,float32"><span class="Identifier">ellipticalArcTo</span></a>, <a href="pixie/paths.html#Path"><span class="Identifier">Path</span></a>, <a href="pixie/paths.html#lineTo,Path,Vec2"><span class="Identifier">lineTo</span></a>, <a href="pixie/paths.html#ellipse,Path,Vec2,float32,float32"><span class="Identifier">ellipse</span></a>, <a href="pixie/paths.html#quadraticCurveTo,Path,float32,float32,float32,float32"><span class="Identifier">quadraticCurveTo</span></a>, <a href="pixie/paths.html#arcTo,Path,float32,float32,float32,float32,float32"><span class="Identifier">arcTo</span></a>, <a href="pixie/paths.html#moveTo,Path,float32,float32"><span class="Identifier">moveTo</span></a>, <a href="pixie/paths.html#roundedRect,Path,Rect,float32,float32,float32,float32"><span class="Identifier">roundedRect</span></a>, <a href="pixie/paths.html#PathCommandKind"><span class="Identifier">PathCommandKind</span></a>, <a href="pixie/paths.html#polygon,Path,float32,float32,float32,int"><span class="Identifier">polygon</span></a>, <a href="pixie/paths.html#strokePath,Image,SomePath,ColorRGBA,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#transform,Path,Mat3"><span class="Identifier">transform</span></a>, <a href="pixie/paths.html#PathCommand"><span class="Identifier">PathCommand</span></a>, <a href="pixie/paths.html#roundedRect,Path,Vec2,Vec2,float32,float32,float32,float32"><span class="Identifier">roundedRect</span></a>, <a href="pixie/paths.html#rect,Path,Rect"><span class="Identifier">rect</span></a>, <a href="pixie/paths.html#fillPath,Image,SomePath,ColorRGBA,"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#segments.i,seq[Vec2]"><span class="Identifier">segments</span></a>, <a href="pixie/paths.html#closePath,Path"><span class="Identifier">closePath</span></a>, <a href="pixie/paths.html#addPath,Path,Path"><span class="Identifier">addPath</span></a>, <a href="pixie/paths.html#rect,Path,float32,float32,float32,float32"><span class="Identifier">rect</span></a>, <a href="pixie/paths.html#strokePath,Mask,SomePath,float"><span class="Identifier">strokePath</span></a>, <a href="pixie/paths.html#commandsToShapes,Path,float32"><span class="Identifier">commandsToShapes</span></a>, <a href="pixie/paths.html#ellipse,Path,float32,float32,float32,float32"><span class="Identifier">ellipse</span></a>, <a href="pixie/paths.html#WindingRule"><span class="Identifier">WindingRule</span></a>, <a href="pixie/paths.html#fillPath,Mask,SomePath,"><span class="Identifier">fillPath</span></a>, <a href="pixie/paths.html#moveTo,Path,Vec2"><span class="Identifier">moveTo</span></a>, <a href="pixie/paths.html#fillPath,Mask,SomePath"><span class="Identifier">fillPath</span></a> </dl></div> </div> @@ -538,7 +538,7 @@ Strokes a polygon. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:09 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:16:00 UTC</small> </div> </div> </div> diff --git a/docs/pixie/blends.html b/docs/pixie/blends.html index df6f9f5..d605418 100644 --- a/docs/pixie/blends.html +++ b/docs/pixie/blends.html @@ -156,16 +156,6 @@ function main() { <li><a class="reference" href="#maskerSimd%2CBlendMode" title="maskerSimd(blendMode: BlendMode): MaskerSimd">maskerSimd,<wbr>BlendMode</a></li> - </ul> - <ul class="simple nested-toc-section">unpackAlphaValues - <li><a class="reference" href="#unpackAlphaValues%2CM128i" - title="unpackAlphaValues(v: M128i): M128i">unpackAlphaValues,<wbr>M128i</a></li> - - </ul> - <ul class="simple nested-toc-section">packAlphaValues - <li><a class="reference" href="#packAlphaValues%2CM128i" - title="packAlphaValues(v: M128i): M128i">packAlphaValues,<wbr>M128i</a></li> - </ul> </ul> @@ -252,20 +242,6 @@ Blends alphas of backdrop, source. -</dd> -<a id="packAlphaValues,M128i"></a> -<dt><pre><span class="Keyword">proc</span> <a href="#packAlphaValues%2CM128i"><span class="Identifier">packAlphaValues</span></a><span class="Other">(</span><span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">M128i</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">M128i</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt> -<dd> - -Shuffle the alpha values for these 4 colors to the first 4 bytes - -</dd> -<a id="unpackAlphaValues,M128i"></a> -<dt><pre><span class="Keyword">proc</span> <a href="#unpackAlphaValues%2CM128i"><span class="Identifier">unpackAlphaValues</span></a><span class="Other">(</span><span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">M128i</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">M128i</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt> -<dd> - -Unpack the first 32 bits into 4 rgba(0, 0, 0, value) - </dd> <a id="blenderSimd,BlendMode"></a> <dt><pre><span class="Keyword">proc</span> <a href="#blenderSimd%2CBlendMode"><span class="Identifier">blenderSimd</span></a><span class="Other">(</span><span class="Identifier">blendMode</span><span class="Other">:</span> <a href="blends.html#BlendMode"><span class="Identifier">BlendMode</span></a><span class="Other">)</span><span class="Other">:</span> <a href="blends.html#BlenderSimd"><span class="Identifier">BlenderSimd</span></a> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Identifier">PixieError</span><span class="Other">]</span><span class="Other">,</span> @@ -307,7 +283,7 @@ Is there a blend masking function with SIMD support? <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> </div> </div> </div> diff --git a/docs/pixie/blends.idx b/docs/pixie/blends.idx index fde94db..0d796a7 100644 --- a/docs/pixie/blends.idx +++ b/docs/pixie/blends.idx @@ -27,8 +27,6 @@ blender pixie/blends.html#blender,BlendMode blends: blender(blendMode: BlendMode masker pixie/blends.html#masker,BlendMode blends: masker(blendMode: BlendMode): Masker BlenderSimd pixie/blends.html#BlenderSimd blends: BlenderSimd MaskerSimd pixie/blends.html#MaskerSimd blends: MaskerSimd -packAlphaValues pixie/blends.html#packAlphaValues,M128i blends: packAlphaValues(v: M128i): M128i -unpackAlphaValues pixie/blends.html#unpackAlphaValues,M128i blends: unpackAlphaValues(v: M128i): M128i blenderSimd pixie/blends.html#blenderSimd,BlendMode blends: blenderSimd(blendMode: BlendMode): BlenderSimd hasSimdBlender pixie/blends.html#hasSimdBlender,BlendMode blends: hasSimdBlender(blendMode: BlendMode): bool maskerSimd pixie/blends.html#maskerSimd,BlendMode blends: maskerSimd(blendMode: BlendMode): MaskerSimd diff --git a/docs/pixie/common.html b/docs/pixie/common.html index eca7409..54133c5 100644 --- a/docs/pixie/common.html +++ b/docs/pixie/common.html @@ -239,7 +239,7 @@ Linearly interpolate between a and b using t. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> </div> </div> </div> diff --git a/docs/pixie/fileformats/bmp.html b/docs/pixie/fileformats/bmp.html index 2e1862b..a6e9758 100644 --- a/docs/pixie/fileformats/bmp.html +++ b/docs/pixie/fileformats/bmp.html @@ -182,7 +182,7 @@ Encodes an image into the BMP file format. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> </div> </div> </div> diff --git a/docs/pixie/fileformats/jpg.html b/docs/pixie/fileformats/jpg.html index 963880a..d704c61 100644 --- a/docs/pixie/fileformats/jpg.html +++ b/docs/pixie/fileformats/jpg.html @@ -182,7 +182,7 @@ Encodes Image into a JPEG data string. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> </div> </div> </div> diff --git a/docs/pixie/fileformats/png.html b/docs/pixie/fileformats/png.html index 82165e6..acc4387 100644 --- a/docs/pixie/fileformats/png.html +++ b/docs/pixie/fileformats/png.html @@ -201,7 +201,7 @@ Encodes the mask data into the PNG file format. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:16:00 UTC</small> </div> </div> </div> diff --git a/docs/pixie/fileformats/svg.html b/docs/pixie/fileformats/svg.html index 9cdb4df..0f7162a 100644 --- a/docs/pixie/fileformats/svg.html +++ b/docs/pixie/fileformats/svg.html @@ -171,7 +171,7 @@ Render SVG file and return the image. Defaults to the SVG's view box size. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:09 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:16:00 UTC</small> </div> </div> </div> diff --git a/docs/pixie/images.html b/docs/pixie/images.html index 50efb5f..e544fd1 100644 --- a/docs/pixie/images.html +++ b/docs/pixie/images.html @@ -288,7 +288,7 @@ function main() { <div class="section" id="6"> <h1><a class="toc-backref" href="#6">Imports</a></h1> <dl class="item"> -<a class="reference external" href="blends.html">blends</a>, <a class="reference external" href="common.html">common</a>, <a class="reference external" href="masks.html">masks</a> +<a class="reference external" href="blends.html">blends</a>, <a class="reference external" href="common.html">common</a>, <a class="reference external" href="masks.html">masks</a>, <a class="reference external" href="internal.html">internal</a> </dl></div> <div class="section" id="7"> <h1><a class="toc-backref" href="#7">Types</a></h1> @@ -601,7 +601,7 @@ Create a shadow of the image with the offset, spread and blur. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> </div> </div> </div> diff --git a/docs/pixie/internal.html b/docs/pixie/internal.html new file mode 100644 index 0000000..8c1a79f --- /dev/null +++ b/docs/pixie/internal.html @@ -0,0 +1,152 @@ +<?xml version="1.0" encoding="utf-8" ?> +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> +<!-- This file is generated by Nim. --> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + +<meta name="viewport" content="width=device-width, initial-scale=1.0"> + +<!-- Favicon --> +<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/> +<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII="> + +<!-- Google fonts --> +<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/> +<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/> + +<!-- CSS --> +<title>pixie/internal</title> +<link rel="stylesheet" type="text/css" href="../nimdoc.out.css"> + +<script type="text/javascript" src="../dochack.js"></script> + +<script type="text/javascript"> +function main() { + var pragmaDots = document.getElementsByClassName("pragmadots"); + for (var i = 0; i < pragmaDots.length; i++) { + pragmaDots[i].onclick = function(event) { + // Hide tease + event.target.parentNode.style.display = "none"; + // Show actual + event.target.parentNode.nextElementSibling.style.display = "inline"; + } + } + + const toggleSwitch = document.querySelector('.theme-switch input[type="checkbox"]'); + function switchTheme(e) { + if (e.target.checked) { + document.documentElement.setAttribute('data-theme', 'dark'); + localStorage.setItem('theme', 'dark'); + } else { + document.documentElement.setAttribute('data-theme', 'light'); + localStorage.setItem('theme', 'light'); + } + } + + toggleSwitch.addEventListener('change', switchTheme, false); + + const currentTheme = localStorage.getItem('theme') ? localStorage.getItem('theme') : null; + if (currentTheme) { + document.documentElement.setAttribute('data-theme', currentTheme); + + if (currentTheme === 'dark') { + toggleSwitch.checked = true; + } + } +} +</script> + +</head> +<body onload="main()"> +<div class="document" id="documentId"> + <div class="container"> + <h1 class="title">pixie/internal</h1> + <div class="row"> + <div class="three columns"> + <div class="theme-switch-wrapper"> + <label class="theme-switch" for="checkbox"> + <input type="checkbox" id="checkbox" /> + <div class="slider round"></div> + </label> + <em>Dark Mode</em> + </div> + <div id="global-links"> + <ul class="simple"> + <li> + <a href="../theindex.html">Index</a> + </li> + </ul> + </div> + <div id="searchInputDiv"> + Search: <input type="text" id="searchInput" + onkeyup="search()" /> + </div> + <div> + Group by: + <select onchange="groupBy(this.value)"> + <option value="section">Section</option> + <option value="type">Type</option> + </select> + </div> + <ul class="simple simple-toc" id="toc-list"> +<li> + <a class="reference reference-toplevel" href="#12" id="62">Procs</a> + <ul class="simple simple-toc-section"> + <ul class="simple nested-toc-section">unpackAlphaValues + <li><a class="reference" href="#unpackAlphaValues%2CM128i" + title="unpackAlphaValues(v: M128i): M128i">unpackAlphaValues,<wbr>M128i</a></li> + + </ul> + <ul class="simple nested-toc-section">packAlphaValues + <li><a class="reference" href="#packAlphaValues%2CM128i" + title="packAlphaValues(v: M128i): M128i">packAlphaValues,<wbr>M128i</a></li> + + </ul> + + </ul> +</li> + +</ul> + + </div> + <div class="nine columns" id="content"> + <div id="tocRoot"></div> + + <p class="module-desc"></p> + <div class="section" id="12"> +<h1><a class="toc-backref" href="#12">Procs</a></h1> +<dl class="item"> +<a id="packAlphaValues,M128i"></a> +<dt><pre><span class="Keyword">proc</span> <a href="#packAlphaValues%2CM128i"><span class="Identifier">packAlphaValues</span></a><span class="Other">(</span><span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">M128i</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">M128i</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt> +<dd> + +Shuffle the alpha values for these 4 colors to the first 4 bytes + +</dd> +<a id="unpackAlphaValues,M128i"></a> +<dt><pre><span class="Keyword">proc</span> <a href="#unpackAlphaValues%2CM128i"><span class="Identifier">unpackAlphaValues</span></a><span class="Other">(</span><span class="Identifier">v</span><span class="Other">:</span> <span class="Identifier">M128i</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">M128i</span> <span><span class="Other">{</span><span class="Other pragmadots">...</span><span class="Other">}</span></span><span class="pragmawrap"><span class="Other">{.</span><span class="pragma"><span class="Identifier">inline</span><span class="Other">,</span> <span class="Identifier">raises</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span><span class="Other">,</span> <span class="Identifier">tags</span><span class="Other">:</span> <span class="Other">[</span><span class="Other">]</span></span><span class="Other">.}</span></span></pre></dt> +<dd> + +Unpack the first 32 bits into 4 rgba(0, 0, 0, value) + +</dd> + +</dl></div> + + </div> +</div> + + <div class="row"> + <div class="twelve-columns footer"> + <span class="nim-sprite"></span> + <br/> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> + </div> + </div> + </div> +</div> + +</body> +</html> diff --git a/docs/pixie/internal.idx b/docs/pixie/internal.idx new file mode 100644 index 0000000..38f86be --- /dev/null +++ b/docs/pixie/internal.idx @@ -0,0 +1,2 @@ +packAlphaValues pixie/internal.html#packAlphaValues,M128i internal: packAlphaValues(v: M128i): M128i +unpackAlphaValues pixie/internal.html#unpackAlphaValues,M128i internal: unpackAlphaValues(v: M128i): M128i diff --git a/docs/pixie/masks.html b/docs/pixie/masks.html index 8a2546f..3310c50 100644 --- a/docs/pixie/masks.html +++ b/docs/pixie/masks.html @@ -354,7 +354,7 @@ A value of 0 stays 0. Anything else turns into 255. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:08 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:15:59 UTC</small> </div> </div> </div> diff --git a/docs/pixie/paints.html b/docs/pixie/paints.html index dca9d0b..3bbc62c 100644 --- a/docs/pixie/paints.html +++ b/docs/pixie/paints.html @@ -243,7 +243,7 @@ Angular gradient. <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:09 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:16:00 UTC</small> </div> </div> </div> diff --git a/docs/pixie/paths.html b/docs/pixie/paths.html index b1685f3..5220dc4 100644 --- a/docs/pixie/paths.html +++ b/docs/pixie/paths.html @@ -289,7 +289,7 @@ function main() { <div class="section" id="6"> <h1><a class="toc-backref" href="#6">Imports</a></h1> <dl class="item"> -<a class="reference external" href="blends.html">blends</a>, <a class="reference external" href="common.html">common</a>, <a class="reference external" href="images.html">images</a>, <a class="reference external" href="masks.html">masks</a>, <a class="reference external" href="paints.html">paints</a> +<a class="reference external" href="blends.html">blends</a>, <a class="reference external" href="common.html">common</a>, <a class="reference external" href="images.html">images</a>, <a class="reference external" href="masks.html">masks</a>, <a class="reference external" href="paints.html">paints</a>, <a class="reference external" href="internal.html">internal</a> </dl></div> <div class="section" id="7"> <h1><a class="toc-backref" href="#7">Types</a></h1> @@ -662,7 +662,7 @@ Return elements in pairs: (1st, 2nd), (2nd, 3rd) ... (n - 1, last). <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:09 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:16:00 UTC</small> </div> </div> </div> diff --git a/docs/theindex.html b/docs/theindex.html index 2bfc9bf..aac6e02 100644 --- a/docs/theindex.html +++ b/docs/theindex.html @@ -63,7 +63,7 @@ function main() { <div class="document" id="documentId"> <div class="container"> <h1 class="title">Index</h1> - Modules: <a href="pixie.html">pixie</a>, <a href="pixie/blends.html">pixie/blends</a>, <a href="pixie/common.html">pixie/common</a>, <a href="pixie/fileformats/bmp.html">pixie/fileformats/bmp</a>, <a href="pixie/fileformats/jpg.html">pixie/fileformats/jpg</a>, <a href="pixie/fileformats/png.html">pixie/fileformats/png</a>, <a href="pixie/fileformats/svg.html">pixie/fileformats/svg</a>, <a href="pixie/images.html">pixie/images</a>, <a href="pixie/masks.html">pixie/masks</a>, <a href="pixie/paints.html">pixie/paints</a>, <a href="pixie/paths.html">pixie/paths</a>.<br/><p /><h2>API symbols</h2> + Modules: <a href="pixie.html">pixie</a>, <a href="pixie/blends.html">pixie/blends</a>, <a href="pixie/common.html">pixie/common</a>, <a href="pixie/fileformats/bmp.html">pixie/fileformats/bmp</a>, <a href="pixie/fileformats/jpg.html">pixie/fileformats/jpg</a>, <a href="pixie/fileformats/png.html">pixie/fileformats/png</a>, <a href="pixie/fileformats/svg.html">pixie/fileformats/svg</a>, <a href="pixie/images.html">pixie/images</a>, <a href="pixie/internal.html">pixie/internal</a>, <a href="pixie/masks.html">pixie/masks</a>, <a href="pixie/paints.html">pixie/paints</a>, <a href="pixie/paths.html">pixie/paths</a>.<br/><p /><h2>API symbols</h2> <dl><dt><a name="%60%24%60" href="#%60%24%60"><span>`$`:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" data-doc-search-tag="images: `$`(image: Image): string" href="pixie/images.html#%24%2CImage">images: `$`(image: Image): string</a></li> @@ -598,7 +598,7 @@ function main() { </ul></dd> <dt><a name="packAlphaValues" href="#packAlphaValues"><span>packAlphaValues:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" - data-doc-search-tag="blends: packAlphaValues(v: M128i): M128i" href="pixie/blends.html#packAlphaValues%2CM128i">blends: packAlphaValues(v: M128i): M128i</a></li> + data-doc-search-tag="internal: packAlphaValues(v: M128i): M128i" href="pixie/internal.html#packAlphaValues%2CM128i">internal: packAlphaValues(v: M128i): M128i</a></li> </ul></dd> <dt><a name="Paint" href="#Paint"><span>Paint:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" @@ -884,7 +884,7 @@ function main() { </ul></dd> <dt><a name="unpackAlphaValues" href="#unpackAlphaValues"><span>unpackAlphaValues:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" - data-doc-search-tag="blends: unpackAlphaValues(v: M128i): M128i" href="pixie/blends.html#unpackAlphaValues%2CM128i">blends: unpackAlphaValues(v: M128i): M128i</a></li> + data-doc-search-tag="internal: unpackAlphaValues(v: M128i): M128i" href="pixie/internal.html#unpackAlphaValues%2CM128i">internal: unpackAlphaValues(v: M128i): M128i</a></li> </ul></dd> <dt><a name="VLine" href="#VLine"><span>VLine:</span></a></dt><dd><ul class="simple"> <li><a class="reference external" @@ -923,7 +923,7 @@ function main() { <div class="twelve-columns footer"> <span class="nim-sprite"></span> <br/> - <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 17:48:09 UTC</small> + <small style="color: var(--hint);">Made with Nim. Generated: 2021-02-25 18:16:00 UTC</small> </div> </div> </div>