Blender  V3.3
Classes | Macros | Typedefs | Functions
bmp.c File Reference
#include <math.h>
#include "BLI_fileops.h"
#include "BLI_utildefines.h"
#include "imbuf.h"
#include "IMB_filetype.h"
#include "IMB_imbuf.h"
#include "IMB_imbuf_types.h"
#include "IMB_colormanagement.h"
#include "IMB_colormanagement_intern.h"

Go to the source code of this file.

Classes

struct  BMPINFOHEADER
 

Macros

#define BMP_FILEHEADER_SIZE   14
 
#define CHECK_HEADER_FIELD(_mem, _field)   ((_mem[0] == _field[0]) && (_mem[1] == _field[1]))
 
#define CHECK_HEADER_FIELD_BMP(_mem)
 

Typedefs

typedef struct BMPINFOHEADER BMPINFOHEADER
 

Functions

static bool checkbmp (const uchar *mem, const size_t size)
 
bool imb_is_a_bmp (const uchar *buf, size_t size)
 
static size_t imb_bmp_calc_row_size_in_bytes (size_t x, size_t depth)
 
ImBufimb_bmp_decode (const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
static int putIntLSB (uint ui, FILE *ofile)
 
static int putShortLSB (ushort us, FILE *ofile)
 
bool imb_savebmp (ImBuf *ibuf, const char *filepath, int UNUSED(flags))
 

Macro Definition Documentation

◆ BMP_FILEHEADER_SIZE

#define BMP_FILEHEADER_SIZE   14

Definition at line 51 of file bmp.c.

◆ CHECK_HEADER_FIELD

#define CHECK_HEADER_FIELD (   _mem,
  _field 
)    ((_mem[0] == _field[0]) && (_mem[1] == _field[1]))

Definition at line 53 of file bmp.c.

◆ CHECK_HEADER_FIELD_BMP

#define CHECK_HEADER_FIELD_BMP (   _mem)
Value:
(CHECK_HEADER_FIELD(_mem, "BM") || CHECK_HEADER_FIELD(_mem, "BA") || \
CHECK_HEADER_FIELD(_mem, "CI") || CHECK_HEADER_FIELD(_mem, "CP") || \
CHECK_HEADER_FIELD(_mem, "IC") || CHECK_HEADER_FIELD(_mem, "PT"))
#define CHECK_HEADER_FIELD(_mem, _field)
Definition: bmp.c:53

Definition at line 54 of file bmp.c.

Typedef Documentation

◆ BMPINFOHEADER

typedef struct BMPINFOHEADER BMPINFOHEADER

Function Documentation

◆ checkbmp()

static bool checkbmp ( const uchar mem,
const size_t  size 
)
static

◆ imb_bmp_calc_row_size_in_bytes()

static size_t imb_bmp_calc_row_size_in_bytes ( size_t  x,
size_t  depth 
)
static

Definition at line 98 of file bmp.c.

References x.

Referenced by imb_bmp_decode().

◆ imb_bmp_decode()

ImBuf* imb_bmp_decode ( const uchar mem,
size_t  size,
int  flags,
char  colorspace[IM_MAX_SPACE] 
)

◆ imb_is_a_bmp()

bool imb_is_a_bmp ( const uchar buf,
size_t  size 
)

Definition at line 93 of file bmp.c.

References checkbmp(), and size().

◆ imb_savebmp()

bool imb_savebmp ( ImBuf ibuf,
const char *  filepath,
int   UNUSEDflags 
)

◆ putIntLSB()

static int putIntLSB ( uint  ui,
FILE *  ofile 
)
static

Definition at line 279 of file bmp.c.

Referenced by imb_savebmp().

◆ putShortLSB()

static int putShortLSB ( ushort  us,
FILE *  ofile 
)
static

Definition at line 287 of file bmp.c.

Referenced by imb_savebmp().