navit  0.5.3-trunk
raster.h File Reference
#include <stdint.h>
#include "SDL.h"
#include "point.h"

Go to the source code of this file.

Functions

void raster_rect (SDL_Surface *s, int16_t x, int16_t y, int16_t w, int16_t h, uint32_t col)
 
void raster_line (SDL_Surface *s, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t col)
 
void raster_circle (SDL_Surface *s, int16_t x, int16_t y, int16_t r, uint32_t col)
 
void raster_polygon (SDL_Surface *s, int16_t n, int16_t *vx, int16_t *vy, uint32_t col)
 
void raster_polygon_with_holes (SDL_Surface *s, struct point *p, int count, int hole_count, int *ccount, struct point **holes, uint32_t col)
 render filled polygon with holes by raycasting along the y axis More...
 
void raster_aaline (SDL_Surface *s, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint32_t col)
 
void raster_aacircle (SDL_Surface *s, int16_t x, int16_t y, int16_t r, uint32_t col)
 
void raster_aapolygon (SDL_Surface *s, int16_t n, int16_t *vx, int16_t *vy, uint32_t col)
 
void raster_aapolygon_with_holes (SDL_Surface *s, struct point *p, int count, int hole_count, int *ccount, struct point **holes, uint32_t col)
 render filled polygon with holes by raycasting along the y axis More...
 

Function Documentation

◆ raster_aacircle()

void raster_aacircle ( SDL_Surface *  s,
int16_t  x,
int16_t  y,
int16_t  r,
uint32_t  col 
)

References raster_AAFilledEllipse().

Referenced by draw_circle().

◆ raster_aaline()

void raster_aaline ( SDL_Surface *  s,
int16_t  x1,
int16_t  y1,
int16_t  x2,
int16_t  y2,
uint32_t  col 
)

References raster_aalineColorInt().

Referenced by draw_lines().

◆ raster_aapolygon()

void raster_aapolygon ( SDL_Surface *  s,
int16_t  n,
int16_t *  vx,
int16_t *  vy,
uint32_t  col 
)

◆ raster_aapolygon_with_holes()

void raster_aapolygon_with_holes ( SDL_Surface *  s,
struct point p,
int  count,
int  hole_count,
int *  ccount,
struct point **  holes,
uint32_t  col 
)

render filled polygon with holes by raycasting along the y axis

This function renders a filled polygon that can have holes by SDL primitive graphic functions by raycasting along the y axis. This works basically the same as for complex polygons. Only difference is the "holes" are individual polygon loops not connected to the outer loop. FIXME: This draws well as long as the "hole" does not intersect with the outer polygon. However such multipolygons are seen a mapping error in OSM and therefore the rendering err may even help in detecting them. But this could be fixed by never starting a line on a vertex that came from a hole intersection.

Parameters
sSDL surface to draw on
pArray of points containing the outer polygon
countNumber of points in outer polygon
hole_countNumber of hole polygons
ccountnumber of points per hole polygon @oaram holes array of point arrays. One for each "hole"
colColor to draw this.

References p, raster_aalineColorInt(), raster_polygon_with_holes(), point::x, and point::y.

Referenced by draw_polygon_with_holes().

◆ raster_circle()

void raster_circle ( SDL_Surface *  s,
int16_t  x,
int16_t  y,
int16_t  r,
uint32_t  col 
)

References raster_hline(), and raster_PutPixel().

Referenced by draw_circle().

◆ raster_line()

void raster_line ( SDL_Surface *  s,
int16_t  x1,
int16_t  y1,
int16_t  x2,
int16_t  y2,
uint32_t  col 
)

◆ raster_polygon()

void raster_polygon ( SDL_Surface *  s,
int16_t  n,
int16_t *  vx,
int16_t *  vy,
uint32_t  col 
)

◆ raster_polygon_with_holes()

void raster_polygon_with_holes ( SDL_Surface *  s,
struct point p,
int  count,
int  hole_count,
int *  ccount,
struct point **  holes,
uint32_t  col 
)

render filled polygon with holes by raycasting along the y axis

This function renders a filled polygon that can have holes by SDL primitive graphic functions by raycasting along the y axis. This works basically the same as for complex polygons. Only difference is the "holes" are individual polygon loops not connected to the outer loop. FIXME: This draws well as long as the "hole" does not intersect with the outer polygon. However such multipolygons are seen a mapping error in OSM and therefore the rendering err may even help in detecting them. But this could be fixed by never starting a line on a vertex that came from a hole intersection.

Parameters
sSDL surface to draw on
pArray of points containing the outer polygon
countNumber of points in outer polygon
hole_countNumber of hole polygons
ccountnumber of points per hole polygon @oaram holes array of point arrays. One for each "hole"
colColor to draw this.

References gfxPrimitivesCompareInt(), p, raster_hline(), point::x, and point::y.

Referenced by draw_polygon_with_holes(), and raster_aapolygon_with_holes().

◆ raster_rect()

void raster_rect ( SDL_Surface *  s,
int16_t  x,
int16_t  y,
int16_t  w,
int16_t  h,
uint32_t  col 
)

References raster_rect_inline.

Referenced by draw_rectangle().