Draw a circle/dot to mark a POI

@param array $poi
@param string $color
@param integer $borderSize
@param integer $imageWidth
@param integer $imageHeight
775440
private function drawPoiCircle($poi, $color, $borderSize, $pointSize) {
        $dot = new ImagickDraw();
        $dot->setStrokeColor($color);
        $dot->setFillColor('transparent');
        $dot->setStrokeAntialias(true);
        $dot->setStrokeWidth($borderSize);

        $dot->circle($poi['cx'], $poi['cy'], $poi['cx'] + $pointSize, $poi['cy'] + $pointSize);

        // Draw the border
        $this->imagick->drawImage($dot);
    }
1246061
public function addRectangle($x1, $y1, $x2, $y2, $colors = [0, 0, 0])
    {
        $color = imagecolorallocate($this->image(), $colors[0],  $colors[1],  $colors[2]);
        imagerectangle ( $this->image() , $x1 , $y1 , $x2 , $y2 ,  $color );
    }
1240874
private void drawCircleDown(@NonNull Canvas canvas, float step, float radius) {
    canvas.drawCircle(
            xCoordinate + step,
            getMeasuredHeight() / 2,
            bounceDotRadius - radius,
            endPaint
    );
  }
929305
protected function drawScratch($img, $imageWidth, $imageHeight, $hex)
    {
        $rgb = $this->hexToRgb($hex);

        imageline(
            $img,
            mt_rand(0, floor($imageWidth / 2)),
            mt_rand(1, $imageHeight),
            mt_rand(floor($imageWidth / 2), $imageWidth),
            mt_rand(1, $imageHeight),
            imagecolorallocate($img, $rgb['r'], $rgb['g'], $rgb['b'])
        );
    }
1057071
public function border($color = '#000', $thickness = 5): Image
	{
		$this->processor->border($color, $thickness);

		return $this;
	}
199165
public function setAxisColor($r, $g, $b)
    {
        $this->ink['axis'] = imagecolorallocate($this->im, $r, $g, $b);
    }
668801
public static CellStyle setBorder(CellStyle cellStyle, BorderStyle borderSize, IndexedColors colorIndex) {
		cellStyle.setBorderBottom(borderSize);
		cellStyle.setBottomBorderColor(colorIndex.index);

		cellStyle.setBorderLeft(borderSize);
		cellStyle.setLeftBorderColor(colorIndex.index);

		cellStyle.setBorderRight(borderSize);
		cellStyle.setRightBorderColor(colorIndex.index);

		cellStyle.setBorderTop(borderSize);
		cellStyle.setTopBorderColor(colorIndex.index);

		return cellStyle;
	}
853094
private function drawArc(
    CanvasInterface $canvas, StyleInterface $style = null, $filled = false)
    {
        $color = (is_null($style)) ?
                $this->getColor()->getValue() :
                $style->apply($canvas, $this)->getValue();

        $falgs = array();
        if ($this->isRounded()) {
            $falgs[] = IMG_ARC_PIE;
        }

        if ($this->isAnglesConnected()) {
            $falgs[] = IMG_ARC_CHORD;
        }

        if ($this->isAnglesConnectedToCenter()) {
            $falgs[] = IMG_ARC_EDGED;
        }
        if ($filled === false) {
            $falgs[] = IMG_ARC_NOFILL;
        }

        if (
                false == @imagefilledarc(
                        $canvas->getHandler()
                        , $this->getCenter()->getX()
                        , $this->getCenter()->getY()
                        , $this->getDimension()->getWidth()
                        , $this->getDimension()->getHeight()
                        , $this->getStartDegree()
                        , $this->getEndDegree()
                        , $color
                        , $this->getBitflags($falgs)
                )
        ) {
            throw new DrawableException(sprintf(
                    'Failed To Draw The Arc "%s"', (string) $this
            ));
        }
    }
500617
private function createRectangle($color)
    {
        imagefilledrectangle(
            $this->resource,
            0,
            0,
            $this->width,
            $this->height,
            $color
        );
    }
