(imageData)
| 742 | } |
| 743 | |
| 744 | const grayscale = function (imageData) { |
| 745 | const d = imageData.data |
| 746 | for (let i = 0, end = d.length; i <= end; i += 4) { |
| 747 | const r = d[i] |
| 748 | const g = d[i + 1] |
| 749 | const b = d[i + 2] |
| 750 | const v = (0.2126 * r) + (0.7152 * g) + (0.0722 * b) |
| 751 | d[i] = (d[i + 1] = (d[i + 2] = v)) |
| 752 | } |
| 753 | return imageData |
| 754 | } |
| 755 | |
| 756 | // Deep compares l with r, with the exception that undefined values are considered equal to missing values |
| 757 | // Very practical for comparing Mongoose documents where undefined is not allowed, instead fields get deleted |
nothing calls this directly
no outgoing calls
no test coverage detected