Lines Matching refs:height
224 int32_t width, height, format;
226 const unsigned char* pixels = stbi_load_from_memory(buffer, len, &width, &height, &format, 0);
228 pixels = jpgd_decompress_jpeg_image_from_memory(buffer, len, &width, &height, &format, 3);
236 pixmap->height = (uint32_t)height;
259 gdx2d_pixmap* gdx2d_new(uint32_t width, uint32_t height, uint32_t format) {
263 pixmap->height = height;
265 pixmap->pixels = (unsigned char*)malloc(width * height * gdx2d_bytes_per_pixel(format));
292 int pixels = pixmap->width * pixmap->height;
297 int pixels = pixmap->width * pixmap->height;
308 int pixels = pixmap->width * pixmap->height;
325 int pixels = pixmap->width * pixmap->height;
340 int pixels = pixmap->width * pixmap->height;
351 int pixels = pixmap->width * pixmap->height;
391 if(x >= pixmap->width || y >= pixmap->height)
396 static inline void set_pixel(unsigned char* pixels, uint32_t width, uint32_t height, uint32_t bpp, set_pixel_func pixel_func, int32_t x, int32_t y, uint32_t col) {
398 if(x >= (int32_t)width || y >= (int32_t)height) return;
415 set_pixel((unsigned char*)pixmap->pixels, pixmap->width, pixmap->height, gdx2d_bytes_per_pixel(pixmap->format), set_pixel_func_ptr(pixmap->format), x, y, col);
418 set_pixel((unsigned char*)pixmap->pixels, pixmap->width, pixmap->height, gdx2d_bytes_per_pixel(pixmap->format), set_pixel_func_ptr(pixmap->format), x, y, col);
490 if(y < 0 || y >= (int32_t)pixmap->height) return;
534 if(y1 >= (int32_t)pixmap->height) return;
538 if(y2 >= (int32_t)pixmap->height) y2 = pixmap->height - 1;
553 void gdx2d_draw_rect(const gdx2d_pixmap* pixmap, int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t col) {
555 hline(pixmap, x, x + width - 1, y + height - 1, col);
556 vline(pixmap, y, y + height - 1, x, col);
557 vline(pixmap, y, y + height - 1, x + width - 1, col);
560 static inline void circle_points(unsigned char* pixels, uint32_t width, uint32_t height, uint32_t bpp, set_pixel_func pixel_func, int32_t cx, int32_t cy, int32_t x, int32_t y, uint32_t col) {
562 set_pixel(pixels, width, height, bpp, pixel_func, cx, cy + y, col);
563 set_pixel(pixels, width, height, bpp, pixel_func, cx, cy - y, col);
564 set_pixel(pixels, width, height, bpp, pixel_func, cx + y, cy, col);
565 set_pixel(pixels, width, height, bpp, pixel_func, cx - y, cy, col);
568 set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy + y, col);
569 set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy + y, col);
570 set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy - y, col);
571 set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy - y, col);
574 set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy + y, col);
575 set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy + y, col);
576 set_pixel(pixels, width, height, bpp, pixel_func, cx + x, cy - y, col);
577 set_pixel(pixels, width, height, bpp, pixel_func, cx - x, cy - y, col);
578 set_pixel(pixels, width, height, bpp, pixel_func, cx + y, cy + x, col);
579 set_pixel(pixels, width, height, bpp, pixel_func, cx - y, cy + x, col);
580 set_pixel(pixels, width, height, bpp, pixel_func, cx + y, cy - x, col);
581 set_pixel(pixels, width, height, bpp, pixel_func, cx - y, cy - x, col);
591 uint32_t height = pixmap->height;
596 circle_points(pixels, width, height, bpp, pixel_func, x, y, px, py, col);
605 circle_points(pixels, width, height, bpp, pixel_func, x, y, px, py, col);
609 void gdx2d_fill_rect(const gdx2d_pixmap* pixmap, int32_t x, int32_t y, uint32_t width, uint32_t height, uint32_t col) {
611 int32_t y2 = y + height - 1;
614 if(y >= (int32_t)pixmap->height) return;
621 if(y2 >= (int32_t)pixmap->height) y2 = pixmap->height - 1;
729 bound_y2 = min(edges[1].y2, pixmap->height-1);
751 bound_y2 = min(edges[2].y2, pixmap->height-1);
770 uint32_t width, uint32_t height) {
784 for(;sy < src_y + height; sy++, dy++) {
786 if(sy >= src_pixmap->height || dy >= dst_pixmap->height) break;
836 if(sy >= src_pixmap->height || dy >= dst_pixmap->height) break;
914 if(sy >= src_pixmap->height || dy >= dst_pixmap->height) break;