image.bend relies on unsafe/foreign
raw source on the hub · import gralha-image@0.1.0.1/image.bend as MImage
Premultiplied colors and quadtree pixel buffers shared by the decoders and the renderer.
2 imports
import Base import gralha-text-scan@0.1.0.1/scan.bend as U
Types
type Color source · line 5 · raw
Data
Color@r:F32 -> @g:F32 -> @b:F32 -> @a:F32 -> Color
type Pixels source · line 16 · raw
Data
Filter and embedded-image buffers retain premultiplied floating-point channels. Uniform tiles share a single color instead of allocating one value per pixel.
Flat@color:Color -> Pixels
Quad@tl:Pixels -> @tr:Pixels -> @bl:Pixels -> @br:Pixels -> Pixels
type Picture source · line 32 · raw
Data
A decoded image: a square quadtree of premultiplied colors covering width by height.
Picture@width:U32 -> @height:U32 -> @depth:Nat -> @pixels:Pixels -> Picture
Definitions
def clear source · line 8 · raw
Color
def rgba source · line 11 · raw
@r:F32 -> @g:F32 -> @b:F32 -> @+a:F32 -> Color
def color.same source · line 20 · raw
@a:Color -> @b:Color -> Bool
def pixels.join source · line 25 · raw
@+a:Pixels -> @+b:Pixels -> @+c:Pixels -> @+d:Pixels -> Pixels
def picture.blank source · line 35 · raw
Picture
Unsafe
unsafe pixels.get source · line 39 · raw
@xs:Pixels -> @+size:U32 -> @+x:U32 -> @+y:U32 -> Color
unsafe picture.depth source · line 47 · raw
@+size:U32 -> @+side:U32 -> @+depth:Nat -> Nat
unsafe pixels.set source · line 51 · raw
@+pixels:Pixels -> @+depth:Nat -> @+x:U32 -> @+y:U32 -> @+col:Color -> Pixels