diff --git a/apps/files_external/lib/Lib/Storage/FtpConnection.php b/apps/files_external/lib/Lib/Storage/FtpConnection.php
index cca03ddda65d6..0b6c1108d1cfd 100644
--- a/apps/files_external/lib/Lib/Storage/FtpConnection.php
+++ b/apps/files_external/lib/Lib/Storage/FtpConnection.php
@@ -1,6 +1,7 @@
*
@@ -27,8 +28,7 @@
* Low level wrapper around the ftp functions that smooths over some difference between servers
*/
class FtpConnection {
- /** @var resource|\FTP\Connection */
- private $connection;
+ private \FTP\Connection $connection;
public function __construct(bool $secure, string $hostname, int $port, string $username, string $password) {
if ($secure) {
@@ -50,10 +50,7 @@ public function __construct(bool $secure, string $hostname, int $port, string $u
}
public function __destruct() {
- if ($this->connection) {
- ftp_close($this->connection);
- }
- $this->connection = null;
+ ftp_close($this->connection);
}
public function setUtf8Mode(): bool {
diff --git a/apps/theming/lib/ImageManager.php b/apps/theming/lib/ImageManager.php
index f536bae0421de..994e3f35118f9 100644
--- a/apps/theming/lib/ImageManager.php
+++ b/apps/theming/lib/ImageManager.php
@@ -240,7 +240,7 @@ public function updateImage(string $key, string $tmpFile): string {
imagesavealpha($newImage, true);
imagealphablending($newImage, true);
- $newWidth = (int)(imagesx($newImage) < 4096 ? imagesx($newImage) : 4096);
+ $newWidth = (imagesx($newImage) < 4096 ? imagesx($newImage) : 4096);
$newHeight = (int)(imagesy($newImage) / (imagesx($newImage) / $newWidth));
$outputImage = imagescale($newImage, $newWidth, $newHeight);
if ($outputImage === false) {
@@ -248,7 +248,7 @@ public function updateImage(string $key, string $tmpFile): string {
}
$newTmpFile = $this->tempManager->getTemporaryFile();
- imageinterlace($outputImage, 1);
+ imageinterlace($outputImage, true);
// Keep jpeg images encoded as jpeg
if (str_contains($detectedMimeType, 'image/jpeg')) {
if (!imagejpeg($outputImage, $newTmpFile, 90)) {
diff --git a/apps/user_ldap/lib/Access.php b/apps/user_ldap/lib/Access.php
index a51dfc3b349f5..7732f008a10e0 100644
--- a/apps/user_ldap/lib/Access.php
+++ b/apps/user_ldap/lib/Access.php
@@ -188,11 +188,6 @@ public function readAttribute(string $dn, string $attr, string $filter = 'object
return false;
}
$cr = $this->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- //LDAP not available
- $this->logger->debug('LDAP resource not available.', ['app' => 'user_ldap']);
- return false;
- }
$attr = mb_strtolower($attr, 'UTF-8');
// the actual read attribute later may contain parameters on a ranged
// request, e.g. member;range=99-199. Depends on server reply.
@@ -344,11 +339,6 @@ public function setPassword($userDN, $password) {
throw new \Exception('LDAP password changes are disabled.');
}
$cr = $this->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- //LDAP not available
- $this->logger->debug('LDAP resource not available.', ['app' => 'user_ldap']);
- return false;
- }
try {
// try PASSWD extended operation first
return @$this->invokeLDAPMethod('exopPasswd', $userDN, '', $password) ||
@@ -1108,12 +1098,6 @@ private function executeSearch(
) {
// See if we have a resource, in case not cancel with message
$cr = $this->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- // Seems like we didn't find any resource.
- // Return an empty array just like before.
- $this->logger->debug('Could not search, because resource is missing.', ['app' => 'user_ldap']);
- return false;
- }
//check whether paged search should be attempted
try {
@@ -1136,7 +1120,7 @@ private function executeSearch(
/**
* processes an LDAP paged search operation
*
- * @param resource|\LDAP\Result|resource[]|\LDAP\Result[] $sr the array containing the LDAP search resources
+ * @param \LDAP\Result|\LDAP\Result[] $sr the array containing the LDAP search resources
* @param int $foundItems number of results in the single search operation
* @param int $limit maximum results to be counted
* @param bool $pagedSearchOK whether a paged search has been executed
@@ -1249,7 +1233,7 @@ private function count(
}
/**
- * @param resource|\LDAP\Result|resource[]|\LDAP\Result[] $sr
+ * @param \LDAP\Result|\LDAP\Result[] $sr
* @return int
* @throws ServerNotAvailableException
*/
diff --git a/apps/user_ldap/lib/Connection.php b/apps/user_ldap/lib/Connection.php
index 788344b4e7d03..7c780ccbb4a4f 100644
--- a/apps/user_ldap/lib/Connection.php
+++ b/apps/user_ldap/lib/Connection.php
@@ -86,30 +86,15 @@
* @property string ldapAdminGroup
*/
class Connection extends LDAPUtility {
- /**
- * @var resource|\LDAP\Connection|null
- */
- private $ldapConnectionRes = null;
-
- /**
- * @var string
- */
- private $configPrefix;
-
- /**
- * @var ?string
- */
- private $configID;
-
- /**
- * @var bool
- */
- private $configured = false;
+ private ?\LDAP\Connection $ldapConnectionRes = null;
+ private string $configPrefix;
+ private ?string $configID;
+ private bool $configured = false;
/**
* @var bool whether connection should be kept on __destruct
*/
- private $dontDestruct = false;
+ private bool $dontDestruct = false;
/**
* @var bool runtime flag that indicates whether supported primary groups are available
@@ -241,14 +226,11 @@ public function init($force = false) {
}
/**
- * @return resource|\LDAP\Connection The LDAP resource
+ * @return \LDAP\Connection The LDAP resource
*/
- public function getConnectionResource() {
+ public function getConnectionResource(): \LDAP\Connection {
if (!$this->ldapConnectionRes) {
$this->init();
- } elseif (!$this->ldap->isResource($this->ldapConnectionRes)) {
- $this->ldapConnectionRes = null;
- $this->establishConnection();
}
if (is_null($this->ldapConnectionRes)) {
$this->logger->error(
@@ -263,7 +245,7 @@ public function getConnectionResource() {
/**
* resets the connection resource
*/
- public function resetConnectionResource() {
+ public function resetConnectionResource(): void {
if (!is_null($this->ldapConnectionRes)) {
@$this->ldap->unbind($this->ldapConnectionRes);
$this->ldapConnectionRes = null;
@@ -273,9 +255,8 @@ public function resetConnectionResource() {
/**
* @param string|null $key
- * @return string
*/
- private function getCacheKey($key) {
+ private function getCacheKey($key): string {
$prefix = 'LDAP-'.$this->configID.'-'.$this->configPrefix.'-';
if (is_null($key)) {
return $prefix;
@@ -332,9 +313,8 @@ public function clearCache() {
* Caches the general LDAP configuration.
* @param bool $force optional. true, if the re-read should be forced. defaults
* to false.
- * @return null
*/
- private function readConfiguration($force = false) {
+ private function readConfiguration(bool $force = false): void {
if ((!$this->configured || $force) && !is_null($this->configID)) {
$this->configuration->readConfiguration();
$this->configured = $this->validateConfiguration();
@@ -406,7 +386,7 @@ public function getConfiguration() {
return $result;
}
- private function doSoftValidation() {
+ private function doSoftValidation(): void {
//if User or Group Base are not set, take over Base DN setting
foreach (['ldapBaseUsers', 'ldapBaseGroups'] as $keyBase) {
$val = $this->configuration->$keyBase;
@@ -461,13 +441,9 @@ private function doSoftValidation() {
}
}
- /**
- * @return bool
- */
- private function doCriticalValidation() {
+ private function doCriticalValidation(): bool {
$configurationOK = true;
- $errorStr = 'Configuration Error (prefix '.
- (string)$this->configPrefix .'): ';
+ $errorStr = 'Configuration Error (prefix ' . $this->configPrefix . '): ';
//options that shall not be empty
$options = ['ldapHost', 'ldapUserDisplayName',
@@ -552,7 +528,7 @@ private function doCriticalValidation() {
* Validates the user specified configuration
* @return bool true if configuration seems OK, false otherwise
*/
- private function validateConfiguration() {
+ private function validateConfiguration(): bool {
if ($this->doNotValidate) {
//don't do a validation if it is a new configuration with pure
//default values. Will be allowed on changes via __set or
@@ -575,7 +551,7 @@ private function validateConfiguration() {
*
* @throws ServerNotAvailableException
*/
- private function establishConnection() {
+ private function establishConnection(): ?bool {
if (!$this->configuration->ldapConfigurationActive) {
return null;
}
@@ -663,15 +639,18 @@ private function establishConnection() {
/**
* @param string $host
* @param string $port
- * @return bool
* @throws \OC\ServerNotAvailableException
*/
- private function doConnect($host, $port) {
+ private function doConnect($host, $port): bool {
if ($host === '') {
return false;
}
- $this->ldapConnectionRes = $this->ldap->connect($host, $port);
+ $this->ldapConnectionRes = $this->ldap->connect($host, $port) ?: null;
+
+ if ($this->ldapConnectionRes === null) {
+ throw new ServerNotAvailableException('Connection failed');
+ }
if (!$this->ldap->setOption($this->ldapConnectionRes, LDAP_OPT_PROTOCOL_VERSION, 3)) {
throw new ServerNotAvailableException('Could not set required LDAP Protocol version.');
diff --git a/apps/user_ldap/lib/Group_LDAP.php b/apps/user_ldap/lib/Group_LDAP.php
index 699205cf501b5..09bdbd6db963d 100644
--- a/apps/user_ldap/lib/Group_LDAP.php
+++ b/apps/user_ldap/lib/Group_LDAP.php
@@ -1374,10 +1374,10 @@ public function getGroupDetails($gid) {
* of the current access.
*
* @param string $gid
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
* @throws ServerNotAvailableException
*/
- public function getNewLDAPConnection($gid) {
+ public function getNewLDAPConnection($gid): \LDAP\Connection {
$connection = clone $this->access->getConnection();
return $connection->getConnectionResource();
}
diff --git a/apps/user_ldap/lib/Group_Proxy.php b/apps/user_ldap/lib/Group_Proxy.php
index 7410aa6a6e9d0..1544d5f91e9e4 100644
--- a/apps/user_ldap/lib/Group_Proxy.php
+++ b/apps/user_ldap/lib/Group_Proxy.php
@@ -371,9 +371,9 @@ public function getLDAPAccess($gid) {
* The connection needs to be closed manually.
*
* @param string $gid
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
*/
- public function getNewLDAPConnection($gid) {
+ public function getNewLDAPConnection($gid): \LDAP\Connection {
return $this->handleRequest($gid, 'getNewLDAPConnection', [$gid]);
}
diff --git a/apps/user_ldap/lib/IGroupLDAP.php b/apps/user_ldap/lib/IGroupLDAP.php
index 2face1aa90748..ee83c18a8c6a9 100644
--- a/apps/user_ldap/lib/IGroupLDAP.php
+++ b/apps/user_ldap/lib/IGroupLDAP.php
@@ -36,7 +36,7 @@ public function getLDAPAccess($gid);
/**
* Return a new LDAP connection for the specified group.
* @param string $gid
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
*/
public function getNewLDAPConnection($gid);
}
diff --git a/apps/user_ldap/lib/ILDAPWrapper.php b/apps/user_ldap/lib/ILDAPWrapper.php
index 6ec88effa5f2c..ecf949c145a62 100644
--- a/apps/user_ldap/lib/ILDAPWrapper.php
+++ b/apps/user_ldap/lib/ILDAPWrapper.php
@@ -34,7 +34,7 @@ interface ILDAPWrapper {
/**
* Bind to LDAP directory
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @param string $dn an RDN to log in with
* @param string $password the password
* @return bool true on success, false otherwise
@@ -47,14 +47,14 @@ public function bind($link, $dn, $password);
* connect to an LDAP server
* @param string $host The host to connect to
* @param string $port The port to connect to
- * @return resource|\LDAP\Connection|false a link resource on success, otherwise false
+ * @return \LDAP\Connection|false a link resource on success, otherwise false
*/
public function connect($host, $port);
/**
* Retrieve the LDAP pagination cookie
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\Result $result LDAP result resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Result $result LDAP result resource
* @param string &$cookie structure sent by LDAP server
* @return bool true on success, false otherwise
*
@@ -64,22 +64,22 @@ public function controlPagedResultResponse($link, $result, &$cookie);
/**
* Count the number of entries in a search
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\Result $result LDAP result resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Result $result LDAP result resource
* @return int|false number of results on success, false otherwise
*/
public function countEntries($link, $result);
/**
* Return the LDAP error number of the last LDAP command
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @return int error code
*/
public function errno($link);
/**
* Return the LDAP error message of the last LDAP command
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @return string error message
*/
public function error($link);
@@ -95,69 +95,69 @@ public function explodeDN($dn, $withAttrib);
/**
* Return first result id
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\Result $result LDAP result resource
- * @return resource|\LDAP\ResultEntry an LDAP entry resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Result $result LDAP result resource
+ * @return \LDAP\ResultEntry an LDAP entry resource
* */
public function firstEntry($link, $result);
/**
* Get attributes from a search result entry
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\ResultEntry $result LDAP result resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\ResultEntry $result LDAP result resource
* @return array|false containing the results, false on error
* */
public function getAttributes($link, $result);
/**
* Get the DN of a result entry
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\ResultEntry $result LDAP result resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\ResultEntry $result LDAP result resource
* @return string|false containing the DN, false on error
*/
public function getDN($link, $result);
/**
* Get all result entries
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\Result $result LDAP result resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Result $result LDAP result resource
* @return array|false containing the results, false on error
*/
public function getEntries($link, $result);
/**
* Return next result id
- * @param resource|\LDAP\Connection $link LDAP link resource
- * @param resource|\LDAP\ResultEntry $result LDAP result resource
- * @return resource|\LDAP\ResultEntry an LDAP entry resource
+ * @param \LDAP\Connection $link LDAP link resource
+ * @param \LDAP\ResultEntry $result LDAP result resource
+ * @return \LDAP\ResultEntry an LDAP entry resource
* */
public function nextEntry($link, $result);
/**
* Read an entry
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @param string $baseDN The DN of the entry to read from
* @param string $filter An LDAP filter
* @param array $attr array of the attributes to read
- * @return resource|\LDAP\Result an LDAP search result resource
+ * @return \LDAP\Result an LDAP search result resource
*/
public function read($link, $baseDN, $filter, $attr);
/**
* Search LDAP tree
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @param string $baseDN The DN of the entry to read from
* @param string $filter An LDAP filter
* @param array $attr array of the attributes to read
* @param int $attrsOnly optional, 1 if only attribute types shall be returned
* @param int $limit optional, limits the result entries
- * @return resource|\LDAP\Result|false an LDAP search result resource, false on error
+ * @return \LDAP\Result|false an LDAP search result resource, false on error
*/
public function search($link, string $baseDN, string $filter, array $attr, int $attrsOnly = 0, int $limit = 0, int $pageSize = 0, string $cookie = '');
/**
* Replace the value of a userPassword by $password
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @param string $userDN the DN of the user whose password is to be replaced
* @param string $password the new value for the userPassword
* @return bool true on success, false otherwise
@@ -166,14 +166,14 @@ public function modReplace($link, $userDN, $password);
/**
* Performs a PASSWD extended operation.
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @return bool|string The generated password if new_password is empty or omitted. Otherwise true on success and false on failure.
*/
public function exopPasswd($link, string $userDN, string $oldPassword, string $password);
/**
* Sets the value of the specified option to be $value
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @param int $option a defined LDAP Server option
* @param mixed $value the new value for the option
* @return bool true on success, false otherwise
@@ -182,14 +182,14 @@ public function setOption($link, $option, $value);
/**
* establish Start TLS
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @return bool true on success, false otherwise
*/
public function startTls($link);
/**
* Unbind from LDAP directory
- * @param resource|\LDAP\Connection $link LDAP link resource
+ * @param \LDAP\Connection $link LDAP link resource
* @return bool true on success, false otherwise
*/
public function unbind($link);
@@ -205,6 +205,7 @@ public function areLDAPFunctionsAvailable();
/**
* Checks whether the submitted parameter is a resource
* @param mixed $resource the resource variable to check
+ * @psalm-assert-if-true object $resource
* @return bool true if it is a resource or LDAP object, false otherwise
*/
public function isResource($resource);
diff --git a/apps/user_ldap/lib/IUserLDAP.php b/apps/user_ldap/lib/IUserLDAP.php
index dfba11c5d3434..b4df16728a2e8 100644
--- a/apps/user_ldap/lib/IUserLDAP.php
+++ b/apps/user_ldap/lib/IUserLDAP.php
@@ -37,7 +37,7 @@ public function getLDAPAccess($uid);
/**
* Return a new LDAP connection for the specified user.
* @param string $uid
- * @return resource|\LDAP\Connection of the LDAP connection
+ * @return \LDAP\Connection of the LDAP connection
*/
public function getNewLDAPConnection($uid);
diff --git a/apps/user_ldap/lib/LDAP.php b/apps/user_ldap/lib/LDAP.php
index 8e63422b1ac4b..01f4e16ab1000 100644
--- a/apps/user_ldap/lib/LDAP.php
+++ b/apps/user_ldap/lib/LDAP.php
@@ -360,7 +360,7 @@ private function preFunctionCall(string $functionName, array $args): void {
/**
* Analyzes the returned LDAP error and acts accordingly if not 0
*
- * @param resource|\LDAP\Connection $resource the LDAP Connection resource
+ * @param \LDAP\Connection $resource the LDAP Connection resource
* @throws ConstraintViolationException
* @throws ServerNotAvailableException
* @throws \Exception
diff --git a/apps/user_ldap/lib/LDAPProvider.php b/apps/user_ldap/lib/LDAPProvider.php
index 751ebf6876847..353eefb7be4f4 100644
--- a/apps/user_ldap/lib/LDAPProvider.php
+++ b/apps/user_ldap/lib/LDAPProvider.php
@@ -149,7 +149,7 @@ public function sanitizeDN($dn) {
* Return a new LDAP connection resource for the specified user.
* The connection must be closed manually.
* @param string $uid user id
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
* @throws \Exception if user id was not found in LDAP
*/
public function getLDAPConnection($uid) {
@@ -163,7 +163,7 @@ public function getLDAPConnection($uid) {
* Return a new LDAP connection resource for the specified user.
* The connection must be closed manually.
* @param string $gid group id
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
* @throws \Exception if group id was not found in LDAP
*/
public function getGroupLDAPConnection($gid) {
diff --git a/apps/user_ldap/lib/User_LDAP.php b/apps/user_ldap/lib/User_LDAP.php
index d787bfea4d40c..7d5562f0ee013 100644
--- a/apps/user_ldap/lib/User_LDAP.php
+++ b/apps/user_ldap/lib/User_LDAP.php
@@ -622,7 +622,7 @@ public function getLDAPAccess($uid) {
* The cloned connection needs to be closed manually.
* of the current access.
* @param string $uid
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
*/
public function getNewLDAPConnection($uid) {
$connection = clone $this->access->getConnection();
diff --git a/apps/user_ldap/lib/User_Proxy.php b/apps/user_ldap/lib/User_Proxy.php
index 934bed7d45047..96415491e4129 100644
--- a/apps/user_ldap/lib/User_Proxy.php
+++ b/apps/user_ldap/lib/User_Proxy.php
@@ -438,7 +438,7 @@ public function getLDAPAccess($uid) {
* The connection needs to be closed manually.
*
* @param string $uid
- * @return resource|\LDAP\Connection The LDAP connection
+ * @return \LDAP\Connection The LDAP connection
*/
public function getNewLDAPConnection($uid) {
return $this->handleRequest($uid, 'getNewLDAPConnection', [$uid]);
diff --git a/apps/user_ldap/lib/Wizard.php b/apps/user_ldap/lib/Wizard.php
index 1f4794f164e6f..1b4c9162b71b9 100644
--- a/apps/user_ldap/lib/Wizard.php
+++ b/apps/user_ldap/lib/Wizard.php
@@ -48,8 +48,7 @@
class Wizard extends LDAPUtility {
protected static ?IL10N $l = null;
protected Access $access;
- /** @var resource|\LDAP\Connection|null */
- protected $cr;
+ protected ?\LDAP\Connection $cr = null;
protected Configuration $configuration;
protected WizardResult $result;
protected LoggerInterface $logger;
@@ -361,7 +360,7 @@ private function getUserAttributes() {
if (!$this->ldap->isResource($rr)) {
return false;
}
- /** @var resource|\LDAP\Result $rr */
+ /** @var \LDAP\Result $rr */
$er = $this->ldap->firstEntry($cr, $rr);
$attributes = $this->ldap->getAttributes($cr, $er);
if ($attributes === false) {
@@ -646,10 +645,6 @@ public function testLoginName(string $loginName) {
}
$cr = $this->access->connection->getConnectionResource();
- if (!$this->ldap->isResource($cr)) {
- throw new \Exception('connection error');
- }
- /** @var resource|\LDAP\Connection $cr */
if (mb_strpos($this->access->connection->ldapLoginFilter, '%uid', 0, 'UTF-8')
=== false) {
@@ -819,7 +814,7 @@ private function detectGroupMemberAssoc() {
if (!$this->ldap->isResource($rr)) {
return false;
}
- /** @var resource|\LDAP\Result $rr */
+ /** @var \LDAP\Result $rr */
$er = $this->ldap->firstEntry($cr, $rr);
while ($this->ldap->isResource($er)) {
$this->ldap->getDN($cr, $er);
@@ -866,7 +861,7 @@ private function testBaseDN(string $base): bool {
);
return false;
}
- /** @var resource|\LDAP\Result $rr */
+ /** @var \LDAP\Result $rr */
$entries = $this->ldap->countEntries($cr, $rr);
return ($entries !== false) && ($entries > 0);
}
@@ -929,7 +924,7 @@ private function composeLdapFilter(int $filterType): string {
if (!$this->ldap->isResource($rr)) {
continue;
}
- /** @var resource|\LDAP\Result $rr */
+ /** @var \LDAP\Result $rr */
$er = $this->ldap->firstEntry($cr, $rr);
$attrs = $this->ldap->getAttributes($cr, $er);
$dn = $this->ldap->getDN($cr, $er);
@@ -1073,7 +1068,7 @@ private function connectAndBind(int $port, bool $tls): bool {
if (!$this->ldap->isResource($cr)) {
throw new \Exception(self::$l->t('Invalid Host'));
}
- /** @var resource|\LDAP\Connection $cr */
+ /** @var \LDAP\Connection $cr */
//set LDAP options
$this->ldap->setOption($cr, LDAP_OPT_PROTOCOL_VERSION, 3);
@@ -1169,7 +1164,7 @@ public function cumulativeSearchOnAttribute(array $filters, string $attr, int $d
if (!$this->ldap->isResource($cr)) {
return false;
}
- /** @var resource|\LDAP\Connection $cr */
+ /** @var \LDAP\Connection $cr */
$lastFilter = null;
if (isset($filters[count($filters) - 1])) {
$lastFilter = $filters[count($filters) - 1];
@@ -1184,7 +1179,7 @@ public function cumulativeSearchOnAttribute(array $filters, string $attr, int $d
if (!$this->ldap->isResource($rr)) {
continue;
}
- /** @var resource|\LDAP\Result $rr */
+ /** @var \LDAP\Result $rr */
$entries = $this->ldap->countEntries($cr, $rr);
$getEntryFunc = 'firstEntry';
if (($entries !== false) && ($entries > 0)) {
@@ -1214,9 +1209,7 @@ public function cumulativeSearchOnAttribute(array $filters, string $attr, int $d
$dnReadCount++;
$foundItems = array_merge($foundItems, $newItems);
$dnRead[] = $dn;
- } while (($state === self::LRESULT_PROCESSED_SKIP
- || $this->ldap->isResource($entry))
- && ($dnReadLimit === 0 || $dnReadCount < $dnReadLimit));
+ } while ($dnReadLimit === 0 || $dnReadCount < $dnReadLimit);
}
}
@@ -1310,9 +1303,9 @@ private function getAttributeValuesFromEntry(array $result, string $attribute, a
}
/**
- * @return resource|\LDAP\Connection|false a link resource on success, otherwise false
+ * @return \LDAP\Connection|false a link resource on success, otherwise false
*/
- private function getConnection() {
+ private function getConnection(): \LDAP\Connection|false {
if (!is_null($this->cr)) {
return $this->cr;
}
diff --git a/apps/user_ldap/tests/AccessTest.php b/apps/user_ldap/tests/AccessTest.php
index 5469b9267e7a5..329cbbb56d477 100644
--- a/apps/user_ldap/tests/AccessTest.php
+++ b/apps/user_ldap/tests/AccessTest.php
@@ -114,6 +114,9 @@ private function getConnectorAndLdapMock() {
$connector = $this->getMockBuilder(Connection::class)
->setConstructorArgs([$lw, '', null])
->getMock();
+ $connector->expects($this->any())
+ ->method('getConnectionResource')
+ ->willReturn(ldap_connect('ldap://example.com'));
$um = $this->getMockBuilder(Manager::class)
->setConstructorArgs([
$this->createMock(IConfig::class),
@@ -287,6 +290,11 @@ public function testBatchApplyUserAttributes() {
->method('isResource')
->willReturn(true);
+ $this->connection
+ ->expects($this->any())
+ ->method('getConnectionResource')
+ ->willReturn(ldap_connect('ldap://example.com'));
+
$this->ldap->expects($this->any())
->method('getAttributes')
->willReturn(['displayname' => ['bar', 'count' => 1]]);
@@ -469,19 +477,18 @@ public function testSetPasswordWithLdapNotAvailable() {
$this->connection
->method('__get')
->willReturn(true);
- $connection = $this->createMock(LDAP::class);
+ $connection = ldap_connect('ldap://example.com');
$this->connection
->expects($this->once())
->method('getConnectionResource')
- ->willReturn($connection);
+ ->willThrowException(new \OC\ServerNotAvailableException('Connection to LDAP server could not be established'));
$this->ldap
- ->expects($this->once())
- ->method('isResource')
- ->with($connection)
- ->willReturn(false);
+ ->expects($this->never())
+ ->method('isResource');
- /** @noinspection PhpUnhandledExceptionInspection */
- $this->assertFalse($this->access->setPassword('CN=foo', 'MyPassword'));
+ $this->expectException(\OC\ServerNotAvailableException::class);
+ $this->expectExceptionMessage('Connection to LDAP server could not be established');
+ $this->access->setPassword('CN=foo', 'MyPassword');
}
@@ -492,16 +499,11 @@ public function testSetPasswordWithRejectedChange() {
$this->connection
->method('__get')
->willReturn(true);
- $connection = $this->createMock(LDAP::class);
+ $connection = ldap_connect('ldap://example.com');
$this->connection
->expects($this->any())
->method('getConnectionResource')
->willReturn($connection);
- $this->ldap
- ->expects($this->once())
- ->method('isResource')
- ->with($connection)
- ->willReturn(true);
$this->ldap
->expects($this->once())
->method('modReplace')
@@ -516,16 +518,11 @@ public function testSetPassword() {
$this->connection
->method('__get')
->willReturn(true);
- $connection = $this->createMock(LDAP::class);
+ $connection = ldap_connect('ldap://example.com');
$this->connection
->expects($this->any())
->method('getConnectionResource')
->willReturn($connection);
- $this->ldap
- ->expects($this->once())
- ->method('isResource')
- ->with($connection)
- ->willReturn(true);
$this->ldap
->expects($this->once())
->method('modReplace')
@@ -559,7 +556,7 @@ protected function prepareMocksForSearchTests(
->expects($this->any())
->method('isResource')
->willReturnCallback(function ($resource) {
- return is_resource($resource) || is_object($resource);
+ return is_object($resource);
});
$this->ldap
->expects($this->any())
diff --git a/apps/user_ldap/tests/ConnectionTest.php b/apps/user_ldap/tests/ConnectionTest.php
index b4e26c922ed31..1bacd433ed0bc 100644
--- a/apps/user_ldap/tests/ConnectionTest.php
+++ b/apps/user_ldap/tests/ConnectionTest.php
@@ -114,7 +114,7 @@ public function testUseBackupServer() {
$this->ldap->expects($this->exactly(3))
->method('connect')
- ->willReturn('ldapResource');
+ ->willReturn(ldap_connect('ldap://example.com'));
$this->ldap->expects($this->any())
->method('errno')
@@ -173,7 +173,7 @@ public function testDontUseBackupServerOnFailedAuth() {
$this->ldap->expects($this->once())
->method('connect')
- ->willReturn('ldapResource');
+ ->willReturn(ldap_connect('ldap://example.com'));
$this->ldap->expects($this->any())
->method('errno')
@@ -221,7 +221,7 @@ public function testBindWithInvalidCredentials() {
$this->ldap->expects($this->any())
->method('connect')
- ->willReturn('ldapResource');
+ ->willReturn(ldap_connect('ldap://example.com'));
$this->ldap->expects($this->once())
->method('bind')
@@ -264,7 +264,7 @@ public function testStartTlsNegotiationFailure() {
$this->ldap->expects($this->any())
->method('connect')
- ->willReturn('ldapResource');
+ ->willReturn(ldap_connect('ldap://example.com'));
$this->ldap->expects($this->any())
->method('setOption')
diff --git a/apps/user_ldap/tests/LDAPProviderTest.php b/apps/user_ldap/tests/LDAPProviderTest.php
index 3e34ce7bdbb14..44a03f77edfdd 100644
--- a/apps/user_ldap/tests/LDAPProviderTest.php
+++ b/apps/user_ldap/tests/LDAPProviderTest.php
@@ -271,14 +271,15 @@ public function testGetLDAPConnection() {
$userBackend->expects($this->any())
->method('userExists')
->willReturn(true);
+ $ldapConnection = ldap_connect('ldap://example.com');
$userBackend->expects($this->any())
->method('getNewLDAPConnection')
- ->willReturn(true);
+ ->willReturn($ldapConnection);
$server = $this->getServerMock($userBackend, $this->getDefaultGroupBackendMock());
$ldapProvider = $this->getLDAPProvider($server);
- $this->assertTrue($ldapProvider->getLDAPConnection('existing_user'));
+ $this->assertEquals($ldapConnection, $ldapProvider->getLDAPConnection('existing_user'));
}
@@ -317,14 +318,15 @@ public function testGetGroupLDAPConnection() {
->method('groupExists')
->willReturn(true);
+ $ldapConnection = ldap_connect('ldap://example.com');
$groupBackend->expects($this->any())
->method('getNewLDAPConnection')
- ->willReturn(true);
+ ->willReturn($ldapConnection);
$server = $this->getServerMock($userBackend, $groupBackend);
$ldapProvider = $this->getLDAPProvider($server);
- $this->assertTrue($ldapProvider->getGroupLDAPConnection('existing_group'));
+ $this->assertEquals($ldapConnection, $ldapProvider->getGroupLDAPConnection('existing_group'));
}
diff --git a/apps/user_ldap/tests/User_LDAPTest.php b/apps/user_ldap/tests/User_LDAPTest.php
index 35c692d634fb8..be892e1607faa 100644
--- a/apps/user_ldap/tests/User_LDAPTest.php
+++ b/apps/user_ldap/tests/User_LDAPTest.php
@@ -320,7 +320,7 @@ public function testDeleteUserSuccess() {
->willReturn($mapping);
$this->connection->expects($this->any())
->method('getConnectionResource')
- ->willReturn('this is an ldap link');
+ ->willReturn(ldap_connect('ldap://example.com'));
$this->deletedUsersIndex->expects($this->once())
->method('isUserMarked')
diff --git a/apps/user_ldap/tests/WizardTest.php b/apps/user_ldap/tests/WizardTest.php
index 5382a0c7f6f59..9cd6afc800765 100644
--- a/apps/user_ldap/tests/WizardTest.php
+++ b/apps/user_ldap/tests/WizardTest.php
@@ -84,8 +84,8 @@ private function getWizardAndMocks() {
private function prepareLdapWrapperForConnections(MockObject &$ldap) {
$ldap->expects($this->once())
->method('connect')
- //dummy value, usually invalid
- ->willReturn(true);
+ //dummy value
+ ->willReturn(ldap_connect('ldap://example.com'));
$ldap->expects($this->exactly(3))
->method('setOption')
@@ -173,7 +173,7 @@ public function testCumulativeSearchOnAttributeUnlimited() {
$ldap->expects($this->any())
->method('isResource')
->willReturnCallback(function ($r) {
- if ($r === true) {
+ if ($r instanceof \LDAP\Connection) {
return true;
}
if ($r % 24 === 0) {
diff --git a/build/stubs/ftp.php b/build/stubs/ftp.php
index c2505d5a5666a..22e97f0f44f64 100644
--- a/build/stubs/ftp.php
+++ b/build/stubs/ftp.php
@@ -16,59 +16,80 @@ final class Connection
namespace {
- function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|resource|false {}
+ function ftp_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {}
#ifdef HAVE_FTP_SSL
- function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|resource|false {}
+ function ftp_ssl_connect(string $hostname, int $port = 21, int $timeout = 90): FTP\Connection|false {}
#endif
- function ftp_login(FTP\Connection|resource $ftp, string $username, string $password): bool {}
- function ftp_pwd(FTP\Connection|resource $ftp): string|false {}
- function ftp_cdup(FTP\Connection|resource $ftp): bool {}
- function ftp_chdir(FTP\Connection|resource $ftp, string $directory): bool {}
- function ftp_exec(FTP\Connection|resource $ftp, string $command): bool {}
- function ftp_raw(FTP\Connection|resource $ftp, string $command): ?array {}
- function ftp_mkdir(FTP\Connection|resource $ftp, string $directory): string|false {}
- function ftp_rmdir(FTP\Connection|resource $ftp, string $directory): bool {}
- function ftp_chmod(FTP\Connection|resource $ftp, int $permissions, string $filename): int|false {}
+ function ftp_login(FTP\Connection $ftp, string $username, string $password): bool {}
+ function ftp_pwd(FTP\Connection $ftp): string|false {}
+ function ftp_cdup(FTP\Connection $ftp): bool {}
+ function ftp_chdir(FTP\Connection $ftp, string $directory): bool {}
+ function ftp_exec(FTP\Connection $ftp, string $command): bool {}
+
+ /**
+ * @return array
- *
- * Elements of array returned by gd_info
- *
- *
- *
- * Attribute
- * Meaning
- *
- *
- * GD Version
- * string value describing the installed
- * libgd version.
- *
- *
- * FreeType Support
- * boolean value. TRUE
- * if FreeType Support is installed.
- *
- *
- * FreeType Linkage
- * string value describing the way in which
- * FreeType was linked. Expected values are: 'with freetype',
- * 'with TTF library', and 'with unknown library'. This element will
- * only be defined if FreeType Support evaluated to
- * TRUE.
- *
- *
- * T1Lib Support
- * boolean value. TRUE
- * if T1Lib support is included.
- *
- *
- * GIF Read Support
- * boolean value. TRUE
- * if support for reading GIF
- * images is included.
- *
- *
- * GIF Create Support
- * boolean value. TRUE
- * if support for creating GIF
- * images is included.
- *
- *
- * JPEG Support
- * boolean value. TRUE
- * if JPEG support is included.
- *
- *
- * PNG Support
- * boolean value. TRUE
- * if PNG support is included.
- *
- *
- * WBMP Support
- * boolean value. TRUE
- * if WBMP support is included.
- *
- *
- * XBM Support
- * boolean value. TRUE
- * if XBM support is included.
- *
- *
- * WebP Support
- * boolean value. TRUE
- * if WebP support is included.
- *
- * Previous to PHP 5.3.0, the JPEG Support attribute was named - * JPG Support. - */ -function gd_info () {} - -/** - * Draws an arc - * @link https://php.net/manual/en/function.imagearc.php - * @param resource $image - * @param int $cx
- * x-coordinate of the center. - *
- * @param int $cy- * y-coordinate of the center. - *
- * @param int $width- * The arc width. - *
- * @param int $height- * The arc height. - *
- * @param int $start- * The arc start angle, in degrees. - *
- * @param int $end- * The arc end angle, in degrees. - * 0° is located at the three-o'clock position, and the arc is drawn - * clockwise. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool TRUE on success or FALSE on failure. - */ -function imagearc ($image, $cx, $cy, $width, $height, $start, $end, $color) {} - -/** - * Draw an ellipse - * @link https://php.net/manual/en/function.imageellipse.php - * @param resource $image - * @param int $cx- * x-coordinate of the center. - *
- * @param int $cy- * y-coordinate of the center. - *
- * @param int $width- * The ellipse width. - *
- * @param int $height- * The ellipse height. - *
- * @param int $color- * The color of the ellipse. A color identifier created with - * imagecolorallocate. - *
- * @return bool TRUE on success or FALSE on failure. - */ -function imageellipse ($image, $cx, $cy, $width, $height, $color) {} - -/** - * Draw a character horizontally - * @link https://php.net/manual/en/function.imagechar.php - * @param resource $image - * @param int $font - * @param int $x- * x-coordinate of the start. - *
- * @param int $y- * y-coordinate of the start. - *
- * @param string $c- * The character to draw. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool TRUE on success or FALSE on failure. - */ -function imagechar ($image, $font, $x, $y, $c, $color) {} - -/** - * Draw a character vertically - * @link https://php.net/manual/en/function.imagecharup.php - * @param resource $image - * @param int $font - * @param int $x- * x-coordinate of the start. - *
- * @param int $y- * y-coordinate of the start. - *
- * @param string $c- * The character to draw. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool TRUE on success or FALSE on failure. - */ -function imagecharup ($image, $font, $x, $y, $c, $color) {} - -/** - * Get the index of the color of a pixel - * @link https://php.net/manual/en/function.imagecolorat.php - * @param resource $image - * @param int $x- * x-coordinate of the point. - *
- * @param int $y- * y-coordinate of the point. - *
- * @return int|false the index of the color or FALSE on failure - */ -function imagecolorat ($image, $x, $y) {} - -/** - * Allocate a color for an image - * @link https://php.net/manual/en/function.imagecolorallocate.php - * @param resource $image - * @param int $redValue of red component.
- * @param int $greenValue of green component.
- * @param int $blueValue of blue component.
- * @return int|false A color identifier or FALSE if the allocation failed. - */ -function imagecolorallocate ($image, $red, $green, $blue) {} - -/** - * Copy the palette from one image to another - * @link https://php.net/manual/en/function.imagepalettecopy.php - * @param resource $destination- * The destination image resource. - *
- * @param resource $source- * The source image resource. - *
- * @return void No value is returned. - */ -function imagepalettecopy ($destination, $source) {} - -/** - * Create a new image from the image stream in the string - * @link https://php.net/manual/en/function.imagecreatefromstring.php - * @param string $image- * A string containing the image data. - *
- * @return resource|false An image resource will be returned on success. FALSE is returned if - * the image type is unsupported, the data is not in a recognised format, - * or the image is corrupt and cannot be loaded. - */ -function imagecreatefromstring ($image) {} - -/** - * Get the index of the closest color to the specified color - * @link https://php.net/manual/en/function.imagecolorclosest.php - * @param resource $image - * @param int $redValue of red component.
- * @param int $greenValue of green component.
- * @param int $blueValue of blue component.
- * @return int|false the index of the closest color, in the palette of the image, to - * the specified one or FALSE on failure - */ -function imagecolorclosest ($image, $red, $green, $blue) {} - -/** - * Get the index of the color which has the hue, white and blackness - * @link https://php.net/manual/en/function.imagecolorclosesthwb.php - * @param resource $image - * @param int $redValue of red component.
- * @param int $greenValue of green component.
- * @param int $blueValue of blue component.
- * @return int|false an integer with the index of the color which has - * the hue, white and blackness nearest the given color or FALSE on failure - */ -function imagecolorclosesthwb ($image, $red, $green, $blue) {} - -/** - * De-allocate a color for an image - * @link https://php.net/manual/en/function.imagecolordeallocate.php - * @param resource $image - * @param int $color- * The color identifier. - *
- * @return bool TRUE on success or FALSE on failure. - */ -function imagecolordeallocate ($image, $color) {} - -/** - * Get the index of the specified color or its closest possible alternative - * @link https://php.net/manual/en/function.imagecolorresolve.php - * @param resource $image - * @param int $redValue of red component.
- * @param int $greenValue of green component.
- * @param int $blueValue of blue component.
- * @return int|false a color index or FALSE on failure - */ -function imagecolorresolve ($image, $red, $green, $blue) {} - -/** - * Get the index of the specified color - * @link https://php.net/manual/en/function.imagecolorexact.php - * @param resource $image - * @param int $redValue of red component.
- * @param int $greenValue of green component.
- * @param int $blueValue of blue component.
- * @return int|false the index of the specified color in the palette, -1 if the - * color does not exist, or FALSE on failure - */ -function imagecolorexact ($image, $red, $green, $blue) {} - -/** - * Set the color for the specified palette index - * @link https://php.net/manual/en/function.imagecolorset.php - * @param resource $image - * @param int $index- * An index in the palette. - *
- * @param int $redValue of red component.
- * @param int $greenValue of green component.
- * @param int $blueValue of blue component.
- * @param int $alpha [optional]- * Value of alpha component. - *
- * @return void No value is returned. - */ -function imagecolorset ($image, $index, $red, $green, $blue, $alpha = 0) {} - -/** - * Define a color as transparent - * @link https://php.net/manual/en/function.imagecolortransparent.php - * @param resource $image - * @param int $color [optional]- * A color identifier created with - * imagecolorallocate. - *
- * @return int|false The identifier of the new (or current, if none is specified) - * transparent color is returned. If color - * is not specified, and the image has no transparent color, the - * returned identifier will be -1. If an error occurs, FALSE is returned. - */ -function imagecolortransparent ($image, $color = null) {} - -/** - * Find out the number of colors in an image's palette - * @link https://php.net/manual/en/function.imagecolorstotal.php - * @param resource $image- * An image resource, returned by one of the image creation functions, such - * as imagecreatefromgif. - *
- * @return int|false the number of colors in the specified image's palette, 0 for - * truecolor images, or FALSE on failure - */ -function imagecolorstotal ($image) {} - -/** - * Get the colors for an index - * @link https://php.net/manual/en/function.imagecolorsforindex.php - * @param resource $image - * @param int $index- * The color index. - *
- * @return array|false an associative array with red, green, blue and alpha keys that - * contain the appropriate values for the specified color index or FALSE on failure - */ -function imagecolorsforindex ($image, $index) {} - -/** - * Copy part of an image - * @link https://php.net/manual/en/function.imagecopy.php - * @param resource $dst_im- * Destination image link resource. - *
- * @param resource $src_im- * Source image link resource. - *
- * @param int $dst_x- * x-coordinate of destination point. - *
- * @param int $dst_y- * y-coordinate of destination point. - *
- * @param int $src_x- * x-coordinate of source point. - *
- * @param int $src_y- * y-coordinate of source point. - *
- * @param int $src_w- * Source width. - *
- * @param int $src_h- * Source height. - *
- * @return bool true on success or false on failure. - */ -function imagecopy ($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h) {} - -/** - * Copy and merge part of an image - * @link https://php.net/manual/en/function.imagecopymerge.php - * @param resource $dst_im- * Destination image link resource. - *
- * @param resource $src_im- * Source image link resource. - *
- * @param int $dst_x- * x-coordinate of destination point. - *
- * @param int $dst_y- * y-coordinate of destination point. - *
- * @param int $src_x- * x-coordinate of source point. - *
- * @param int $src_y- * y-coordinate of source point. - *
- * @param int $src_w- * Source width. - *
- * @param int $src_h- * Source height. - *
- * @param int $pct- * The two images will be merged according to pct - * which can range from 0 to 100. When pct = 0, - * no action is taken, when 100 this function behaves identically - * to imagecopy for pallete images, while it - * implements alpha transparency for true colour images. - *
- * @return bool true on success or false on failure. - */ -function imagecopymerge ($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) {} - -/** - * Copy and merge part of an image with gray scale - * @link https://php.net/manual/en/function.imagecopymergegray.php - * @param resource $dst_im- * Destination image link resource. - *
- * @param resource $src_im- * Source image link resource. - *
- * @param int $dst_x- * x-coordinate of destination point. - *
- * @param int $dst_y- * y-coordinate of destination point. - *
- * @param int $src_x- * x-coordinate of source point. - *
- * @param int $src_y- * y-coordinate of source point. - *
- * @param int $src_w- * Source width. - *
- * @param int $src_h- * Source height. - *
- * @param int $pct- * The src_im will be changed to grayscale according - * to pct where 0 is fully grayscale and 100 is - * unchanged. When pct = 100 this function behaves - * identically to imagecopy for pallete images, while - * it implements alpha transparency for true colour images. - *
- * @return bool true on success or false on failure. - */ -function imagecopymergegray ($dst_im, $src_im, $dst_x, $dst_y, $src_x, $src_y, $src_w, $src_h, $pct) {} - -/** - * Copy and resize part of an image - * @link https://php.net/manual/en/function.imagecopyresized.php - * @param resource $dst_image - * @param resource $src_image - * @param int $dst_x- * x-coordinate of destination point. - *
- * @param int $dst_y- * y-coordinate of destination point. - *
- * @param int $src_x- * x-coordinate of source point. - *
- * @param int $src_y- * y-coordinate of source point. - *
- * @param int $dst_w- * Destination width. - *
- * @param int $dst_h- * Destination height. - *
- * @param int $src_w- * Source width. - *
- * @param int $src_h- * Source height. - *
- * @return bool true on success or false on failure. - */ -function imagecopyresized ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {} - -/** - * Create a new palette based image - * @link https://php.net/manual/en/function.imagecreate.php - * @param int $width- * The image width. - *
- * @param int $height- * The image height. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreate ($width, $height) {} - -/** - * Create a new true color image - * @link https://php.net/manual/en/function.imagecreatetruecolor.php - * @param int $width- * Image width. - *
- * @param int $height- * Image height. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatetruecolor ($width, $height) {} - -/** - * Finds whether an image is a truecolor image - * @link https://php.net/manual/en/function.imageistruecolor.php - * @param resource $image - * @return bool true if the image is truecolor, false - * otherwise. - */ -function imageistruecolor ($image) {} - -/** - * Convert a true color image to a palette image - * @link https://php.net/manual/en/function.imagetruecolortopalette.php - * @param resource $image - * @param bool $dither- * Indicates if the image should be dithered - if it is true then - * dithering will be used which will result in a more speckled image but - * with better color approximation. - *
- * @param int $ncolors- * Sets the maximum number of colors that should be retained in the palette. - *
- * @return bool true on success or false on failure. - */ -function imagetruecolortopalette ($image, $dither, $ncolors) {} - -/** - * Set the thickness for line drawing - * @link https://php.net/manual/en/function.imagesetthickness.php - * @param resource $image - * @param int $thickness- * Thickness, in pixels. - *
- * @return bool true on success or false on failure. - */ -function imagesetthickness ($image, $thickness) {} - -/** - * Draw a partial arc and fill it - * @link https://php.net/manual/en/function.imagefilledarc.php - * @param resource $image - * @param int $cx- * x-coordinate of the center. - *
- * @param int $cy- * y-coordinate of the center. - *
- * @param int $width- * The arc width. - *
- * @param int $height- * The arc height. - *
- * @param int $start- * The arc start angle, in degrees. - *
- * @param int $end- * The arc end angle, in degrees. - * 0° is located at the three-o'clock position, and the arc is drawn - * clockwise. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @param int $style- * A bitwise OR of the following possibilities: - * IMG_ARC_PIE - * @return bool true on success or false on failure. - */ -function imagefilledarc ($image, $cx, $cy, $width, $height, $start, $end, $color, $style) {} - -/** - * Draw a filled ellipse - * @link https://php.net/manual/en/function.imagefilledellipse.php - * @param resource $image - * @param int $cx
- * x-coordinate of the center. - *
- * @param int $cy- * y-coordinate of the center. - *
- * @param int $width- * The ellipse width. - *
- * @param int $height- * The ellipse height. - *
- * @param int $color- * The fill color. A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagefilledellipse ($image, $cx, $cy, $width, $height, $color) {} - -/** - * Set the blending mode for an image - * @link https://php.net/manual/en/function.imagealphablending.php - * @param resource $image - * @param bool $blendmode- * Whether to enable the blending mode or not. On true color images - * the default value is true otherwise the default value is false - *
- * @return bool true on success or false on failure. - */ -function imagealphablending ($image, $blendmode) {} - -/** - * Set the flag to save full alpha channel information (as opposed to single-color transparency) when saving PNG images - * @link https://php.net/manual/en/function.imagesavealpha.php - * @param resource $image - * @param bool $saveflag- * Whether to save the alpha channel or not. Default to false. - *
- * @return bool true on success or false on failure. - */ -function imagesavealpha ($image, $saveflag) {} - -/** - * Allocate a color for an image - * @link https://php.net/manual/en/function.imagecolorallocatealpha.php - * @param resource $image - * @param int $red- * Value of red component. - *
- * @param int $green- * Value of green component. - *
- * @param int $blue- * Value of blue component. - *
- * @param int $alpha- * A value between 0 and 127. - * 0 indicates completely opaque while - * 127 indicates completely transparent. - *
- * @return int|false A color identifier or false if the allocation failed. - */ -function imagecolorallocatealpha ($image, $red, $green, $blue, $alpha) {} - -/** - * Get the index of the specified color + alpha or its closest possible alternative - * @link https://php.net/manual/en/function.imagecolorresolvealpha.php - * @param resource $image - * @param int $red- * Value of red component. - *
- * @param int $green- * Value of green component. - *
- * @param int $blue- * Value of blue component. - *
- * @param int $alpha- * A value between 0 and 127. - * 0 indicates completely opaque while - * 127 indicates completely transparent. - *
- * @return int|false a color index or FALSE on failure - */ -function imagecolorresolvealpha ($image, $red, $green, $blue, $alpha) {} - -/** - * Get the index of the closest color to the specified color + alpha - * @link https://php.net/manual/en/function.imagecolorclosestalpha.php - * @param resource $image - * @param int $red- * Value of red component. - *
- * @param int $green- * Value of green component. - *
- * @param int $blue- * Value of blue component. - *
- * @param int $alpha- * A value between 0 and 127. - * 0 indicates completely opaque while - * 127 indicates completely transparent. - *
- * @return int|false the index of the closest color in the palette or - * FALSE on failure - */ -function imagecolorclosestalpha ($image, $red, $green, $blue, $alpha) {} - -/** - * Get the index of the specified color + alpha - * @link https://php.net/manual/en/function.imagecolorexactalpha.php - * @param resource $image - * @param int $red- * Value of red component. - *
- * @param int $green- * Value of green component. - *
- * @param int $blue- * Value of blue component. - *
- * @param int $alpha- * A value between 0 and 127. - * 0 indicates completely opaque while - * 127 indicates completely transparent. - *
- * @return int|false the index of the specified color+alpha in the palette of the - * image, -1 if the color does not exist in the image's palette, or FALSE - * on failure - */ -function imagecolorexactalpha ($image, $red, $green, $blue, $alpha) {} - -/** - * Copy and resize part of an image with resampling - * @link https://php.net/manual/en/function.imagecopyresampled.php - * @param resource $dst_image - * @param resource $src_image - * @param int $dst_x- * x-coordinate of destination point. - *
- * @param int $dst_y- * y-coordinate of destination point. - *
- * @param int $src_x- * x-coordinate of source point. - *
- * @param int $src_y- * y-coordinate of source point. - *
- * @param int $dst_w- * Destination width. - *
- * @param int $dst_h- * Destination height. - *
- * @param int $src_w- * Source width. - *
- * @param int $src_h- * Source height. - *
- * @return bool true on success or false on failure. - */ -function imagecopyresampled ($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {} - -/** - * Rotate an image with a given angle - * @link https://php.net/manual/en/function.imagerotate.php - * @param resource $image - * @param float $angle- * Rotation angle, in degrees. - *
- * @param int $bgd_color- * Specifies the color of the uncovered zone after the rotation - *
- * @param int $ignore_transparent [optional]- * If set and non-zero, transparent colors are ignored (otherwise kept). - *
- * @return resource|false the rotated image or FALSE on failure - */ -function imagerotate ($image, $angle, $bgd_color, $ignore_transparent = null) {} - -/** - * Should antialias functions be used or not.- * Whether to enable antialiasing or not. - *
- * @return bool true on success or false on failure. - */ -function imageantialias ($image, $enabled) {} - -/** - * Set the tile image for filling - * @link https://php.net/manual/en/function.imagesettile.php - * @param resource $image - * @param resource $tile- * The image resource to be used as a tile. - *
- * @return bool true on success or false on failure. - */ -function imagesettile ($image, $tile) {} - -/** - * Set the brush image for line drawing - * @link https://php.net/manual/en/function.imagesetbrush.php - * @param resource $image - * @param resource $brush- * An image resource. - *
- * @return bool true on success or false on failure. - */ -function imagesetbrush ($image, $brush) {} - -/** - * Set the style for line drawing - * @link https://php.net/manual/en/function.imagesetstyle.php - * @param resource $image - * @param array $style- * An array of pixel colors. You can use the - * IMG_COLOR_TRANSPARENT constant to add a - * transparent pixel. - *
- * @return bool true on success or false on failure. - */ -function imagesetstyle ($image, array $style) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefrompng.php - * @param string $filename- * Path to the PNG image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefrompng ($filename) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefromgif.php - * @param string $filename- * Path to the GIF image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromgif ($filename) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefromjpeg.php - * @param string $filename- * Path to the JPEG image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromjpeg ($filename) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefromwbmp.php - * @param string $filename- * Path to the WBMP image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromwbmp ($filename) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefromwebp.php - * @param string $filename- * Path to the WebP image. - *
- * @return resource|false an image resource identifier on success, false on errors. - * @since 5.4 - */ -function imagecreatefromwebp ($filename) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefromxbm.php - * @param string $filename- * Path to the XBM image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromxbm ($filename) {} - -/** - * Create a new image from file or URL - * @link https://php.net/manual/en/function.imagecreatefromxpm.php - * @param string $filename- * Path to the XPM image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromxpm ($filename) {} - -/** - * Create a new image from GD file or URL - * @link https://php.net/manual/en/function.imagecreatefromgd.php - * @param string $filename- * Path to the GD file. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromgd ($filename) {} - -/** - * Create a new image from GD2 file or URL - * @link https://php.net/manual/en/function.imagecreatefromgd2.php - * @param string $filename- * Path to the GD2 image. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromgd2 ($filename) {} - -/** - * Create a new image from a given part of GD2 file or URL - * @link https://php.net/manual/en/function.imagecreatefromgd2part.php - * @param string $filename- * Path to the GD2 image. - *
- * @param int $srcX- * x-coordinate of source point. - *
- * @param int $srcY- * y-coordinate of source point. - *
- * @param int $width- * Source width. - *
- * @param int $height- * Source height. - *
- * @return resource|false an image resource identifier on success, false on errors. - */ -function imagecreatefromgd2part ($filename, $srcX, $srcY, $width, $height) {} - -/** - * Output a PNG image to either the browser or a file - * @link https://php.net/manual/en/function.imagepng.php - * @param resource $image - * @param string $filename [optional]- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- *- * &null; is invalid if the quality and - * filters arguments are not used. - *
- * @param int $quality [optional]- * Compression level: from 0 (no compression) to 9. - *
- * @param int $filters [optional]- * Allows reducing the PNG file size. It is a bitmask field which may be - * set to any combination of the PNG_FILTER_XXX - * constants. PNG_NO_FILTER or - * PNG_ALL_FILTERS may also be used to respectively - * disable or activate all filters. - *
- * @return bool true on success or false on failure. - */ -function imagepng ($image, $filename = null, $quality = null, $filters = null) {} - -/** - * Output a WebP image to browser or file - * @link https://php.net/manual/en/function.imagewebp.php - * @param resource $image - * @param string $to [optional]- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- * @param int $quality [optional]- * quality ranges from 0 (worst quality, smaller file) to 100 (best quality, biggest file). - *
- * @return bool true on success or false on failure. - * @since 5.4 - */ -function imagewebp ($image, $to = null, $quality = 80) {} - -/** - * Output image to browser or file - * @link https://php.net/manual/en/function.imagegif.php - * @param resource $image - * @param string $filename [optional]- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- * @return bool true on success or false on failure. - */ -function imagegif ($image, $filename = null) {} - -/** - * Output image to browser or file - * @link https://php.net/manual/en/function.imagejpeg.php - * @param resource $image - * @param string $filename [optional]- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- *- * To skip this argument in order to provide the - * quality parameter, use &null;. - *
- * @param int $quality [optional]- * quality is optional, and ranges from 0 (worst - * quality, smaller file) to 100 (best quality, biggest file). The - * default is the default IJG quality value (about 75). - *
- * @return bool true on success or false on failure. - */ -function imagejpeg ($image, $filename = null, $quality = null) {} - -/** - * Output image to browser or file - * @link https://php.net/manual/en/function.imagewbmp.php - * @param resource $image - * @param string $filename [optional]- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- * @param int $foreground [optional]- * You can set the foreground color with this parameter by setting an - * identifier obtained from imagecolorallocate. - * The default foreground color is black. - *
- * @return bool true on success or false on failure. - */ -function imagewbmp ($image, $filename = null, $foreground = null) {} - -/** - * Output GD image to browser or file.- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- * @return bool true on success or false on failure. - */ -function imagegd ($image, $filename = null) {} - -/** - * Output GD2 image to browser or file - * @link https://php.net/manual/en/function.imagegd2.php - * @param resource $image - * @param string $filename [optional]- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- * @param int $chunk_size [optional]- * Chunk size. - *
- * @param int $type [optional]- * Either IMG_GD2_RAW or - * IMG_GD2_COMPRESSED. Default is - * IMG_GD2_RAW. - *
- * @return bool true on success or false on failure. - */ -function imagegd2 ($image, $filename = null, $chunk_size = null, $type = null) {} - -/** - * Destroy an image - * @link https://php.net/manual/en/function.imagedestroy.php - * @param resource $image - * @return bool true on success or false on failure. - */ -function imagedestroy ($image) {} - -/** - * Apply a gamma correction to a GD image - * @link https://php.net/manual/en/function.imagegammacorrect.php - * @param resource $image - * @param float $inputgamma- * The input gamma. - *
- * @param float $outputgamma- * The output gamma. - *
- * @return bool true on success or false on failure. - */ -function imagegammacorrect ($image, $inputgamma, $outputgamma) {} - -/** - * Flood fill - * @link https://php.net/manual/en/function.imagefill.php - * @param resource $image - * @param int $x- * x-coordinate of start point. - *
- * @param int $y- * y-coordinate of start point. - *
- * @param int $color- * The fill color. A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagefill ($image, $x, $y, $color) {} - -/** - * Draw a filled polygon - * @link https://php.net/manual/en/function.imagefilledpolygon.php - * @param resource $image - * @param array $points- * An array containing the x and y - * coordinates of the polygons vertices consecutively. - *
- * @param int $num_points [optional]- * Total number of vertices, which must be at least 3. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagefilledpolygon ($image, array $points, $num_points, $color) {} - -/** - * Draw a filled rectangle - * @link https://php.net/manual/en/function.imagefilledrectangle.php - * @param resource $image - * @param int $x1- * x-coordinate for point 1. - *
- * @param int $y1- * y-coordinate for point 1. - *
- * @param int $x2- * x-coordinate for point 2. - *
- * @param int $y2- * y-coordinate for point 2. - *
- * @param int $color- * The fill color. A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagefilledrectangle ($image, $x1, $y1, $x2, $y2, $color) {} - -/** - * Flood fill to specific color - * @link https://php.net/manual/en/function.imagefilltoborder.php - * @param resource $image - * @param int $x- * x-coordinate of start. - *
- * @param int $y- * y-coordinate of start. - *
- * @param int $border- * The border color. A color identifier created with - * imagecolorallocate. - *
- * @param int $color- * The fill color. A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagefilltoborder ($image, $x, $y, $border, $color) {} - -/** - * Get font width - * @link https://php.net/manual/en/function.imagefontwidth.php - * @param int $font - * @return int the width of the pixel - */ -function imagefontwidth ($font) {} - -/** - * Get font height - * @link https://php.net/manual/en/function.imagefontheight.php - * @param int $font - * @return int the height of the pixel. - */ -function imagefontheight ($font) {} - -/** - * Enable or disable interlace - * @link https://php.net/manual/en/function.imageinterlace.php - * @param resource $image - * @param int $interlace [optional]- * If non-zero, the image will be interlaced, else the interlace bit is - * turned off. - *
- * @return int|false 1 if the interlace bit is set for the image, - * 0 if it is not, or FALSE on failure - */ -function imageinterlace ($image, $interlace = null) {} - -/** - * Draw a line - * @link https://php.net/manual/en/function.imageline.php - * @param resource $image - * @param int $x1- * x-coordinate for first point. - *
- * @param int $y1- * y-coordinate for first point. - *
- * @param int $x2- * x-coordinate for second point. - *
- * @param int $y2- * y-coordinate for second point. - *
- * @param int $color- * The line color. A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imageline ($image, $x1, $y1, $x2, $y2, $color) {} - -/** - * Load a new font - * @link https://php.net/manual/en/function.imageloadfont.php - * @param string $file- * The font file format is currently binary and architecture - * dependent. This means you should generate the font files on the - * same type of CPU as the machine you are running PHP on. - *
- *- *
byte position | - *C data type | - *description | - *
byte 0-3 | - *int | - *number of characters in the font | - *
byte 4-7 | - *int | - *- * value of first character in the font (often 32 for space) - * | - *
byte 8-11 | - *int | - *pixel width of each character | - *
byte 12-15 | - *int | - *pixel height of each character | - *
byte 16- | - *char | - *- * array with character data, one byte per pixel in each - * character, for a total of (nchars*width*height) bytes. - * | - *
- * An array containing the polygon's vertices, e.g.: - *
- * Total number of points (vertices). - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagepolygon ($image, array $points, $num_points, $color) {} - -/** - * Draw a rectangle - * @link https://php.net/manual/en/function.imagerectangle.php - * @param resource $image - * @param int $x1- * Upper left x coordinate. - *
- * @param int $y1- * Upper left y coordinate - * 0, 0 is the top left corner of the image. - *
- * @param int $x2- * Bottom right x coordinate. - *
- * @param int $y2- * Bottom right y coordinate. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagerectangle ($image, $x1, $y1, $x2, $y2, $color) {} - -/** - * Set a single pixel - * @link https://php.net/manual/en/function.imagesetpixel.php - * @param resource $image - * @param int $x- * x-coordinate. - *
- * @param int $y- * y-coordinate. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagesetpixel ($image, $x, $y, $color) {} - -/** - * Draw a string horizontally - * @link https://php.net/manual/en/function.imagestring.php - * @param resource $image - * @param int $font - * @param int $x- * x-coordinate of the upper left corner. - *
- * @param int $y- * y-coordinate of the upper left corner. - *
- * @param string $string- * The string to be written. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagestring ($image, $font, $x, $y, $string, $color) {} - -/** - * Draw a string vertically - * @link https://php.net/manual/en/function.imagestringup.php - * @param resource $image - * @param int $font - * @param int $x- * x-coordinate of the upper left corner. - *
- * @param int $y- * y-coordinate of the upper left corner. - *
- * @param string $string- * The string to be written. - *
- * @param int $color- * A color identifier created with - * imagecolorallocate. - *
- * @return bool true on success or false on failure. - */ -function imagestringup ($image, $font, $x, $y, $string, $color) {} - -/** - * Get image width - * @link https://php.net/manual/en/function.imagesx.php - * @param resource $image - * @return int|false Return the width of the image or false on - * errors. - */ -function imagesx ($image) {} - -/** - * Get image height - * @link https://php.net/manual/en/function.imagesy.php - * @param resource $image - * @return int|false Return the height of the image or false on - * errors. - */ -function imagesy ($image) {} - -/** - * Draw a dashed line - * @link https://php.net/manual/en/function.imagedashedline.php - * @param resource $image - * @param int $x1- * Upper left x coordinate. - *
- * @param int $y1- * Upper left y coordinate 0, 0 is the top left corner of the image. - *
- * @param int $x2- * Bottom right x coordinate. - *
- * @param int $y2- * Bottom right y coordinate. - *
- * @param int $color- * The fill color. A color identifier created with - * imagecolorallocate. - *
- * @return bool TRUE on success or FALSE on failure. - * @deprecated Use combination of imagesetstyle() and imageline() instead - */ -function imagedashedline ($image, $x1, $y1, $x2, $y2, $color) {} - -/** - * Give the bounding box of a text using TrueType fonts - * @link https://php.net/manual/en/function.imagettfbbox.php - * @param float $size- * The font size. Depending on your version of GD, this should be - * specified as the pixel size (GD1) or point size (GD2). - *
- * @param float $angle- * Angle in degrees in which text will be measured. - *
- * @param string $fontfile- * The name of the TrueType font file (can be a URL). Depending on - * which version of the GD library that PHP is using, it may attempt to - * search for files that do not begin with a leading '/' by appending - * '.ttf' to the filename and searching along a library-defined font path. - *
- * @param string $text- * The string to be measured. - *
- * @return array|false imagettfbbox returns an array with 8 - * elements representing four points making the bounding box of the - * text on success and false on error. - *- * The points are relative to the text regardless of the - * angle, so "upper left" means in the top left-hand - * corner seeing the text horizontally. - */ -function imagettfbbox ($size, $angle, $fontfile, $text) {} - -/** - * Write text to the image using TrueType fonts - * @link https://php.net/manual/en/function.imagettftext.php - * @param resource $image - * @param float $size
- * The font size. Depending on your version of GD, this should be - * specified as the pixel size (GD1) or point size (GD2). - *
- * @param float $angle- * The angle in degrees, with 0 degrees being left-to-right reading text. - * Higher values represent a counter-clockwise rotation. For example, a - * value of 90 would result in bottom-to-top reading text. - *
- * @param int $x- * The coordinates given by x and - * y will define the basepoint of the first - * character (roughly the lower-left corner of the character). This - * is different from the imagestring, where - * x and y define the - * upper-left corner of the first character. For example, "top left" - * is 0, 0. - *
- * @param int $y- * The y-ordinate. This sets the position of the fonts baseline, not the - * very bottom of the character. - *
- * @param int $color- * The color index. Using the negative of a color index has the effect of - * turning off antialiasing. See imagecolorallocate. - *
- * @param string $fontfile- * The path to the TrueType font you wish to use. - *
- *- * Depending on which version of the GD library PHP is using, when - * fontfile does not begin with a leading - * / then .ttf will be appended - * to the filename and the library will attempt to search for that - * filename along a library-defined font path. - *
- *- * When using versions of the GD library lower than 2.0.18, a space character, - * rather than a semicolon, was used as the 'path separator' for different font files. - * Unintentional use of this feature will result in the warning message: - * Warning: Could not find/open font. For these affected versions, the - * only solution is moving the font to a path which does not contain spaces. - *
- *- * In many cases where a font resides in the same directory as the script using it - * the following trick will alleviate any include problems. - *
- *- * - *- *
- * Note:
- * open_basedir
does not apply to fontfile.
- *
- * The text string in UTF-8 encoding. - *
- *- * May include decimal numeric character references (of the form: - * €) to access characters in a font beyond position 127. - * The hexadecimal format (like ©) is supported. - * Strings in UTF-8 encoding can be passed directly. - *
- *- * Named entities, such as ©, are not supported. Consider using - * html_entity_decode - * to decode these named entities into UTF-8 strings (html_entity_decode() - * supports this as of PHP 5.0.0). - *
- *- * If a character is used in the string which is not supported by the - * font, a hollow rectangle will replace the character. - *
- * @return array|false an array with 8 elements representing four points making the - * bounding box of the text. The order of the points is lower left, lower - * right, upper right, upper left. The points are relative to the text - * regardless of the angle, so "upper left" means in the top left-hand - * corner when you see the text horizontally. - * Returns false on error. - */ -function imagettftext ($image, $size, $angle, $x, $y, $color, $fontfile, $text) {} - -/** - * Give the bounding box of a text using fonts via freetype2 - * @link https://php.net/manual/en/function.imageftbbox.php - * @param float $size- * The font size. Depending on your version of GD, this should be - * specified as the pixel size (GD1) or point size (GD2). - *
- * @param float $angle- * Angle in degrees in which text will be - * measured. - *
- * @param string $fontfile- * The name of the TrueType font file (can be a URL). Depending on - * which version of the GD library that PHP is using, it may attempt to - * search for files that do not begin with a leading '/' by appending - * '.ttf' to the filename and searching along a library-defined font path. - *
- * @param string $text- * The string to be measured. - *
- * @param array $extrainfo [optional]- *
Key | - *Type | - *Meaning | - *
linespacing | - *float | - *Defines drawing linespacing | - *
- * The points are relative to the text regardless of the - * angle, so "upper left" means in the top left-hand - * corner seeing the text horizontally. - * Returns false on error. - */ -function imageftbbox ($size, $angle, $fontfile, $text, $extrainfo = null ) {} - -/** - * Write text to the image using fonts using FreeType 2 - * @link https://php.net/manual/en/function.imagefttext.php - * @param resource $image - * @param float $size
- * The font size to use in points. - *
- * @param float $angle- * The angle in degrees, with 0 degrees being left-to-right reading text. - * Higher values represent a counter-clockwise rotation. For example, a - * value of 90 would result in bottom-to-top reading text. - *
- * @param int $x- * The coordinates given by x and - * y will define the basepoint of the first - * character (roughly the lower-left corner of the character). This - * is different from the imagestring, where - * x and y define the - * upper-left corner of the first character. For example, "top left" - * is 0, 0. - *
- * @param int $y- * The y-ordinate. This sets the position of the fonts baseline, not the - * very bottom of the character. - *
- * @param int $color- * The index of the desired color for the text, see - * imagecolorexact. - *
- * @param string $fontfile- * The path to the TrueType font you wish to use. - *
- *- * Depending on which version of the GD library PHP is using, when - * fontfile does not begin with a leading - * / then .ttf will be appended - * to the filename and the library will attempt to search for that - * filename along a library-defined font path. - *
- *- * When using versions of the GD library lower than 2.0.18, a space character, - * rather than a semicolon, was used as the 'path separator' for different font files. - * Unintentional use of this feature will result in the warning message: - * Warning: Could not find/open font. For these affected versions, the - * only solution is moving the font to a path which does not contain spaces. - *
- *- * In many cases where a font resides in the same directory as the script using it - * the following trick will alleviate any include problems. - *
- *- * - *- *
- * Note:
- * open_basedir
does not apply to fontfile.
- *
- * Text to be inserted into image. - *
- * @param array $extrainfo [optional]- *
Key | - *Type | - *Meaning | - *
linespacing | - *float | - *Defines drawing linespacing | - *
- * Path to the Postscript font file. - *
- * @return resource|false In the case everything went right, a valid font index will be returned and - * can be used for further purposes. Otherwise the function returns false. - * @removed 7.0 This function was REMOVED in PHP 7.0.0. + * @return array- * A font resource, returned by imagepsloadfont. - *
- * @return bool true on success or false on failure. - * @removed 7.0 - */ -function imagepsfreefont ($font_index) {} +function imageloadfont(string $filename): GdFont|false {} -/** - * Change the character encoding vector of a font - * @link https://php.net/manual/en/function.imagepsencodefont.php - * @param resource $font_index- * A font resource, returned by imagepsloadfont. - *
- * @param string $encodingfile- * The exact format of this file is described in T1libs documentation. - * T1lib comes with two ready-to-use files, - * IsoLatin1.enc and - * IsoLatin2.enc. - *
- * @return bool true on success or false on failure. - * @removed 7.0 - */ -function imagepsencodefont ($font_index, $encodingfile) {} +function imagesetstyle(GdImage $image, array $style): bool {} -/** - * Extend or condense a font - * @link https://php.net/manual/en/function.imagepsextendfont.php - * @param resource $font_index- * A font resource, returned by imagepsloadfont. - *
- * @param float $extend- * Extension value, must be greater than 0. - *
- * @return bool true on success or false on failure. - * @removed 7.0 - */ -function imagepsextendfont ($font_index, $extend) {} +/** @refcount 1 */ +function imagecreatetruecolor(int $width, int $height): GdImage|false {} -/** - * Slant a font - * @link https://php.net/manual/en/function.imagepsslantfont.php - * @param resource $font_index- * A font resource, returned by imagepsloadfont. - *
- * @param float $slant- * Slant level. - *
- * @return bool true on success or false on failure. - * @removed 7.0 This function was REMOVED in PHP 7.0.0. - */ -function imagepsslantfont ($font_index, $slant) {} +function imageistruecolor(GdImage $image): bool {} -/** - * Draws a text over an image using PostScript Type1 fonts - * @link https://php.net/manual/en/function.imagepstext.php - * @param resource $image - * @param string $text- * The text to be written. - *
- * @param resource $font_index- * A font resource, returned by imagepsloadfont. - *
- * @param int $size- * size is expressed in pixels. - *
- * @param int $foreground- * The color in which the text will be painted. - *
- * @param int $background- * The color to which the text will try to fade in with antialiasing. - * No pixels with the color background are - * actually painted, so the background image does not need to be of solid - * color. - *
- * @param int $x- * x-coordinate for the lower-left corner of the first character. - *
- * @param int $y- * y-coordinate for the lower-left corner of the first character. - *
- * @param int $space [optional]- * Allows you to change the default value of a space in a font. This - * amount is added to the normal value and can also be negative. - * Expressed in character space units, where 1 unit is 1/1000th of an - * em-square. - *
- * @param int $tightness [optional]- * tightness allows you to control the amount - * of white space between characters. This amount is added to the - * normal character width and can also be negative. - * Expressed in character space units, where 1 unit is 1/1000th of an - * em-square. - *
- * @param float $angle [optional]- * angle is in degrees. - *
- * @param int $antialias_steps [optional]- * Allows you to control the number of colours used for antialiasing - * text. Allowed values are 4 and 16. The higher value is recommended - * for text sizes lower than 20, where the effect in text quality is - * quite visible. With bigger sizes, use 4. It's less computationally - * intensive. - *
- * @return array|false This function returns an array containing the following elements: - *- * The text to be written. - *
- * @param resource $font - * @param int $size- * size is expressed in pixels. - *
- * @return array|false an array containing the following elements: - *- * Path to JPEG file. - *
- * @param string $wbmpname- * Path to destination WBMP file. - *
- * @param int $dest_height- * Destination image height. - *
- * @param int $dest_width- * Destination image width. - *
- * @param int $threshold- * Threshold value, between 0 and 8 (inclusive). - *
- * @return bool true on success or false on failure. - * @deprecated 7.2 Use imagecreatefromjpeg() and imagewbmp() instead - * @removed 8.0 - */ -function jpeg2wbmp ($jpegname, $wbmpname, $dest_height, $dest_width, $threshold) {} +function imagesetthickness(GdImage $image, int $thickness): bool {} -/** - * Convert PNG image file to WBMP image file - * @link https://php.net/manual/en/function.png2wbmp.php - * @param string $pngname- * Path to PNG file. - *
- * @param string $wbmpname- * Path to destination WBMP file. - *
- * @param int $dest_height- * Destination image height. - *
- * @param int $dest_width- * Destination image width. - *
- * @param int $threshold- * Threshold value, between 0 and 8 (inclusive). - *
- * @return bool true on success or false on failure. - * @deprecated 7.2 Use imagecreatefrompng() and imagewbmp() instead - * @removed 8.0 - */ -function png2wbmp ($pngname, $wbmpname, $dest_height, $dest_width, $threshold) {} +function imagefilledellipse(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $color): bool {} -/** - * Output image to browser or file - * @link https://php.net/manual/en/function.image2wbmp.php - * @param resource $image - * @param string $filename [optional]- * Path to the saved file. If not given, the raw image stream will be - * outputted directly. - *
- * @param int $threshold [optional]- * Threshold value, between 0 and 255 (inclusive). - *
- * @return bool true on success or false on failure. - * @deprecated 7.3 Use imagewbmp() instead - * @removed 8.0 - */ -function image2wbmp ($image, $filename = null, $threshold = null) {} +function imagefilledarc(GdImage $image, int $center_x, int $center_y, int $width, int $height, int $start_angle, int $end_angle, int $color, int $style): bool {} -/** - * Set the alpha blending flag to use the bundled libgd layering effects - * @link https://php.net/manual/en/function.imagelayereffect.php - * @param resource $image - * @param int $effect- * One of the following constants: - * IMG_EFFECT_REPLACE - * Use pixel replacement (equivalent of passing true to - * imagealphablending) - * @return bool true on success or false on failure. - */ -function imagelayereffect ($image, $effect) {} +function imagealphablending(GdImage $image, bool $enable): bool {} -/** - * Makes the colors of the palette version of an image more closely match the true color version - * @link https://php.net/manual/en/function.imagecolormatch.php - * @param $image1 resource
- * A truecolor image link resource. - *
- * @param $image2 resource- * A palette image link resource pointing to an image that has the same - * size as image1. - *
- * @return bool true on success or false on failure. - */ -function imagecolormatch ($image1, $image2) {} +function imagesavealpha(GdImage $image, bool $enable): bool {} -/** - * Output XBM image to browser or file - * @link https://php.net/manual/en/function.imagexbm.php - * @param resource $image - * @param string $filename- * The path to save the file to. If not set or &null;, the raw image stream - * will be outputted directly. - *
- * @param int $foreground [optional]- * You can set the foreground color with this parameter by setting an - * identifier obtained from imagecolorallocate. - * The default foreground color is black. - *
- * @return bool true on success or false on failure. - */ -function imagexbm ($image, $filename, $foreground = null) {} +function imagelayereffect(GdImage $image, int $effect): bool {} -/** - * Applies a filter to an image - * @link https://php.net/manual/en/function.imagefilter.php - * @param resource $image - * @param int $filtertype- * filtertype can be one of the following: - * IMG_FILTER_NEGATE: Reverses all colors of - * the image. - * @param int $arg1 [optional]
- * IMG_FILTER_BRIGHTNESS: Brightness level. - * @param int $arg2 [optional]
- * IMG_FILTER_COLORIZE: Value of green component. - * @param int $arg3 [optional]
- * IMG_FILTER_COLORIZE: Value of blue component. - * @param int $arg4 [optional]
- * IMG_FILTER_COLORIZE: Alpha channel, A value - * between 0 and 127. 0 indicates completely opaque while 127 indicates - * completely transparent. - * @return bool true on success or false on failure. - */ -function imagefilter ($image, $filtertype, $arg1 = null, $arg2 = null, $arg3 = null, $arg4 = null) {} +function imagecolorallocatealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int|false {} -/** - * Apply a 3x3 convolution matrix, using coefficient and offset - * @link https://php.net/manual/en/function.imageconvolution.php - * @param resource $image - * @param array $matrix
- * A 3x3 matrix: an array of three arrays of three floats. - *
- * @param float $div- * The divisor of the result of the convolution, used for normalization. - *
- * @param float $offset- * Color offset. - *
- * @return bool true on success or false on failure. - */ -function imageconvolution ($image, array $matrix, $div, $offset) {} +function imagecolorresolvealpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {} -/** - * @param resource $im An image resource, returned by one of the image creation functions, such as {@see imagecreatetruecolor()}. - * @param int $res_x [optional] The horizontal resolution in DPI. - * @param int $res_y [optional] The vertical resolution in DPI. - * @return array|bool When used as getter (that is without the optional parameters), it returns TRUE on success, or FALSE on failure. When used as setter (that is with one or both optional parameters given), it returns an indexed array of the horizontal and vertical resolution on success, or FALSE on failure. - * @link https://php.net/manual/en/function.imageresolution.php - * @since 7.2 - */ -function imageresolution ($im, $res_x = 96, $res_y = 96) {} +function imagecolorclosestalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {} +function imagecolorexactalpha(GdImage $image, int $red, int $green, int $blue, int $alpha): int {} -/** - * imagesetclip() sets the current clipping rectangle, i.e. the area beyond which no pixels will be drawn. - * @param resource $im An image resource, returned by one of the image creation functions, such as {@see imagecreatetruecolor()}. - * @param int $x1 The x-coordinate of the upper left corner. - * @param int $y1 The y-coordinate of the upper left corner. - * @param int $x2 The x-coordinate of the lower right corner. - * @param int $y2 The y-coordinate of the lower right corner. - * @return bool Returns TRUE on success or FALSE on failure. - * @link https://php.net/manual/en/function.imagesetclip.php - * @see imagegetclip() - * @since 7.2 - */ -function imagesetclip ($im, $x1, $y1, $x2, $y2) {} +function imagecopyresampled(GdImage $dst_image, GdImage $src_image, int $dst_x, int $dst_y, int $src_x, int $src_y, int $dst_width, int $dst_height, int $src_width, int $src_height): bool {} -/** - * imagegetclip() retrieves the current clipping rectangle, i.e. the area beyond which no pixels will be drawn. - * @param resource $im An image resource, returned by one of the image creation functions, such as {@see imagecreatetruecolor()} - * @return array|false an indexed array with the coordinates of the clipping rectangle which has the following entries: - *- * points[0] = x0 - * points[1] = y0 - * points[2] = x1 - * points[3] = y1 - *- * @param int $num_points [optional] Total number of points (vertices). - * @param int $color A color identifier created with {@see imagecolorallocate()}. - * @return bool Returns TRUE on success or FALSE on failure. - * @link https://php.net/manual/en/function.imageopenpolygon.php - * @since 7.2 - * @see imageplygon() - */ -function imageopenpolygon ($image , $points, $num_points, $color) {} +/** @refcount 1 */ +function imagegrabwindow(int $handle, bool $client_area = false): GdImage|false {} -/** - * imagecreatefrombmp() returns an image identifier representing the image obtained from the given filename. - * TIP A URL can be used as a filename with this function if the fopen wrappers have been enabled. See {@see fopen()} for more details on how to specify the filename. See the Supported Protocols and Wrappers for links to information about what abilities the various wrappers have, notes on their usage, and information on any predefined variables they may provide. - * @param string $filename Path to the BMP image. - * @return resource|false Returns an image resource identifier on success, FALSE on errors. - * @link https://php.net/manual/en/function.imagecreatefrombmp.php - * @since 7.2 - */ -function imagecreatefrombmp($filename){} +/** @refcount 1 */ +function imagegrabscreen(): GdImage|false {} -/** - * Outputs or saves a BMP version of the given image. - * @param resource $image An image resource, returned by one of the image creation functions, such as {@see imagecreatetruecolor()}. - * @param mixed $to The path or an open stream resource (which is automatically being closed after this function returns) to save the file to. If not set or NULL, the raw image stream will be outputted directly. - *
- * This constant has the same value as {@see IMG_JPG} - *
- * @link https://php.net/manual/en/image.constants.php#constant.img-jpeg - */ -define ('IMG_JPEG', 2); +/** @refcount 1 */ +function imagecreatefromstring(string $data): GdImage|false {} -/** - * Used as a return value by {@see imagetypes()} - * @link https://php.net/manual/en/image.constants.php#constant.img-png - */ -define ('IMG_PNG', 4); +#ifdef HAVE_GD_AVIF +/** @refcount 1 */ +function imagecreatefromavif(string $filename): GdImage|false {} +#endif -/** - * Used as a return value by {@see imagetypes()} - * @link https://php.net/manual/en/image.constants.php#constant.img-wbmp - */ -define ('IMG_WBMP', 8); +/** @refcount 1 */ +function imagecreatefromgif(string $filename): GdImage|false {} -/** - * Used as a return value by {@see imagetypes()} - * @link https://php.net/manual/en/image.constants.php#constant.img-xpm - */ -define ('IMG_XPM', 16); +#ifdef HAVE_GD_JPG +/** @refcount 1 */ +function imagecreatefromjpeg(string $filename): GdImage|false {} +#endif -/** - * Used as a return value by {@see imagetypes()} - * @since 5.6.25 - * @since 7.0.10 - * @link https://php.net/manual/en/image.constants.php#constant.img-webp - */ -define('IMG_WEBP', 32); +#ifdef HAVE_GD_PNG +/** @refcount 1 */ +function imagecreatefrompng(string $filename): GdImage|false {} +#endif -/** - * Used as a return value by {@see imagetypes()} - * @since 7.2 - * @link https://php.net/manual/en/image.constants.php#constant.img-bmp - */ -define('IMG_BMP', 64); +#ifdef HAVE_GD_WEBP +/** @refcount 1 */ +function imagecreatefromwebp(string $filename): GdImage|false {} +#endif -/** - * Special color option which can be used instead of color allocated with - * {@see imagecolorallocate()} or {@see imagecolorallocatealpha()} - * @link https://php.net/manual/en/image.constants.php#constant.img-color-tiled - */ -define ('IMG_COLOR_TILED', -5); +/** @refcount 1 */ +function imagecreatefromxbm(string $filename): GdImage|false {} -/** - * Special color option which can be used instead of color allocated with - * {@see imagecolorallocate()} or {@see imagecolorallocatealpha()} - * @link https://php.net/manual/en/image.constants.php#constant.img-color-styled - */ -define ('IMG_COLOR_STYLED', -2); +#ifdef HAVE_GD_XPM +/** @refcount 1 */ +function imagecreatefromxpm(string $filename): GdImage|false {} +#endif -/** - * Special color option which can be used instead of color allocated with - * {@see imagecolorallocate()} or {@see imagecolorallocatealpha()} - * @link https://php.net/manual/en/image.constants.php#constant.img-color-brushed - */ -define ('IMG_COLOR_BRUSHED', -3); +/** @refcount 1 */ +function imagecreatefromwbmp(string $filename): GdImage|false {} -/** - * Special color option which can be used instead of color allocated with - * {@see imagecolorallocate()} or {@see imagecolorallocatealpha()} - * @link https://php.net/manual/en/image.constants.php#constant.img-color-styledbrushed - */ -define ('IMG_COLOR_STYLEDBRUSHED', -4); +/** @refcount 1 */ +function imagecreatefromgd(string $filename): GdImage|false {} -/** - * Special color option which can be used instead of color allocated with - * {@see imagecolorallocate()} or {@see imagecolorallocatealpha()} - * @link https://php.net/manual/en/image.constants.php#constant.img-color-transparent - */ -define ('IMG_COLOR_TRANSPARENT', -6); +/** @refcount 1 */ +function imagecreatefromgd2(string $filename): GdImage|false {} -/** - * A style constant used by the {@see imagefilledarc()} function. - *- * This constant has the same value as {@see IMG_ARC_PIE} - *
- * @link https://php.net/manual/en/image.constants.php#constant.img-arc-rounded - */ -define ('IMG_ARC_ROUNDED', 0); +/** @refcount 1 */ +function imagecreatefromgd2part(string $filename, int $x, int $y, int $width, int $height): GdImage|false {} -/** - * A style constant used by the {@see imagefilledarc()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-arc-pie - */ -define ('IMG_ARC_PIE', 0); +#ifdef HAVE_GD_BMP +/** @refcount 1 */ +function imagecreatefrombmp(string $filename): GdImage|false {} +#endif -/** - * A style constant used by the {@see imagefilledarc()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-arc-chord - */ -define ('IMG_ARC_CHORD', 1); +#ifdef HAVE_GD_TGA +function imagecreatefromtga(string $filename): GdImage|false {} +#endif -/** - * A style constant used by the {@see imagefilledarc()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-arc-nofill - */ -define ('IMG_ARC_NOFILL', 2); +function imagexbm(GdImage $image, ?string $filename, ?int $foreground_color = null): bool {} -/** - * A style constant used by the {@see imagefilledarc()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-arc-edged - */ -define ('IMG_ARC_EDGED', 4); +#ifdef HAVE_GD_AVIF +/** @param resource|string|null $file */ +function imageavif(GdImage $image, $file = null, int $quality = -1, int $speed = -1): bool {} +#endif -/** - * A type constant used by the {@see imagegd2()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-gd2-raw - */ -define ('IMG_GD2_RAW', 1); +/** @param resource|string|null $file */ +function imagegif(GdImage $image, $file = null): bool {} -/** - * A type constant used by the {@see imagegd2()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-gd2-compressed - */ -define ('IMG_GD2_COMPRESSED', 2); +#ifdef HAVE_GD_PNG +/** @param resource|string|null $file */ +function imagepng(GdImage $image, $file = null, int $quality = -1, int $filters = -1): bool {} +#endif -/** - * Alpha blending effect used by the {@see imagelayereffect()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-effect-replace - */ -define ('IMG_EFFECT_REPLACE', 0); +#ifdef HAVE_GD_WEBP +/** @param resource|string|null $file */ +function imagewebp(GdImage $image, $file = null, int $quality = -1): bool {} +#endif -/** - * Alpha blending effect used by the {@see imagelayereffect()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-effect-alphablend - */ -define ('IMG_EFFECT_ALPHABLEND', 1); +#ifdef HAVE_GD_JPG +/** @param resource|string|null $file */ +function imagejpeg(GdImage $image, $file = null, int $quality = -1): bool {} +#endif -/** - * Alpha blending effect used by the {@see imagelayereffect()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-effect-normal - */ -define ('IMG_EFFECT_NORMAL', 2); +/** @param resource|string|null $file */ +function imagewbmp(GdImage $image, $file = null, ?int $foreground_color = null): bool {} -/** - * Alpha blending effect used by the {@see imagelayereffect()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-effect-overlay - */ -define ('IMG_EFFECT_OVERLAY', 3); +function imagegd(GdImage $image, ?string $file = null): bool {} -/** - * Alpha blending effect used by the {@see imagelayereffect()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-effect-multiply - * @since 7.2 - */ -define ('IMG_EFFECT_MULTIPLY', 4); +function imagegd2(GdImage $image, ?string $file = null, int $chunk_size = UNKNOWN, int $mode = UNKNOWN): bool {} -/** - * When the bundled version of GD is used this is 1 otherwise - * it's set to 0. - * @link https://php.net/manual/en/image.constants.php - */ -define ('GD_BUNDLED', 1); +#ifdef HAVE_GD_BMP +/** @param resource|string|null $file */ +function imagebmp(GdImage $image, $file = null, bool $compressed = true): bool {} +#endif -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-negate - */ -define ('IMG_FILTER_NEGATE', 0); +function imagedestroy(GdImage $image): bool {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-grayscale - */ -define ('IMG_FILTER_GRAYSCALE', 1); +function imagecolorallocate(GdImage $image, int $red, int $green, int $blue): int|false {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-brightness - */ -define ('IMG_FILTER_BRIGHTNESS', 2); +function imagepalettecopy(GdImage $dst, GdImage $src): void {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-contrast - */ -define ('IMG_FILTER_CONTRAST', 3); +function imagecolorat(GdImage $image, int $x, int $y): int|false {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-colorize - */ -define ('IMG_FILTER_COLORIZE', 4); +function imagecolorclosest(GdImage $image, int $red, int $green, int $blue): int {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-edgedetect - */ -define ('IMG_FILTER_EDGEDETECT', 5); +function imagecolorclosesthwb(GdImage $image, int $red, int $green, int $blue): int {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-gaussian-blur - */ -define ('IMG_FILTER_GAUSSIAN_BLUR', 7); +function imagecolordeallocate(GdImage $image, int $color): bool {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-selective-blur - */ -define ('IMG_FILTER_SELECTIVE_BLUR', 8); +function imagecolorresolve(GdImage $image, int $red, int $green, int $blue): int {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-emboss - */ -define ('IMG_FILTER_EMBOSS', 6); +function imagecolorexact(GdImage $image, int $red, int $green, int $blue): int {} -/** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-mean-removal - */ -define ('IMG_FILTER_MEAN_REMOVAL', 9); +/** @return false|null */ +function imagecolorset(GdImage $image, int $color, int $red, int $green, int $blue, int $alpha = 0): ?bool {} /** - * Special GD filter used by the {@see imagefilter()} function. - * @link https://php.net/manual/en/image.constants.php#constant.img-filter-smooth + * @return arrayAn image resource, returned by one of the image creation functions, - * such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}.
- * @param array $affineArray with keys 0 to 5.
- * @param array $clip [optional]Array with keys "x", "y", "width" and "height".
- * @return resource|bool Return affined image resource on success or FALSE on failure. - */ -function imageaffine($image, $affine, $clip = null) {} - -/** - * Concat two matrices (as in doing many ops in one go) - * @link https://www.php.net/manual/en/function.imageaffinematrixconcat.php - * @param array $m1Array with keys 0 to 5.
- * @param array $m2Array with keys 0 to 5.
- * @return array|bool Array with keys 0 to 5 and float values or FALSE on failure. - * @since 5.5 - */ -function imageaffinematrixconcat(array $m1, array $m2) {} - -/** - * Return an image containing the affine tramsformed src image, using an optional clipping area - * @link https://www.php.net/manual/en/function.imageaffinematrixget.php - * @param int $typeOne of IMG_AFFINE_* constants. - * @param mixed $options [optional] - * @return array|bool Array with keys 0 to 5 and float values or FALSE on failure. - * @since 5.5 - */ - -function imageaffinematrixget ($type, $options = null) {} - -/** - * Crop an image using the given coordinates and size, x, y, width and height - * @link https://www.php.net/manual/en/function.imagecrop.php - * @param resource $image
- * An image resource, returned by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}. - *
- * @param array $rectArray with keys "x", "y", "width" and "height".
- * @return resource|bool Return cropped image resource on success or FALSE on failure. - * @since 5.5 - */ -function imagecrop ($image, $rect) {} - -/** - * Crop an image automatically using one of the available modes - * @link https://www.php.net/manual/en/function.imagecropauto.php - * @param resource $image- * An image resource, returned by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}. - *
- * @param int $mode [optional]- * One of IMG_CROP_* constants. - *
- * @param float $threshold [optional]- * Used IMG_CROP_THRESHOLD mode. - *
- * @param int $color [optional] - *- * Used in IMG_CROP_THRESHOLD mode. - *
- * @return resource|bool Return cropped image resource on success or FALSE on failure. - * @since 5.5 - */ -function imagecropauto ($image, $mode = IMG_CROP_DEFAULT, $threshold = .5, $color = -1) {} - -/** - * Flips an image using a given mode - * @link https://www.php.net/manual/en/function.imageflip.php - * @param resource $image- * An image resource, returned by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}. - *
- * @param int $mode- * Flip mode, this can be one of the IMG_FLIP_* constants: - *
- *Constant | - *Meaning | - *
---|---|
IMG_FLIP_HORIZONTAL | - *- * Flips the image horizontally. - * | - *
IMG_FLIP_VERTICAL | - *- * Flips the image vertically. - * | - *
IMG_FLIP_BOTH | - *- * Flips the image both horizontally and vertically. - * | - *
- * An image resource, returnd by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}. - *
- * @return bool Returns TRUE if the convertion was complete, or if the source image already is a true color image, otherwise FALSE is returned. - * @since 5.5 - */ -function imagepalettetotruecolor ($image) {} - -/** - * @since 5.5 - * Scale an image using the given new width and height - * @link https://www.php.net/manual/en/function.imagescale.php - * @param resource $image- * An image resource, returnd by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}. - *
- * @param int $new_width - * @param int $new_height [optional] - * @param int $mode [optional] One of IMG_NEAREST_NEIGHBOUR, IMG_BILINEAR_FIXED, IMG_BICUBIC, IMG_BICUBIC_FIXED or anything else (will use two pass). - * @return resource|bool Return scaled image resource on success or FALSE on failure. - */ +function imagegetinterpolation(GdImage $image): int {} -function imagescale ($image, $new_width, $new_height = -1, $mode = IMG_BILINEAR_FIXED) {} +function imagesetinterpolation(GdImage $image, int $method = IMG_BILINEAR_FIXED): bool {} /** - * Set the interpolation method - * @link https://www.php.net/manual/en/function.imagesetinterpolation.php - * @param resource $image- * An image resource, returned by one of the image creation functions, such as {@link https://www.php.net/manual/en/function.imagecreatetruecolor.php imagecreatetruecolor()}. - *
- * @param int $method- * The interpolation method, which can be one of the following: - *
- * One of the layer method constants. - *
- * @return Imagick TRUE on success. - */ - public function compareImageLayers ($method) {} - - /** - * (PECL imagick 2.0.0)- * A string containing the image. - *
- * @return bool TRUE on success. - */ - public function pingImageBlob ($image) {} - - /** - * (PECL imagick 2.0.0)- * An open filehandle to the image. - *
- * @param string $fileName [optional]- * Optional filename for this image. - *
- * @return bool TRUE on success. - */ - public function pingImageFile ($filehandle, $fileName = null) {} - - /** - * (PECL imagick 2.0.0)- * By default target must match a particular pixel color exactly. - * However, in many cases two colors may differ by a small amount. - * The fuzz member of image defines how much tolerance is acceptable - * to consider two colors as the same. This parameter represents the variation - * on the quantum range. - *
- * @return bool TRUE on success. - */ - public function trimImage ($fuzz) {} - - /** - * (PECL imagick 2.0.0)- * The amplitude of the wave. - *
- * @param float $length- * The length of the wave. - *
- * @return bool TRUE on success. - */ - public function waveImage ($amplitude, $length) {} - - /** - * (PECL imagick 2.0.0)- * The black point. - *
- * @param float $whitePoint- * The white point - *
- * @param int $x- * X offset of the ellipse - *
- * @param int $y- * Y offset of the ellipse - *
- * @return bool TRUE on success. - */ - public function vignetteImage ($blackPoint, $whitePoint, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * True activates the matte channel and false disables it. - *
- * @return bool TRUE on success. - */ - public function setImageMatte ($matte) {} - - /** - * Adaptively resize image with data dependent triangulation - * - * If legacy is true, the calculations are done with the small rounding bug that existed in Imagick before 3.4.0.- * The radius of the Gaussian, in pixels, not counting the center pixel - *
- * @param float $sigma- * The standard deviation of the Gaussian, in pixels. - *
- * @param float $angle- * Apply the effect along this angle. - *
- * @return bool TRUE on success. - */ - public function sketchImage ($radius, $sigma, $angle) {} - - /** - * (PECL imagick 2.0.0)- * A value other than zero shades the intensity of each pixel. - *
- * @param float $azimuth- * Defines the light source direction. - *
- * @param float $elevation- * Defines the light source direction. - *
- * @return bool TRUE on success. - */ - public function shadeImage ($gray, $azimuth, $elevation) {} - - /** - * (PECL imagick 2.0.0)- * The width in pixels. - *
- * @param int $rows- * The height in pixels. - *
- * @param int $offset- * The image offset. - *
- * @return bool TRUE on success. - */ - public function setSizeOffset ($columns, $rows, $offset) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the Gaussian, in pixels, not counting the center pixel. - * Provide a value of 0 and the radius will be chosen automagically. - *
- * @param float $sigma- * The standard deviation of the Gaussian, in pixels. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function adaptiveBlurImage ($radius, $sigma, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (PECL imagick 2.0.0)- * The black point. - *
- * @param float $white_point- * The white point. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Imagick::CHANNEL_ALL. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function contrastStretchImage ($black_point, $white_point, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the Gaussian, in pixels, not counting the center pixel. Use 0 for auto-select. - *
- * @param float $sigma- * The standard deviation of the Gaussian, in pixels. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function adaptiveSharpenImage ($radius, $sigma, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (PECL imagick 2.0.0)- * The low point - *
- * @param float $high- * The high point - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function randomThresholdImage ($low, $high, $channel = Imagick::CHANNEL_ALL) {} - - /** - * @param $xRounding - * @param $yRounding - * @param $strokeWidth [optional] - * @param $displace [optional] - * @param $sizeCorrection [optional] - */ - public function roundCornersImage ($xRounding, $yRounding, $strokeWidth, $displace, $sizeCorrection) {} - - /** - * (PECL imagick 2.0.0)- * x rounding - *
- * @param float $y_rounding- * y rounding - *
- * @param float $stroke_width [optional]- * stroke width - *
- * @param float $displace [optional]- * image displace - *
- * @param float $size_correction [optional]- * size correction - *
- * @return bool TRUE on success. - */ - public function roundCorners ($x_rounding, $y_rounding, $stroke_width = 10.0, $displace = 5.0, $size_correction = -6.0) {} - - /** - * (PECL imagick 2.0.0)- * The position to set the iterator to - *
- * @return bool TRUE on success. - */ - public function setIteratorIndex ($index) {} - - /** - * (PECL imagick 2.0.0)- * A crop geometry string. This geometry defines a subregion of the image to crop. - *
- * @param string $geometry- * An image geometry string. This geometry defines the final size of the image. - *
- * @return Imagick TRUE on success. - */ - public function transformImage ($crop, $geometry) {} - - /** - * (PECL imagick 2.0.0)- * The level of transparency: 1.0 is fully opaque and 0.0 is fully - * transparent. - *
- * @return bool TRUE on success. - */ - public function setImageOpacity ($opacity) {} - - /** - * (PECL imagick 2.2.2)- * A string containing the name of the threshold dither map to use - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function orderedPosterizeImage ($threshold_map, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The polaroid properties - *
- * @param float $angle- * The polaroid angle - *
- * @return bool TRUE on success. - */ - public function polaroidImage (ImagickDraw $properties, $angle) {} - - /** - * (PECL imagick 2.0.0)- * name of the property (for example Exif:DateTime) - *
- * @return string|false a string containing the image property, false if a - * property with the given name does not exist. - */ - public function getImageProperty ($name) {} - - /** - * (PECL imagick 2.0.0)- * The method is one of the Imagick::INTERPOLATE_* constants - *
- * @return bool TRUE on success. - */ - public function setImageInterpolateMethod ($method) {} - - /** - * (PECL imagick 2.0.0)- * The image black point - *
- * @param float $whitePoint- * The image white point - *
- * @return bool TRUE on success. - */ - public function linearStretchImage ($blackPoint, $whitePoint) {} - - /** - * (PECL imagick 2.0.0)- * The new width - *
- * @param int $height- * The new height - *
- * @param int $x- * X position for the new size - *
- * @param int $y- * Y position for the new size - *
- * @return bool TRUE on success. - */ - public function extentImage ($width, $height, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * One of the orientation constants - *
- * @return bool TRUE on success. - */ - public function setImageOrientation ($orientation) {} - - /** - * (PECL imagick 2.1.0)- * ImagickPixel object or a string containing the fill color - *
- * @param float $fuzz- * The amount of fuzz. For example, set fuzz to 10 and the color red at - * intensities of 100 and 102 respectively are now interpreted as the - * same color for the purposes of the floodfill. - *
- * @param mixed $bordercolor- * ImagickPixel object or a string containing the border color - *
- * @param int $x- * X start position of the floodfill - *
- * @param int $y- * Y start position of the floodfill - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function paintFloodfillImage ($fill, $fuzz, $bordercolor, $x, $y, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * Imagick object containing the color lookup table - *
- * @param int $channel [optional]- * The Channeltype - * constant. When not supplied, default channels are replaced. - *
- * @return bool TRUE on success. - * @since 2.0.0 - */ - public function clutImage (Imagick $lookup_table, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (PECL imagick 2.0.0)- * The pattern for property names. - *
- * @param bool $only_names [optional]- * Whether to return only property names. If FALSE then also the values are returned - *
- * @return array an array containing the image properties or property names. - */ - public function getImageProperties ($pattern = "*", $only_names = true) {} - - /** - * (PECL imagick 2.2.0)- * The pattern for profile names. - *
- * @param bool $include_values [optional]- * Whether to return only profile names. If FALSE then only profile names will be returned. - *
- * @return array an array containing the image profiles or profile names. - */ - public function getImageProfiles ($pattern = "*", $include_values = true) {} - - /** - * (PECL imagick 2.0.1)- * The method of image distortion. See distortion constants - *
- * @param array $arguments- * The arguments for this distortion method - *
- * @param bool $bestfit- * Attempt to resize destination to fit distorted source - *
- * @return bool TRUE on success. - */ - public function distortImage ($method, array $arguments, $bestfit) {} - - /** - * (No version information available, might only be in SVN)- * Filehandle where to write the image - *
- * @return bool TRUE on success. - */ - public function writeImageFile ($filehandle) {} - - /** - * (No version information available, might only be in SVN)- * Filehandle where to write the images - *
- * @return bool TRUE on success. - */ - public function writeImagesFile ($filehandle) {} - - /** - * (No version information available, might only be in SVN)- * The page definition. For example 7168x5147+0+0 - *
- * @return bool TRUE on success. - */ - public function resetImagePage ($page) {} - - /** - * (No version information available, might only be in SVN)- * The Imagick object containing the clip mask - *
- * @return bool TRUE on success. - */ - public function setImageClipMask (Imagick $clip_mask) {} - - /** - * (No version information available, might only be in SVN)- * X server address - *
- * @return bool TRUE on success. - */ - public function animateImages ($x_server) {} - - /** - * (No version information available, might only be in SVN)- * The matrix containing the color values - *
- * @return bool TRUE on success. - */ - public function recolorImage (array $matrix) {} - - /** - * (PECL imagick 2.1.0)- * Font name or a filename - *
- * @return bool TRUE on success. - */ - public function setFont ($font) {} - - /** - * (PECL imagick 2.1.0)- * Point size - *
- * @return bool TRUE on success. - */ - public function setPointSize ($point_size) {} - - /** - * (No version information available, might only be in SVN)- * One of the Imagick::LAYERMETHOD_* constants - *
- * @return Imagick Returns an Imagick object containing the merged image. - * @throws ImagickException - */ - public function mergeImageLayers ($layer_method) {} - - /** - * (No version information available, might only be in SVN)- * One of the Imagick::ALPHACHANNEL_* constants - *
- * @return bool TRUE on success. - */ - public function setImageAlphaChannel ($mode) {} - - /** - * (No version information available, might only be in SVN)- * ImagickPixel object or a string containing the fill color - *
- * @param float $fuzz- * The amount of fuzz. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color. - *
- * @param mixed $target- * ImagickPixel object or a string containing the target color to paint - *
- * @param int $x- * X start position of the floodfill - *
- * @param int $y- * Y start position of the floodfill - *
- * @param bool $invert- * If TRUE paints any pixel that does not match the target color. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function floodFillPaintImage ($fill, $fuzz, $target, $x, $y, $invert, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (No version information available, might only be in SVN)- * ImagickPixel object or a string containing the color to change - *
- * @param mixed $fill- * The replacement color - *
- * @param float $fuzz- * The amount of fuzz. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color. - *
- * @param bool $invert- * If TRUE paints any pixel that does not match the target color. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function opaquePaintImage ($target, $fill, $fuzz, $invert, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (No version information available, might only be in SVN)- * The target color to paint - *
- * @param float $alpha- * The level of transparency: 1.0 is fully opaque and 0.0 is fully transparent. - *
- * @param float $fuzz- * The amount of fuzz. For example, set fuzz to 10 and the color red at intensities of 100 and 102 respectively are now interpreted as the same color. - *
- * @param bool $invert- * If TRUE paints any pixel that does not match the target color. - *
- * @return bool TRUE on success. - */ - public function transparentPaintImage ($target, $alpha, $fuzz, $invert) {} - - /** - * (No version information available, might only be in SVN)- * The width of the target size - *
- * @param int $height- * The height of the target size - *
- * @param float $delta_x- * How much the seam can traverse on x-axis. - * Passing 0 causes the seams to be straight. - *
- * @param float $rigidity- * Introduces a bias for non-straight seams. This parameter is - * typically 0. - *
- * @return bool TRUE on success. - */ - public function liquidRescaleImage ($width, $height, $delta_x, $rigidity) {} - - /** - * (No version information available, might only be in SVN)- * The passphrase - *
- * @return bool TRUE on success. - */ - public function encipherImage ($passphrase) {} - - /** - * (No version information available, might only be in SVN)- * The passphrase - *
- * @return bool TRUE on success. - */ - public function decipherImage ($passphrase) {} - - /** - * (No version information available, might only be in SVN)- * The gravity property. Refer to the list of - * gravity constants. - *
- * @return bool No value is returned. - */ - public function setGravity ($gravity) {} - - /** - * (No version information available, might only be in SVN)- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return array an array containing minima and maxima values of the channel(s). - */ - public function getImageChannelRange ($channel) {} - - /** - * (No version information available, might only be in SVN)- * Imagick object containing the reference image - *
- * @param int $metric- * Refer to this list of metric type constants. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return float a double describing the channel distortion. - */ - public function getImageChannelDistortions (Imagick $reference, $metric, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (No version information available, might only be in SVN)- * The gravity property. Refer to the list of - * gravity constants. - *
- * @return bool No value is returned. - */ - public function setImageGravity ($gravity) {} - - /** - * (No version information available, might only be in SVN)- * The image x position - *
- * @param int $y- * The image y position - *
- * @param int $width- * The image width - *
- * @param int $height- * The image height - *
- * @param string $map- * Map of pixel ordering as a string. This can be for example RGB. - * The value can be any combination or order of R = red, G = green, B = blue, A = alpha (0 is transparent), - * O = opacity (0 is opaque), C = cyan, Y = yellow, M = magenta, K = black, I = intensity (for grayscale), P = pad. - *
- * @param int $storage- * The pixel storage method. - * Refer to this list of pixel constants. - *
- * @param array $pixels- * The array of pixels - *
- * @return bool TRUE on success. - */ - public function importImagePixels ($x, $y, $width, $height, $map, $storage, array $pixels) {} - - /** - * (No version information available, might only be in SVN)- * Deskew threshold - *
- * @return bool - */ - public function deskewImage ($threshold) {} - - /** - * (No version information available, might only be in SVN)- * One of the COLORSPACE constants. - *
- * @param float $cluster_threshold- * A percentage describing minimum number of pixels - * contained in hexedra before it is considered valid. - *
- * @param float $smooth_threshold- * Eliminates noise from the histogram. - *
- * @param bool $verbose [optional]- * Whether to output detailed information about recognised classes. - *
- * @return bool - */ - public function segmentImage ($COLORSPACE, $cluster_threshold, $smooth_threshold, $verbose = false) {} - - /** - * (No version information available, might only be in SVN)- * Refer to this list of sparse method constants - *
- * @param array $arguments- * An array containing the coordinates. - * The array is in format array(1,1, 2,45) - *
- * @param int $channel [optional] - * @return bool TRUE on success. - */ - public function sparseColorImage ($SPARSE_METHOD, array $arguments, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (No version information available, might only be in SVN)- * An Imagick object containing the replacement colors - *
- * @param int $DITHER- * Refer to this list of dither method constants - *
- * @return bool TRUE on success. - */ - public function remapImage (Imagick $replacement, $DITHER) {} - - /** - * (No version information available, might only be in SVN)- * X-coordinate of the exported area - *
- * @param int $y- * Y-coordinate of the exported area - *
- * @param int $width- * Width of the exported aread - *
- * @param int $height- * Height of the exported area - *
- * @param string $map- * Ordering of the exported pixels. For example "RGB". - * Valid characters for the map are R, G, B, A, O, C, Y, M, K, I and P. - *
- * @param int $STORAGE- * Refer to this list of pixel type constants - *
- * @return array an array containing the pixels values. - */ - public function exportImagePixels ($x, $y, $width, $height, $map, $STORAGE) {} - - /** - * (No version information available, might only be in SVN)- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return array an array with kurtosis and skewness - * members. - */ - public function getImageChannelKurtosis ($channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (No version information available, might only be in SVN)- * Refer to this list of function constants - *
- * @param array $arguments- * Array of arguments to pass to this function. - *
- * @param int $channel [optional] - * @return bool TRUE on success. - */ - public function functionImage ($function, array $arguments, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * @param $COLORSPACE - */ - public function transformImageColorspace ($COLORSPACE) {} - - /** - * (No version information available, might only be in SVN)- * Imagick object containing the Hald lookup image. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function haldClutImage (Imagick $clut, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * @param $CHANNEL [optional] - */ - public function autoLevelImage ($CHANNEL) {} - - /** - * @param $factor [optional] - */ - public function blueShiftImage ($factor) {} - - /** - * (No version information available, might only be in SVN)- * The name of the artifact - *
- * @return string the artifact value on success. - */ - public function getImageArtifact ($artifact) {} - - /** - * (No version information available, might only be in SVN)- * The name of the artifact - *
- * @param string $value- * The value of the artifact - *
- * @return bool TRUE on success. - */ - public function setImageArtifact ($artifact, $value) {} - - /** - * (No version information available, might only be in SVN)- * The name of the artifact to delete - *
- * @return bool TRUE on success. - */ - public function deleteImageArtifact ($artifact) {} - - /** - * (PECL imagick 0.9.10-0.9.9)- * One of the COLORSPACE constants - *
- * @return bool TRUE on success. - */ - public function setColorspace ($COLORSPACE) {} - - /** - * @param $CHANNEL [optional] - */ - public function clampImage ($CHANNEL) {} - - /** - * @param $stack - * @param $offset - */ - public function smushImages ($stack, $offset) {} - - /** - * (PECL imagick 2.0.0)- * The path to an image to load or an array of paths. Paths can include - * wildcards for file names, or can be URLs. - *
- * @throws ImagickException Throws ImagickException on error. - */ - public function __construct ($files = null) {} - - /** - * @return string - */ - public function __toString () {} - - public function count () {} - - /** - * (PECL imagick 2.0.0)- * The x-coordinate of the region. - *
- * @param int $y- * The y-coordinate of the region. - *
- * @param int $columns- * The width of the region. - *
- * @param int $rows- * The height of the region. - *
- * @return ImagickPixelIterator an ImagickPixelIterator for an image section. - */ - public function getPixelRegionIterator ($x, $y, $columns, $rows) {} - - /** - * (PECL imagick 0.9.0-0.9.9)- * String presentation of the image format. Format support - * depends on the ImageMagick installation. - *
- * @return bool TRUE on success. - */ - public function setImageFormat ($format) {} - - /** - * Scales the size of an image to the given dimensions. Passing zero as either of the arguments will preserve dimension while scaling.- * Filename where to write the image. The extension of the filename - * defines the type of the file. - * Format can be forced regardless of file extension using format: prefix, - * for example "jpg:test.png". - *
- * @return bool TRUE on success. - */ - public function writeImage ($filename = null) {} - - /** - * (PECL imagick 0.9.0-0.9.9)- * Blur radius - *
- * @param float $sigma- * Standard deviation - *
- * @param int $channel [optional]- * The Channeltype - * constant. When not supplied, all channels are blurred. - *
- * @return bool TRUE on success. - */ - public function blurImage ($radius, $sigma, $channel = null) {} - - /** - * Changes the size of an image to the given dimensions and removes any associated profiles.- * Image width - *
- * @param int $rows- * Image height - *
- * @param bool $bestfit [optional]- * Whether to force maximum values - *
- * The behavior of the parameter bestfit changed in Imagick 3.0.0. Before this version given dimensions 400x400 an image of dimensions 200x150 would be left untouched. In Imagick 3.0.0 and later the image would be scaled up to size 400x300 as this is the "best fit" for the given dimensions. If bestfit parameter is used both width and height must be given. - * @param bool $fill [optional] - * @param bool $legacy [optional] Added since 3.4.0. Default value FALSE - * @return bool TRUE on success. - * @since 2.0.0 - */ - public function thumbnailImage ($columns, $rows, $bestfit = false, $fill = false, $legacy = false) {} - - /** - * Creates a cropped thumbnail at the requested size. - * If legacy is true, uses the incorrect behaviour that was present until Imagick 3.4.0. - * If false it uses the correct behaviour. - * @link https://php.net/manual/en/imagick.cropthumbnailimage.php - * @param int $width The width of the thumbnail - * @param int $height The Height of the thumbnail - * @param bool $legacy [optional] Added since 3.4.0. Default value FALSE - * @return bool TRUE on succes - * @throws ImagickException Throws ImagickException on error - * @since 2.0.0 - */ - public function cropThumbnailImage ($width, $height, $legacy = false) {} - - /** - * (PECL imagick 2.0.0)- * The position to set the iterator to - *
- * @return bool TRUE on success. - */ - public function setImageIndex ($index) {} - - /** - * (PECL imagick 2.0.0)- * The comment to add - *
- * @return bool TRUE on success. - */ - public function commentImage ($comment) {} - - /** - * (PECL imagick 2.0.0)- * The width of the crop - *
- * @param int $height- * The height of the crop - *
- * @param int $x- * The X coordinate of the cropped region's top left corner - *
- * @param int $y- * The Y coordinate of the cropped region's top left corner - *
- * @return bool TRUE on success. - */ - public function cropImage ($width, $height, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * The label to add - *
- * @return bool TRUE on success. - */ - public function labelImage ($label) {} - - /** - * (PECL imagick 2.0.0)- * The drawing operations to render on the image. - *
- * @return bool TRUE on success. - */ - public function drawImage (ImagickDraw $draw) {} - - /** - * (No version information available, might only be in SVN)- * The image compression quality as an integer - *
- * @return bool TRUE on success. - */ - public function setImageCompressionQuality ($quality) {} - - /** - * (PECL imagick 2.2.2)- * The ImagickDraw object that contains settings for drawing the text - *
- * @param float $x- * Horizontal offset in pixels to the left of text - *
- * @param float $y- * Vertical offset in pixels to the baseline of text - *
- * @param float $angle- * The angle at which to write the text - *
- * @param string $text- * The string to draw - *
- * @return bool TRUE on success. - */ - public function annotateImage (ImagickDraw $draw_settings, $x, $y, $angle, $text) {} - - /** - * (PECL imagick 2.0.0)- * Imagick object which holds the composite image - *
- * @param int $composite Composite operator - * @param int $x- * The column offset of the composited image - *
- * @param int $y- * The row offset of the composited image - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this list of channel constants. - *
- * @return bool TRUE on success. - */ - public function compositeImage (Imagick $composite_object, $composite, $x, $y, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The font name, size, and color are obtained from this object. - *
- * @param string $tile_geometry- * The number of tiles per row and page (e.g. 6x4+0+0). - *
- * @param string $thumbnail_geometry- * Preferred image size and border size of each thumbnail - * (e.g. 120x120+4+3>). - *
- * @param int $mode- * Thumbnail framing mode, see Montage Mode constants. - *
- * @param string $frame- * Surround the image with an ornamental border (e.g. 15x15+3+3). The - * frame color is that of the thumbnail's matte color. - *
- * @return Imagick TRUE on success. - */ - public function montageImage (ImagickDraw $draw, $tile_geometry, $thumbnail_geometry, $mode, $frame) {} - - /** - * (PECL imagick 2.0.0)- * Width of the local neighborhood. - *
- * @param int $height- * Height of the local neighborhood. - *
- * @param int $offset- * The mean offset - *
- * @return bool TRUE on success. - */ - public function adaptiveThresholdImage ($width, $height, $offset) {} - - /** - * (PECL imagick 2.0.0)- * The threshold below which everything turns black - *
- * @return bool TRUE on success. - */ - public function blackThresholdImage ($threshold) {} - - /** - * (PECL imagick 2.0.0)- * Whether to stack the images vertically. - * By default (or if FALSE is specified) images are stacked left-to-right. - * If stack is TRUE, images are stacked top-to-bottom. - *
- * @return Imagick Imagick instance on success. - */ - public function appendImages ($stack = false) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the Gaussian, in pixels, not counting the center pixel - *
- * @param float $sigma- * The standard deviation of the Gaussian, in pixels - *
- * @return bool TRUE on success. - */ - public function charcoalImage ($radius, $sigma) {} - - /** - * (PECL imagick 2.0.0)- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function normalizeImage ($channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the circular neighborhood. - *
- * @return bool TRUE on success. - */ - public function oilPaintImage ($radius) {} - - /** - * (PECL imagick 2.0.0)- * The X offset. - *
- * @param int $y- * The Y offset. - *
- * @return bool TRUE on success. - */ - public function rollImage ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * The background color - *
- * @param float $degrees- * The number of degrees to rotate the image - *
- * @return bool TRUE on success. - */ - public function rotateImage ($background, $degrees) {} - - /** - * (PECL imagick 2.0.0)- * One of the COMPRESSION constants - *
- * @return bool TRUE on success. - */ - public function setImageCompression ($compression) {} - - /** - * (PECL imagick 2.0.0)- * The amount of time expressed in 'ticks' that the image should be - * displayed for. For animated GIFs there are 100 ticks per second, so a - * value of 20 would be 20/100 of a second aka 1/5th of a second. - *
- * @return bool TRUE on success. - */ - public function setImageDelay ($delay) {} - - /** - * (PECL imagick 2.0.0)- * The number of iterations the image should loop over. Set to '0' to loop - * continuously. - *
- * @return bool TRUE on success. - */ - public function setImageIterations ($iterations) {} - - /** - * (PECL imagick 2.0.0)- * The duration for which an image should be displayed expressed in ticks - * per second. - *
- * @return bool TRUE on success. - */ - public function setImageTicksPerSecond ($ticks_per_second) {} - - /** - * (PECL imagick 2.0.0)- * The background color - *
- * @param float $x_shear- * The number of degrees to shear on the x axis - *
- * @param float $y_shear- * The number of degrees to shear on the y axis - *
- * @return bool TRUE on success. - */ - public function shearImage ($background, $x_shear, $y_shear) {} - - /** - * (PECL imagick 2.0.0)- * The filename to read the information from. - *
- * @return bool TRUE on success. - */ - public function pingImage ($filename) {} - - /** - * (PECL imagick 2.0.0)- * The X server name - *
- * @return bool TRUE on success. - */ - public function displayImage ($servername) {} - - /** - * (PECL imagick 2.0.0)- * The X server name - *
- * @return bool TRUE on success. - */ - public function displayImages ($servername) {} - - /** - * (PECL imagick 2.0.0)- * The query pattern - *
- * @return array an array containing the configured fonts. - */ - public static function queryFonts ($pattern = "*") {} - - /** - * (PECL imagick 2.0.0)- * ImagickDraw object containing font properties - *
- * @param string $text- * The text - *
- * @param bool $multiline [optional]- * Multiline parameter. If left empty it is autodetected - *
- * @return array a multi-dimensional array representing the font metrics. - */ - public function queryFontMetrics (ImagickDraw $properties, $text, $multiline = null) {} - - /** - * (PECL imagick 2.0.0)- * The type of the noise. Refer to this list of - * noise constants. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return bool TRUE on success. - */ - public function addNoiseImage ($noise_type, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the Gaussian, in pixels, not counting the center pixel. - *
- * @param float $sigma- * The standard deviation of the Gaussian, in pixels. - *
- * @param float $angle- * Apply the effect along this angle. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - * The channel argument affects only if Imagick is compiled against ImageMagick version - * 6.4.4 or greater. - *
- * @return bool TRUE on success. - */ - public function motionBlurImage ($radius, $sigma, $angle, $channel = Imagick::CHANNEL_DEFAULT) {} - - /** - * (PECL imagick 2.0.0)- * The number of in-between images to generate. - *
- * @return Imagick This method returns a new Imagick object on success. - * Throw an ImagickException on error. - * @throws ImagickException on error - */ - public function morphImages ($number_frames) {} - - /** - * (PECL imagick 2.0.0)- * The affine matrix - *
- * @return bool TRUE on success. - */ - public function affineTransformImage (ImagickDraw $matrix) {} - - /** - * (PECL imagick 2.0.0)- * ImagickPixel object or a string containing the border color - *
- * @param int $width- * Border width - *
- * @param int $height- * Border height - *
- * @return bool TRUE on success. - */ - public function borderImage ($bordercolor, $width, $height) {} - - /** - * (PECL imagick 2.0.0)- * Width of the chopped area - *
- * @param int $height- * Height of the chopped area - *
- * @param int $x- * X origo of the chopped area - *
- * @param int $y- * Y origo of the chopped area - *
- * @return bool TRUE on success. - */ - public function chopImage ($width, $height, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * The name of the path - *
- * @param bool $inside- * If TRUE later operations take effect inside clipping path. - * Otherwise later operations take effect outside clipping path. - *
- * @return bool TRUE on success. - */ - public function clipPathImage ($pathname, $inside) {} - - /** - * @param $pathname - * @param $inside - */ - public function clipImagePath ($pathname, $inside) {} - - /** - * (PECL imagick 2.0.0)- * ImagickPixel object containing the fill color - *
- * @param float $fuzz- * The amount of fuzz. For example, set fuzz to 10 and the color red at - * intensities of 100 and 102 respectively are now interpreted as the - * same color for the purposes of the floodfill. - *
- * @param mixed $bordercolor- * ImagickPixel object containing the border color - *
- * @param int $x- * X start position of the floodfill - *
- * @param int $y- * Y start position of the floodfill - *
- * @return bool TRUE on success. - */ - public function colorFloodfillImage ($fill, $fuzz, $bordercolor, $x, $y) {} - - /** - * Blends the fill color with each pixel in the image. The 'opacity' color is a per channel strength factor for how strongly the color should be applied.- * ImagickPixel object or a string containing the colorize color - *
- * @param mixed $opacity- * ImagickPixel object or an float containing the opacity value. - * 1.0 is fully opaque and 0.0 is fully transparent. - *
- * @param bool $legacy [optional] Added since 3.4.0. Default value FALSE - * @return bool TRUE on success. - * @throws ImagickException Throws ImagickException on error - * @since 2.0.0 - */ - public function colorizeImage ($colorize, $opacity, $legacy = false) {} - - /** - * (PECL imagick 2.0.0)- * Imagick object containing the image to compare. - *
- * @param int $channelType- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @param int $metricType- * One of the metric type constants. - *
- * @return array Array consisting of new_wand and - * distortion. - */ - public function compareImageChannels (Imagick $image, $channelType, $metricType) {} - - /** - * (PECL imagick 2.0.0)- * An image to compare to. - *
- * @param int $metric- * Provide a valid metric type constant. Refer to this - * list of metric constants. - *
- * @return array Array consisting of an Imagick object of the - * reconstructed image and a double representing the difference. - * @throws ImagickException Throws ImagickException on error. - */ - public function compareImages (Imagick $compare, $metric) {} - - /** - * (PECL imagick 2.0.0)- * The sharpen value - *
- * @return bool TRUE on success. - */ - public function contrastImage ($sharpen) {} - - /** - * (PECL imagick 2.0.0)- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return Imagick TRUE on success. - */ - public function combineImages ($channelType) {} - - /** - * (PECL imagick 2.0.0)- * The convolution kernel - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function convolveImage (array $kernel, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The amount to displace the colormap. - *
- * @return bool TRUE on success. - */ - public function cycleColormapImage ($displace) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the operation. - *
- * @return bool TRUE on success. - */ - public function edgeImage ($radius) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the effect - *
- * @param float $sigma- * The sigma of the effect - *
- * @return bool TRUE on success. - */ - public function embossImage ($radius, $sigma) {} - - /** - * (PECL imagick 2.0.0)- * The evaluation operator - *
- * @param float $constant- * The value of the operator - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function evaluateImage ($op, $constant, $channel = Imagick::CHANNEL_ALL) {} - - /** - * Merges a sequence of images. This is useful for combining Photoshop layers into a single image. - * This is replaced by: - *- * $im = $im->mergeImageLayers(\Imagick::LAYERMETHOD_FLATTEN) - *- * @link https://php.net/manual/en/imagick.flattenimages.php - * @return Imagick Returns an Imagick object containing the merged image. - * @throws ImagickException Throws ImagickException on error. - * @since 2.0.0 - */ - public function flattenImages () {} - - /** - * (PECL imagick 2.0.0)
- * ImagickPixel object or a string representing the matte color - *
- * @param int $width- * The width of the border - *
- * @param int $height- * The height of the border - *
- * @param int $inner_bevel- * The inner bevel width - *
- * @param int $outer_bevel- * The outer bevel width - *
- * @return bool TRUE on success. - */ - public function frameImage ($matte_color, $width, $height, $inner_bevel, $outer_bevel) {} - - /** - * (PECL imagick 2.0.0)- * The expression. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return Imagick TRUE on success. - */ - public function fxImage ($expression, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The amount of gamma-correction. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function gammaImage ($gamma, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the Gaussian, in pixels, not counting the center pixel. - *
- * @param float $sigma- * The standard deviation of the Gaussian, in pixels. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function gaussianBlurImage ($radius, $sigma, $channel = Imagick::CHANNEL_ALL) {} - - /** - * @param $key - */ - public function getImageAttribute ($key) {} - - /** - * (PECL imagick 2.0.0)- * Provide any channel constant that is valid for your channel mode. To apply to more than one channel, combine channel constants using bitwise operators. Defaults to Imagick::CHANNEL_DEFAULT. Refer to this list of channel constants - *
- * @return int TRUE on success. - */ - public function getImageChannelDepth ($channel) {} - - /** - * (PECL imagick 2.0.0)- * Imagick object to compare to. - *
- * @param int $channel- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @param int $metric- * One of the metric type constants. - *
- * @return float TRUE on success. - */ - public function getImageChannelDistortion (Imagick $reference, $channel, $metric) {} - - /** - * (PECL imagick 2.0.0)- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return array TRUE on success. - */ - public function getImageChannelExtrema ($channel) {} - - /** - * (PECL imagick 2.0.0)- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return array TRUE on success. - */ - public function getImageChannelMean ($channel) {} - - /** - * (PECL imagick 2.0.0)- * The offset into the image colormap. - *
- * @return ImagickPixel TRUE on success. - */ - public function getImageColormapColor ($index) {} - - /** - * (PECL imagick 2.0.0)- * Imagick object to compare to. - *
- * @param int $metric- * One of the metric type constants. - *
- * @return float the distortion metric used on the image (or the best guess - * thereof). - */ - public function getImageDistortion (Imagick $reference, $metric) {} - - /** - * (PECL imagick 2.0.0)- * The x-coordinate of the pixel - *
- * @param int $y- * The y-coordinate of the pixel - *
- * @return ImagickPixel an ImagickPixel instance for the color at the coordinates given. - */ - public function getImagePixelColor ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * The name of the profile to return. - *
- * @return string a string containing the image profile. - */ - public function getImageProfile ($name) {} - - /** - * (PECL imagick 2.0.0)- * The width of the extracted region. - *
- * @param int $height- * The height of the extracted region. - *
- * @param int $x- * X-coordinate of the top-left corner of the extracted region. - *
- * @param int $y- * Y-coordinate of the top-left corner of the extracted region. - *
- * @return Imagick Extracts a region of the image and returns it as a new wand. - */ - public function getImageRegion ($width, $height, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the implode - *
- * @return bool TRUE on success. - */ - public function implodeImage ($radius) {} - - /** - * (PECL imagick 2.0.0)- * The image black point - *
- * @param float $gamma- * The gamma value - *
- * @param float $whitePoint- * The image white point - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function levelImage ($blackPoint, $gamma, $whitePoint, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * The level of transparency: 1.0 is fully opaque and 0.0 is fully - * transparent. - *
- * @param float $fuzz- * The fuzz member of image defines how much tolerance is acceptable to - * consider two colors as the same. - *
- * @param mixed $bordercolor- * An ImagickPixel object or string representing the border color. - *
- * @param int $x- * The starting x coordinate of the operation. - *
- * @param int $y- * The starting y coordinate of the operation. - *
- * @return bool TRUE on success. - */ - public function matteFloodfillImage ($alpha, $fuzz, $bordercolor, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * The radius of the pixel neighborhood. - *
- * @return bool TRUE on success. - */ - public function medianFilterImage ($radius) {} - - /** - * (PECL imagick 2.0.0)- * Whether to only negate grayscale pixels within the image. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function negateImage ($gray, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * Change this target color to the fill color within the image. An - * ImagickPixel object or a string representing the target color. - *
- * @param mixed $fill- * An ImagickPixel object or a string representing the fill color. - *
- * @param float $fuzz- * The fuzz member of image defines how much tolerance is acceptable to - * consider two colors as the same. - *
- * @param int $channel [optional]- * Provide any channel constant that is valid for your channel mode. To - * apply to more than one channel, combine channeltype constants using - * bitwise operators. Refer to this - * list of channel constants. - *
- * @return bool TRUE on success. - */ - public function paintOpaqueImage ($target, $fill, $fuzz, $channel = Imagick::CHANNEL_ALL) {} - - /** - * (PECL imagick 2.0.0)- * Change this target color to specified opacity value within the image. - *
- * @param float $alpha- * The level of transparency: 1.0 is fully opaque and 0.0 is fully - * transparent. - *
- * @param float $fuzz- * The fuzz member of image defines how much tolerance is acceptable to - * consider two colors as the same. - *
- * @return bool TRUE on success. - */ - public function paintTransparentImage ($target, $alpha, $fuzz) {} - - /** - * (PECL imagick 2.0.0)- * Preview type. See Preview type constants - *
- * @return bool TRUE on success. - */ - public function previewImages ($preview) {} - - /** - * (PECL imagick 2.0.0)- * The border color - *
- * @return bool TRUE on success. - */ - public function setImageBorderColor ($border) {} - - /** - * (PECL imagick 2.0.0)- * One of the COLORSPACE constants - *
- * @return bool TRUE on success. - */ - public function setImageColorspace ($colorspace) {} - - /** - * (PECL imagick 2.0.0)- * The source Imagick object - *
- * @return bool TRUE on success. - */ - public function addImage (Imagick $source) {} - - /** - * (PECL imagick 2.0.0)- * The replace Imagick object - *
- * @return bool TRUE on success. - */ - public function setImage (Imagick $replace) {} - - /** - * (PECL imagick 2.0.0)- * Columns in the new image - *
- * @param int $rows- * Rows in the new image - *
- * @param mixed $background- * The background color used for this image - *
- * @param string $format [optional]- * Image format. This parameter was added in Imagick version 2.0.1. - *
- * @return bool TRUE on success. - */ - public function newImage ($cols, $rows, $background, $format = null) {} - - /** - * (PECL imagick 2.0.0)- * columns in the new image - *
- * @param int $rows- * rows in the new image - *
- * @param string $pseudoString- * string containing pseudo image definition. - *
- * @return bool TRUE on success. - */ - public function newPseudoImage ($columns, $rows, $pseudoString) {} - - /** - * (PECL imagick 2.0.0)- * The name of the option - *
- * @return string a value associated with a wand and the specified key. - */ - public function getOption ($key) {} - - /** - * (PECL imagick 2.0.0)- * Refer to the list of resourcetype constants. - *
- * @return int the specified resource's memory usage in megabytes. - */ - public static function getResource ($type) {} - - /** - * (PECL imagick 2.0.0)- * Refer to the list of resourcetype constants. - *
- * @return int the specified resource limit in megabytes. - */ - public static function getResourceLimit ($type) {} - - /** - * (PECL imagick 2.0.0)- * Refer to the list of resourcetype constants. - *
- * @param int $limit- * The resource limit. The unit depends on the type of the resource being limited. - *
- * @return bool TRUE on success. - */ - public static function setResourceLimit ($type, $limit) {} - - /** - * (PECL imagick 2.0.0)- * The horizontal resolution. - *
- * @param float $y_resolution- * The vertical resolution. - *
- * @return bool TRUE on success. - */ - public function setResolution ($x_resolution, $y_resolution) {} - - /** - * (PECL imagick 2.0.0)bool callback ( mixed $offset , mixed $span )- * Caution - * The values passed to the callback function are not consistent. In particular the span parameter can increase during image processing. Because of this calculating the percentage complete of an image operation is not trivial. - * @return void - * @since 3.3.0 - */ - public function setProgressMonitor ($callback) { } - - /** - * Sets the ImageMagick registry entry named key to value. This is most useful for setting "temporary-path" which controls where ImageMagick creates temporary images e.g. while processing PDFs. - * @link https://php.net/manual/en/imagick.setregistry.php - * @param string $key - * @param string $value - * @return void - * @since 3.3.0 - */ - public static function setRegistry ($key, $value) { } - - /** - * Replace each pixel with corresponding statistic from the neighborhood of the specified width and height. - * @link https://php.net/manual/en/imagick.statisticimage.php - * @param int $type - * @param int $width - * @param int $height - * @param int $channel [optional] - * @return void - * @since 3.3.0 - */ - public function statisticImage ($type, $width, $height, $channel = Imagick::CHANNEL_DEFAULT ) { } - - /** - * Searches for a subimage in the current image and returns a similarity image such that an exact match location is - * completely white and if none of the pixels match, black, otherwise some gray level in-between. - * You can also pass in the optional parameters bestMatch and similarity. After calling the function similarity will - * be set to the 'score' of the similarity between the subimage and the matching position in the larger image, - * bestMatch will contain an associative array with elements x, y, width, height that describe the matching region. - * - * @link https://php.net/manual/en/imagick.subimagematch.php - * @param Imagick $imagick - * @param array $bestMatch [optional] - * @param float $similarity [optional] A new image that displays the amount of similarity at each pixel. - * @param float $similarity_threshold [optional] Only used if compiled with ImageMagick (library) > 7 - * @param int $metric [optional] Only used if compiled with ImageMagick (library) > 7 - * @return Imagick - * @since 3.3.0 - */ - public function subImageMatch (Imagick $imagick, array &$bestMatch, &$similarity, $similarity_threshold, $metric) { } - - /** - * Is an alias of Imagick::subImageMatch - * - * @param Imagick $imagick - * @param array $bestMatch [optional] - * @param float $similarity [optional] A new image that displays the amount of similarity at each pixel. - * @param float $similarity_threshold [optional] - * @param int $metric [optional] - * @return Imagick - * @see Imagick::subImageMatch() This function is an alias of subImageMatch() - * @since 3.4.0 - */ - public function similarityImage (Imagick $imagick, array &$bestMatch, &$similarity, $similarity_threshold, $metric) { } - - /** - * Returns any ImageMagick configure options that match the specified pattern (e.g. "*" for all). Options include NAME, VERSION, LIB_VERSION, etc. - * @return string - * @since 3.4.0 - */ - public function getConfigureOptions () { } - - /** - * GetFeatures() returns the ImageMagick features that have been compiled into the runtime. - * @return string - * @since 3.4.0 - */ - public function getFeatures () { } - - /** - * @return int - * @since 3.4.0 - */ - public function getHDRIEnabled () { } - - /** - * Sets the image channel mask. Returns the previous set channel mask. - * Only works with Imagick >=7 - * @param int $channel - * @since 3.4.0 - */ - public function setImageChannelMask ($channel) {} - - /** - * Merge multiple images of the same size together with the selected operator. https://www.imagemagick.org/Usage/layers/#evaluate-sequence - * @param int $EVALUATE_CONSTANT - * @return bool - * @see https://www.imagemagick.org/Usage/layers/#evaluate-sequence - * @since 3.4.0 - */ - public function evaluateImages ($EVALUATE_CONSTANT) { } - - /** - * Extracts the 'mean' from the image and adjust the image to try make set its gamma appropriately. - * @param int $channel [optional] Default value Imagick::CHANNEL_ALL - * @return bool - * @since 3.4.1 - */ - public function autoGammaImage ($channel = Imagick::CHANNEL_ALL) { } - - /** - * Adjusts an image so that its orientation is suitable $ for viewing (i.e. top-left orientation). - * @return bool - * @since 3.4.1 - */ - public function autoOrient () { } - - /** - * Composite one image onto another using the specified gravity. - * - * @param Imagick $imagick - * @param int $COMPOSITE_CONSTANT - * @param int $GRAVITY_CONSTANT - * @return bool - * @since 3.4.1 - */ - public function compositeImageGravity(Imagick $imagick, $COMPOSITE_CONSTANT, $GRAVITY_CONSTANT) { } - - /** - * Attempts to increase the appearance of large-scale light-dark transitions. - * - * @param float $radius - * @param float $strength - * @return bool - * @since 3.4.1 - */ - public function localContrastImage($radius, $strength) { } - - /** - * Identifies the potential image type, returns one of the Imagick::IMGTYPE_* constants - * @return int - * @since 3.4.3 - */ - public function identifyImageType() { } - - /** - * Sets the image to the specified alpha level. Will replace ImagickDraw::setOpacity() - * - * @param float $alpha - * @return bool - * @since 3.4.3 - */ - public function setImageAlpha($alpha) { } -} + public function transposeImage(): bool {} + + public function transverseImage(): bool {} + + public function trimImage(float $fuzz): bool {} + + public function waveImage(float $amplitude, float $length): bool {} + + public function vignetteImage(float $black_point, float $white_point, int $x, int $y): bool {} + + public function uniqueImageColors(): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 +// PHP_ME(imagick, getimagematte, imagick_zero_args, ZEND_ACC_PUBLIC | ZEND_ACC_DEPRECATED) + /** @deprecated */ + public function getImageMatte(): bool {} +#endif +#endif + + // TODO - enabled? + public function setImageMatte(bool $matte): bool {} + + public function adaptiveResizeImage( + int $columns, + int $rows, + bool $bestfit = false, + bool $legacy = false): bool {} -/** - * @method ImagickDraw clone() (PECL imagick 2.0.0)
- * ImagickPixel to use to set the color - *
- * @return bool No value is returned. - */ - public function setFillColor (ImagickPixel $fill_pixel) {} - - /** - * (PECL imagick 2.0.0)- * fill alpha - *
- * @return bool No value is returned. - */ - public function setFillAlpha ($opacity) {} - - /** - * @param $x_resolution - * @param $y_resolution - */ - public function setResolution ($x_resolution, $y_resolution) {} - - /** - * (PECL imagick 2.0.0)- * the stroke color - *
- * @return bool No value is returned. - */ - public function setStrokeColor (ImagickPixel $stroke_pixel) {} - - /** - * (PECL imagick 2.0.0)- * opacity - *
- * @return bool No value is returned. - */ - public function setStrokeAlpha ($opacity) {} - - /** - * (PECL imagick 2.0.0)- * stroke width - *
- * @return bool No value is returned. - */ - public function setStrokeWidth ($stroke_width) {} - - /** - * (PECL imagick 2.0.0)- * origin x coordinate - *
- * @param float $oy- * origin y coordinate - *
- * @param float $px- * perimeter x coordinate - *
- * @param float $py- * perimeter y coordinate - *
- * @return bool No value is returned. - */ - public function circle ($ox, $oy, $px, $py) {} - - /** - * (PECL imagick 2.0.0)- * The x coordinate where text is drawn - *
- * @param float $y- * The y coordinate where text is drawn - *
- * @param string $text- * The text to draw on the image - *
- * @return bool No value is returned. - */ - public function annotation ($x, $y, $text) {} - - /** - * (PECL imagick 2.0.0)- * the encoding name - *
- * @return bool No value is returned. - */ - public function setTextEncoding ($encoding) {} - - /** - * (PECL imagick 2.0.0)- * the font family - *
- * @return bool TRUE on success. - */ - public function setFontFamily ($font_family) {} - - /** - * (PECL imagick 2.0.0)- * the point size - *
- * @return bool No value is returned. - */ - public function setFontSize ($pointsize) {} - - /** - * (PECL imagick 2.0.0)- * STYLETYPE_ constant - *
- * @return bool No value is returned. - */ - public function setFontStyle ($style) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the top left corner - *
- * @param float $y1- * y coordinate of the top left corner - *
- * @param float $x2- * x coordinate of the bottom right corner - *
- * @param float $y2- * y coordinate of the bottom right corner - *
- * @return bool No value is returned. - */ - public function rectangle ($x1, $y1, $x2, $y2) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the top left corner - *
- * @param float $y1- * y coordinate of the top left corner - *
- * @param float $x2- * x coordinate of the bottom right - *
- * @param float $y2- * y coordinate of the bottom right - *
- * @param float $rx- * x rounding - *
- * @param float $ry- * y rounding - *
- * @return bool No value is returned. - */ - public function roundRectangle ($x1, $y1, $x2, $y2, $rx, $ry) {} - - /** - * (PECL imagick 2.0.0)- * degrees to skew - *
- * @return bool No value is returned. - */ - public function skewX ($degrees) {} - - /** - * (PECL imagick 2.0.0)- * degrees to skew - *
- * @return bool No value is returned. - */ - public function skewY ($degrees) {} - - /** - * (PECL imagick 2.0.0)- * horizontal translation - *
- * @param float $y- * vertical translation - *
- * @return bool No value is returned. - */ - public function translate ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * starting x coordinate - *
- * @param float $sy- * starting y coordinate - *
- * @param float $ex- * ending x coordinate - *
- * @param float $ey- * ending y coordinate - *
- * @return bool No value is returned. - */ - public function line ($sx, $sy, $ex, $ey) {} - - /** - * (PECL imagick 2.0.0)- * Starting x ordinate of bounding rectangle - *
- * @param float $sy- * starting y ordinate of bounding rectangle - *
- * @param float $ex- * ending x ordinate of bounding rectangle - *
- * @param float $ey- * ending y ordinate of bounding rectangle - *
- * @param float $sd- * starting degrees of rotation - *
- * @param float $ed- * ending degrees of rotation - *
- * @return bool No value is returned. - */ - public function arc ($sx, $sy, $ex, $ey, $sd, $ed) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the matte - *
- * @param float $y- * y coordinate of the matte - *
- * @param int $paintMethod- * PAINT_ constant - *
- * @return bool TRUE on success or FALSE on failure. - */ - public function matte ($x, $y, $paintMethod) {} - - /** - * (PECL imagick 2.0.0)- * multidimensional array like array( array( 'x' => 3, 'y' => 4 ), array( 'x' => 2, 'y' => 6 ) ); - *
- * @return bool TRUE on success. - */ - public function polygon (array $coordinates) {} - - /** - * (PECL imagick 2.0.0)- * point's x coordinate - *
- * @param float $y- * point's y coordinate - *
- * @return bool No value is returned. - */ - public function point ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * STRETCH_ constant - *
- * @return bool No value is returned. - */ - public function setFontStretch ($fontStretch) {} - - /** - * (PECL imagick 2.0.0)- * the antialias setting - *
- * @return bool No value is returned. - */ - public function setStrokeAntialias ($stroke_antialias) {} - - /** - * (PECL imagick 2.0.0)- * ALIGN_ constant - *
- * @return bool No value is returned. - */ - public function setTextAlignment ($alignment) {} - - /** - * (PECL imagick 2.0.0)- * DECORATION_ constant - *
- * @return bool No value is returned. - */ - public function setTextDecoration ($decoration) {} - - /** - * (PECL imagick 2.0.0)- * the under color - *
- * @return bool No value is returned. - */ - public function setTextUnderColor (ImagickPixel $under_color) {} - - /** - * (PECL imagick 2.0.0)- * left x coordinate - *
- * @param int $y1- * left y coordinate - *
- * @param int $x2- * right x coordinate - *
- * @param int $y2- * right y coordinate - *
- * @return bool No value is returned. - */ - public function setViewbox ($x1, $y1, $x2, $y2) {} - - /** - * (PECL imagick 2.0.0)- * Affine matrix parameters - *
- * @return bool No value is returned. - */ - public function affine (array $affine) {} - - /** - * (PECL imagick 2.0.0)- * Multidimensional array like array( array( 'x' => 1, 'y' => 2 ), - * array( 'x' => 3, 'y' => 4 ) ) - *
- * @return bool No value is returned. - */ - public function bezier (array $coordinates) {} - - /** - * (PECL imagick 2.0.0)- * composition operator. One of COMPOSITE_ constants - *
- * @param float $x- * x coordinate of the top left corner - *
- * @param float $y- * y coordinate of the top left corner - *
- * @param float $width- * width of the composition image - *
- * @param float $height- * height of the composition image - *
- * @param Imagick $compositeWand- * the Imagick object where composition image is taken from - *
- * @return bool TRUE on success. - */ - public function composite ($compose, $x, $y, $width, $height, Imagick $compositeWand) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the paint - *
- * @param float $y- * y coordinate of the paint - *
- * @param int $paintMethod- * one of the PAINT_ constants - *
- * @return bool No value is returned. - */ - public function color ($x, $y, $paintMethod) {} - - /** - * (PECL imagick 2.0.0)- * The comment string to add to vector output stream - *
- * @return bool No value is returned. - */ - public function comment ($comment) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the first control point - *
- * @param float $y1- * y coordinate of the first control point - *
- * @param float $x2- * x coordinate of the second control point - *
- * @param float $y2- * y coordinate of the first control point - *
- * @param float $x- * x coordinate of the curve end - *
- * @param float $y- * y coordinate of the curve end - *
- * @return bool No value is returned. - */ - public function pathCurveToAbsolute ($x1, $y1, $x2, $y2, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of starting control point - *
- * @param float $y1- * y coordinate of starting control point - *
- * @param float $x2- * x coordinate of ending control point - *
- * @param float $y2- * y coordinate of ending control point - *
- * @param float $x- * ending x coordinate - *
- * @param float $y- * ending y coordinate - *
- * @return bool No value is returned. - */ - public function pathCurveToRelative ($x1, $y1, $x2, $y2, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the control point - *
- * @param float $y1- * y coordinate of the control point - *
- * @param float $x- * x coordinate of the end point - *
- * @param float $y- * y coordinate of the end point - *
- * @return bool No value is returned. - */ - public function pathCurveToQuadraticBezierAbsolute ($x1, $y1, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * starting x coordinate - *
- * @param float $y1- * starting y coordinate - *
- * @param float $x- * ending x coordinate - *
- * @param float $y- * ending y coordinate - *
- * @return bool No value is returned. - */ - public function pathCurveToQuadraticBezierRelative ($x1, $y1, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * ending x coordinate - *
- * @param float $y- * ending y coordinate - *
- * @return bool No value is returned. - */ - public function pathCurveToQuadraticBezierSmoothAbsolute ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * ending x coordinate - *
- * @param float $y- * ending y coordinate - *
- * @return bool No value is returned. - */ - public function pathCurveToQuadraticBezierSmoothRelative ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the second control point - *
- * @param float $y2- * y coordinate of the second control point - *
- * @param float $x- * x coordinate of the ending point - *
- * @param float $y- * y coordinate of the ending point - *
- * @return bool No value is returned. - */ - public function pathCurveToSmoothAbsolute ($x2, $y2, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the second control point - *
- * @param float $y2- * y coordinate of the second control point - *
- * @param float $x- * x coordinate of the ending point - *
- * @param float $y- * y coordinate of the ending point - *
- * @return bool No value is returned. - */ - public function pathCurveToSmoothRelative ($x2, $y2, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x radius - *
- * @param float $ry- * y radius - *
- * @param float $x_axis_rotation- * x axis rotation - *
- * @param bool $large_arc_flag- * large arc flag - *
- * @param bool $sweep_flag- * sweep flag - *
- * @param float $x- * x coordinate - *
- * @param float $y- * y coordinate - *
- * @return bool No value is returned. - */ - public function pathEllipticArcAbsolute ($rx, $ry, $x_axis_rotation, $large_arc_flag, $sweep_flag, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x radius - *
- * @param float $ry- * y radius - *
- * @param float $x_axis_rotation- * x axis rotation - *
- * @param bool $large_arc_flag- * large arc flag - *
- * @param bool $sweep_flag- * sweep flag - *
- * @param float $x- * x coordinate - *
- * @param float $y- * y coordinate - *
- * @return bool No value is returned. - */ - public function pathEllipticArcRelative ($rx, $ry, $x_axis_rotation, $large_arc_flag, $sweep_flag, $x, $y) {} - - /** - * (PECL imagick 2.0.0)- * starting x coordinate - *
- * @param float $y- * ending x coordinate - *
- * @return bool No value is returned. - */ - public function pathLineToAbsolute ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * starting x coordinate - *
- * @param float $y- * starting y coordinate - *
- * @return bool No value is returned. - */ - public function pathLineToRelative ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate - *
- * @return bool No value is returned. - */ - public function pathLineToHorizontalAbsolute ($x) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate - *
- * @return bool No value is returned. - */ - public function pathLineToHorizontalRelative ($x) {} - - /** - * (PECL imagick 2.0.0)- * y coordinate - *
- * @return bool No value is returned. - */ - public function pathLineToVerticalAbsolute ($y) {} - - /** - * (PECL imagick 2.0.0)- * y coordinate - *
- * @return bool No value is returned. - */ - public function pathLineToVerticalRelative ($y) {} - - /** - * (PECL imagick 2.0.0)- * x coordinate of the starting point - *
- * @param float $y- * y coordinate of the starting point - *
- * @return bool No value is returned. - */ - public function pathMoveToAbsolute ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * target x coordinate - *
- * @param float $y- * target y coordinate - *
- * @return bool No value is returned. - */ - public function pathMoveToRelative ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * array of x and y coordinates: array( array( 'x' => 4, 'y' => 6 ), array( 'x' => 8, 'y' => 10 ) ) - *
- * @return bool TRUE on success. - */ - public function polyline (array $coordinates) {} - - /** - * (PECL imagick 2.0.0)- * Clip mask Id - *
- * @return bool No value is returned. - */ - public function pushClipPath ($clip_mask_id) {} - - /** - * (PECL imagick 2.0.0)- * the pattern Id - *
- * @param float $x- * x coordinate of the top-left corner - *
- * @param float $y- * y coordinate of the top-left corner - *
- * @param float $width- * width of the pattern - *
- * @param float $height- * height of the pattern - *
- * @return bool TRUE on success or FALSE on failure. - */ - public function pushPattern ($pattern_id, $x, $y, $width, $height) {} - - /** - * (PECL imagick 2.0.0)- * degrees to rotate - *
- * @return bool No value is returned. - */ - public function rotate ($degrees) {} - - /** - * (PECL imagick 2.0.0)- * horizontal factor - *
- * @param float $y- * vertical factor - *
- * @return bool No value is returned. - */ - public function scale ($x, $y) {} - - /** - * (PECL imagick 2.0.0)- * the clipping path name - *
- * @return bool No value is returned. - */ - public function setClipPath ($clip_mask) {} - - /** - * (PECL imagick 2.0.0)- * FILLRULE_ constant - *
- * @return bool No value is returned. - */ - public function setClipRule ($fill_rule) {} - - /** - * (PECL imagick 2.0.0)- * the number of clip units - *
- * @return bool No value is returned. - */ - public function setClipUnits ($clip_units) {} - - /** - * (PECL imagick 2.0.0)- * the fill opacity - *
- * @return bool No value is returned. - */ - public function setFillOpacity ($fillOpacity) {} - - /** - * (PECL imagick 2.0.0)- * URL to use to obtain fill pattern. - *
- * @return bool TRUE on success or FALSE on failure. - */ - public function setFillPatternURL ($fill_url) {} - - /** - * (PECL imagick 2.0.0)- * FILLRULE_ constant - *
- * @return bool No value is returned. - */ - public function setFillRule ($fill_rule) {} - - /** - * (PECL imagick 2.0.0)- * GRAVITY_ constant - *
- * @return bool No value is returned. - */ - public function setGravity ($gravity) {} - - /** - * (PECL imagick 2.0.0)- * stroke URL - *
- * @return bool imagick.imagickdraw.return.success; - */ - public function setStrokePatternURL ($stroke_url) {} - - /** - * (PECL imagick 2.0.0)- * dash offset - *
- * @return bool No value is returned. - */ - public function setStrokeDashOffset ($dash_offset) {} - - /** - * (PECL imagick 2.0.0)- * LINECAP_ constant - *
- * @return bool No value is returned. - */ - public function setStrokeLineCap ($linecap) {} - - /** - * (PECL imagick 2.0.0)- * LINEJOIN_ constant - *
- * @return bool No value is returned. - */ - public function setStrokeLineJoin ($linejoin) {} - - /** - * (PECL imagick 2.0.0)- * the miter limit - *
- * @return bool No value is returned. - */ - public function setStrokeMiterLimit ($miterlimit) {} - - /** - * (PECL imagick 2.0.0)- * stroke opacity. 1.0 is fully opaque - *
- * @return bool No value is returned. - */ - public function setStrokeOpacity ($stroke_opacity) {} - - /** - * (PECL imagick 2.0.0)- * xml containing the vector graphics - *
- * @return bool TRUE on success or FALSE on failure. - */ - public function setVectorGraphics ($xml) {} - - /** - * (PECL imagick 2.0.0)- * array of floats - *
- * @return bool TRUE on success. - */ - public function setStrokeDashArray (array $dashArray) {} + public function sketchImage(float $radius, float $sigma, float $angle): bool {} + public function shadeImage(bool $gray, float $azimuth, float $elevation): bool {} + + public function getSizeOffset(): int {} + + public function setSizeOffset(int $columns, int $rows, int $offset): bool {} + + + public function adaptiveBlurImage( + float $radius, + float $sigma, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function contrastStretchImage( + float $black_point, + float $white_point, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function adaptiveSharpenImage( + float $radius, + float $sigma, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + + public function randomThresholdImage( + float $low, + float $high, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function roundCornersImage( + float $x_rounding, + float $y_rounding, + float $stroke_width = 10, + float $displace = 5, + float $size_correction = -6): bool {} + + /* This alias is due to BWC */ /** - * Sets the opacity to use when drawing using the fill or stroke color or texture. Fully opaque is 1.0. + * @deprecated + * @alias Imagick::roundCornersImage + */ + public function roundCorners( + float $x_rounding, + float $y_rounding, + float $stroke_width = 10, + float $displace = 5, + float $size_correction = -6): bool {} + +#endif + + public function setIteratorIndex(int $index): bool {} + + public function getIteratorIndex(): int {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function transformImage(string $crop, string $geometry): Imagick {} +#endif +#endif + +#if MagickLibVersion > 0x630 +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageOpacity(float $opacity): bool {} +#endif + +#if MagickLibVersion >= 0x700 + public function setImageAlpha(float $alpha): bool {} +#endif + +#if MagickLibVersion < 0x700 + + /** @deprecated */ + public function orderedPosterizeImage( + string $threshold_map, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif +#endif + +#if MagickLibVersion > 0x631 + // TODO - ImagickDraw .... + public function polaroidImage(ImagickDraw $settings, float $angle): bool {} + + public function getImageProperty(string $name): string {} + + public function setImageProperty(string $name, string $value): bool {} + + public function deleteImageProperty(string $name): bool {} + + // Replaces any embedded formatting characters with the appropriate + // image property and returns the interpreted text. + // See http://www.imagemagick.org/script/escape.php for escape sequences. + // -format "%m:%f %wx%h" + public function identifyFormat(string $format): string {} + + +#if IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD + // INTERPOLATE_* + public function setImageInterpolateMethod(int $method): bool {} +#endif + + // why does this not need to be inside the 'if' for IM_HAVE_IMAGICK_SETIMAGEINTERPOLATEMETHOD ..? + public function getImageInterpolateMethod(): int {} + + public function linearStretchImage(float $black_point, float $white_point): bool {} + + public function getImageLength(): int {} + + public function extentImage(int $width, int $height, int $x, int $y): bool {} +#endif +#if MagickLibVersion > 0x633 + public function getImageOrientation(): int {} + + public function setImageOrientation(int $orientation): bool {} +#endif + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion > 0x634 +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function paintFloodfillImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif +#endif +#endif + +#if MagickLibVersion > 0x635 + + // TODO - Imagick + public function clutImage(Imagick $lookup_table, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function getImageProperties(string $pattern = "*", bool $include_values = true): array {} + + public function getImageProfiles(string $pattern = "*", bool $include_values = true): array {} + + // DISTORTION_* + public function distortImage(int $distortion, array $arguments, bool $bestfit): bool {} + + public function writeImageFile(resource $filehandle, ?string $format = null): bool {} + + public function writeImagesFile(resource $filehandle, ?string $format = null): bool {} + + public function resetImagePage(string $page): bool {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageClipMask(imagick $clip_mask): bool {} + + /** @deprecated */ + public function getImageClipMask(): Imagick {} +#endif + + // TODO - x server? + public function animateImages(string $x_server): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function recolorImage(array $matrix): bool {} +#endif +#endif +#endif + +#if MagickLibVersion > 0x636 + public function setFont(string $font): bool {} + + public function getFont(): string {} + + public function setPointSize(float $point_size): bool {} + + public function getPointSize(): float {} + + // LAYERMETHOD_* + public function mergeImageLayers(int $layermethod): Imagick {} +#endif + +#if MagickLibVersion > 0x637 + // ALPHACHANNEL_* + public function setImageAlphaChannel(int $alphachannel): bool {} + + // TODO - ImagickPixel ugh +// TODO - ugh MagickBooleanType MagickFloodfillPaintImage(MagickWand *wand, +// const PixelWand *fill,const double fuzz,const PixelWand *bordercolor, +// const ssize_t x,const ssize_t y,const MagickBooleanType invert) + + public function floodfillPaintImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y, + bool $invert, + ?int $channel = Imagick::CHANNEL_DEFAULT + ): bool{} + + + + public function opaquePaintImage( + ImagickPixel|string $target_color, + ImagickPixel|string $fill_color, + float $fuzz, + bool $invert, + int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function transparentPaintImage( + ImagickPixel|string $target_color, + float $alpha, + float $fuzz, + bool $invert + ): bool {} +#endif +#if MagickLibVersion > 0x638 + public function liquidRescaleImage(int $width, int $height, float $delta_x, float $rigidity): bool {} + + public function encipherImage(string $passphrase): bool {} + +// PHP_ME(imagick, decipherimage, imagick_decipherimage_args, ZEND_ACC_PUBLIC) + public function decipherImage(string $passphrase): bool {} +#endif + +#if MagickLibVersion > 0x639 + + // GRAVITY_* + public function setGravity(int $gravity): bool {} + + public function getGravity(): int {} + + // CHANNEL_ + public function getImageChannelRange(int $channel): array {} + + public function getImageAlphaChannel(): int {} +#endif + +#if MagickLibVersion > 0x642 + public function getImageChannelDistortions( + Imagick $reference_image, + int $metric, + int $channel = Imagick::CHANNEL_DEFAULT + ): float {} +#endif + +#if MagickLibVersion > 0x643 + // GRAVITY_ + public function setImageGravity(int $gravity): bool {} + + public function getImageGravity(): int {} +#endif + +#if MagickLibVersion > 0x645 + /** + * @param int $x + * @param int $y + * @param int $width + * @param int $height + * @param string $map + * @param int $pixelstorage // PIXELSTORAGE + * @param array $pixels + * @return bool + */ + public function importImagePixels( + int $x, + int $y, + int $width, + int $height, + string $map, + int $pixelstorage, + array $pixels): bool {} + + public function deskewImage(float $threshold): bool {} + + /** + * @param int $colorspace // COLORSPACE + * @param float $cluster_threshold + * @param float $smooth_threshold + * @param bool $verbose + * @return bool + */ + public function segmentImage( + int $colorspace, + float $cluster_threshold, + float $smooth_threshold, + bool $verbose = false + ): bool {} + + // SPARSECOLORMETHOD_* + public function sparseColorImage( + int $sparsecolormethod, + array $arguments, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function remapImage(Imagick $replacement, int $dither_method): bool {} +#endif + + +#if PHP_IMAGICK_HAVE_HOUGHLINE + public function houghLineImage(int $width, int $height, float $threshold): bool {} +#endif + +#if MagickLibVersion > 0x646 + /** + * @param int $x + * @param int $y + * @param int $width + * @param int $height + * @param string $map e.g. "RGB" + * @param int $pixelstorage // PIXELSTORAGE + * @return array + */ + public function exportImagePixels( + int $x, + int $y, + int $width, + int $height, + string $map, + int $pixelstorage + ): array {} +#endif + +#if MagickLibVersion > 0x648 + public function getImageChannelKurtosis(int $channel = Imagick::CHANNEL_DEFAULT): array {} + + public function functionImage( + int $function, + array $parameters, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion > 0x651 + // COLORSPACE_* + public function transformImageColorspace(int $colorspace): bool {} +#endif + +#if MagickLibVersion > 0x652 + public function haldClutImage(Imagick $clut, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + +#if MagickLibVersion > 0x655 + public function autoLevelImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function blueShiftImage(float $factor = 1.5): bool {} +#endif + +#if MagickLibVersion > 0x656 + /** + * @param string $artifact example 'compose:args' + * @return string + */ + public function getImageArtifact(string $artifact): string {} + + /** + * @param string $artifact example 'compose:args' + * @param string $value example "1,0,-0.5,0.5" + * @return bool + */ + public function setImageArtifact(string $artifact, string $value): bool {} + + public function deleteImageArtifact(string $artifact): bool {} + + // Will return CHANNEL_* + public function getColorspace(): int {} + +// PHP_ME(imagick, setcolorspace, imagick_setcolorspace_args, ZEND_ACC_PUBLIC) + public function setColorspace(int $colorspace): bool {} + + // CHANNEL_* + public function clampImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + +#if MagickLibVersion > 0x667 + // stack By default, images are stacked left-to-right. Set stack to MagickTrue to stack them top-to-bottom. + //offset minimum distance in pixels between images. + public function smushImages(bool $stack, int $offset): Imagick {} +#endif + +// PHP_ME(imagick, __construct, imagick_construct_args, ZEND_ACC_PUBLIC|ZEND_ACC_CTOR) + // TODO int|float? :spocks_eyebrow.gif: + public function __construct(string|array|int|float|null $files = null) {} + + public function __toString(): string {} + +#if PHP_VERSION_ID >= 50600 + // This calls MagickGetNumberImages underneath + // mode is unused. Remove at next major release + // https://github.com/Imagick/imagick/commit/13302500c0ab0ce58e6502e68871187180f7987c + public function count(int $mode = 0): int {} +#else + public function count(): int {} +#endif + + public function getPixelIterator(): ImagickPixelIterator {} + + public function getPixelRegionIterator(int $x, int $y, int $columns, int $rows): ImagickPixelIterator {} + + public function readImage(string $filename): bool {} + + public function readImages(array $filenames): bool {} + + public function readImageBlob(string $image, ?string $filename = null): bool {} + + public function setImageFormat(string $format): bool {} + + public function scaleImage(int $columns, int $rows, bool $bestfit = false, bool $legacy = false): bool {} + + public function writeImage(?string $filename = null): bool {} + + public function writeImages(string $filename, bool $adjoin): bool {} + + // CHANNEL_ + public function blurImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function thumbnailImage( + ?int $columns, + ?int $rows, + bool $bestfit = false, + bool $fill = false, + bool $legacy = false): bool {} + + public function cropThumbnailImage(int $width, int $height, bool $legacy = false): bool {} + + public function getImageFilename(): string {} + + public function setImageFilename(string $filename): bool {} + + public function getImageFormat(): string {} + + public function getImageMimeType(): string {} + + public function removeImage(): bool {} + + /** @alias Imagick::clear */ + public function destroy(): bool {} + + public function clear(): bool {} + + public function clone(): Imagick {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageSize(): int {} +#endif +#endif + + public function getImageBlob(): string {} + + public function getImagesBlob(): string {} + + public function setFirstIterator(): bool {} + + public function setLastIterator(): bool {} + + public function resetIterator(): void {} + + public function previousImage(): bool {} + + public function nextImage(): bool {} + + public function hasPreviousImage(): bool {} + + public function hasNextImage(): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageIndex(int $index): bool {} + + /** @deprecated */ + public function getImageIndex(): int {} +#endif +#endif + + public function commentImage(string $comment): bool {} + + public function cropImage(int $width, int $height, int $x, int $y): bool {} + + public function labelImage(string $label): bool {} + + public function getImageGeometry(): array {} + + public function drawImage(ImagickDraw $drawing): bool {} + + public function setImageCompressionQuality(int $quality): bool {} + + public function getImageCompressionQuality(): int {} + + public function setImageCompression(int $compression): bool {} + + public function getImageCompression(): int {} + + public function annotateImage( + ImagickDraw $settings, + float $x, + float $y, + float $angle, + string $text + ): bool {} + + public function compositeImage( + Imagick $composite_image, + int $composite, + int $x, + int $y, + int $channel = Imagick::CHANNEL_DEFAULT): bool{} + + public function modulateImage(float $brightness, float $saturation, float $hue): bool {} + + public function getImageColors(): int {} + + + + /** + * @param ImagickDraw $settings + * @param string $tile_geometry e.g. "3x2+0+0" + * @param string $thumbnail_geometry e.g. "200x160+3+3>" + * @param int $monatgemode // MONTAGEMODE_ + * @param string $frame // "10x10+2+2" + * @return Imagick + */ + public function montageImage( + ImagickDraw $settings, + string $tile_geometry, + string $thumbnail_geometry, + int $monatgemode, + string $frame + ): Imagick {} + + public function identifyImage(bool $append_raw_output = false): array {} + + public function thresholdImage(float $threshold, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function adaptiveThresholdImage(int $width, int $height, int $offset): bool {} + + public function blackThresholdImage(ImagickPixel|string $threshold_color): bool {} + + public function whiteThresholdImage(ImagickPixel|string $threshold_color): bool {} + + public function appendImages(bool $stack): Imagick {} + + public function charcoalImage(float $radius, float $sigma): bool {} + + public function normalizeImage(int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function oilPaintImage(float $radius): bool {} + + public function posterizeImage(int $levels, bool $dither): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function radialBlurImage(float $angle, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif +#endif + + public function raiseImage(int $width, int $height, int $x, int $y, bool $raise): bool {} + + public function resampleImage(float $x_resolution, float $y_resolution, int $filter, float $blur): bool {} + + public function resizeImage( + int $columns, + int $rows, + int $filter, + float $blur, + bool $bestfit = false, + bool $legacy = false): bool {} + + public function rollImage(int $x, int $y): bool {} + + public function rotateImage(ImagickPixel|string $background_color, float $degrees): bool {} + + public function sampleImage(int $columns, int $rows): bool {} + + public function solarizeImage(int $threshold): bool {} + + public function shadowImage(float $opacity, float $sigma, int $x, int $y): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageAttribute(string $key, string $value): bool {} +#endif +#endif + + public function setImageBackgroundColor(ImagickPixel|string $background_color): bool {} + +#if MagickLibVersion >= 0x700 + public function setImageChannelMask(int $channel): int {} +#endif + + public function setImageCompose(int $compose): bool {} + + public function setImageDelay(int $delay): bool {} + + public function setImageDepth(int $depth): bool {} + + public function setImageGamma(float $gamma): bool {} + + public function setImageIterations(int $iterations): bool {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageMatteColor(ImagickPixel|string $matte_color): bool {} +#endif + + public function setImagePage(int $width, int $height, int $x, int $y): bool {} + + // TODO test this. + public function setImageProgressMonitor(string $filename): bool {} + +#if MagickLibVersion > 0x653 + public function setProgressMonitor(callable $callback): bool {} +#endif + + public function setImageResolution(float $x_resolution, float $y_resolution): bool {} + + // I have no idea what scene does. + public function setImageScene(int $scene): bool {} + + public function setImageTicksPerSecond(int $ticks_per_second): bool {} + + // IMGTYPE_* + public function setImageType(int $image_type): bool {} + + public function setImageUnits(int $units): bool {} + + public function sharpenImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function shaveImage(int $columns, int $rows): bool {} + + public function shearImage(ImagickPixel|string $background_color, float $x_shear, float $y_shear): bool {} + + public function spliceImage(int $width, int $height, int $x, int $y): bool {} + + public function pingImage(string $filename): bool {} + + public function readImageFile(resource $filehandle, ?string $filename = null): bool {} + + public function displayImage(string $servername): bool {} + + public function displayImages(string $servername): bool {} + + public function spreadImage(float $radius): bool {} + + public function swirlImage(float $degrees): bool {} + + public function stripImage(): bool {} + + public static function queryFormats(string $pattern = "*"): array {} + + public static function queryFonts(string $pattern = "*"): array {} + + /* TODO $multiline == null, means we should autodetect */ + public function queryFontMetrics(ImagickDraw $settings, string $text, ?bool $multiline = null): array {} + + public function steganoImage(Imagick $watermark, int $offset): Imagick {} + + // NOISE_* + public function addNoiseImage(int $noise, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function motionBlurImage( + float $radius, + float $sigma, + float $angle, + int $channel = Imagick::CHANNEL_DEFAULT + ):bool {} + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function mosaicImages(): Imagick {} +#endif +#endif + + public function morphImages(int $number_frames): Imagick {} + + public function minifyImage(): bool {} + + public function affineTransformImage(ImagickDraw $settings): bool {} + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function averageImages(): Imagick {} +#endif +#endif + + public function borderImage(ImagickPixel|string $border_color, int $width, int $height): bool {} + + public static function calculateCrop( + int $original_width, + int $original_height, + int $desired_width, + int $desired_height, + bool $legacy = false): array {} + + public function chopImage(int $width, int $height, int $x, int $y): bool {} + + public function clipImage(): bool {} + + public function clipPathImage(string $pathname, bool $inside): bool {} + + /* clippathimage has been deprecated. Create alias here and use the newer API function if present */ + /** @alias Imagick::clipPathImage */ + public function clipImagePath(string $pathname, bool $inside): void {} + + public function coalesceImages(): Imagick {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function colorFloodfillImage( + ImagickPixel|string $fill_color, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y + ): bool {} +#endif +#endif + + // TODO - opacity is actually float if legacy is true... + public function colorizeImage( + ImagickPixel|string $colorize_color, + ImagickPixel|string|false $opacity_color, + ?bool $legacy = false ): bool {} + + public function compareImageChannels(Imagick $reference, int $channel, int $metric): array {} + + public function compareImages(Imagick $reference, int $metric): array {} + + public function contrastImage(bool $sharpen): bool {} + + public function combineImages(int $colorspace): Imagick {} + + // kernel is a 2d array of float values + public function convolveImage(array $kernel, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function cycleColormapImage(int $displace): bool {} + + public function deconstructImages(): Imagick {} + + public function despeckleImage(): bool {} + + public function edgeImage(float $radius): bool {} + + public function embossImage(float $radius, float $sigma): bool {} + + public function enhanceImage(): bool {} + + public function equalizeImage(): bool {} + + // EVALUATE_* + public function evaluateImage(int $evaluate, float $constant, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if MagickLibVersion >= 0x687 +// Merge multiple images of the same size together with the selected operator. +//http://www.imagemagick.org/Usage/layers/#evaluate-sequence + + // EVALUATE_* + public function evaluateImages(int $evaluate): bool {} + +#endif + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function flattenImages(): Imagick {} +#endif +#endif + public function flipImage(): bool {} + + public function flopImage(): bool {} + +#if MagickLibVersion >= 0x655 + public function forwardFourierTransformImage(bool $magnitude): bool {} +#endif + + public function frameImage( + ImagickPixel|string $matte_color, + int $width, + int $height, + int $inner_bevel, + int $outer_bevel + ): bool {} + + + public function fxImage(string $expression, int $channel = Imagick::CHANNEL_DEFAULT): Imagick {} + + public function gammaImage(float $gamma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + + public function gaussianBlurImage(float $radius, float $sigma, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function getImageAttribute(string $key): string {} +#endif +#endif + + public function getImageBackgroundColor(): ImagickPixel {} + + public function getImageBluePrimary(): array {} + + public function getImageBorderColor(): ImagickPixel {} + + public function getImageChannelDepth(int $channel): int {} + + public function getImageChannelDistortion(Imagick $reference, int $channel, int $metric): float {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageChannelExtrema(int $channel): array {} +#endif +#endif + + public function getImageChannelMean(int $channel): array {} + + public function getImageChannelStatistics(): array {} + + // index - the offset into the image colormap. I have no idea. + public function getImageColormapColor(int $index): ImagickPixel {} + + public function getImageColorspace(): int {} + + public function getImageCompose(): int {} + + public function getImageDelay(): int {} + + public function getImageDepth(): int {} + + // METRIC_ + public function getImageDistortion(Imagick $reference, int $metric): float {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageExtrema(): array {} +#endif +#endif + + public function getImageDispose(): int {} + + public function getImageGamma(): float {} + + public function getImageGreenPrimary(): array {} + + public function getImageHeight(): int {} + + public function getImageHistogram(): array {} + + public function getImageInterlaceScheme(): int {} + + public function getImageIterations(): int {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function getImageMatteColor(): ImagickPixel {} +#endif + + public function getImagePage(): array {} + + public function getImagePixelColor(int $x, int $y): ImagickPixel {} + + +#if IM_HAVE_IMAGICK_SETIMAGEPIXELCOLOR + // TODO - needs a test. + public function setImagePixelColor(int $x, int $y, ImagickPixel|string $color): ImagickPixel {} +#endif + + public function getImageProfile(string $name): string {} + + public function getImageRedPrimary(): array {} + + public function getImageRenderingIntent(): int {} + + public function getImageResolution(): array {} + + public function getImageScene(): int {} + + public function getImageSignature(): string {} + + public function getImageTicksPerSecond(): int {} + + public function getImageType(): int {} + + public function getImageUnits(): int {} + + public function getImageVirtualPixelMethod(): int {} + + public function getImageWhitePoint(): array {} + + public function getImageWidth(): int {} + + public function getNumberImages(): int {} + + public function getImageTotalInkDensity(): float {} + + public function getImageRegion(int $width, int $height, int $x, int $y): Imagick {} + + public function implodeImage(float $radius): bool {} + +#if MagickLibVersion >= 0x658 + // TODO MagickWand *magnitude_wand,MagickWand *phase_wand, + public function inverseFourierTransformImage(Imagick $complement, bool $magnitude): bool {} +#endif + + public function levelImage( + float $black_point, + float $gamma, + float $white_point, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function magnifyImage(): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function mapImage(imagick $map, bool $dither): bool {} + + /** @deprecated */ + public function matteFloodfillImage( + float $alpha, + float $fuzz, + ImagickPixel|string $border_color, + int $x, + int $y + ): bool {} +#endif +#endif + +#if MagickLibVersion < 0x700 +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) + /** @deprecated */ + public function medianFilterImage(float $radius): bool {} +#endif +#endif + + public function negateImage(bool $gray, int $channel = Imagick::CHANNEL_DEFAULT): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function paintOpaqueImage( + ImagickPixel|string $target_color, + ImagickPixel|string $fill_color, + float $fuzz, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + /** @deprecated */ + public function paintTransparentImage(ImagickPixel|string $target_color, float $alpha, float $fuzz): bool {} +#endif +#endif + + // PREVIEW_* + public function previewImages(int $preview): bool {} + + public function profileImage(string $name, string $profile): bool {} + + public function quantizeImage( + int $number_colors, + int $colorspace, + int $tree_depth, + bool $dither, + bool $measure_error + ): bool {} + + + public function quantizeImages( + int $number_colors, + int $colorspace, + int $tree_depth, + bool $dither, + bool $measure_error): bool {} + +#if !defined(MAGICKCORE_EXCLUDE_DEPRECATED) +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function reduceNoiseImage(float $radius): bool {} +#endif +#endif + + public function removeImageProfile(string $name): string {} + + public function separateImageChannel(int $channel): bool {} + + public function sepiaToneImage(float $threshold): bool {} + +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function setImageBias(float $bias): bool {} + + /** @deprecated */ + public function setImageBiasQuantum(string $bias): void {} +#endif + + public function setImageBluePrimary(float $x, float $y): bool {} + /* {{{ proto bool Imagick::setImageBluePrimary(float x,float y) +For IM7 the prototype is +proto bool Imagick::setImageBluePrimary(float x, float y, float z) */ + + public function setImageBorderColor(ImagickPixel|string $border_color): bool {} + + public function setImageChannelDepth(int $channel, int $depth): bool {} + + public function setImageColormapColor(int $index, ImagickPixel|string $color): bool {} + + public function setImageColorspace(int $colorspace): bool {} + + public function setImageDispose(int $dispose): bool {} + + public function setImageExtent(int $columns, int $rows): bool {} + + public function setImageGreenPrimary(float $x, float $y): bool {} + + // INTERLACE_* + public function setImageInterlaceScheme(int $interlace): bool {} + + public function setImageProfile(string $name, string $profile): bool {} + + public function setImageRedPrimary(float $x, float $y): bool {} + + // RENDERINGINTENT + public function setImageRenderingIntent(int $rendering_intent): bool {} + + public function setImageVirtualPixelMethod(int $method): bool {} + + public function setImageWhitePoint(float $x, float $y): bool {} + + public function sigmoidalContrastImage( + bool $sharpen, + float $alpha, + float $beta, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool{} + + // TODO - MagickStereoImage() composites two images and produces a single + // image that is the composite of a left and right image of a stereo pair + public function stereoImage(Imagick $offset_image): bool {} + + public function textureImage(Imagick $texture): Imagick {} + + public function tintImage( + ImagickPixel|string $tint_color, + ImagickPixel|string $opacity_color, + bool $legacy = false + ): bool {} + + public function unsharpMaskImage( + float $radius, + float $sigma, + float $amount, + float $threshold, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + + public function getImage(): Imagick {} + + public function addImage(Imagick $image): bool {} + + public function setImage(Imagick $image): bool {} + + + public function newImage( + int $columns, + int $rows, + ImagickPixel|string $background_color, + string $format = null + ): bool {} + + // TODO - canvas? description + public function newPseudoImage(int $columns, int $rows, string $pseudo_format): bool {} + + public function getCompression(): int {} + + public function getCompressionQuality(): int {} + + public static function getCopyright(): string {} + + public static function getConfigureOptions(string $pattern = "*"): string {} + + +#if MagickLibVersion > 0x660 + public static function getFeatures(): string {} +#endif + + public function getFilename(): string {} + + public function getFormat(): string {} + + public static function getHomeURL(): string {} + + public function getInterlaceScheme(): int {} + + public function getOption(string $key): string {} + + public static function getPackageName(): string {} + + public function getPage(): array {} + + public static function getQuantum(): int {} + + public static function getHdriEnabled(): bool {} + + public static function getQuantumDepth(): array {} + + public static function getQuantumRange(): array {} + + public static function getReleaseDate(): string {} + + public static function getResource(int $type): int {} + + public static function getResourceLimit(int $type): int {} + + public function getSamplingFactors(): array {} + + public function getSize(): array {} + + public static function getVersion(): array {} + + public function setBackgroundColor(ImagickPixel|string $background_color): bool {} + + public function setCompression(int $compression): bool {} + + public function setCompressionQuality(int $quality): bool {} + + public function setFilename(string $filename): bool {} + + public function setFormat(string $format): bool {} + + // INTERLACE_* + public function setInterlaceScheme(int $interlace): bool {} + + public function setOption(string $key, string $value): bool {} + + public function setPage(int $width, int $height, int $x, int $y): bool {} + + public static function setResourceLimit(int $type, int $limit): bool {} + + public function setResolution(float $x_resolution, float $y_resolution): bool {} + + public function setSamplingFactors(array $factors): bool {} + + public function setSize(int $columns, int $rows): bool {} + + // IMGTYPE_* + public function setType(int $imgtype): bool {} + +#if MagickLibVersion > 0x628 + /** @alias Imagick::getIteratorIndex */ + public function key(): int {} + +//#else +//# if defined(MAGICKCORE_EXCLUDE_DEPRECATED) +//# error "MAGICKCORE_EXCLUDE_DEPRECATED should not be defined with ImageMagick version below 6.2.8" +//# else +//// PHP_MALIAS(imagick, key, getimageindex, imagick_zero_args, ZEND_ACC_PUBLIC) +// /** @alias Imagick::getImageIndex */ +// public function key(): int {} +// +//# endif +//#endif + + /** @alias Imagick::nextImage + * @tentative-return-type + */ + public function next(): void {} + + /** @alias Imagick::setFirstIterator + * @tentative-return-type + */ + public function rewind(): void {} + + public function valid(): bool {} + + public function current(): Imagick {} + +#if MagickLibVersion >= 0x659 + public function brightnessContrastImage( + float $brightness, + float $contrast, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion > 0x661 + public function colorMatrixImage(array $color_matrix): bool {} +#endif + + public function selectiveBlurImage( + float $radius, + float $sigma, + float $threshold, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} + +#if MagickLibVersion >= 0x689 + public function rotationalBlurImage(float $angle, int $channel = Imagick::CHANNEL_DEFAULT): bool {} +#endif + +#if MagickLibVersion >= 0x683 + public function statisticImage( + int $type, + int $width, + int $height, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#if MagickLibVersion >= 0x652 + public function subimageMatch(Imagick $image, ?array &$offset = null, ?float &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} + + /** @alias Imagick::subimageMatch */ + public function similarityimage(Imagick $image, ?array &$offset = null, ?float &$similarity = null, float $threshold = 0.0, int $metric = 0): Imagick {} +#endif + + public static function setRegistry(string $key, string $value): bool {} + + public static function getRegistry(string $key): string {} + + public static function listRegistry(): array {} + +#if MagickLibVersion >= 0x680 + + /** + * @param int $morphology MORPHOLOGY_* + * @param int $iterations + * @param ImagickKernel $kernel + * @param int $channel + * @return bool + */ + public function morphology( + int $morphology, + int $iterations, + ImagickKernel $kernel, + int $channel = Imagick::CHANNEL_DEFAULT + ): bool {} +#endif + +#ifdef IMAGICK_WITH_KERNEL +#if MagickLibVersion < 0x700 + /** @deprecated */ + public function filter(ImagickKernel $kernel, int $channel = Imagick::CHANNEL_UNDEFINED): bool {} +#endif +#endif + + public function setAntialias(bool $antialias): void {} + + public function getAntialias(): bool {} + +#if MagickLibVersion > 0x676 + /** + * @param string $color_correction_collection + *- * The normalized value for hue, described as a fractional arc - * (between 0 and 1) of the hue circle, where the zero value is - * red. - *
- * @param float $saturation- * The normalized value for saturation, with 1 as full saturation. - *
- * @param float $luminosity- * The normalized value for luminosity, on a scale from black at - * 0 to white at 1, with the full HS value at 0.5 luminosity. - *
- * @return bool TRUE on success. - */ - public function setHSL ($hue, $saturation, $luminosity) {} - - public function getColorValueQuantum () {} - - /** - * @param $color_value - */ - public function setColorValueQuantum ($color_value) {} - - public function getIndex () {} - - /** - * @param $index - */ - public function setIndex ($index) {} - - /** - * (PECL imagick 2.0.0)- * The optional color string to use as the initial value of this object. - *
- */ - public function __construct ($color = null) {} - - /** - * (PECL imagick 2.0.0)- * The color definition to use in order to initialise the - * ImagickPixel object. - *
- * @return bool TRUE if the specified color was set, FALSE otherwise. - */ - public function setColor ($color) {} - - /** - * (PECL imagick 2.0.0)- * One of the Imagick color constants e.g. \Imagick::COLOR_GREEN or \Imagick::COLOR_ALPHA. - *
- * @param float $value- * The value to set this channel to, ranging from 0 to 1. - *
- * @return bool TRUE on success. - */ - public function setColorValue ($color, $value) {} - - /** - * (PECL imagick 2.0.0)- * The color to get the value of, specified as one of the Imagick color - * constants. This can be one of the RGB colors, CMYK colors, alpha and - * opacity e.g (Imagick::COLOR_BLUE, Imagick::COLOR_MAGENTA). - *
- * @return float The value of the channel, as a normalized floating-point number, throwing - * ImagickPixelException on error. - * @throws ImagickPixelException on error - */ - public function getColorValue ($color) {} - - /** - * (PECL imagick 2.0.0)- * The ImagickPixel object to compare this object against. - *
- * @param float $fuzz- * The maximum distance within which to consider these colors as similar. - * The theoretical maximum for this value is the square root of three - * (1.732). - *
- * @return bool TRUE on success. - */ - public function isSimilar (ImagickPixel $color, $fuzz) {} - - /** - * (No version information available, might only be in SVN)- * The ImagickPixel object to compare this object against. - *
- * @param float $fuzz- * The maximum distance within which to consider these colors as similar. - * The theoretical maximum for this value is the square root of three - * (1.732). - *
- * @return bool TRUE on success. - */ - public function isPixelSimilar (ImagickPixel $color, $fuzz) {} - - /** - * (PECL imagick 2.0.0)- * Normalize the color values - *
- * @return array An array of channel values, each normalized if TRUE is given as param. Throws - * ImagickPixelException on error. - * @throws ImagickPixelException on error. - */ - public function getColor ($normalized = false) {} - - /** - * (PECL imagick 2.1.0)