1178187
function PaintDivLnBorder($state = 0, $blvl = 0, $h = 0)
	{
		// $state = 0 normal; 1 top; 2 bottom; 3 top and bottom
		$this->ColDetails[$this->CurrCol]['bottom_margin'] = $this->y + $h;

		$save_y = $this->y;

		$w = $this->blk[$blvl]['width'];
		$x0 = $this->x;    // left
		$y0 = $this->y;    // top
		$x1 = $this->x + $w;   // bottom
		$y1 = $this->y + $h;   // bottom
		$continuingpage = (isset($this->blk[$blvl]['startpage']) && $this->blk[$blvl]['startpage'] != $this->page);

		if ($this->blk[$blvl]['border_top'] && ($state == 1 || $state == 3)) {
			$tbd = $this->blk[$blvl]['border_top'];
			if (isset($tbd['s']) && $tbd['s']) {
				$this->_setBorderLine($tbd);
				$this->y = $y0 + ($tbd['w'] / 2);
				if ($tbd['style'] == 'dotted' || $tbd['style'] == 'dashed') {
					$this->_setDashBorder($tbd['style'], '', $continuingpage, 'T');
					$this->Line($x0 + ($tbd['w'] / 2), $this->y, $x0 + $w - ($tbd['w'] / 2), $this->y);
				} else {
					$this->SetLineJoin(0);
					$this->SetLineCap(0);
					$this->Line($x0, $this->y, $x0 + $w, $this->y);
				}
				$this->y += $tbd['w'];
				// Reset Corners and Dash off
				$this->SetLineJoin(2);
				$this->SetLineCap(2);
				$this->SetDash();
			}
		}
		if ($this->blk[$blvl]['border_left']) {
			$tbd = $this->blk[$blvl]['border_left'];
			if (isset($tbd['s']) && $tbd['s']) {
				$this->_setBorderLine($tbd);
				if ($tbd['style'] == 'dotted' || $tbd['style'] == 'dashed') {
					$this->y = $y0 + ($tbd['w'] / 2);
					$this->_setDashBorder($tbd['style'], '', $continuingpage, 'L');
					$this->Line($x0 + ($tbd['w'] / 2), $this->y, $x0 + ($tbd['w'] / 2), $y0 + $h - ($tbd['w'] / 2));
				} else {
					$this->y = $y0;
					$this->SetLineJoin(0);
					$this->SetLineCap(0);
					$this->Line($x0 + ($tbd['w'] / 2), $this->y, $x0 + ($tbd['w'] / 2), $y0 + $h);
				}
				$this->y += $tbd['w'];
				// Reset Corners and Dash off
				$this->SetLineJoin(2);
				$this->SetLineCap(2);
				$this->SetDash();
			}
		}
		if ($this->blk[$blvl]['border_right']) {
			$tbd = $this->blk[$blvl]['border_right'];
			if (isset($tbd['s']) && $tbd['s']) {
				$this->_setBorderLine($tbd);
				if ($tbd['style'] == 'dotted' || $tbd['style'] == 'dashed') {
					$this->y = $y0 + ($tbd['w'] / 2);
					$this->_setDashBorder($tbd['style'], '', $continuingpage, 'R');
					$this->Line($x0 + $w - ($tbd['w'] / 2), $this->y, $x0 + $w - ($tbd['w'] / 2), $y0 + $h - ($tbd['w'] / 2));
				} else {
					$this->y = $y0;
					$this->SetLineJoin(0);
					$this->SetLineCap(0);
					$this->Line($x0 + $w - ($tbd['w'] / 2), $this->y, $x0 + $w - ($tbd['w'] / 2), $y0 + $h);
				}
				$this->y += $tbd['w'];
				// Reset Corners and Dash off
				$this->SetLineJoin(2);
				$this->SetLineCap(2);
				$this->SetDash();
			}
		}
		if ($this->blk[$blvl]['border_bottom'] && $state > 1) {
			$tbd = $this->blk[$blvl]['border_bottom'];
			if (isset($tbd['s']) && $tbd['s']) {
				$this->_setBorderLine($tbd);
				$this->y = $y0 + $h - ($tbd['w'] / 2);
				if ($tbd['style'] == 'dotted' || $tbd['style'] == 'dashed') {
					$this->_setDashBorder($tbd['style'], '', $continuingpage, 'B');
					$this->Line($x0 + ($tbd['w'] / 2), $this->y, $x0 + $w - ($tbd['w'] / 2), $this->y);
				} else {
					$this->SetLineJoin(0);
					$this->SetLineCap(0);
					$this->Line($x0, $this->y, $x0 + $w, $this->y);
				}
				$this->y += $tbd['w'];
				// Reset Corners and Dash off
				$this->SetLineJoin(2);
				$this->SetLineCap(2);
				$this->SetDash();
			}
		}
		$this->SetDash();
		$this->y = $save_y;
	}
