X-Git-Url: http://git.imager.perl.org/imager.git/blobdiff_plain/97ac0a9684911cf11b8ef6fdf925295cd8fc42e7..a34dc54c7c4b65e15d89a0e7934e728aa2eaea4f:/hlines.c diff --git a/hlines.c b/hlines.c index 8b2ef18a..6fc3c04e 100644 --- a/hlines.c +++ b/hlines.c @@ -68,7 +68,7 @@ i_int_init_hlines( int bytes = count_y * sizeof(i_int_hline_entry *); if (bytes / count_y != sizeof(i_int_hline_entry *)) { - m_fatal(3, "integer overflow calculating memory allocation\n"); + i_fatal(3, "integer overflow calculating memory allocation\n"); } hlines->start_y = start_y; @@ -111,7 +111,7 @@ i_int_hlines_add(i_int_hlines *hlines, int y, int x, int width) { int x_limit = x + width; if (width < 0) { - m_fatal(3, "negative width %d passed to i_int_hlines_add\n", width); + i_fatal(3, "negative width %d passed to i_int_hlines_add\n", width); } /* just return if out of range */ @@ -263,8 +263,26 @@ i_int_hlines_fill_fill(im, hlines, fill) */ void i_int_hlines_fill_fill(i_img *im, i_int_hlines *hlines, i_fill_t *fill) { - int y, i, x; + i_render r; + int y, i; + + i_render_init(&r, im, im->xsize); + for (y = hlines->start_y; y < hlines->limit_y; ++y) { + i_int_hline_entry *entry = hlines->entries[y - hlines->start_y]; + if (entry) { + for (i = 0; i < entry->count; ++i) { + i_int_hline_seg *seg = entry->segs + i; + int width = seg->x_limit-seg->minx; + + i_render_fill(&r, seg->minx, y, width, NULL, fill); + } + } + } + i_render_done(&r); + +#if 1 +#else if (im->bits == i_8_bits && fill->fill_with_color) { i_color *line = mymalloc(sizeof(i_color) * im->xsize); i_color *work = NULL; @@ -327,6 +345,7 @@ i_int_hlines_fill_fill(i_img *im, i_int_hlines *hlines, i_fill_t *fill) { if (work) myfree(work); } +#endif } /*