<?php

require __DIR__ . '/../vendor/autoload.php';
use Cvuorinen\Raspicam\Raspistill;
$camera = new Raspistill();
// Take picture with default configurations
$camera->takePicture('pic1.jpg');
// Configure camera with fluent interface
$camera->flip()->brightness(65)->contrast(45)->raw(true)->exposure(Raspistill::EXPOSURE_BACKLIGHT)->effect(Raspistill::EFFECT_FILM)->ISO(600)->whiteBalance(Raspistill::WHITE_BALANCE_FLUORESCENT)->quality(50)->shutterSpeed(0.75)->timeout(1);
$camera->takePicture('pic2.jpg');
// Configure camera with a constructor parameter array
$camera2 = new Raspistill(['timeout' => 2.5, 'raw' => true, 'rotate' => 90, 'width' => 640, 'height' => 480, 'exposure' => Raspistill::EXPOSURE_NIGHT, 'sharpness' => 85]);
$camera2->takePicture('pic3.jpg');
示例#2
0
 public function testConstructorArraySetsCorrectArguments()
 {
     $options = ['flip' => true, 'contrast' => 50, 'ISO' => 500, 'exposure' => Raspistill::EXPOSURE_NIGHT, 'shutterSpeed' => 1.5];
     $expectedArguments = ['--vflip', '--hflip', '--contrast', '--ISO', '--exposure', '--shutter'];
     $raspistill = new Raspistill($options);
     $raspistill->setCommandRunner($this->commandRunner);
     $this->expectCommandContains($expectedArguments);
     $raspistill->takePicture('foo.jpg');
 }