module

Image

Common foundation types for Crystal's image ecosystem.

Constants

VERSION = {{ (`shards version \"/tmp/tmp.hIJjmo/src/src\"`).chomp.stringify.downcase }}

Class methods

gray(width : Int32, height : Int32) : Gray8

Creates a new Gray8 image (8-bit grayscale)

Source
gray16(width : Int32, height : Int32) : Gray16

Creates a new Gray16 image (16-bit grayscale)

Source
nrgba(width : Int32, height : Int32) : NRGBA8

Creates a new NRGBA8 image (8-bit RGBA with non-premultiplied alpha)

Source
nrgba16(width : Int32, height : Int32) : NRGBA16

Creates a new NRGBA16 image (16-bit RGBA with non-premultiplied alpha)

Source
point(x : Int32, y : Int32) : Point

Creates a point from x and y coordinates

Source
rect(x0 : Int32, y0 : Int32, x1 : Int32, y1 : Int32) : Rectangle

Creates a rectangle from coordinates, automatically ensuring min < max

Source
rgba(width : Int32, height : Int32) : RGBA8

Creates a new RGBA8 image (8-bit RGBA with premultiplied alpha)

Source
rgba16(width : Int32, height : Int32) : RGBA16

Creates a new RGBA16 image (16-bit RGBA with premultiplied alpha)

Source
uniform(pixel : T, width : Int32, height : Int32) : Uniform(T) forall T

Creates a new Uniform image with a solid color (memory-efficient, O(1) storage)

Source

Nested types