Lines Matching +full:- +full:w
19 …id LV_ATTRIBUTE_FAST_MEM lv_dither_none(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w) in lv_dither_none() argument
23 if(grad == NULL || grad->filled) return; in lv_dither_none()
24 for(lv_coord_t i = 0; i < w; i++) { in lv_dither_none()
25 grad->map[i] = lv_color_hex(grad->hmap[i].full); in lv_dither_none()
27 grad->filled = 1; in lv_dither_none()
41 …TTRIBUTE_FAST_MEM lv_dither_ordered_hor(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w) in lv_dither_ordered_hor() argument
49 …3. It means that a pixel i,j only depends on the value of a pixel i-7, j-7 to i,j and no other one. in lv_dither_ordered_hor()
53 for(lv_coord_t j = 0; j < w; j++) { in lv_dither_ordered_hor()
54 int8_t factor = dither_ordered_threshold_matrix[(y & 7) * 8 + ((j) & 7)] - 32; in lv_dither_ordered_hor()
55 lv_color32_t tmp = grad->hmap[LV_CLAMP(0, j - 4, grad->size)]; in lv_dither_ordered_hor()
61 grad->map[j] = lv_color_hex(t.full); in lv_dither_ordered_hor()
65 …TTRIBUTE_FAST_MEM lv_dither_ordered_ver(lv_grad_t * grad, lv_coord_t x, lv_coord_t y, lv_coord_t w) in lv_dither_ordered_ver() argument
72 …3. It means that a pixel i,j only depends on the value of a pixel i-7, j-7 to i,j and no other one. in lv_dither_ordered_ver()
76 lv_color32_t tmp = grad->hmap[LV_CLAMP(0, y - 4, grad->size)]; in lv_dither_ordered_ver()
80 int8_t factor = dither_ordered_threshold_matrix[(y & 7) * 8 + ((j + x) & 7)] - 32; in lv_dither_ordered_ver()
86 grad->map[j] = lv_color_hex(t.full); in lv_dither_ordered_ver()
90 for(; j < w - 8; j += 8) { in lv_dither_ordered_ver()
91 lv_memcpy(grad->map + j, grad->map, 8 * sizeof(*grad->map)); in lv_dither_ordered_ver()
94 for(; j < w; j++) { in lv_dither_ordered_ver()
95 grad->map[j] = grad->map[j & 7]; in lv_dither_ordered_ver()
100 …RIBUTE_FAST_MEM lv_dither_err_diff_hor(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w) in lv_dither_err_diff_hor() argument
104 LV_UNUSED(w); in lv_dither_err_diff_hor()
110 Can be implemented as: x (x<<3 - x) in lv_dither_err_diff_hor()
111 (x<<2 - x) (x<<2+x) x in lv_dither_err_diff_hor()
114 #define FS_COMPUTE_ERROR(e) { coef[0] = (e<<3) - e; coef[1] = (e<<2) - e; coef[2] = (e<<2) + e; coe… in lv_dither_err_diff_hor()
116 …or_to32(q); e.r = (int8_t)(t.ch.red - u.ch.red); e.g = (int8_t)(t.ch.green - u.ch.green); e.b = (i… in lv_dither_err_diff_hor()
119 grad->map[0] = lv_color_hex(grad->hmap[0].full); in lv_dither_err_diff_hor()
120 for(lv_coord_t x = 1; x < grad->size - 1; x++) { in lv_dither_err_diff_hor()
121 lv_color32_t t = grad->hmap[x]; in lv_dither_err_diff_hor()
125 next_l = grad->error_acc[x + 1]; in lv_dither_err_diff_hor()
133 grad->error_acc[x - 1].r += coef[1] >> 4; in lv_dither_err_diff_hor()
134 grad->error_acc[x].r += coef[2] >> 4; in lv_dither_err_diff_hor()
135 grad->error_acc[x + 1].r = coef[3] >> 4; in lv_dither_err_diff_hor()
139 grad->error_acc[x - 1].g += coef[1] >> 4; in lv_dither_err_diff_hor()
140 grad->error_acc[x].g += coef[2] >> 4; in lv_dither_err_diff_hor()
141 grad->error_acc[x + 1].g = coef[3] >> 4; in lv_dither_err_diff_hor()
145 grad->error_acc[x - 1].b += coef[1] >> 4; in lv_dither_err_diff_hor()
146 grad->error_acc[x].b += coef[2] >> 4; in lv_dither_err_diff_hor()
147 grad->error_acc[x + 1].b = coef[3] >> 4; in lv_dither_err_diff_hor()
149 grad->map[x] = q; in lv_dither_err_diff_hor()
151 grad->map[grad->size - 1] = lv_color_hex(grad->hmap[grad->size - 1].full); in lv_dither_err_diff_hor()
154 …RIBUTE_FAST_MEM lv_dither_err_diff_ver(lv_grad_t * grad, lv_coord_t xs, lv_coord_t y, lv_coord_t w) in lv_dither_err_diff_ver() argument
157 …Since the given hi-resolution gradient (in src) is vertical, the Floyd Steinberg algorithm pass ne… in lv_dither_err_diff_ver()
166 e(i,j) = 1/16 * [ e(i-1,j) * 5 + e(i-1,j+1) * 3 + e(i-1,j-1) * 1 + e(i,j-1) * 7] in lv_dither_err_diff_ver()
168 This means that the error term depends on pixel W, NW, N and SW. in lv_dither_err_diff_ver()
170 …line (N, NW) in the term above. Also, we remember the (W) term too since we are computing the grad… in lv_dither_err_diff_ver()
172 Let's remove it and re-dispatch the error factor accordingly so they stays normalized: in lv_dither_err_diff_ver()
173 e(i,j) ~= 1/16 * [ e(i-1,j) * 6 + e(i-1,j-1) * 1 + e(i,j-1) * 9] in lv_dither_err_diff_ver()
182 lv_scolor24_t next_px_err, prev_l = grad->error_acc[0]; in lv_dither_err_diff_ver()
185 grad->map[0] = lv_color_hex(grad->hmap[y].full); in lv_dither_err_diff_ver()
186 FS_QUANT_ERROR(next_px_err, grad->hmap[y], grad->map[0]); in lv_dither_err_diff_ver()
189 lv_color_t tmp = lv_color_hex(grad->hmap[y].full); in lv_dither_err_diff_ver()
190 lv_color32_t t = grad->hmap[y]; in lv_dither_err_diff_ver()
191 FS_QUANT_ERROR(next_px_err, grad->hmap[y], tmp); in lv_dither_err_diff_ver()
192 FS_COMPONENTS3(t, +, next_px_err, 6, prev_l, 1, grad->error_acc[0], 9); in lv_dither_err_diff_ver()
193 grad->map[0] = lv_color_hex(t.full); in lv_dither_err_diff_ver()
196 for(lv_coord_t x = 1; x < w; x++) { in lv_dither_err_diff_ver()
197 lv_color32_t t = grad->hmap[y]; in lv_dither_err_diff_ver()
200 FS_COMPONENTS3(t, +, next_px_err, 6, prev_l, 1, grad->error_acc[x], 9); in lv_dither_err_diff_ver()
201 prev_l = grad->error_acc[x]; in lv_dither_err_diff_ver()
206 grad->error_acc[x] = next_px_err; in lv_dither_err_diff_ver()
207 grad->map[x] = q; in lv_dither_err_diff_ver()