21 while ((x1 > context->
view_x) && (context->
get_pixel(context, x1 - 1, y) != border_color))
23 while ((x2 < context->view_x + context->
view_w - 1) && (context->
get_pixel(context, x2 + 1, y) != border_color))
26 for (s = span[y]; s; s = s->
row_next) {
27 if ((x1 == s->
x1) && (x2 == s->
x2))
47 unsigned char data[256], *dest, *src;
48 SPAN **span, *s, *tail, *head;
79 if ((x < context->view_x) || (x >= context->
view_x + context->
view_w) ||
80 (y < context->view_y) || (y >= context->
view_y + context->
view_h))
83 if (context->
get_pixel(context, x, y) == border_color)
87 span = (
SPAN **)malloc(size);
90 tail = head =
add_span(context, span, &x, y, border_color);
94 if (tail->
y - 1 >= context->
view_y) {
95 for (x = tail->
x1; x <= tail->
x2; x++) {
96 if (context->
get_pixel(context, x, tail->
y - 1) != border_color) {
97 s =
add_span(context, span, &x, tail->
y - 1, border_color);
106 for (x = tail->
x1; x <= tail->
x2; x++) {
107 if (context->
get_pixel(context, x, tail->
y + 1) != border_color) {
108 s =
add_span(context, span, &x, tail->
y + 1, border_color);
122 for (y = context->
view_y; y < context->view_y + context->
view_h; y++) {
123 for (s = tail = span[y]; s; s = s->
row_next, free(tail), tail = s) {
130 src = data + (((s->
y & 0x7) << 3) * context->
target_bpp);
132 if ((s->
x1 & ~0x7) == (s->
x2 & ~0x7))
133 size = s->
x2 - s->
x1 + 1;
135 size = 8 - (s->
x1 & 0x7);
140 for (x = (s->
x1 + 7) >> 3; x < (s->
x2 & ~0x7) >> 3; x++) {
144 if ((s->
x2 & 0x7) && ((s->
x1 & ~0x7) != (s->
x2 & ~0x7)))