maug
Quick and dirty C mini-augmentation library.
Loading...
Searching...
No Matches
mfmt.h File Reference
#include <mfile.h>
Include dependency graph for mfmt.h:

Go to the source code of this file.

Data Structures

struct  MFMT_STRUCT
 Generic image description struct. More...
 
struct  MFMT_STRUCT_BMPINFO
 BITMAPINFO struct that comes before Windows bitmap data. More...
 
struct  MFMT_STRUCT_BMPFILE
 

Macros

#define MFMT_BMPINFO_OFS_WIDTH   4
 
#define MFMT_BMPINFO_OFS_HEIGHT   8
 
#define MFMT_BMPINFO_OFS_COLOR_PLANES   12
 
#define MFMT_BMPINFO_OFS_BPP   14
 
#define MFMT_BMPINFO_OFS_COMPRESSION   16
 
#define MFMT_BMPINFO_OFS_SZ   20
 
#define MFMT_BMPINFO_OFS_HRES   24
 
#define MFMT_BMPINFO_OFS_VRES   28
 
#define MFMT_BMPINFO_OFS_PAL_SZ   32
 
#define MFMT_BMPINFO_OFS_IMP_COLORS   36
 
#define MFMT_BMP_COMPRESSION_NONE   (0)
 MFMT_STRUCT_BMPINFO::compression value indicating none.
 
#define MFMT_BMP_COMPRESSION_RLE8   (1)
 MFMT_STRUCT_BMPINFO::compression value indicating 8-bit RLE.
 
#define MFMT_BMP_COMPRESSION_RLE4   (2)
 MFMT_STRUCT_BMPINFO::compression value indicating 4-bit RLE.
 
#define MFMT_DECOMP_FLAG_4BIT   0x01
 
#define MFMT_DECOMP_FLAG_8BIT   0x02
 
#define MFMT_PX_FLAG_INVERT_Y   0x01
 
#define MFMT_TRACE_BMP_LVL   0
 
#define MFMT_TRACE_RLE_LVL   0
 
#define mfmt_bmp_check_header()
 

Typedefs

typedef MERROR_RETVAL(* mfmt_decode) (mfile_t *p_file_in, off_t file_offset, off_t file_sz, size_t line_w, MAUG_MHANDLE buffer_out, off_t buffer_out_sz, uint8_t flags)
 Callback to decode compressed data.
 
typedef MERROR_RETVAL(* mfmt_read_header_cb) (struct MFMT_STRUCT *header, mfile_t *p_file_in, uint32_t file_offset, off_t file_sz, uint8_t *p_flags)
 Callback to read image header and get properties.
 
typedef MERROR_RETVAL(* mfmt_read_palette_cb) (struct MFMT_STRUCT *header, uint32_t *palette, size_t palette_sz, mfile_t *p_file_in, uint32_t file_offset, off_t file_sz, uint8_t flags)
 Callback to read image palette into 24-bit RGB values.
 
typedef MERROR_RETVAL(* mfmt_read_px_cb) (struct MFMT_STRUCT *header, uint8_t SEG_FAR *px, off_t px_sz, mfile_t *p_file_in, uint32_t file_offset, off_t file_sz, uint8_t flags)
 Callback to read image pixels into 8-bit values.
 

Functions

MERROR_RETVAL mfmt_decode_rle (mfile_t *p_file_in, off_t file_offset, off_t file_sz, size_t line_w, MAUG_MHANDLE buffer_out, off_t buffer_out_sz, uint8_t flags)
 Decode RLE-encoded data from an input file into a memory buffer.
 
MERROR_RETVAL mfmt_read_bmp_header (struct MFMT_STRUCT *header, mfile_t *p_file_in, uint32_t file_offset, off_t file_sz, uint8_t *p_flags)
 
MERROR_RETVAL mfmt_read_bmp_palette (struct MFMT_STRUCT *header, uint32_t *palette, size_t palette_sz, mfile_t *p_file_in, uint32_t file_offset, off_t file_sz, uint8_t flags)
 
MERROR_RETVAL mfmt_read_bmp_px (struct MFMT_STRUCT *header, uint8_t SEG_FAR *px, off_t px_sz, mfile_t *p_file_in, uint32_t file_offset, off_t file_sz, uint8_t flags)
 Read mfmt_bitmap pixels into an 8-bit memory bitmap.