Exemplo n.º 1
0
        protected void ProjectLayerOntoSurface(IImageProcessingContext <Rgba32> context, Matrix <float> transformMatrix)
        {
            var matrix4x4 = new System.Numerics.Matrix4x4(
                transformMatrix[0, 0], transformMatrix[1, 0], 0, transformMatrix[2, 0],
                transformMatrix[0, 1], transformMatrix[1, 1], 0, transformMatrix[2, 1],
                0, 0, 1, 0,
                transformMatrix[0, 2], transformMatrix[1, 2], 0, transformMatrix[2, 2]
                );

            context.Transform(matrix4x4, KnownResamplers.Lanczos3);
            foreach (var mask in Masks)
            {
                context.Opacity(0, mask);
            }
        }