API referencestd/image

std/image/bmp

Public declarations, types, methods, and source contracts for std/image/bmp.

On this page

Library guide · API index and notation

This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.

import "std/image/bmp"

Names used in signatures

Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.

Alias Package Source file
binary std/image/shared/binary bmp.dodo
color std/image/color bmp.dodo
meta std/image/meta bmp.dodo
pixels std/image/pixels bmp.dodo
sink std/image/sink bmp.dodo

matches

Function · Source

pub fn matches(data: &[u8]) -> bool

info

Function · Source

pub fn info(data: &[u8]) -> pixels.Header!pixels.Error

metadata

Function · Source

A V5 header’s embedded ICC profile, raw.

pub fn metadata(data: &[u8]) -> meta.Metadata!pixels.Error

scratch_size

Function · Source

The decoder needs no scratch.

pub fn scratch_size(data: &[u8]) -> usize!pixels.Error

decode

Function · Source

pub fn decode<S: sink.Sink>(data: &[u8], output: &mut S, scratch: &mut[u8]) -> void!pixels.Error

EncodeOptions

Struct · Source

pub struct EncodeOptions {
    // Keep the source's alpha channel: write 32-bit pixels with a V5 header
    // and an alpha mask. Sources without alpha always give 24-bit files.
    pub alpha: bool
}

EncodeOptions.new

Function · Source

pub fn new() -> EncodeOptions

max_encoded_size

Function · Source

The exact size encode writes.

pub fn max_encoded_size(width: u32, height: u32, layout: &pixels.Layout, options: &EncodeOptions) -> usize!pixels.Error

encode_scratch_size

Function · Source

pub fn encode_scratch_size(width: u32, height: u32, layout: &pixels.Layout, options: &EncodeOptions) -> usize!pixels.Error

encode

Function · Source

pub fn encode(source: &pixels.View, options: &EncodeOptions, output: &mut[u8], scratch: &mut[u8]) -> usize!pixels.Error

encode_from

Function · Source

Write source as an uncompressed bottom-up BMP and return the byte count, max_encoded_size(…).

pub fn encode_from<S: sink.Source>(source: &S, options: &EncodeOptions, output: &mut[u8], scratch: &mut[u8]) -> usize!pixels.Error

Search every guide, reference page, and API declaration.