-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtypes.h
45 lines (37 loc) · 806 Bytes
/
types.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
43
44
45
/*
* Copyright (c) 2011, ChanMin Kim ([email protected])
*
* This files is licensed under a Creative Commons license:
* http://creativecommons.org/licenses/by-nc-sa/3.0/
*/
#ifndef _TYPES_H__
#define _TYPES_H__
#include <cstdint>
#include <bits/types.h>
typedef uint8_t BYTE;
typedef uint32_t dimension_t;
enum class PixelFormat : uint32_t
{
NONE = 0,
X8R8G8B8 = 1
};
struct Image
{
dimension_t width;
dimension_t height;
/// stride in bytes
ssize_t stride;
PixelFormat pixfmt;
BYTE *imageData;
Image()
: width(0), height(0), stride(0), pixfmt(PixelFormat::NONE), imageData(NULL)
{
}
Image(dimension_t width, dimension_t height,
ssize_t stride, PixelFormat pixfmt, BYTE *data)
: width(width), height(height), stride(stride),
pixfmt(pixfmt), imageData(data)
{
}
};
#endif