filmtools / filmspeed
Interfaces, classes and traits for film speed information
1.0.0
2019-03-25 19:50 UTC
Requires
- php: ^7.0
- filmtools/mround: ^1.0.0
Requires (Dev)
- php-coveralls/php-coveralls: ^2.0
- phpunit/phpunit: ^5.7|^6.0|^7.0
- spatie/phpunit-watcher: ^1.8
This package is auto-updated.
Last update: 2024-11-26 08:57:22 UTC
README
Interfaces, classes and traits for film speed information
FilmSpeed classes
<?php use FilmTools\FilmSpeed\AsaFilmSpeed; use FilmTools\FilmSpeed\DinFilmSpeed; $asa = 100; $s1 = new AsaFilmSpeed( $asa ); $s1->getAsa(); // 100 $s1->getDin(); // 21 $s1->getIso(); // "ISO 100/21°" $din = 27; $s2 = new DinFilmSpeed( $din ); $s2->getAsa(); // 400 $s2->getDin(); // 27 $s2->getIso(); // "ISO 400/27°"
Interfaces
FilmSpeedInterface
use FilmTools\FilmSpeed\FilmSpeedInterface; // Returns the Film speed as DIN number. // Because the value may be calculated, this value is float. public function getDin() : float; // Returns the Film speed as ASA number. //Because the value may be calculated, this value is float. public function getAsa() : float; // Returns the Film speed as ISO-formatted string like "ISO 400/27°" public function getIso() : string;
FilmSpeedProvider Interface and Trait
The FilmSpeedProviderTrait provides a protected $filmspeed attribute. It helps to fulfill the FilmSpeedProviderInterface.
use FilmTools\FilmSpeed\FilmSpeedProviderInterface; use FilmTools\FilmSpeed\FilmSpeedProviderTrait; // Returns the Film speed. public function getFilmSpeed() : FilmSpeedInterface;
FilmSpeedAwareInterface
The FilmSpeedAwareTrait provides a setFilmSpeed setter method. It also uses the FilmSpeedProviderTrait.
use FilmTools\FilmSpeed\FilmSpeedAwareInterface; use FilmTools\FilmSpeed\FilmSpeedAwareTrait; // Sets the Film speed. public function setFilmSpeed( FilmSpeedInterface $filmspeed );