private static function getIntersections($edges, $y) 
    {
        $intersections = array();

        foreach ($edges as $edge) {
            if ($edge->y0 < $y && $edge->y1 >= $y ||
                $edge->y0 >= $y && $edge->y1 < $y
            ) {
                $x = $edge->x0 +
                    ($edge->x1 - $edge->x0) * ($y - $edge->y0) /
                    ($edge->y1 - $edge->y0);

                $intersections[] = new EdgeSuperSampleIntersection($x, $edge);
            }
        }

        usort($intersections, array(
            'Jdenticon\\Canvas\\Rasterization\\Rasterizer', 
            'intersection_cmp'));
        
        return $intersections;
    }
private static function getIntersections($edges, $y) 
    {
        $intersections = array();

        foreach ($edges as $edge) {
            if ($edge->y0 < $y && $edge->y1 >= $y ||
                $edge->y0 >= $y && $edge->y1 < $y
            ) {
                $x = $edge->x0 +
                    ($edge->x1 - $edge->x0) * ($y - $edge->y0) /
                    ($edge->y1 - $edge->y0);

                $intersections[] = new EdgeSuperSampleIntersection($x, $edge);
            }
        }

        usort($intersections, array(
            'Jdenticon\\Canvas\\Rasterization\\Rasterizer', 
            'intersection_cmp'));
        
        return $intersections;
    }
private static function getIntersections ( $ edges , $ y ) { $ intersections = array ( ) ; foreach ( $ edges as $ edge ) { if ( $ edge -> y0 < $ y && $ edge -> y1 >= $ y || $ edge -> y0 >= $ y && $ edge -> y1 < $ y ) { $ x = $ edge -> x0 + ( $ edge -> x1 - $ edge -> x0 ) * ( $ y - $ edge -> y0 ) / ( $ edge -> y1 - $ edge -> y0 ) ; $ intersections [ ] = new EdgeSuperSampleIntersection ( $ x , $ edge ) ; } } usort ( $ intersections , array ( 'Jdenticon\\Canvas\\Rasterization\\Rasterizer' , 'intersection_cmp' ) ) ; return $ intersections ; }
Determines what edges that intersect a horizontal line with the specified
y coordinate. For each intersecting edge the intersecting x coordinate is
returned.

@param array $edges Array of edges in the current scanline.
@param int $y Y coordinate of the current scanline.
@return array Array containing EdgeSuperSampleIntersection. Objects
are sorted ascending by x coordinate.
Determines what edges that intersect a horizontal line with the specified y coordinate . For each intersecting edge the intersecting x coordinate is returned .