Banjo API 0.0.1
Multi-purpose C99 API
Loading...
Searching...
No Matches
bitmap.h File Reference

Header file for Bitmap type.

#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.

Typedefs

typedef struct bj_bitmap_t bj_bitmap
 Typedef for the bj_bitmap struct.
 

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
}
 Raster operation (ROP) to apply during blitting. More...
 

Functions

bj_bitmapbj_bitmap_alloc (void)
 Allocate a new bitmap object.
 
bj_bitmapbj_bitmap_new (size_t width, size_t height, bj_pixel_mode mode, size_t stride)
 Creates a new bj_bitmap with the specified width and height.
 
void bj_bitmap_del (bj_bitmap *p_bitmap)
 Deletes a bj_bitmap object and releases associated memory.
 
bj_bitmapbj_bitmap_new_from_file (const char *p_path, bj_error **p_error)
 Creates a new bitmap by loading from a file.
 
bj_bool bj_bitmap_blit_mask_stretched (const bj_bitmap *mask, const bj_rect *mask_area, bj_bitmap *dst, const bj_rect *dst_area, uint32_t fg_native, uint32_t bg_native, bj_mask_bg_mode mode)
 Masked blit with stretching (nearest neighbor). The mask must be 8bpp.
 
void bj_bitmap_print (bj_bitmap *dst, int x, int y, unsigned height, uint32_t fg_native, const char *text)
 Prints text using the default foreground color and transparent background.
 
void bj_bitmap_printf (bj_bitmap *p_bitmap, int x, int y, unsigned height, uint32_t fg_native, const char *fmt,...)
 Prints formatted text into a bitmap, similar to printf.
 

Variables

bj_bitmapdst
 
bj_bitmap const bj_rectdst_area
 
bj_bitmap const bj_rect uint32_t fg_native
 
bj_bitmap const bj_rect uint32_t uint32_t bg_native
 
bj_bitmap const bj_rect uint32_t uint32_t bj_mask_bg_mode mode
 
*with alpha
 Prints text with explicit foreground/background and background mode.