PHP classes for film developings
$ composer require filmtools/developingThis library requires the filmtools/commons library as well as psr/container.
The Developing class aggregates what makes a film developing: an exposure series, a developing time, and negative densities.
<?phpuseFilmTools\Developing\Developing;
$exposures = array( 0, 0.3, 0.6, 0.9);
$densities = array( 0, 0.1, 0.4, 0.6);
$dev_time = 600;
$developing = newDeveloping( $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:
useFilmTools\Commons\Exposures;
useFilmTools\Commons\Zones;
useFilmTools\Commons\FStops;
useFilmTools\Commons\Densities;
$exposures = newExposure0, 0.3, 0.6, 0.9 ]);
$exposures = newZones([ 0, 1, 2, 3 ]);
$exposures = newFStops([ -5, -4, -3, -2 ]);
$densities = newDensities([ 0, 0.1, 0.4, 0.6 ]);
$developing = newDeveloping( $exposures, $densities, 600);The Developing class implements DensitiesProviderInterface which itself extends from ExposuresProviderInterface and DensitiesProviderInterface, both from the filmtools/commons library.
useFilmTools\Commons\Exposures;
useFilmTools\Commons\Densities;
// Returns "Exposures" instancepublicfunction getExposures() : ExposuresInterface;
// Returns "Densities" instancepublicfunction getDensities() : DensitiesInterface;
// Returns the developing time.publicfunction getTime() : int;DensitiesProviderInterface additionally extends from \Psr\Container\ContainerInterface, \Countable, and \IteratorAggregate.
// Countableechocount($developing); // 4// IteratorAggregateforeach( $developingas$logH => $logD):
// noopendforeach;usePsr\Container\NotFoundExceptionInterface;
useFilmTools\Developing\ExposureNotFoundException;
// ContainerInterfacetry {
$bool = $developing->has( 99 ); // false$logD = $developing->get( 99 ); // FALSE
}
catch (NotFoundExceptionInterface$e)
{
echoget_class($e); // ExposureNotFoundException
}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.
class MyClass extends Developing
{ ... }
$developing_factory = newDevelopingFactory;
$developing_factory = newDevelopingFactory( 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:
$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 ]
]);Allowed field names for Density values are logD, density, and densities.
Allowed field names for Exposure values are logH, exposure, and exposures.
Allowed field names for fstops values are fstop and fstops.
Allowed field names for zone numbers values are zone and zones.
Allowed field names for time values are seconds and time.
The most specific column will be used.
The Developing class implements the getData method as prescribed by DevelopingInterface. This method is deprecated and will be removed with next major release.
$ git clone https://github.com/filmtools/developing.git
$ cd developing
$ composer install
# either, or, and:
$ composer test
$ vendor/bin/phpunit

