SkMask Class Reference

#include <SkMask.h>

Collaboration diagram for SkMask:
Collaboration graph
[legend]

List of all members.

Public Types

enum  Format {
  kBW_Format, kA8_Format, k3D_Format, kHorizontalLCD_Format,
  kVerticalLCD_Format
}
enum  { kCountMaskFormats = kVerticalLCD_Format + 1 }
enum  CreateMode { kJustComputeBounds_CreateMode, kJustRenderImage_CreateMode, kComputeBoundsAndRenderImage_CreateMode }

Public Member Functions

bool isEmpty () const
size_t computeImageSize () const
size_t computeTotalImageSize () const
uint8_t * getAddr1 (int x, int y) const
uint8_t * getAddr (int x, int y) const
const uint32_t * getAddrLCD (int x, int y) const
unsigned rowWordsLCD () const

Static Public Member Functions

static uint8_t * AllocImage (size_t bytes)
static void FreeImage (void *image)
static bool FormatIsLCD (Format fm)

Public Attributes

uint8_t * fImage
SkIRect fBounds
uint32_t fRowBytes
Format fFormat

Detailed Description

SkMask is used to describe alpha bitmaps, either 1bit, 8bit, or the 3-channel 3D format. These are passed to SkMaskFilter objects.

Definition at line 26 of file SkMask.h.


Member Enumeration Documentation

anonymous enum
Enumerator:
kCountMaskFormats 

Definition at line 51 of file SkMask.h.

Enumerator:
kJustComputeBounds_CreateMode 

compute bounds and return

kJustRenderImage_CreateMode 

render into preallocate mask

kComputeBoundsAndRenderImage_CreateMode 

compute bounds, alloc image and render into it

Definition at line 123 of file SkMask.h.

Enumerator:
kBW_Format 

1bit per pixel mask (e.g. monochrome)

kA8_Format 

8bits per pixel mask (e.g. antialiasing)

k3D_Format 

3 8bit per pixl planes: alpha, mul, add

kHorizontalLCD_Format 

4 bytes/pixel: a/r/g/b

kVerticalLCD_Format 

4 bytes/pixel: a/r/g/b

Definition at line 27 of file SkMask.h.


Member Function Documentation

static uint8_t* SkMask::AllocImage ( size_t  bytes  )  [static]
size_t SkMask::computeImageSize (  )  const

Return the byte size of the mask, assuming only 1 plane. Does not account for k3D_Format. For that, use computeTotalImageSize(). If there is an overflow of 32bits, then returns 0.

size_t SkMask::computeTotalImageSize (  )  const

Return the byte size of the mask, taking into account any extra planes (e.g. k3D_Format). If there is an overflow of 32bits, then returns 0.

static bool SkMask::FormatIsLCD ( Format  fm  )  [inline, static]

Definition at line 129 of file SkMask.h.

static void SkMask::FreeImage ( void *  image  )  [static]
uint8_t* SkMask::getAddr ( int  x,
int  y 
) const [inline]

Returns the address of the specified byte. Asserts that the mask is kA8_Format, and that x,y are in range. x,y are in the same coordiate space as fBounds.

Definition at line 91 of file SkMask.h.

uint8_t* SkMask::getAddr1 ( int  x,
int  y 
) const [inline]

Returns the address of the byte that holds the specified bit. Asserts that the mask is kBW_Format, and that x,y are in range. x,y are in the same coordiate space as fBounds.

Definition at line 80 of file SkMask.h.

const uint32_t* SkMask::getAddrLCD ( int  x,
int  y 
) const [inline]

Return an address into the 32-bit plane of an LCD or VerticalLCD mask for the given position.

Definition at line 101 of file SkMask.h.

bool SkMask::isEmpty (  )  const [inline]

Returns true if the mask is empty: i.e. it has an empty bounds.

Definition at line 62 of file SkMask.h.

unsigned SkMask::rowWordsLCD (  )  const [inline]

Return the number of 32-bit words in a row of the 32-bit plane of an LCD or VerticalLCD mask.

Definition at line 112 of file SkMask.h.


Member Data Documentation

Definition at line 56 of file SkMask.h.

Definition at line 58 of file SkMask.h.

uint8_t* SkMask::fImage

Definition at line 55 of file SkMask.h.

Definition at line 57 of file SkMask.h.


The documentation for this class was generated from the following file:

Generated on Tue Oct 20 11:03:42 2009 for Skia by  doxygen 1.6.1