pdf_bitmap_buffer() returns a raw vector of length
stride * height containing the bitmap's pixel data exactly as
PDFium stores it. pdf_bitmap_set_buffer() writes a raw vector
of the same length into the bitmap (length is checked).
Details
The byte order depends on the format reported by
pdf_bitmap_info(). For BGRA the i'th pixel at row r, col c
is buf[stride * r + 4 * c + 1:4] == c(B, G, R, A).