PHP | Gmagick getimageinterlacescheme() Function

The Gmagick::getimageinterlacescheme() function is an inbuilt function in PHP which is used to get the interlace scheme of the image.

Syntax:

int Gmagick::getimageinterlacescheme( void )

Parameters: This function doesn’t accept any parameters.



Return Value: This function returns an integer value corresponding to one of INTERLACE constants as given below:

  • gmagick::INTERLACE_UNDEFINED (0)
  • gmagick::INTERLACE_NO (1)
  • gmagick::INTERLACE_LINE (2)
  • gmagick::INTERLACE_PLANE (3)
  • gmagick::INTERLACE_PARTITION (4)

Exceptions: This function throws GmagickException on error.

Below given programs illustrate the Gmagick::getimageinterlacescheme() function in PHP:

Program 1:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create a new Gmagick object
$gmagick = new Gmagick('geeksforgeeks.png');
  
// Get the interlace scheme
$interlaceScheme = $gmagick->getimageinterlacescheme();
echo $interlaceScheme
?>

chevron_right


Output:

0 // Which is the default value for any Gmagick object.

Program 2:

filter_none

edit
close

play_arrow

link
brightness_4
code

<?php
  
// Create a new Gmagick object
$gmagick = new Gmagick('geeksforgeeks.png');
  
// Set the interlace scheme
$gmagick->setimageinterlacescheme(gmagick::INTERLACE_LINE);
  
// Get the interlace scheme
$interlaceScheme = $gmagick->getimageinterlacescheme();
echo $interlaceScheme;
?>

chevron_right


Output:

2 // Which corresponds to gmagick::INTERLACE_LINE.

Reference: https://www.php.net/manual/en/gmagick.getimageinterlacescheme.php

My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :
Practice Tags :


Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.