Пример #1
0
    def process(filename, w, h, output=None):
        if output is None:
            output = filename

        # output = filename + '-toaster.miff'
        scratch = filename + 'scratch.miff'

        # colortone
        # scratch = colortone(filename, '#330000', 100, 0, output=scratch)
        #scratch = colortone(filename, '#220000', 100, 0, output=scratch)
        scratch = colortone(filename, '#110000', 105, 0, output=scratch)

        brightness = Config.get('postprocessing', 'brightness')

        # contrast
        cmd = 'convert {} -modulate {},105,100 {}'.format(
            brightness, scratch, scratch
        )

        execute(cmd)

        # vignette kungfu
        #scratch = vignette(scratch, w, h, 'none', 'LavenderBlush3')
        #scratch = vignette(scratch, w, h, '#FFD6C2', 'none')
        #scratch = vignette(scratch, w, h, '#E3C2B8', 'none')
        scratch = vignette(scratch, w, h, '#b3a298', 'none')

        execute('convert {} {}'.format(scratch, output))
        os.unlink(scratch)

        return output
Пример #2
0
    def __init__(self):
        logger.debug('building new session...')

        self.template = configparser.ConfigParser()
        self.template.read(template_path)
        self.camera = None

        self.plugins = dict((get_class(p), p) for p in
                            getPlugins(ipyrikura.IPyrikuraPlugin))

        for name in self.plugins.keys():
            logger.debug("loaded plugin %s", name)

        self.camera = self.plugins['ShutterCamera'].new(
            re.compile(Config.get('camera', 'name')))
Пример #3
0
def new():
    import time

    # turn on all the relays on the arduino
    # the lights are wired on NC, so this turns lights off
    def lights_out():
        arduino.sendCommand(0x81, 0)
        arduino.sendCommand(0x81, 1)
        arduino.sendCommand(0x81, 2)
        arduino.sendCommand(0x81, 3)

    logger.debug('starting photo booth service')
    session = Session()

    # preview frame producer
    logger.debug('starting camera preview service')
    preview_port = 23453
    factory = protocol.Factory()
    factory.protocol = session.camera.create_producer
    reactor.listenTCP(preview_port, factory)

    # get the arduino going
    logger.debug('starting arduino')
    arduino = Arduino(session)
    try:
        s = SerialPort(arduino, Config.get('arduino', 'port'), reactor,
                       baudrate=Config.getint('arduino', 'baudrate'))
    except serial.serialutil.SerialException:
        raise

    # give arduino a couple seconds to be ready to accept data
    time.sleep(5)
    reactor.callWhenRunning(lights_out)

    # arduino servo tilt server
    logger.debug('starting tilt command listener')
    reactor.listenTCP(Config.getint('arduino', 'tcp-port'),
                      ServoServiceFactory(arduino))

    return reactor
Пример #4
0
import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("purikura.kiosk-loader")

DEFAULT_VKEYBOARD_LAYOUT = 'email'

# because i hate typing
jpath = os.path.join

# set keyboard behaviour to be a little like ios
Config.set('kivy', 'keyboard_mode', 'dock')
Config.set('kivy', 'keyboard_layout', DEFAULT_VKEYBOARD_LAYOUT)

# set the display up
Config.set('graphics', 'fullscreen',
           pkConfig.get('display', 'fullscreen'))
Config.set('graphics', 'width',
           pkConfig.getint('display', 'width'))
Config.set('graphics', 'height',
           pkConfig.getint('display', 'height'))

# the display/touch input i use needs some love
Config.set('postproc', 'retain_time',
           pkConfig.getint('kiosk', 'touch-retain-time'))
Config.set('postproc', 'retain_distance',
           pkConfig.getint('kiosk', 'touch-retain-distance'))

# paths
all_images_path = pkConfig.get('paths', 'images')
event_name = pkConfig.get('event', 'name')
event_images_path = jpath(all_images_path, event_name)
Пример #5
0
import re

from pyrikura import ipyrikura
from pyrikura import resources
from pyrikura import template
from pyrikura.config import Config

import logging
logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("purikura.booth")

# because i hate typing
jpath = os.path.join

# paths
app_root_path = Config.get('paths', 'root')
app_config_path = jpath(app_root_path, 'config')
app_resources_path = jpath(app_root_path, 'resources')
app_sounds_path = jpath(app_resources_path, 'sounds')
app_images_path = jpath(app_resources_path, 'images')
all_templates_path = jpath(app_resources_path, 'templates')
all_images_path = Config.get('paths', 'images')
shared_path = Config.get('paths', 'shared')
plugins_path = Config.get('paths', 'plugins')

# event paths
event_name = Config.get('event', 'name')
template_path = jpath(all_templates_path, Config.get('event', 'template'))
event_images_path = jpath(all_images_path, event_name)
thumbs_path = jpath(event_images_path, 'thumbnails')
details_path = jpath(event_images_path, 'detail')