918556
public function draw(Image $Object, $Value, $X, $Y, $Format = [])
    {
        $this->pChartObject = $Object;

        $R = isset($Format["R"]) ? $Format["R"] : 0;
        $G = isset($Format["G"]) ? $Format["G"] : 0;
        $B = isset($Format["B"]) ? $Format["B"] : 0;
        $Alpha = isset($Format["Alpha"]) ? $Format["Alpha"] : 100;
        $Height = isset($Format["Height"]) ? $Format["Height"] : 30;
        $Angle = isset($Format["Angle"]) ? $Format["Angle"] : 0;
        $ShowLegend = isset($Format["ShowLegend"]) ? $Format["ShowLegend"] : false;
        $LegendOffset = isset($Format["LegendOffset"]) ? $Format["LegendOffset"] : 5;
        $DrawArea = isset($Format["DrawArea"]) ? $Format["DrawArea"] : false;
        $AreaR = isset($Format["AreaR"]) ? $Format["AreaR"] : 255;
        $AreaG = isset($Format["AreaG"]) ? $Format["AreaG"] : 255;
        $AreaB = isset($Format["AreaB"]) ? $Format["AreaB"] : 255;
        $AreaBorderR = isset($Format["AreaBorderR"]) ? $Format["AreaBorderR"] : $AreaR;
        $AreaBorderG = isset($Format["AreaBorderG"]) ? $Format["AreaBorderG"] : $AreaG;
        $AreaBorderB = isset($Format["AreaBorderB"]) ? $Format["AreaBorderB"] : $AreaB;

        $TextString = $this->encode128($Value);

        if ($DrawArea) {
            $X1 = $X + cos(($Angle - 135) * PI / 180) * 10;
            $Y1 = $Y + sin(($Angle - 135) * PI / 180) * 10;

            $X2 = $X1 + cos($Angle * PI / 180) * (strlen($this->Result) + 20);
            $Y2 = $Y1 + sin($Angle * PI / 180) * (strlen($this->Result) + 20);

            if ($ShowLegend) {
                $X3 = $X2
                    + cos(($Angle + 90) * PI / 180)
                    * ($Height + $LegendOffset + $this->pChartObject->FontSize + 10)
                ;
                $Y3 = $Y2
                    + sin(($Angle + 90) * PI / 180)
                    * ($Height + $LegendOffset + $this->pChartObject->FontSize + 10)
                ;
            } else {
                $X3 = $X2 + cos(($Angle + 90) * PI / 180) * ($Height + 20);
                $Y3 = $Y2 + sin(($Angle + 90) * PI / 180) * ($Height + 20);
            }

            $X4 = $X3 + cos(($Angle + 180) * PI / 180) * (strlen($this->Result) + 20);
            $Y4 = $Y3 + sin(($Angle + 180) * PI / 180) * (strlen($this->Result) + 20);

            $Polygon = [$X1, $Y1, $X2, $Y2, $X3, $Y3, $X4, $Y4];
            $Settings = [
                "R" => $AreaR,
                "G" => $AreaG,
                "B" => $AreaB,
                "BorderR" => $AreaBorderR,
                "BorderG" => $AreaBorderG,
                "BorderB" => $AreaBorderB
            ];
            $this->pChartObject->drawPolygon($Polygon, $Settings);
        }

        for ($i = 1; $i <= strlen($this->Result); $i++) {
            if ($this->mid($this->Result, $i, 1) == 1) {
                $X1 = $X + cos($Angle * PI / 180) * $i;
                $Y1 = $Y + sin($Angle * PI / 180) * $i;
                $X2 = $X1 + cos(($Angle + 90) * PI / 180) * $Height;
                $Y2 = $Y1 + sin(($Angle + 90) * PI / 180) * $Height;

                $Settings = ["R" => $R, "G" => $G, "B" => $B, "Alpha" => $Alpha];
                $this->pChartObject->drawLine($X1, $Y1, $X2, $Y2, $Settings);
            }
        }

        if ($ShowLegend) {
            $X1 = $X + cos($Angle * PI / 180) * (strlen($this->Result) / 2);
            $Y1 = $Y + sin($Angle * PI / 180) * (strlen($this->Result) / 2);

            $LegendX = $X1 + cos(($Angle + 90) * PI / 180) * ($Height + $LegendOffset);
            $LegendY = $Y1 + sin(($Angle + 90) * PI / 180) * ($Height + $LegendOffset);

            $Settings = [
                "R" => $R,
                "G" => $G,
                "B" => $B,
                "Alpha" => $Alpha,
                "Angle" => -$Angle,
                "Align" => TEXT_ALIGN_TOPMIDDLE
            ];
            $this->pChartObject->drawText($LegendX, $LegendY, $TextString, $Settings);
        }
    }
