|
| 1 | +<?php |
| 2 | + |
| 3 | +/** |
| 4 | + * Vips is a php binding for the vips image processing library |
| 5 | + * |
| 6 | + * PHP version 7 |
| 7 | + * |
| 8 | + * LICENSE: |
| 9 | + * |
| 10 | + * Copyright (c) 2016 John Cupitt |
| 11 | + * |
| 12 | + * Permission is hereby granted, free of charge, to any person obtaining |
| 13 | + * a copy of this software and associated documentation files (the |
| 14 | + * "Software"), to deal in the Software without restriction, including |
| 15 | + * without limitation the rights to use, copy, modify, merge, publish, |
| 16 | + * distribute, sublicense, and/or sell copies of the Software, and to |
| 17 | + * permit persons to whom the Software is furnished to do so, subject to |
| 18 | + * the following conditions: |
| 19 | + * |
| 20 | + * The above copyright notice and this permission notice shall be |
| 21 | + * included in all copies or substantial portions of the Software. |
| 22 | + * |
| 23 | + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 24 | + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 25 | + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |
| 26 | + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |
| 27 | + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |
| 28 | + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |
| 29 | + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
| 30 | + * |
| 31 | + * @category Images |
| 32 | + * @package Jcupitt\Vips |
| 33 | + * @author John Cupitt <jcupitt@gmail.com> |
| 34 | + * @copyright 2016 John Cupitt |
| 35 | + * @license https://opensource.org/licenses/MIT MIT |
| 36 | + * @version GIT:ad44dfdd31056a41cbf217244ce62e7a702e0282 |
| 37 | + * @link https://github.com/jcupitt/php-vips |
| 38 | + */ |
| 39 | + |
| 40 | +namespace Jcupitt\Vips; |
| 41 | + |
| 42 | +/** |
| 43 | + * This class contains the top-level libvips control methods. |
| 44 | + * |
| 45 | + * @category Images |
| 46 | + * @package Jcupitt\Vips |
| 47 | + * @author John Cupitt <jcupitt@gmail.com> |
| 48 | + * @copyright 2016 John Cupitt |
| 49 | + * @license https://opensource.org/licenses/MIT MIT |
| 50 | + * @version Release:0.1.2 |
| 51 | + * @link https://github.com/jcupitt/php-vips |
| 52 | + */ |
| 53 | +class Main |
| 54 | +{ |
| 55 | + /** |
| 56 | + * Set the maximum number of operations to hold in the libvips operation |
| 57 | + * cache. |
| 58 | + * |
| 59 | + * @param integer $value The maximum number of operations to cache. |
| 60 | + * |
| 61 | + * @return void |
| 62 | + */ |
| 63 | + public static function cacheSetMax($value) |
| 64 | + { |
| 65 | + vips_cache_set_max($value); |
| 66 | + } |
| 67 | + |
| 68 | + /** |
| 69 | + * Set the maximum amount of memory to allow cached operations to use, in |
| 70 | + * bytes. |
| 71 | + * |
| 72 | + * @param integer $value The maximum amount of memory cached opertations can |
| 73 | + * hold, in bytes. |
| 74 | + * |
| 75 | + * @return void |
| 76 | + */ |
| 77 | + public static function cacheSetMaxMem($value) |
| 78 | + { |
| 79 | + vips_cache_set_max_mem($value); |
| 80 | + } |
| 81 | + |
| 82 | + /** |
| 83 | + * Set the maximum number of open files cached operations can use. |
| 84 | + * |
| 85 | + * @param integer $value The maximum number of open files cached operations |
| 86 | + * can use. |
| 87 | + * |
| 88 | + * @return void |
| 89 | + */ |
| 90 | + public static function cacheSetMaxFiles($value) |
| 91 | + { |
| 92 | + vips_cache_set_max_files($value); |
| 93 | + } |
| 94 | + |
| 95 | + /** |
| 96 | + * Set the size of the pools of worker threads vips uses for image |
| 97 | + * evaluation. |
| 98 | + * |
| 99 | + * @param integer $value The size of the pools of worker threads vips uses |
| 100 | + * for image evaluation. |
| 101 | + * |
| 102 | + * @return void |
| 103 | + */ |
| 104 | + public static function concurrencySet($value) |
| 105 | + { |
| 106 | + vips_concurrency_set($value); |
| 107 | + } |
| 108 | + |
| 109 | +} |
| 110 | + |
| 111 | +/* |
| 112 | + * Local variables: |
| 113 | + * tab-width: 4 |
| 114 | + * c-basic-offset: 4 |
| 115 | + * End: |
| 116 | + * vim600: expandtab sw=4 ts=4 fdm=marker |
| 117 | + * vim<600: expandtab sw=4 ts=4 |
| 118 | + */ |
| 119 | + |
| 120 | +?> |
0 commit comments