ExPdfium.Bitmap (ExPdfium v0.3.1)

Copy Markdown View Source

A raw pixel bitmap — produced by ExPdfium.render_page/3 (a rendered page) or ExPdfium.image_data/3 (a decoded embedded image).

data is a raw pixel buffer. format records the byte order and channel count so consumers can interpret it: :rgba/:bgra (4 channels), :bgrx (4, with a padding byte), :bgr (3), or :gray (1). render_page/3 yields :rgba (default) or :bgra; an image decoded with image_data/3 keeps its native pdfium format. With width, height, and stride (bytes per row), the buffer feeds directly into e.g. Vix.Vips.Image.new_from_binary/5.

Summary

Types

format()

@type format() :: :rgba | :bgra | :bgrx | :bgr | :gray

t()

@type t() :: %ExPdfium.Bitmap{
  data: binary(),
  format: format(),
  height: non_neg_integer(),
  stride: non_neg_integer(),
  width: non_neg_integer()
}