Commit | Line | Data |
---|---|---|
80f575fc DM |
1 | #ifndef __TESTUTILS_H |
2 | #define __TESTUTILS_H | |
3 | ||
4 | #include "libvidstab.h" | |
5 | ||
6 | typedef struct _test_data { | |
7 | VSFrameInfo fi; | |
8 | VSFrameInfo fi_color; | |
9 | VSFrame frames[5]; | |
10 | } TestData; | |
11 | ||
12 | ||
13 | VSTransform getTestFrameTransform(int i); | |
14 | ||
15 | void fillArrayWithNoise(unsigned char* buffer, int length, float corr); | |
16 | ||
17 | void paintRectangle(unsigned char* buffer, const VSFrameInfo* fi, int x, int y, | |
18 | int sizex, int sizey, unsigned char color); | |
19 | ||
20 | inline static unsigned char randPixel(){ | |
21 | return rand()%256; | |
22 | } | |
23 | ||
24 | inline static short randUpTo(short max){ | |
25 | return rand()%max; | |
26 | } | |
27 | ||
28 | ||
29 | int loadPGMImage(const char* filename, VSFrame* frame, VSFrameInfo* fi); | |
30 | ||
31 | int storePGMImage(const char* filename, const uint8_t* data, VSFrameInfo fi ); | |
32 | ||
33 | #endif |