Skip to content

Commit a882668

Browse files
committed
Blur optimization
1 parent 52196f3 commit a882668

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

blur.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ int kernel[3][3] = { { 4, 8, 4},
44

55
int radius = 1;
66

7-
void blur_pixels(char pixels[], int x, int y)
7+
void blur_pixels(char pixels[], vec2 min_coords, vec2 max_coords, int x, int y)
88
{
9-
for (int j = 0; j < y; j++)
9+
for (int j = min_coords.y; j <=max_coords.y; j++)
1010
{
11-
for (int i = 0; i < x; i++)
11+
for (int i = min_coords.x; i <=max_coords.x; i++)
1212
{
1313
unsigned char total[] = {0,
1414
0,

tty_cube.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ int main(int argc, char *argv[])
221221
// Somewhat remove aliasing applying a gaussian blur
222222
if (BLUR_ANTIALIAS)
223223
{
224-
blur_pixels(buffer, vinfo.xres, vinfo.yres);
224+
blur_pixels(buffer, min_coords, max_coords, vinfo.xres, vinfo.yres);
225225
}
226226

227227
// For some reason, the fb doesn't update fast enough

0 commit comments

Comments
 (0)