Update the changelog
[opencv] / tests / python / highgui / cvMoveResizeWindow.py
1 #! /usr/bin/env python
2 """
3 This script will test highgui's window move/resize functionality
4 """
5
6 # name of this test and it's requirements
7 TESTNAME = "cvMoveResizeWindow"
8 REQUIRED = ["cvNamedWindow"]
9
10  
11 # needed for sys.exit(int) and .works file handling
12 import sys
13 import works
14
15 # check requirements and delete old flag file, if it exists
16 if not works.check_files(REQUIRED,TESTNAME):
17         sys.exit(77)
18
19 # import the necessary things for OpenCV
20 import python
21 from python.highgui import *
22 from python.cv import *
23
24 # create a window
25 cvNamedWindow(TESTNAME, CV_WINDOW_AUTOSIZE)
26
27 # move the window around
28 cvMoveWindow(TESTNAME,   0,   0)
29 cvMoveWindow(TESTNAME, 100,   0)
30 cvMoveWindow(TESTNAME, 100, 100)
31 cvMoveWindow(TESTNAME,   0, 100)
32
33 # resize the window
34 for i in range(1,10):
35         cvResizeWindow(TESTNAME, i*100, i*100)
36
37 # destroy the window
38 cvDestroyWindow(TESTNAME)
39
40 # create flag file for following tests
41 works.set_file(TESTNAME)
42
43 # return 0 (success)
44 sys.exit(0)