Class FT2::Bitmap
In: ./ft2.c
Parent: Object
Methods
buffer    initialize    num_grays    palette    palette_mode    pitch    pixel_mode    rows    width   
Public Class methods
initialize(VALUE self)

Constructor for FT2::Bitmap.

This method is currently empty. You should never call this method directly unless you're instantiating a derived class (ie, you know what you're doing).

Public Instance methods
rows(VALUE self)

Return the number of rows in a FT2::Bitmap object.

Examples:

  rows = bitmap.rows
width(VALUE self)

Return the width of an FT2::Bitmap object.

Examples:

  width = bitmap.width
pitch(VALUE self)

Return the pitch (bytes per row) of an FT2::Bitmap object.

Return the pitch (bytes per row, including alignment padding) of an FT2::Bitmap object.

Examples:

  width = bitmap.width
buffer(VALUE self)

Return the buffer (e.g. raw pixel data) of an FT2::Bitmap object.

Examples:

  # return the rendered pixels as a binary string
  buffer = bitmap.buffer

  # assume a render method called render_font(buffer, width, height)
  render_font(bitmap.buffer, bitmap.width, bitmap.rows)
num_grays(VALUE self)

Return the number of grays in an FT2::Bitmap object.

Note:

  Only used if Ft2::Bitmap#pixel_mode is FT2::PixelMode::GRAYS.

Examples:

  depth = bitmap.num_grays
pixel_mode(VALUE self)

Return the pixel mode (e.g. bit depth) of an FT2::Bitmap object.

Note:

  Always returns one of the values avaiable in FT2::PixelMode (for a
  full list, try the following code: "p FT2::PixelMode.constants.sort")

Examples:

  case bitmap.pixel_mode
  when FT2::PixelMode::RGB32
    puts "wow that's a lot of colors!"
  when FT2::PixelMode::MONO
    puts "time to get a better monitor..."
  end
palette_mode(VALUE self)

Return the palette mode of an FT2::Bitmap object.

Note:

  Always returns one of the values avaiable in FT2::PaletteMode.

Examples:

  case bitmap.palette_mode
  when FT2::PaletteMode::RGBA
    puts "we have an alpha channel!"
  when FT2::PaletteMode::RGB
    puts "no alpha channel for you"
  end
palette(VALUE self)

Return the palette of an FT2::Bitmap object.

Note:

  Returns a binary string of RGB or RGBA elements (check
  FT2::Bitmap#palette_mode to determine which).

Examples:

  case bitmap.palette_mode
  when FT2::PaletteMode::RGBA
    rgba_palette_string = bitmap.palette
  when FT2::PaletteMode::RGB
    rgb_palette_string = bitmap.palette
  end