336790
protected function drawSingleBar($im, $color) {
        $this->drawFilledRectangle($im, $this->positionX, 0, $this->positionX, $this->thickness - 1, $color);
    }
1336772
public void setCircleColor(@ColorInt int color) {
    jsonObject.addProperty(CircleOptions.PROPERTY_CIRCLE_COLOR, ColorUtils.colorToRgbaString(color));
  }
592170
public static BufferedImage regionBorders( GrayS32 pixelToRegion ,
											   int borderColor ,
											   BufferedImage output ) {
		if( output == null )
			output = new BufferedImage(pixelToRegion.width,pixelToRegion.height,BufferedImage.TYPE_INT_RGB);

		GrayU8 binary = new GrayU8(pixelToRegion.width,pixelToRegion.height);
		ImageSegmentationOps.markRegionBorders(pixelToRegion, binary);
		for( int y = 0; y < binary.height; y++ ) {
			for( int x = 0; x < binary.width; x++ ) {
				if( binary.unsafe_get(x,y) == 1 )  {
					output.setRGB(x,y,borderColor);
				}
			}
		}

		return output;
	}
900375
protected function drawHoughLine($distance, $theta, $color = 111111) {
		if($theta === 0 || $theta === 360) {
			return $this;
		}
		$theta = deg2rad($theta);
		$sizeX2 = $this->width / 2;
		$sizeY2 = $this->height / 2;
		for($x = 0; $x< $this->width; ++$x)    {
			$y1 = (int)($distance / sin($theta) - ($x - $sizeX2) * (cos($theta) / sin($theta)) + $sizeY2);
			$x1 = (int)($distance / cos($theta) - ($x - $sizeX2) * tan($theta) + $sizeY2);

			if($x > 0 && $x < $this->width && $y1 > 0 && $y1 < $this->height) {
				imageline($this->image, $x, $y1, $x, $y1, $color);
			}

			if($x1 > 0 && $x1 < $this->width) {
				imageline($this->image, $x1, $x, $x1, $x, $color);
			}
		}
		return $this;
	}
1117682
function shadedRectangle( $x1, $y1, $width, $height, $options )
    {
        $this->numObj++;
        $shadingLabel = $this->o_shading( $this->numObj, 'new', $options );

        $this->saveState();

        $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3F',$x1).' '.sprintf('%.3F',$y1).' '.sprintf('%.3F',$width).' '.sprintf('%.3F',$height).' re';

        $this->objects[$this->currentContents]['c'].="\nW n";

        $this->objects[$this->currentContents]['c'].="\n/".$shadingLabel.' sh';

        $this->restoreState();
    }
480163
protected function _drawCurve($pt, $color)
    {
        $this->pdf->SetFillColorArray($color);

        if (count($pt) == 10) {
            $this->pdf->drawCurve($pt[0], $pt[1], $pt[2], $pt[3], $pt[4], $pt[5], $pt[6], $pt[7], $pt[8], $pt[9]);
        } else {
            $this->pdf->drawCorner($pt[0], $pt[1], $pt[2], $pt[3], $pt[4], $pt[5], $pt[6], $pt[7]);
        }
    }