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