Defines | Functions
bitmap.h File Reference
#include <string.h>
#include <stdlib.h>
#include "potracelib.h"
Include dependency graph for bitmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BM_ALLBITS   (~(potrace_word)0)
#define BM_CLR(bm, x, y)   (bm_safe(bm, x, y) ? BM_UCLR(bm, x, y) : 0)
#define BM_GET(bm, x, y)   (bm_safe(bm, x, y) ? BM_UGET(bm, x, y) : 0)
#define BM_HIBIT   (((potrace_word)1)<<(BM_WORDBITS-1))
#define bm_index(bm, x, y)   (&bm_scanline(bm, y)[(x)/BM_WORDBITS])
#define BM_INV(bm, x, y)   (bm_safe(bm, x, y) ? BM_UINV(bm, x, y) : 0)
#define bm_mask(x)   (BM_HIBIT >> ((x) & (BM_WORDBITS-1)))
#define BM_PUT(bm, x, y, b)   (bm_safe(bm, x, y) ? BM_UPUT(bm, x, y, b) : 0)
#define bm_range(x, a)   ((int)(x) >= 0 && (int)(x) < (a))
#define bm_safe(bm, x, y)   (bm_range(x, (bm)->w) && bm_range(y, (bm)->h))
#define bm_scanline(bm, y)   ((bm)->map + (y)*(bm)->dy)
#define BM_SET(bm, x, y)   (bm_safe(bm, x, y) ? BM_USET(bm, x, y) : 0)
#define BM_UCLR(bm, x, y)   (*bm_index(bm, x, y) &= ~bm_mask(x))
#define BM_UGET(bm, x, y)   ((*bm_index(bm, x, y) & bm_mask(x)) != 0)
#define BM_UINV(bm, x, y)   (*bm_index(bm, x, y) ^= bm_mask(x))
#define BM_UPUT(bm, x, y, b)   ((b) ? BM_USET(bm, x, y) : BM_UCLR(bm, x, y))
#define BM_USET(bm, x, y)   (*bm_index(bm, x, y) |= bm_mask(x))
#define BM_WORDBITS   (8*BM_WORDSIZE)
#define BM_WORDSIZE   ((int)sizeof(potrace_word))

Functions

static void bm_clear (potrace_bitmap_t *bm, int c)
static potrace_bitmap_tbm_dup (const potrace_bitmap_t *bm)
static void bm_free (potrace_bitmap_t *bm)
static void bm_invert (potrace_bitmap_t *bm)
static potrace_bitmap_tbm_new (int w, int h)

Define Documentation

#define BM_ALLBITS   (~(potrace_word)0)

Definition at line 29 of file bitmap.h.

#define BM_CLR (   bm,
  x,
 
)    (bm_safe(bm, x, y) ? BM_UCLR(bm, x, y) : 0)

Definition at line 46 of file bitmap.h.

#define BM_GET (   bm,
  x,
 
)    (bm_safe(bm, x, y) ? BM_UGET(bm, x, y) : 0)

Definition at line 44 of file bitmap.h.

#define BM_HIBIT   (((potrace_word)1)<<(BM_WORDBITS-1))

Definition at line 28 of file bitmap.h.

#define bm_index (   bm,
  x,
 
)    (&bm_scanline(bm, y)[(x)/BM_WORDBITS])

Definition at line 35 of file bitmap.h.

#define BM_INV (   bm,
  x,
 
)    (bm_safe(bm, x, y) ? BM_UINV(bm, x, y) : 0)

Definition at line 47 of file bitmap.h.

#define bm_mask (   x)    (BM_HIBIT >> ((x) & (BM_WORDBITS-1)))

Definition at line 36 of file bitmap.h.

#define BM_PUT (   bm,
  x,
  y,
 
)    (bm_safe(bm, x, y) ? BM_UPUT(bm, x, y, b) : 0)

Definition at line 48 of file bitmap.h.

#define bm_range (   x,
 
)    ((int)(x) >= 0 && (int)(x) < (a))

Definition at line 37 of file bitmap.h.

#define bm_safe (   bm,
  x,
 
)    (bm_range(x, (bm)->w) && bm_range(y, (bm)->h))

Definition at line 38 of file bitmap.h.

#define bm_scanline (   bm,
 
)    ((bm)->map + (y)*(bm)->dy)

Definition at line 34 of file bitmap.h.

#define BM_SET (   bm,
  x,
 
)    (bm_safe(bm, x, y) ? BM_USET(bm, x, y) : 0)

Definition at line 45 of file bitmap.h.

#define BM_UCLR (   bm,
  x,
 
)    (*bm_index(bm, x, y) &= ~bm_mask(x))

Definition at line 41 of file bitmap.h.

#define BM_UGET (   bm,
  x,
 
)    ((*bm_index(bm, x, y) & bm_mask(x)) != 0)

Definition at line 39 of file bitmap.h.

#define BM_UINV (   bm,
  x,
 
)    (*bm_index(bm, x, y) ^= bm_mask(x))

Definition at line 42 of file bitmap.h.

#define BM_UPUT (   bm,
  x,
  y,
 
)    ((b) ? BM_USET(bm, x, y) : BM_UCLR(bm, x, y))

Definition at line 43 of file bitmap.h.

#define BM_USET (   bm,
  x,
 
)    (*bm_index(bm, x, y) |= bm_mask(x))

Definition at line 40 of file bitmap.h.

#define BM_WORDBITS   (8*BM_WORDSIZE)

Definition at line 27 of file bitmap.h.

#define BM_WORDSIZE   ((int)sizeof(potrace_word))

Definition at line 26 of file bitmap.h.


Function Documentation

static void bm_clear ( potrace_bitmap_t bm,
int  c 
) [inline, static]

Definition at line 79 of file bitmap.h.

static potrace_bitmap_t* bm_dup ( const potrace_bitmap_t bm) [inline, static]

Definition at line 84 of file bitmap.h.

static void bm_free ( potrace_bitmap_t bm) [inline, static]

Definition at line 51 of file bitmap.h.

static void bm_invert ( potrace_bitmap_t bm) [inline, static]

Definition at line 94 of file bitmap.h.

static potrace_bitmap_t* bm_new ( int  w,
int  h 
) [inline, static]

Definition at line 59 of file bitmap.h.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines


portrait_painter
Author(s): Niklas Meinzer, Ina Baumgarten
autogenerated on Wed Dec 26 2012 16:00:43