이미지 처리 및 GD imagesetinterpolation
(PHP 5 >= 5.5.0, PHP 7, PHP 8)
imagesetinterpolation — 보간 방식 설정
설명
imagesetinterpolation(GdImage $image
, int $method
= IMG_BILINEAR_FIXED): bool
보간 메서드를 설정합니다. 보간 메서드를 설정하면 imagerotate() 함수와 같은 GD의 다양한 함수 렌더링에 영향을 줍니다.
매개변수
image
- imagecreatetruecolor()와 같은 이미지 생성 함수 중 하나에서 반환되는 GdImage 객체.
method
- 다음 중 하나일 수 있는 보간 메서드:
-
IMG_BELL
: Bell filter. -
IMG_BESSEL
: Bessel filter. -
IMG_BICUBIC
: Bicubic interpolation. -
IMG_BICUBIC_FIXED
: Fixed point implementation of the bicubic interpolation. -
IMG_BILINEAR_FIXED
: Fixed point implementation of the bilinear interpolation (default (also on image creation)
). -
IMG_BLACKMAN
: Blackman window function. -
IMG_BOX
: Box blur filter. -
IMG_BSPLINE
: Spline interpolation. -
IMG_CATMULLROM
: Cubic Hermite spline interpolation. -
IMG_GAUSSIAN
: Gaussian function. -
IMG_GENERALIZED_CUBIC
: Generalized cubic spline fractal interpolation. -
IMG_HERMITE
: Hermite interpolation. -
IMG_HAMMING
: Hamming filter. -
IMG_HANNING
: Hanning filter. -
IMG_MITCHELL
: Mitchell filter. -
IMG_POWER
: Power interpolation. -
IMG_QUADRATIC
: Inverse quadratic interpolation. -
IMG_SINC
: Sinc function. -
IMG_NEAREST_NEIGHBOUR
: Nearest neighbour interpolation. -
IMG_WEIGHTED4
: Weighting filter. -
IMG_TRIANGLE
: Triangle interpolation.
-
반환 값
성공하면 true
를, 실패하면 false
를 반환합니다.
변경 로그
버전 | 설명 |
---|---|
8.0.0 | image 는 이제 GdImage 인스턴스를 반환합니다. 이전에는 리소스가 필요했습니다. |
Examples
예제 #1 imagesetinterpolation() 예제
<?php
// Load an image
$im = imagecreate(500, 500);
// By default interpolation is IMG_BILINEAR_FIXED, switch
// to use the 'Mitchell' filter:
imagesetinterpolation($im, IMG_MITCHELL);
// Continue to work with $im ...
?>
메모
보간 메서드를 변경하면 렌더링 시 다음 함수에 영향을 줍니다.
기타
- imagegetinterpolation() - 보간 메서드 가져오기