Skip to content
FutureBlitz

    Install

    Import std.image.bitmap

    std.image.bitmap

    The formats of plain bitmaps: BMP and TGA, as stb_image reads and stb_image_write writes them, and QOI, the Quite OK Image format, which the runtime reads and writes itself. Each one keeps every pixel as it is, alpha too.

    std/image/bitmap.fb

    Types

    Bmp struct

    Public Struct Bmp

    What reads and writes BMP images, in its Static Methods.

    std/image/bitmap.fb, line 10

    • @PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOError static method #

      The image in data, a BMP of 1, 4, 8, 16, 24, or 32 bits a pixel. Throws an IOError of INVALID_DATA when the data isn't a BMP or is broken, and OTHER when it's run-length encoded, which stb_image doesn't read, or the image has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: Image): UInt8[] static method #

      The BMP of the image, 32 bits a pixel, with its alpha. Panics when it has no pixels.

    Tga struct

    Public Struct Tga

    What reads and writes TGA images, in its Static Methods.

    std/image/bitmap.fb, line 38

    • @PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOError static method #

      The image in data, a TGA of a palette, gray, or colors, run-length encoded or not. Throws an IOError of INVALID_DATA when the data isn't a TGA or is broken, and OTHER when the image has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: Image): UInt8[] static method #

      The TGA of the image, 32 bits a pixel, with its alpha, run-length encoded. Panics when it has no pixels or a side longer than 65535.

    Qoi struct

    Public Struct Qoi

    What reads and writes QOI images, in its Static Methods.

    std/image/bitmap.fb, line 66

    • @PanicsAtCaller Public Static Method Decode(data: UInt8[], limit: Int = MOST_PIXELS): Image Throws IOError static method #

      The image in data, a QOI of 3 or 4 channels. Throws an IOError of INVALID_DATA when the data isn't a QOI or is broken, UNEXPECTED_END when it ends before its pixels do, and OTHER when the image has more pixels than limit. Panics when the limit is negative.

    • @PanicsAtCaller Public Static Method Encode(image: Image): UInt8[] static method #

      The QOI of the image, 4 channels, in sRGB. Panics when it has no pixels.

    Report an issue with this page or with FutureBlitz on GitHub.