filmtools/standards
Composer 安装命令:
composer require filmtools/standards
包简介
Interfaces and Classes for FilmTools' Film developing standards
README 文档
README
Still in experimental state
Installation
$ composer require filmtools/standards
Interfaces and Traits
The StandardInterface
<?php use FilmTools\Standards\StandardInterface; // Returns a name or short description of this developing standard. public function getName() : string; // Returns the minimum film density of interest public function getDmin() : float; // Returns the maximum film density of interest public function getDmax() : float; // Returns the file path to CSV with norm data public function getNormDataFile() : string;
StandardProviderInterface
<?php use FilmTools\Standards\StandardProviderInterface; // Returns the Standard instance, or null. public function getStandard() : ?StandardInterface;
StandardProviderTrait
This trait implements the getStandard method as a public standard member attribute.
<?php use FilmTools\Standards\StandardProviderTrait; use FilmTools\Standards\StandardProviderInterface; class MyClass implements StandardProviderInterface { use StandardProviderTrait; } $foo = new MyClass; print_r( $foo->standard ); print_r( $foo->getStandard() );
StandardAwareInterface
The StandardAwareInterface extends StandardProviderInterface.
<?php use FilmTools\Standards\StandardAwareInterface; // Sets the Standard instance. public function setStandard( StandardInterface $standard);
StandardAwareTrait
The StandardAwareTrait uses StandardProviderTrait and implements setStandard method:
<?php use FilmTools\Standards\StandardAwareTrait; use FilmTools\Standards\StandardAwareInterface; use FilmTools\Standards\TraditionalStandard; class MyClass implements StandardAwareInterface { use StandardAwareTrait; } $foo = new MyClass; $foo->setStandard( new TraditionalStandard ); print_r( $foo->standard ); print_r( $foo->getStandard() );
Classes
The Standard Factory
This callable class creates a StandardInterface instance according to the developing standard name. The result is an extension of the Standard class.
The constructor accepts a name of the default standard which defaults to iso6.
See the examples below on how to setup a developing standard.
<?php use FilmTools\Standards\StandardsFactory; $standard_factory = new StandardsFactory; $standard_factory = new StandardsFactory("iso6"); // Call without standard name $standard = $standard_factory(); echo get_class($standard); // FilmTools\Standards\TraditionalStandard
Standard classes
ISO 6 (Traditional Standard)
<?php use FilmTools\Standards\TraditionalStandard; use FilmTools\Standards\TraditionalInterface; echo TraditionalInterface::DMIN; // 0.1 echo TraditionalInterface::DMAX; // 1.29 $standard = new TraditionalStandard; $standard = $standard_factory("iso6"); $standard = $standard_factory("traditional"); echo $standard->getName(); // "Traditional (ISO6)" echo $standard->getDmin(); // 0.1 echo $standard->getDmax(); // 1.29 echo $standard->getNormDataFile // "/path/to/normdensities-iso6.csv"
Lambrecht/Woodhouse Standard
Ralph W. Lambrecht and Chris Woodhouse work in their famous book “Way Beyond Monochrome” with slightly higher density values.
<?php use FilmTools\Standards\LambrechtWoodhouseStandard; use FilmTools\Standards\LambrechtWoodhouseInterface; echo LambrechtWoodhouseInterface::DMIN; // 0.17 echo LambrechtWoodhouseInterface::DMAX; // 1.37 $standard = $standard_factory("wbm"); $standard = new LambrechtWoodhouseStandard; echo $standard->getName(); // "Way Beyond Monochrome (Lambrecht/Woodhouse)" echo $standard->getDmin(); // 0.17 echo $standard->getDmax(); // 1.37 echo $standard->getNormDataFile // "/path/to/normdensities-wbm.csv"
Kodak Standard
The Kodak standard extends from TraditionalStandard.
<?php use FilmTools\Standards\KodakStandard; $standard = $standard_factory("kodak"); $standard = $standard_factory("ci"); $standard = new KodakStandard; echo $standard->getName(); // "Contrast Index (Kodak)" echo $standard->getDmin(); // 0.1 echo $standard->getDmax(); // 1.29 echo $standard->getNormDataFile // "/path/to/normdensities-ci.csv"
Ilford Standard
The Ilford standard extends from TraditionalStandard.
<?php use FilmTools\Standards\IlfordStandard; $standard = $standard_factory("ilford"); $standard = $standard_factory("gbar"); $standard = new IlfordStandard; echo $standard->getName(); // "G-bar (Ilford)" echo $standard->getDmin(); // 0.1 echo $standard->getDmax(); // 1.29 echo $standard->getNormDataFile // "/path/to/normdensities-iso6.csv"
filmtools/standards 适用场景与选型建议
filmtools/standards 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 20 次下载、GitHub Stars 达 0, 最近一次更新时间为 2019 年 04 月 02 日, 在 PHP 生态内属于活跃度较高的组件。
我们在过去多个企业项目中使用过 filmtools/standards 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 filmtools/standards 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
统计信息
- 总下载量: 20
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 5
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-04-02