2017 © Pedro Peláez
 

library developing

PHP classes for film developings

image

filmtools/developing

PHP classes for film developings

  • Tuesday, June 19, 2018
  • by tomkyle
  • Repository
  • 1 Watchers
  • 0 Stars
  • 10 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

FilmTools · Developing

PHP classes for film developings, (*1)

Build Status Scrutinizer Code Quality Code Coverage Build Status, (*2)

Installation

$ composer require filmtools/developing

This library requires the filmtools/commons library as well as psr/container., (*3)

The Developing class

The Developing class aggregates what makes a film developing: an exposure series, a developing time, and negative densities., (*4)

<?php
use FilmTools\Developing\Developing;

$exposures = array( 0, 0.3, 0.6, 0.9);
$densities = array( 0, 0.1, 0.4, 0.6);
$dev_time = 600;

$developing = new Developing( $exposures, $densities, $dev_time);

The constructor not only accepts exposure and densities arrays. It also accepts the Exposures variations or Densities objects from the filmtools/commons library:, (*5)

use FilmTools\Commons\Exposures;
use FilmTools\Commons\Zones;
use FilmTools\Commons\FStops;
use FilmTools\Commons\Densities;

$exposures = new Exposure 0, 0.3, 0.6, 0.9 ]);
$exposures = new Zones([ 0, 1, 2, 3 ]);
$exposures = new FStops([ -5, -4, -3, -2 ]);
$densities = new Densities([  0, 0.1, 0.4, 0.6 ]);

$developing = new Developing( $exposures, $densities, 600);

Methods API

The Developing class implements DensitiesProviderInterface which itself extends from ExposuresProviderInterface and DensitiesProviderInterface, both from the filmtools/commons library., (*6)

use FilmTools\Commons\Exposures;
use FilmTools\Commons\Densities;

// Returns "Exposures" instance
public function getExposures() : ExposuresInterface;

// Returns "Densities" instance
public function getDensities() : DensitiesInterface;

// Returns the developing time.
public function getTime() : int;

DensitiesProviderInterface additionally extends from \Psr\Container\ContainerInterface, \Countable, and \IteratorAggregate., (*7)

// Countable
echo count($developing); // 4
// IteratorAggregate
foreach( $developing as $logH => $logD):
// noop
endforeach;
use Psr\Container\NotFoundExceptionInterface;
use FilmTools\Developing\ExposureNotFoundException;

// ContainerInterface
try {
  $bool = $developing->has( 99 ); // false
  $logD = $developing->get( 99 ); // FALSE  
}
catch (NotFoundExceptionInterface $e)
{
  echo get_class($e); // ExposureNotFoundException
}

The DevelopingFactory

This callable class builds a new Developing instance from an associative Array. The constructor optionally accepts any FQDN of a class that extends from Developing., (*8)

class MyClass extends Developing
{ ... }

$developing_factory = new DevelopingFactory;
$developing_factory = new DevelopingFactory( MyClass::class );

$developing = $developing_factory([
    'time' => 600,
    'exposures' => [ 0, 0.3, 0.6, 0.9 ],
    'densities' => [ 0, 0.1, 0.4, 0.6 ],
]);

In case that you're not dealing with exposure values but zone numbers or f-stops rather, pass these instead. They will be converted to exposure values internally:, (*9)

$time = 600;
$densities = [ 0, 0.1, 0.4, 0.6 ];

$developing = $developing_factory([
    'time'      => $time,
    'densities' => $densities,
    'zones'     => [ 0, 1, 2, 3 ],  
]);

$developing = $developing_factory([
    'time'      => $time,
    'densities' => $densities,
    'fstops'    => [ -5, -4, 0, 1, 3 ]
]);

About field names

Allowed field names for Density values are logD, density, and densities., (*10)

Allowed field names for Exposure values are logH, exposure, and exposures., (*11)

Allowed field names for fstops values are fstop and fstops., (*12)

Allowed field names for zone numbers values are zone and zones., (*13)

Allowed field names for time values are seconds and time., (*14)

The most specific column will be used., (*15)

Deprecation notes

The Developing class implements the getData method as prescribed by DevelopingInterface. This method is deprecated and will be removed with next major release., (*16)

Development and Unit testing

$ git clone https://github.com/filmtools/developing.git
$ cd developing
$ composer install

# either, or, and:
$ composer test
$ vendor/bin/phpunit

The Versions

19/06 2018

dev-develop

dev-develop

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires

14/12 2017

dev-master

9999999-dev

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires

09/12 2017

1.0.4

1.0.4.0

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires

09/12 2017

1.0.3

1.0.3.0

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires

09/12 2017

1.0.2

1.0.2.0

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires

07/12 2017

1.0.1

1.0.1.0

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires

07/12 2017

1.0.0

1.0.0.0

PHP classes for film developings

  Sources   Download

CC By-Sa 3.0

The Requires

 

The Development Requires