File: testutils.h

package info (click to toggle)
libvidstab 1.1.0-2.1
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 648 kB
  • sloc: ansic: 6,094; makefile: 19; sh: 14
file content (33 lines) | stat: -rw-r--r-- 728 bytes parent folder | download | duplicates (2)
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
#ifndef __TESTUTILS_H
#define __TESTUTILS_H

#include "libvidstab.h"

typedef struct _test_data {
  VSFrameInfo fi;
  VSFrameInfo fi_color;
  VSFrame frames[5];
} TestData;


VSTransform getTestFrameTransform(int i);

void fillArrayWithNoise(unsigned char* buffer, int length, float corr);

void paintRectangle(unsigned char* buffer, const VSFrameInfo* fi, int x, int y,
                    int sizex, int sizey, unsigned char color);

inline static unsigned char randPixel(){
  return rand()%256;
}

inline static short randUpTo(short max){
  return rand()%max;
}


int loadPGMImage(const char* filename, VSFrame* frame, VSFrameInfo* fi);

int storePGMImage(const char* filename, const uint8_t* data, VSFrameInfo fi );

#endif