Calculation Scheme Based on a Weighted Primitive: Application to Image Processing Transforms