public PrebuiltGammaTable(IGammaFunction gamma_function) { for (int i = ScanlineRasterizer.AA_SCALE - 1; i >= 0; --i) { _gammaLut[i] = AggMathRound.uround( gamma_function.GetGamma((float)(i) / ScanlineRasterizer.AA_MASK) * ScanlineRasterizer.AA_MASK); } }
public static Color Make(double r_, double g_, double b_) { return(new Color( ((byte)AggMathRound.uround(CO.BASE_MASK)), ((byte)AggMathRound.uround(r_ * CO.BASE_MASK)), ((byte)AggMathRound.uround(g_ * CO.BASE_MASK)), ((byte)AggMathRound.uround(b_ * CO.BASE_MASK)))); }
public static Color Make(float r_, float g_, float b_, float a_) { return(new Color( ((byte)AggMathRound.uround_f(a_ * CO.BASE_MASK)), ((byte)AggMathRound.uround_f(r_ * CO.BASE_MASK)), ((byte)AggMathRound.uround_f(g_ * CO.BASE_MASK)), ((byte)AggMathRound.uround_f(b_ * CO.BASE_MASK)) )); }
//--------------------------------- //from vector clipper static int upscale(double v) => AggMathRound.iround(v * poly_subpix.SCALE);
static int MulDiv(int a, int b, int c) { return(AggMathRound.iround_f((float)a * (float)b / (float)c)); }