[][src]Struct freetype::bitmap::Bitmap

pub struct Bitmap { /* fields omitted */ }

Methods

impl Bitmap
[src]

pub unsafe fn from_raw(raw: *const FT_Bitmap) -> Self
[src]

pub fn buffer(&self) -> &[u8]
[src]

A typeless pointer to the bitmap buffer. This value should be aligned on 32-bit boundaries in most cases.

pub fn width(&self) -> i32
[src]

The number of pixels in bitmap row.

pub fn rows(&self) -> i32
[src]

The number of bitmap rows.

pub fn raw(&self) -> &FT_Bitmap
[src]

pub fn pixel_mode(&self) -> FtResult<PixelMode>
[src]

The pixel mode, i.e., how pixel bits are stored. See PixelMode for possible values.

pub fn pitch(&self) -> i32
[src]

The pitch's absolute value is the number of bytes taken by one bitmap row, including padding. However, the pitch is positive when the bitmap has a ‘down’ flow, and negative when it has an ‘up’ flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row.

Note that ‘padding’ means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value. For the B/W rasterizer, ‘pitch’ is always an even number.

To change the pitch of a bitmap (say, to make it a multiple of 4), use FT_Bitmap_Convert. Alternatively, you might use callback functions to directly render to the application's surface; see the file ‘example2.cpp’ in the tutorial for a demonstration.

Auto Trait Implementations

impl !Send for Bitmap

impl !Sync for Bitmap

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]