Lines Matching +full:8 +full:x
19 #define LSB_BIT_MASK(x) BIT_MASK(x) argument
20 #define MSB_BIT_MASK(x) (BIT_MASK(x) << (8 - x)) argument
46 /** Resolution of a framebuffer in pixels in X direction */
52 /** Number of pixels per tile, typically 8 */
74 (fptr->width * fptr->height / 8U); in get_glyph_ptr()
78 uint8_t x, uint8_t y) in get_glyph_byte() argument
81 return glyph_ptr[x * (fptr->height / 8U) + y]; in get_glyph_byte()
83 return glyph_ptr[y * (fptr->width) + x]; in get_glyph_byte()
92 * a byte is interpreted as 8 pixels ordered vertically among each other.
95 char c, uint16_t x, uint16_t y, in draw_char_vtmono() argument
114 const int16_t fb_x = x + g_x; in draw_char_vtmono()
119 * by separating per 8-line boundaries. in draw_char_vtmono()
123 const size_t fb_index = (fb_y / 8U) * fb->x_res + fb_x; in draw_char_vtmono()
124 const size_t offset = y % 8; in draw_char_vtmono()
125 const uint8_t bottom_lines = ((offset + fptr->height) % 8); in draw_char_vtmono()
143 next_byte = get_glyph_byte(glyph_ptr, fptr, g_x, g_y / 8); in draw_char_vtmono()
145 byte = get_glyph_byte(glyph_ptr, fptr, g_x, g_y / 8); in draw_char_vtmono()
146 next_byte = get_glyph_byte(glyph_ptr, fptr, g_x, (g_y + 8) / 8); in draw_char_vtmono()
151 * Extract the necessary 8 bits from the combined 2 tiles of glyphs. in draw_char_vtmono()
153 byte = ((byte << 8) | next_byte) >> (offset); in draw_char_vtmono()
159 bg_mask = BIT_MASK(8 - offset); in draw_char_vtmono()
168 byte = ((next_byte << 8) | byte) >> (8 - offset); in draw_char_vtmono()
170 bg_mask = BIT_MASK(8 - offset) << offset; in draw_char_vtmono()
179 if (((fptr->height - g_y) < 8) && (bottom_lines != 0)) { in draw_char_vtmono()
200 g_y += (8 - offset); in draw_char_vtmono()
201 } else if ((fptr->height - g_y) >= 8) { in draw_char_vtmono()
202 g_y += 8; in draw_char_vtmono()
212 static inline void draw_point(struct char_framebuffer *fb, int16_t x, int16_t y) in draw_point() argument
215 const size_t index = ((y / 8) * fb->x_res); in draw_point()
216 uint8_t m = BIT(y % 8); in draw_point()
218 if (x < 0 || x >= fb->x_res) { in draw_point()
230 fb->buf[index + x] |= m; in draw_point()
263 static int draw_text(const struct device *dev, const char *const str, int16_t x, int16_t y, in draw_text() argument
275 if (fptr->height % 8) { in draw_text()
284 if ((x + fptr->width > fb->x_res) && wrap) { in draw_text()
285 x = 0U; in draw_text()
288 x += fb->kerning + draw_char_vtmono(fb, str[i], x, y, wrap); in draw_text()
301 draw_point(fb, pos->x, pos->y); in cfb_draw_point()
311 draw_line(fb, start->x, start->y, end->x, end->y); in cfb_draw_line()
321 draw_line(fb, start->x, start->y, end->x, start->y); in cfb_draw_rect()
322 draw_line(fb, end->x, start->y, end->x, end->y); in cfb_draw_rect()
323 draw_line(fb, end->x, end->y, start->x, end->y); in cfb_draw_rect()
324 draw_line(fb, start->x, end->y, start->x, start->y); in cfb_draw_rect()
329 int cfb_draw_text(const struct device *dev, const char *const str, int16_t x, int16_t y) in cfb_draw_text() argument
331 return draw_text(dev, str, x, y, false); in cfb_draw_text()
334 int cfb_print(const struct device *dev, const char *const str, uint16_t x, uint16_t y) in cfb_print() argument
336 return draw_text(dev, str, x, y, true); in cfb_print()
339 int cfb_invert_area(const struct device *dev, uint16_t x, uint16_t y, in cfb_invert_area() argument
345 if (x >= fb->x_res || y >= fb->y_res) { in cfb_invert_area()
352 if (x > fb->x_res) { in cfb_invert_area()
353 x = fb->x_res; in cfb_invert_area()
360 if (x + width > fb->x_res) { in cfb_invert_area()
361 width = fb->x_res - x; in cfb_invert_area()
368 for (size_t i = x; i < x + width; i++) { in cfb_invert_area()
372 * by separating per 8-line boundaries. in cfb_invert_area()
375 const size_t index = ((j / 8) * fb->x_res) + i; in cfb_invert_area()
380 * between the start line or end line and the 8-line boundary. in cfb_invert_area()
382 if ((j % 8) > 0) { in cfb_invert_area()
383 uint8_t m = BIT_MASK((j % 8)); in cfb_invert_area()
388 * drawing within 8 lines from the start line in cfb_invert_area()
390 if (remains < 8) { in cfb_invert_area()
391 m |= BIT_MASK((8 - (j % 8) + remains)) in cfb_invert_area()
392 << ((j % 8) + remains); in cfb_invert_area()
400 j += 7 - (j % 8); in cfb_invert_area()
401 } else if (remains >= 8) { in cfb_invert_area()
406 uint8_t m = BIT_MASK(8 - remains) << (remains); in cfb_invert_area()
428 for (size_t i = 0; i < fb->x_res * fb->y_res / 8U; i++) { in cfb_invert()
579 fb->ppt = 8U; in cfb_framebuffer_init()