-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathraw2bmp.h
42 lines (33 loc) · 813 Bytes
/
raw2bmp.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef __RAW2BMP_H__
#define __RAW2BMP_H__
#ifdef __cplusplus
extern "C" {
#endif
#ifdef _WIN32
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned long uint32_t;
#else
#include <string.h>
#include "bitmap.h"
#include <stdint.h>
#endif
enum image_orient { LANDSCAPE, PORTRAIT };
typedef enum image_orient IMAGE_ORIENT;
#pragma pack(push)
#pragma pack(1)
typedef struct bmp_file
{
BITMAPFILEHEADER bfHeader;
BITMAPINFOHEADER bmiHeader;
RGBQUAD bmiColors[256];
} BMP_FILE;
#pragma pack(pop)
void ffc_offset(uint16_t* buf, const uint16_t* ffc, size_t pixels);
uint8_t* raw2bmp(uint16_t *rawbuf, size_t pixels, IMAGE_ORIENT orient, BMP_FILE* bmpFile);
#ifdef __cplusplus
}
#endif
#endif /* __RAW2BMP_H__ */