Changeset a35b458 in mainline for uspace/lib/softrend/filter.c
- Timestamp:
- 2018-03-02T20:10:49Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f1380b7
- Parents:
- 3061bc1
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:38:31)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:10:49)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/softrend/filter.c
r3061bc1 ra35b458 71 71 blue += weights[index] * BLUE(pixels[index]); 72 72 } 73 73 74 74 return PIXEL((uint8_t) alpha, (uint8_t) red, (uint8_t) green, 75 75 (uint8_t) blue); … … 89 89 long y1 = floor(y); 90 90 long y2 = ceil(y); 91 91 92 92 if (y1 == y2 && x1 == x2) { 93 93 return pixelmap_get_extended_pixel(pixmap, 94 94 (sysarg_t) x1, (sysarg_t) y1, extend); 95 95 } 96 96 97 97 double x_delta = x - x1; 98 98 double y_delta = y - y1; 99 99 100 100 pixel_t pixels[4]; 101 101 pixels[0] = pixelmap_get_extended_pixel(pixmap, x1, y1, extend); … … 103 103 pixels[2] = pixelmap_get_extended_pixel(pixmap, x1, y2, extend); 104 104 pixels[3] = pixelmap_get_extended_pixel(pixmap, x2, y2, extend); 105 105 106 106 float weights[4]; 107 107 weights[0] = (1 - x_delta) * (1 - y_delta); … … 109 109 weights[2] = (1 - x_delta) * ( y_delta); 110 110 weights[3] = ( x_delta) * ( y_delta); 111 111 112 112 return blend_pixels(4, weights, pixels); 113 113 }
Note:
See TracChangeset
for help on using the changeset viewer.