|
MHEG5 1.0
DTVKit MHEG5 1.0 API Documentation
|
Dynamic Line-Art utility functions. More...
#include <stdlib.h>#include <stdio.h>#include <string.h>#include "dla_inl.h"#include "glue_memory.h"#include "glue_debug.h"#include "mg_osd.h"#include "mg_api.h"#include "mh5assert.h"Data Structures | |
| struct | point_list_header |
| struct | hline |
| struct | hline_list |
| struct | S_64_BIT |
Macros | |
| #define | ABS(x) ((x) < 0 ? -(x) : (x)) |
| #define | SGN(x) ((x) < 0 ? -1 : 1) |
| #define | MIN(a, b) ((a) < (b) ? (a) : (b)) |
| #define | MAX(a, b) ((a) > (b) ? (a) : (b)) |
| #define | INDEX_FORWARD(index) index = (index + 1) % vertex_list->length; |
| #define | INDEX_BACKWARD(index) index = (index - 1 + vertex_list->length) % vertex_list->length; |
| #define | INDEX_MOVE(index, direction) |
| #define | DEBUG_DLA 0 |
Typedefs | |
| typedef struct point_list_header | S_POINT_LIST_HEADER |
| typedef struct hline | S_HLINE |
| typedef struct hline_list | S_HLINE_LIST |
Functions | |
| void DLA_FUNCTION() | Line (DLA_Surface *canvas, S16BIT x1, S16BIT y1, S16BIT x2, S16BIT y2, U16BIT width, DLAColor colour) |
| Draw a line on the canvas. More... | |
| void DLA_FUNCTION() | Polygon (DLA_Surface *canvas, S_POLYGON poly, U16BIT width, DLAColor fill_colour, DLAColor line_colour) |
| Draw a polygon on the canvas. More... | |
| void DLA_FUNCTION() | Polyline (DLA_Surface *canvas, S_POLYGON poly, U16BIT width, DLAColor colour) |
| Draw a polyline (sequence of connected lines) on the canvas. More... | |
| void DLA_FUNCTION() | Rectangle (DLA_Surface *canvas, S16BIT x1, S16BIT y1, S16BIT x2, S16BIT y2, U16BIT x_lw, U16BIT y_lw, DLAColor fill_colour, DLAColor line_colour) |
| Draw a rectangle on the canvas. More... | |
| void DLA_FUNCTION() | Ellipse (DLA_Surface *canvas, S16BIT x, S16BIT y, U16BIT w, U16BIT h, U16BIT width, DLAColor fill_colour, DLAColor line_colour) |
| Draw an ellipse ("oval") on the canvas. More... | |
| void DLA_FUNCTION() | Arc (DLA_Surface *canvas, S16BIT x, S16BIT y, U16BIT w, U16BIT h, U16BIT start, U16BIT arc, U16BIT width, DLAColor colour) |
| Draw an arc on the canvas. More... | |
| void DLA_FUNCTION() | Sector (DLA_Surface *canvas, S16BIT x, S16BIT y, U16BIT w, U16BIT h, U16BIT start, U16BIT arc, U16BIT width, DLAColor fill_colour, DLAColor line_colour) |
| Draw a sector ("pie slice") on the canvas. More... | |
| void DLA_FUNCTION() | Border (DLA_Surface *canvas, U16BIT x1_bw, U16BIT y1_bw, U16BIT x2_bw, U16BIT y2_bw, DLAColor line_colour) |
| Draw a border around the canvas. More... | |
Dynamic Line-Art utility functions.
| #define ABS | ( | x | ) | ((x) < 0 ? -(x) : (x)) |
| #define DEBUG_DLA 0 |
| #define INDEX_BACKWARD | ( | index | ) | index = (index - 1 + vertex_list->length) % vertex_list->length; |
| #define INDEX_FORWARD | ( | index | ) | index = (index + 1) % vertex_list->length; |
| #define INDEX_MOVE | ( | index, | |
| direction | |||
| ) |
| #define MAX | ( | a, | |
| b | |||
| ) | ((a) > (b) ? (a) : (b)) |
| #define MIN | ( | a, | |
| b | |||
| ) | ((a) < (b) ? (a) : (b)) |
| #define SGN | ( | x | ) | ((x) < 0 ? -1 : 1) |
| typedef struct hline_list S_HLINE_LIST |
| typedef struct point_list_header S_POINT_LIST_HEADER |
| void DLA_FUNCTION() Arc | ( | DLA_Surface * | canvas, |
| S16BIT | x, | ||
| S16BIT | y, | ||
| U16BIT | w, | ||
| U16BIT | h, | ||
| U16BIT | start, | ||
| U16BIT | arc, | ||
| U16BIT | width, | ||
| DLAColor | colour | ||
| ) |
Draw an arc on the canvas.
| S16BIT | x Left position of bounding rect |
| S16BIT | y Top position of bounding rect |
| U16BIT | w Width of bounding rect |
| U16BIT | h Height of bounding rect |
| U16BIT | start Start angle in 64ths of a degree |
| U16BIT | arc Arc angle in 64ths of a degree |
| U16BIT | width Width of ellipse outline |
| DLAColor | colour Colour to use for arc |
| void DLA_FUNCTION() Border | ( | DLA_Surface * | canvas, |
| U16BIT | x1_bw, | ||
| U16BIT | y1_bw, | ||
| U16BIT | x2_bw, | ||
| U16BIT | y2_bw, | ||
| DLAColor | line_colour | ||
| ) |
Draw a border around the canvas.
| U16BIT | x1_bw left horizontal border width |
| U16BIT | y1_bw top vertical border width |
| U16BIT | x2_bw right horizontal border width |
| U16BIT | y2_bw bottom vertical border width |
| DLAColor | line_colour Colour to use for border |
| void DLA_FUNCTION() Ellipse | ( | DLA_Surface * | canvas, |
| S16BIT | x, | ||
| S16BIT | y, | ||
| U16BIT | w, | ||
| U16BIT | h, | ||
| U16BIT | width, | ||
| DLAColor | fill_colour, | ||
| DLAColor | line_colour | ||
| ) |
Draw an ellipse ("oval") on the canvas.
| S16BIT | x Left position of bounding rect |
| S16BIT | y Top position of bounding rect |
| U16BIT | w Width of bounding rect |
| U16BIT | h Height of bounding rect |
| U16BIT | width Width of ellipse outline |
| DLAColor | fill_colour Colour to use for filling |
| DLAColor | line_colour Colour to use for outline |
| void DLA_FUNCTION() Line | ( | DLA_Surface * | canvas, |
| S16BIT | x1, | ||
| S16BIT | y1, | ||
| S16BIT | x2, | ||
| S16BIT | y2, | ||
| U16BIT | width, | ||
| DLAColor | colour | ||
| ) |
Draw a line on the canvas.
| S16BIT | x1 x-coordinate of first point |
| S16BIT | y1 y-coordinate of first point |
| S16BIT | x2 x-coordinate of second point |
| S16BIT | y2 y-coordinate of second point |
| U16BIT | width Width of line in pixels |
| DLAColor | colour Colour for line |
| void DLA_FUNCTION() Polygon | ( | DLA_Surface * | canvas, |
| S_POLYGON | poly, | ||
| U16BIT | width, | ||
| DLAColor | fill_colour, | ||
| DLAColor | line_colour | ||
| ) |
Draw a polygon on the canvas.
| S_POINT | * points List of points |
| U16BIT | num_points Number of points in list |
| U16BIT | width Width of polygon outline |
| DLAColor | fill_colour Colour to use for filling |
| DLAColor | line_colour Colour to use for outline |
| void DLA_FUNCTION() Polyline | ( | DLA_Surface * | canvas, |
| S_POLYGON | poly, | ||
| U16BIT | width, | ||
| DLAColor | colour | ||
| ) |
Draw a polyline (sequence of connected lines) on the canvas.
| S_POINT | * points List of points |
| U16BIT | num_points Number of points in list |
| U16BIT | width Width of lines in polyline |
| DLAColor | colour Colour to use for lines |
| void DLA_FUNCTION() Rectangle | ( | DLA_Surface * | canvas, |
| S16BIT | x1, | ||
| S16BIT | y1, | ||
| S16BIT | x2, | ||
| S16BIT | y2, | ||
| U16BIT | x_lw, | ||
| U16BIT | y_lw, | ||
| DLAColor | fill_colour, | ||
| DLAColor | line_colour | ||
| ) |
Draw a rectangle on the canvas.
| S16BIT | x1 Left position of rectangle |
| S16BIT | y1 Top position of rectangle |
| S16BIT | x2 Right position of rectangle |
| S16BIT | y2 Bottom position of rectangle |
| U16BIT | x_lw horizontal outline width |
| U16BIT | y_lw vertical outline width |
| DLAColor | fill_colour Colour to use for filling |
| DLAColor | line_colour Colour to use for outline |
| void DLA_FUNCTION() Sector | ( | DLA_Surface * | canvas, |
| S16BIT | x, | ||
| S16BIT | y, | ||
| U16BIT | w, | ||
| U16BIT | h, | ||
| U16BIT | start, | ||
| U16BIT | arc, | ||
| U16BIT | width, | ||
| DLAColor | fill_colour, | ||
| DLAColor | line_colour | ||
| ) |
Draw a sector ("pie slice") on the canvas.
| S16BIT | x Left position of bounding rect |
| S16BIT | y Top position of bounding rect |
| U16BIT | w Width of bounding rect |
| U16BIT | h Height of bounding rect |
| U16BIT | start Start angle in 64ths of a degree |
| U16BIT | arc Arc angle in 64ths of a degree |
| U16BIT | width Width of ellipse outline |
| DLAColor | fill_colour Colour to use for filling |
| DLAColor | line_colour Colour to use for outline |