Banjo API 0.0.1
C99 game development API
Loading...
Searching...
No Matches
bitmap.h File Reference
#include <banjo/api.h>
#include <banjo/error.h>
#include <banjo/pixel.h>
#include <banjo/rect.h>
#include <banjo/stream.h>
Include dependency graph for bitmap.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Enumerations

enum  bj_blit_op {
  BJ_BLIT_OP_COPY = 0 , BJ_BLIT_OP_XOR , BJ_BLIT_OP_OR , BJ_BLIT_OP_AND ,
  BJ_BLIT_OP_ADD_SAT , BJ_BLIT_OP_SUB_SAT
}
enum  bj_mask_bg_mode { BJ_MASK_BG_TRANSPARENT = 0 , BJ_MASK_BG_OPAQUE , BJ_MASK_BG_REV_TRANSPARENT }

Functions

struct bj_bitmapbj_allocate_bitmap (void)
struct bj_bitmapbj_create_bitmap (size_t width, size_t height, enum bj_pixel_mode mode, size_t stride)
void bj_destroy_bitmap (struct bj_bitmap *bitmap)
struct bj_bitmapbj_create_bitmap_from_file (const char *path, struct bj_error **error)
struct bj_bitmapbj_create_bitmap_from_pixels (void *pixels, size_t width, size_t height, enum bj_pixel_mode mode, size_t stride)
struct bj_bitmapbj_copy_bitmap (const struct bj_bitmap *bitmap)
struct bj_bitmapbj_convert_bitmap (const struct bj_bitmap *bitmap, enum bj_pixel_mode mode)
struct bj_bitmapbj_init_bitmap (struct bj_bitmap *bitmap, void *pixels, size_t width, size_t height, enum bj_pixel_mode mode, size_t stride)
void bj_assign_bitmap (struct bj_bitmap *bitmap, void *pixels, size_t width, size_t height, enum bj_pixel_mode mode, size_t stride)
void bj_reset_bitmap (struct bj_bitmap *bitmap)
void * bj_bitmap_pixels (struct bj_bitmap *bitmap)
size_t bj_bitmap_width (const struct bj_bitmap *bitmap)
size_t bj_bitmap_height (const struct bj_bitmap *bitmap)
int bj_bitmap_mode (struct bj_bitmap *bitmap)
size_t bj_bitmap_stride (struct bj_bitmap *bitmap)
void bj_make_bitmap_rgb (const struct bj_bitmap *bitmap, size_t x, size_t y, uint8_t *red, uint8_t *green, uint8_t *blue)
uint32_t bj_make_bitmap_pixel (struct bj_bitmap *bitmap, uint8_t red, uint8_t green, uint8_t blue)
void bj_put_pixel (struct bj_bitmap *bitmap, size_t x, size_t y, uint32_t value)
void bj_clear_bitmap (struct bj_bitmap *bitmap)
void bj_set_bitmap_colorkey (struct bj_bitmap *bitmap, bj_bool enabled, uint32_t key_value)
uint32_t bj_bitmap_pixel (const struct bj_bitmap *bitmap, size_t x, size_t y)
void bj_set_bitmap_clear_color (struct bj_bitmap *bitmap, uint32_t clear_color)
bj_bool bj_blit (const struct bj_bitmap *src, const struct bj_rect *src_area, struct bj_bitmap *dst, const struct bj_rect *dst_area, enum bj_blit_op op)
bj_bool bj_blit_stretched (const struct bj_bitmap *src, const struct bj_rect *src_area, struct bj_bitmap *dst, const struct bj_rect *dst_area, enum bj_blit_op op)
bj_bool bj_blit_mask (const struct bj_bitmap *mask, const struct bj_rect *mask_area, struct bj_bitmap *dst, const struct bj_rect *dst_area, uint32_t fg_native, uint32_t bg_native, bj_mask_bg_mode mode)
bj_bool bj_blit_mask_stretched (const struct bj_bitmap *mask, const struct bj_rect *mask_area, struct bj_bitmap *dst, const struct bj_rect *dst_area, uint32_t fg_native, uint32_t bg_native, bj_mask_bg_mode mode)
void bj_draw_text (struct bj_bitmap *dst, int x, int y, unsigned height, uint32_t fg_native, const char *text)
void bj_draw_textf (struct bj_bitmap *bitmap, int x, int y, unsigned height, uint32_t fg_native, const char *fmt,...)
void bj_blit_text (struct bj_bitmap *dst, int x, int y, unsigned height, uint32_t fg_native, uint32_t bg_native, bj_mask_bg_mode mode, const char *text)

Detailed Description

Header file for Bitmap type.