filmtools/filmspeed

Interfaces, classes and traits for film speed information

1.0.0 2019-03-25 19:50 UTC

This package is auto-updated.

Last update: 2024-11-26 08:57:22 UTC


README

Interfaces, classes and traits for film speed information

Packagist PHP version Build Status Scrutinizer Code Quality Code Coverage Build Status

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 );