+ [task#127424] add comments of findRegions function.

This commit is contained in:
wangzemei
2024-09-05 16:39:53 +08:00
committed by 刘刚
parent e963f96de7
commit ce8fc6d5ca
+11
View File
@@ -129,10 +129,21 @@ function getRegionInfo(pixels, visited, x, y, width, height)
return region;
}
/**
* 查找区域。
* Find regions.
*
* @param object pixels
* @param number width
* @param number height
* @access public
* @return array
*/
function findRegions(pixels, width, height)
{
const visited = {};
const regions = [];
for(let y = 0; y < height; y++)
{
for(let x = 0; x < width; x++)