Ejemplo n.º 1
0
 def __init__(self, headless=None):
     '''
     constructor
     '''
     super().__init__()
     if headless is None:
         self.headless = Environment.inContinuousIntegration()
     else:
         self.headless = headless
     rlen = len(Environment4Test.rotations)
     wlen = len(Environment4Test.warpPointList)
     fenlen = len(Environment4Test.fens)
     if rlen != wlen:
         raise Exception("%d rotations for %d warpPoints" % (rlen, wlen))
     if fenlen != wlen:
         raise Exception("%d FENs for %d images" % (fenlen, wlen))
     self.imageInfos = []
     for num in range(1, 1000):
         path = self.testMedia + "chessBoard%03d.jpg" % (num)
         if not os.path.isfile(path):
             break
         if num - 1 >= len(Environment4Test.rotations):
             raise Exception("%d test files for %d warpPoints/rotations" %
                             (num, wlen))
         imageInfo = ImageInfo(
             num,
             title="image%03d" % (num),
             path=path,
             fen=Environment4Test.fens[num - 1],
             rotation=Environment4Test.rotations[num - 1],
             warpPoints=Environment4Test.warpPointList[num - 1])
         self.imageInfos.append(imageInfo)
Ejemplo n.º 2
0
 def __init__(self, args, board=None):
     self.device = args.input
     self.title = Video.title(self.device)
     self.video = Video(self.title)
     self.video.headless = Environment.inContinuousIntegration()
     self.args = args
     self.showDebug = args.debug
     self.start = None
     self.quitWanted = False
     self.hasImage = False
     self.timestamps = []
     self.debug = args.debug
     if board is None:
         board = Board(args=args)
     self.board = board
     if self.args.fen is not None:
         self.board.updatePieces(self.args.fen)
     self.warp = Warp(args.warpPointList)
     self.warp.rotation = args.rotation
     if self.args.nowarp:
         self.warp.warping = True
     self.firstFrame = True
     self.speedup = args.speedup
     pass
Ejemplo n.º 3
0
 def getVideo():
     video = Video()
     video.headless = Environment.inContinuousIntegration()
     return video