xref: /imagick/ImagickPixel.stub.php (revision 8cc982df)
1<?php
2
3/** @generate-function-entries */
4
5class ImagickPixel
6{
7    public function __construct(?string $color = null) {}
8
9    public function clear(): bool {}
10
11    /** @alias ImagickPixel::clear */
12    public function destroy(): bool {}
13
14    public function getColor(int $normalized = 0): array {}
15
16    public function getColorAsString(): string {}
17
18    public function getColorCount(): int {}
19
20    public function getColorQuantum(): array {}
21
22    // COLOR_*
23    public function getColorValue(int $color): float {}
24
25    /**
26     * @param int $color // COLOR_*
27     * @return mixed
28     * - Float if IM compiled with HDRI
29     * - int if IM compiled with fixed point math
30     */
31    public function getColorValueQuantum(int $color): IMAGICK_QUANTUM_TYPE {}
32
33    public function getHSL(): array {}
34
35    public function getIndex(): int {}
36
37    public function isPixelSimilar(ImagickPixel|string $color, float $fuzz): bool {}
38
39    // The fuzz value should be in the range 0-QuantumRange. The maximum value
40    // represents the longest possible distance in the colorspace. e.g. from
41    // RGB(0, 0, 0) to RGB(255, 255, 255) for the RGB colorspace
42    public function isPixelSimilarQuantum(ImagickPixel|string $color, float $fuzz_quantum_range_scaled_by_square_root_of_three): bool {}
43
44    /** @alias ImagickPixel::isPixelSimilarQuantum */
45
46    public function isSimilar(
47        ImagickPixel|string $color,
48        // Feel free to not use named params for this.
49        float $fuzz_quantum_range_scaled_by_square_root_of_three
50    ): bool{}
51
52    public function setColor(string $color): bool {}
53
54    public function setColorCount(int $color_count): bool {}
55
56    // COLOR_*
57    public function setColorValue(int $color, float $value): bool {}
58
59    /**
60     * @param int $color // COLOR_*
61     * @param mixed $value
62     * @return bool
63     *
64     * Type of value depends on how ImageMagick was compiled.
65     * - Float if IM compiled with HDRI
66     * - int if IM compiled with fixed point math
67     *
68     */
69    public function setColorValueQuantum(int $color, IMAGICK_QUANTUM_TYPE $value): bool{}
70
71    public function setHSL(float $hue, float $saturation , float $luminosity): bool{}
72
73    // This function could be described more clearly...
74    // https://imagemagick.org/api/pixel-wand.php#PixelSetIndex
75    public function setIndex(IMAGICK_QUANTUM_TYPE $index): bool {}
76
77    //// Not in docs.
78#if MagickLibVersion >= 0x693
79    public function setColorFromPixel(ImagickPixel $pixel): bool {}
80#endif
81}
82
83
84
85