forked from abduld/libwb
-
Notifications
You must be signed in to change notification settings - Fork 0
/
wbImage.h
40 lines (30 loc) · 1.17 KB
/
wbImage.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
#ifndef __IMAGE_H__
#define __IMAGE_H__
#include "wbTypes.h"
struct st_wbImage_t {
int width;
int height;
int channels;
int pitch;
float *data;
};
#define wbImage_channels 3
#define wbImage_getWidth(img) ((img)->width)
#define wbImage_getHeight(img) ((img)->height)
#define wbImage_getChannels(img) ((img)->channels)
#define wbImage_getPitch(img) ((img)->pitch)
#define wbImage_getData(img) ((img)->data)
#define wbImage_setWidth(img, val) (wbImage_getWidth(img) = val)
#define wbImage_setHeight(img, val) (wbImage_getHeight(img) = val)
#define wbImage_setChannels(img, val) (wbImage_getChannels(img) = val)
#define wbImage_setPitch(img, val) (wbImage_getPitch(img) = val)
#define wbImage_setData(img, val) (wbImage_getData(img) = val)
typedef void (*wbImage_onSameFunction_t)(string str);
wbImage_t wbImage_new(int width, int height, int channels, float *data);
wbImage_t wbImage_new(int width, int height, int channels);
wbImage_t wbImage_new(int width, int height);
void wbImage_delete(wbImage_t img);
wbBool wbImage_sameQ(wbImage_t a, wbImage_t b,
wbImage_onSameFunction_t onUnSame);
wbBool wbImage_sameQ(wbImage_t a, wbImage_t b);
#endif /* __IMAGE_H__ */