Exemplo n.º 1
0
/* Draw the borders.  */
inline static void draw_borders(raster_t *raster)
{
    if (!raster->open_left_border)
        draw_blank(raster, 0, raster->display_xstart - 1);
    if (!raster->open_right_border)
        draw_blank(raster,
                   raster->display_xstop,
                   raster->geometry->screen_size.width - 1);
}
Exemplo n.º 2
0
/* Not exactly efficient, but this is only a test */
static void
draw_row			(ushort *		canvas,
				 vbi_page *		pg,
				 int			row)
{
	int i, j, num_tspaces = 0;
	vbi_rgba *s = row_buffer;

	for (i = 0; i < pg->columns; ++i) {
		if (pg->text[row * pg->columns + i].opacity
		    == VBI_TRANSPARENT_SPACE) {
			num_tspaces++;
			continue;
		}

		if (num_tspaces > 0) {
			draw_blank(i - num_tspaces, num_tspaces);
			num_tspaces = 0; 
		}

		vbi_draw_cc_page_region (pg, VBI_PIXFMT_RGBA32_LE,
					 row_buffer + i * CELL_WIDTH,
					 sizeof(row_buffer) / CELL_HEIGHT,
					 i, row, 1, 1);
	}

	if (num_tspaces > 0)
		draw_blank(i - num_tspaces, num_tspaces);

	for (i = 0; i < CELL_HEIGHT; i++) {
		for (j = 0; j < pg->columns * CELL_WIDTH; j++)
			canvas[j] = RGB565(s[j]);
		s += sizeof(row_buffer) / sizeof(row_buffer[0]) / CELL_HEIGHT;
		canvas += DISP_WIDTH;
	}
}