コード例 #1
0
ファイル: photobooth.py プロジェクト: XeL64/pyPhotobooth
def StartSession():
    global countdown_timer 
    
    logger.info("START CAPTURE %d" % (stats.incr_session_count()))
    # turn off blink timer
    pygame.time.set_timer(EVT_BTN_BLINK, 0)               
    # start picture taking timer
    pygame.time.set_timer(EVT_PICTURE, int(config.DELAY_SECS * 1000))
    # start countdown update timer
    countdown_timer = config.DELAY_SECS
    pygame.time.set_timer(EVT_COUNTDOWN, 1000)
    # update screen
    gui.bg_redraw(screen)
    gui.show_all_thumbnail_markers(screen)
    gui.show_thumbnail_marker(screen, 0, config.MARKER_SELECT_COLOR)
    gui.display_delay(screen, "Get Ready...", countdown_timer)
    pygame.display.flip()
コード例 #2
0
ファイル: photobooth.py プロジェクト: XeL64/pyPhotobooth
            logger.info("EVT_PICTURE %d" % (len(capturedImages)+1))
            saveImg = cv.CreateImage((cropFrame.width, cropFrame.height), cropFrame.depth, cropFrame.nChannels)
            cv.Resize(cropFrame, saveImg)
            capturedImages.append(saveImg)
            gui.show_thumbnail(screen, cropFrame, len(capturedImages)-1)
            
            if (len(capturedImages) >= config.NUM_IMAGES):
                # Done taking pictures, stop current session                
                capture_in_progress = False
                StopSession(screen, capturedImages, event_dir)
            else:
                # Reset event timers and GUI for next picture in current session
                pygame.time.set_timer(EVT_COUNTDOWN, 0)
                countdown_timer = config.DELAY_SECS
                pygame.time.set_timer(EVT_COUNTDOWN, 1000)
                gui.show_thumbnail_marker(screen, len(capturedImages), config.MARKER_SELECT_COLOR)
                gui.display_delay(screen, "Get Ready...", countdown_timer)
        elif event.type == EVT_BTN_BLINK:
            ####################################################
            # Blink press button text
            ####################################################
            gui.blink_btn_text(screen)
        elif event.type == pygame.QUIT:
            ####################################################
            # Quit program
            ####################################################
            logger.info("EVT_QUIT" + str(event))
            on_exit = True

    # Process command queue
    if not capture_in_progress: