Struct freetype::bitmap::Bitmap

source ·
pub struct Bitmap { /* private fields */ }

Implementations§

source§

impl Bitmap

source

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

source

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

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

source

pub fn width(&self) -> i32

The number of pixels in bitmap row.

source

pub fn rows(&self) -> i32

The number of bitmap rows.

source

pub fn raw(&self) -> &FT_Bitmap

source

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

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

source

pub fn pitch(&self) -> i32

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 RefUnwindSafe for Bitmap

§

impl !Send for Bitmap

§

impl !Sync for Bitmap

§

impl Unpin for Bitmap

§

impl UnwindSafe for Bitmap

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.