Lines Matching refs:fb
117 STATIC void mono_horiz_setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32… in mono_horiz_setpixel() argument
118 size_t index = (x + y * fb->stride) >> 3; in mono_horiz_setpixel()
119 unsigned int offset = fb->format == FRAMEBUF_MHMSB ? x & 0x07 : 7 - (x & 0x07); in mono_horiz_setpixel()
120 …((uint8_t *)fb->buf)[index] = (((uint8_t *)fb->buf)[index] & ~(0x01 << offset)) | ((col != 0) << o… in mono_horiz_setpixel()
123 STATIC uint32_t mono_horiz_getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in mono_horiz_getpixel() argument
124 size_t index = (x + y * fb->stride) >> 3; in mono_horiz_getpixel()
125 unsigned int offset = fb->format == FRAMEBUF_MHMSB ? x & 0x07 : 7 - (x & 0x07); in mono_horiz_getpixel()
126 return (((uint8_t *)fb->buf)[index] >> (offset)) & 0x01; in mono_horiz_getpixel()
129 STATIC void mono_horiz_fill_rect(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, unsig… in mono_horiz_fill_rect() argument
130 unsigned int reverse = fb->format == FRAMEBUF_MHMSB; in mono_horiz_fill_rect()
131 unsigned int advance = fb->stride >> 3; in mono_horiz_fill_rect()
133 uint8_t *b = &((uint8_t *)fb->buf)[(x >> 3) + y * advance]; in mono_horiz_fill_rect()
145 STATIC void mvlsb_setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32_t co… in mvlsb_setpixel() argument
146 size_t index = (y >> 3) * fb->stride + x; in mvlsb_setpixel()
148 …((uint8_t *)fb->buf)[index] = (((uint8_t *)fb->buf)[index] & ~(0x01 << offset)) | ((col != 0) << o… in mvlsb_setpixel()
151 STATIC uint32_t mvlsb_getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in mvlsb_getpixel() argument
152 return (((uint8_t *)fb->buf)[(y >> 3) * fb->stride + x] >> (y & 0x07)) & 0x01; in mvlsb_getpixel()
155 STATIC void mvlsb_fill_rect(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, unsigned i… in mvlsb_fill_rect() argument
157 uint8_t *b = &((uint8_t *)fb->buf)[(y >> 3) * fb->stride + x]; in mvlsb_fill_rect()
169 STATIC void rgb565_setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32_t c… in rgb565_setpixel() argument
170 ((uint16_t *)fb->buf)[x + y * fb->stride] = col; in rgb565_setpixel()
173 STATIC uint32_t rgb565_getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in rgb565_getpixel() argument
174 return ((uint16_t *)fb->buf)[x + y * fb->stride]; in rgb565_getpixel()
177 STATIC void rgb565_fill_rect(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, unsigned … in rgb565_fill_rect() argument
178 uint16_t *b = &((uint16_t *)fb->buf)[x + y * fb->stride]; in rgb565_fill_rect()
183 b += fb->stride - w; in rgb565_fill_rect()
189 STATIC void gs2_hmsb_setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32_t… in gs2_hmsb_setpixel() argument
190 uint8_t *pixel = &((uint8_t *)fb->buf)[(x + y * fb->stride) >> 2]; in gs2_hmsb_setpixel()
197 STATIC uint32_t gs2_hmsb_getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in gs2_hmsb_getpixel() argument
198 uint8_t pixel = ((uint8_t *)fb->buf)[(x + y * fb->stride) >> 2]; in gs2_hmsb_getpixel()
203 STATIC void gs2_hmsb_fill_rect(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, unsigne… in gs2_hmsb_fill_rect() argument
206 gs2_hmsb_setpixel(fb, xx, yy, col); in gs2_hmsb_fill_rect()
213 STATIC void gs4_hmsb_setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32_t… in gs4_hmsb_setpixel() argument
214 uint8_t *pixel = &((uint8_t *)fb->buf)[(x + y * fb->stride) >> 1]; in gs4_hmsb_setpixel()
223 STATIC uint32_t gs4_hmsb_getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in gs4_hmsb_getpixel() argument
225 return ((uint8_t *)fb->buf)[(x + y * fb->stride) >> 1] & 0x0f; in gs4_hmsb_getpixel()
228 return ((uint8_t *)fb->buf)[(x + y * fb->stride) >> 1] >> 4; in gs4_hmsb_getpixel()
231 STATIC void gs4_hmsb_fill_rect(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, unsigne… in gs4_hmsb_fill_rect() argument
233 uint8_t *pixel_pair = &((uint8_t *)fb->buf)[(x + y * fb->stride) >> 1]; in gs4_hmsb_fill_rect()
236 unsigned int pixel_count_till_next_line = (fb->stride - w) >> 1; in gs4_hmsb_fill_rect()
264 STATIC void gs8_setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32_t col)… in gs8_setpixel() argument
265 uint8_t *pixel = &((uint8_t *)fb->buf)[(x + y * fb->stride)]; in gs8_setpixel()
269 STATIC uint32_t gs8_getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in gs8_getpixel() argument
270 return ((uint8_t *)fb->buf)[(x + y * fb->stride)]; in gs8_getpixel()
273 STATIC void gs8_fill_rect(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, unsigned int… in gs8_fill_rect() argument
274 uint8_t *pixel = &((uint8_t *)fb->buf)[(x + y * fb->stride)]; in gs8_fill_rect()
277 pixel += fb->stride; in gs8_fill_rect()
291 static inline void setpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y, uint32_t c… in setpixel() argument
292 formats[fb->format].setpixel(fb, x, y, col); in setpixel()
295 static inline uint32_t getpixel(const mp_obj_framebuf_t *fb, unsigned int x, unsigned int y) { in getpixel() argument
296 return formats[fb->format].getpixel(fb, x, y); in getpixel()
299 STATIC void fill_rect(const mp_obj_framebuf_t *fb, int x, int y, int w, int h, uint32_t col) { in fill_rect() argument
300 if (h < 1 || w < 1 || x + w <= 0 || y + h <= 0 || y >= fb->height || x >= fb->width) { in fill_rect()
306 int xend = MIN(fb->width, x + w); in fill_rect()
307 int yend = MIN(fb->height, y + h); in fill_rect()
311 formats[fb->format].fill_rect(fb, x, y, xend - x, yend - y, col); in fill_rect()