Defines | Functions
potracelib_demo.c File Reference
#include <stdio.h>
#include <string.h>
#include <errno.h>
#include <stdlib.h>
#include "potracelib.h"
Include dependency graph for potracelib_demo.c:

Go to the source code of this file.

Defines

#define BM_HIBIT   (((potrace_word)1)<<(BM_WORDBITS-1))
#define bm_index(bm, x, y)   (&bm_scanline(bm, y)[(x)/BM_WORDBITS])
#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_UCLR(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))
#define HEIGHT   250
#define WIDTH   250

Functions

static void bm_free (potrace_bitmap_t *bm)
static potrace_bitmap_tbm_new (int w, int h)
int main ()

Define Documentation

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

Definition at line 23 of file potracelib_demo.c.

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

Definition at line 25 of file potracelib_demo.c.

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

Definition at line 26 of file potracelib_demo.c.

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

Definition at line 32 of file potracelib_demo.c.

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

Definition at line 27 of file potracelib_demo.c.

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

Definition at line 28 of file potracelib_demo.c.

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

Definition at line 24 of file potracelib_demo.c.

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

Definition at line 30 of file potracelib_demo.c.

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

Definition at line 31 of file potracelib_demo.c.

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

Definition at line 29 of file potracelib_demo.c.

#define BM_WORDBITS   (8*BM_WORDSIZE)

Definition at line 22 of file potracelib_demo.c.

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

Definition at line 21 of file potracelib_demo.c.

#define HEIGHT   250

Definition at line 15 of file potracelib_demo.c.

#define WIDTH   250

Definition at line 14 of file potracelib_demo.c.


Function Documentation

static void bm_free ( potrace_bitmap_t bm) [static]

Definition at line 55 of file potracelib_demo.c.

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

Definition at line 35 of file potracelib_demo.c.

int main ( )

Definition at line 65 of file potracelib_demo.c.

 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