Logo Search packages:      
Sourcecode: libcaca version File versions  Download package

line.c File Reference


Detailed Description

Line drawing.

Version:
$Id: line.c 219 2004-01-07 12:45:02Z sam $
Author:
Sam Hocevar <sam@zoy.org> This file contains line and polyline drawing functions, with both thin and thick styles.

Definition in file line.c.

#include "config.h"
#include <stdlib.h>
#include "caca.h"
#include "caca_internals.h"

Go to the source code of this file.

Classes

struct  line

Typedefs

typedef unsigned char uint8_t

Functions

void caca_draw_line (int x1, int y1, int x2, int y2, char c)
 Draw a line on the screen using the given character.
void caca_draw_polyline (int const x[], int const y[], int n, char c)
 Draw a polyline on the screen using the given character and coordinate arrays. The first and last points are not connected, so in order to draw a polygon you need to specify the starting point at the end of the list as well.
void caca_draw_thin_line (int x1, int y1, int x2, int y2)
 Draw a thin line on the screen, using ASCII art.
void caca_draw_thin_polyline (int const x[], int const y[], int n)
 Draw a thin polyline on the screen using the given coordinate arrays and with ASCII art. The first and last points are not connected, so in order to draw a polygon you need to specify the starting point at the end of the list as well.
static uint8_t clip_bits (int x, int y)
 Helper function for clip_line().
static void clip_line (struct line *s)
 Generic Cohen-Sutherland line clipping function.
static void draw_solid_line (struct line *s)
 Solid line drawing function, using Bresenham's mid-point line scan-conversion algorithm.
static void draw_thin_line (struct line *s)
 Thin line drawing function, using Bresenham's mid-point line scan-conversion algorithm and ASCII art graphics.


Generated by  Doxygen 1.6.0   Back to index