1
#define __NR_PIXBLOCK_LINE_C__
4
* Pixel buffer rendering library
7
* Lauris Kaplinski <lauris@kaplinski.com>
9
* This code is in public domain
12
#include <libnr/nr-pixops.h>
13
#include <libnr/nr-pixblock-pixel.h>
16
nr_pixblock_draw_line_rgba32 (NRPixBlock *d, long x0, long y0, long x1, long y1, short first, unsigned long rgba)
18
long deltax, deltay, xinc1, xinc2, yinc1, yinc2;
19
long den, num, numadd, numpixels;
46
if (deltax >= deltay) {
62
/* We can be quite sure 1x1 pixblock is TINY */
63
nr_pixblock_setup_fast (&spb, NR_PIXBLOCK_MODE_R8G8B8A8N, 0, 0, 1, 1, 0);
65
spx = NR_PIXBLOCK_PX (&spb);
66
spx[0] = NR_RGBA32_R (rgba);
67
spx[1] = NR_RGBA32_G (rgba);
68
spx[2] = NR_RGBA32_B (rgba);
69
spx[3] = NR_RGBA32_A (rgba);
71
dbpp = NR_PIXBLOCK_BPP (d);
76
for (curpixel = 0; curpixel <= numpixels; curpixel++) {
77
if ((x >= d->area.x0) && (y >= d->area.y0) && (x < d->area.x1) && (y < d->area.y1)) {
78
nr_compose_pixblock_pixblock_pixel (d, NR_PIXBLOCK_PX (d) + (y - d->area.y0) * d->rs + (x - d->area.x0) * dbpp, &spb, spx);
90
nr_pixblock_release (&spb);