Changeset 0d62c10 in mainline for uspace/lib
- Timestamp:
- 2020-10-09T20:27:24Z (5 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f80690a
- Parents:
- 8bf9058
- Location:
- uspace/lib
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/congfx/src/console.c
r8bf9058 r0d62c10 207 207 208 208 /* Check that we support all requested flags */ 209 if ((params->flags & ~ bmpf_color_key) != 0)209 if ((params->flags & ~(bmpf_color_key | bmpf_colorize)) != 0) 210 210 return ENOTSUP; 211 211 … … 296 296 297 297 if ((cbm->flags & bmpf_color_key) == 0) { 298 /* Simple copy */ 298 299 for (y = crect.p0.y; y < crect.p1.y; y++) { 299 300 console_set_pos(cbm->cgc->con, crect.p0.x, y); … … 312 313 } 313 314 } 314 } else { 315 } else if ((cbm->flags & bmpf_colorize) == 0) { 316 /* Color key */ 315 317 for (y = crect.p0.y; y < crect.p1.y; y++) { 316 318 for (x = crect.p0.x; x < crect.p1.x; x++) { … … 332 334 } 333 335 } 336 } else { 337 /* Color key & colorize */ 338 console_set_rgb_color(cbm->cgc->con, cbm->cgc->clr, 339 cbm->cgc->clr); 340 341 for (y = crect.p0.y; y < crect.p1.y; y++) { 342 for (x = crect.p0.x; x < crect.p1.x; x++) { 343 344 clr = pixelmap_get_pixel(&pixelmap, 345 x - offs.x - cbm->rect.p0.x, 346 y - offs.y - cbm->rect.p0.y); 347 348 if (clr != cbm->key_color) { 349 console_set_pos(cbm->cgc->con, x, y); 350 rv = fputc('X', cbm->cgc->fout); 351 if (rv < 0) 352 return EIO; 353 354 console_flush(cbm->cgc->con); 355 } 356 357 } 358 } 334 359 } 335 360 -
uspace/lib/gfx/include/types/gfx/bitmap.h
r8bf9058 r0d62c10 47 47 /** Bitmap flags */ 48 48 typedef enum { 49 /** Directly map GC output into this bitmap */ 50 bmpf_direct_output = 0x1, 49 51 /** Enable color key */ 50 bmpf_color_key = 0x 1,51 /** Directly map GC output into this bitmap*/52 bmpf_ direct_output = 0x252 bmpf_color_key = 0x2, 53 /** Paint non-background pixels with current drawing color */ 54 bmpf_colorize = 0x4 53 55 } gfx_bitmap_flags_t; 54 56 -
uspace/lib/gfxfont/src/font.c
r8bf9058 r0d62c10 122 122 gfx_bitmap_params_init(¶ms); 123 123 params.rect = font->rect; 124 params.flags = bmpf_color_key ;124 params.flags = bmpf_color_key | bmpf_colorize; 125 125 params.key_color = PIXEL(0, 0, 0, 0); 126 126 … … 366 366 if (nrect->p1.y - nrect->p0.y > params.rect.p1.y) 367 367 params.rect.p1.y = nrect->p1.y - nrect->p0.y; 368 params.flags = bmpf_color_key ;368 params.flags = bmpf_color_key | bmpf_colorize; 369 369 params.key_color = PIXEL(0, 0, 0, 0); 370 370 … … 705 705 params.rect.p1.x = width; 706 706 params.rect.p1.y = height; 707 params.flags = bmpf_color_key ;707 params.flags = bmpf_color_key | bmpf_colorize; 708 708 params.key_color = PIXEL(0, 0, 0, 0); 709 709 -
uspace/lib/gfxfont/src/text.c
r8bf9058 r0d62c10 135 135 case gfx_valign_bottom: 136 136 cpos.y -= fmetrics.descent; 137 137 break; 138 138 default: 139 139 break; -
uspace/lib/memgfx/src/memgc.c
r8bf9058 r0d62c10 225 225 226 226 /* Check that we support all requested flags */ 227 if ((params->flags & ~(bmpf_color_key | bmpf_direct_output)) != 0) 227 if ((params->flags & ~(bmpf_color_key | bmpf_colorize | 228 bmpf_direct_output)) != 0) 228 229 return ENOTSUP; 229 230 … … 367 368 /* Nothing to do */ 368 369 } else if ((mbm->flags & bmpf_color_key) == 0) { 370 /* Simple copy */ 369 371 for (y = drect.p0.y; y < drect.p1.y; y++) { 370 372 for (x = drect.p0.x; x < drect.p1.x; x++) { … … 375 377 } 376 378 } 377 } else { 379 } else if ((mbm->flags & bmpf_colorize) == 0) { 380 /* Color key */ 378 381 for (y = drect.p0.y; y < drect.p1.y; y++) { 379 382 for (x = drect.p0.x; x < drect.p1.x; x++) { … … 385 388 } 386 389 } 390 } else { 391 /* Color key & colorization */ 392 for (y = drect.p0.y; y < drect.p1.y; y++) { 393 for (x = drect.p0.x; x < drect.p1.x; x++) { 394 pixel = pixelmap_get_pixel(&smap, 395 x - mbm->rect.p0.x - offs.x, 396 y - mbm->rect.p0.y - offs.y); 397 if (pixel != mbm->key_color) 398 pixelmap_put_pixel(&dmap, x, y, 399 mbm->mgc->color); 400 } 401 } 387 402 } 388 403
Note:
See TracChangeset
for help on using the changeset viewer.