當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


PHP Gmagick getimagewhitepoint()用法及代碼示例

Gmagick::getimagewhitepoint()函數是PHP中的內置函數,用於通過鍵“x”和“y”獲取色度白點作為關聯數組。

用法:

array Gmagick::getimagewhitepoint( void )

參數:此函數不接受任何參數。


返回值:該函數返回一個包含色度白點的數組值。

異常:此函數在錯誤時引發GmagickException。

下麵給出的程序說明了PHP中的Gmagick::getimagewhitepoint()函數:

使用的圖片:

程序1:

<?php 
  
// Create a new  Gmagick object 
$gmagick = new Gmagick('geeksforgeeks.png'); 
  
// Get the white point 
$res = $gmagick->getimagewhitepoint(); 
print("<pre>".print_r($res, true)."</pre>"); 
?>

輸出:

Array
(
    [x] => 0.31270000338554
    [y] => 0.3289999961853
)

程序2:

<?php 
  
// Create a new  Gmagick object 
$gmagick = new Gmagick('geeksforgeeks.png'); 
  
// Set the white point 
$gmagick->setimagewhitepoint(5, 5); 
  
// Get the white point 
$res = $gmagick->getimagewhitepoint(); 
print("<pre>".print_r($res, true)."</pre>"); 
?>

輸出:

Array
(
    [x] => 5
    [y] => 5
)

參考: https://www.php.net/manual/en/gmagick.getimagewhitepoint.php



相關用法


注:本文由純淨天空篩選整理自gurrrung大神的英文原創作品 PHP | Gmagick getimagewhitepoint() Function。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。