This method applies the mask to the given candidate.
It first generates an affine transformation based on the provided parameters, and then applies this transformation to the local position of the candidate. The resulting position is used to sample each layer in the mask, and the maximum value of all layers is returned. If there are no mask layers, it returns 0.
ParameterscThe candidate to apply the mask to.
ReturnsThe maximum mask value for the given candidate.