public ImplicitBrightContrast(ImplicitModuleBase source, Double brightness = 0.00, Double contrastThreshold = 0.00, Double contrastFactor = 1.00)
 {
     this.Source = source;
     this.Brightness = new ImplicitConstant(brightness);
     this.ContrastThreshold = new ImplicitConstant(contrastThreshold);
     this.ContrastFactor = new ImplicitConstant(contrastFactor);
 }
 public ImplicitAutoCorrect(ImplicitModuleBase source, Double low = -1.00, Double high = 1.00)
 {
     this.source = source;
     this.low = low;
     this.high = high;
     this.Calculate();
 }
Ejemplo n.º 3
0
 public ImplicitAutoCorrect(ImplicitModuleBase source, Double low = -1.00, Double high = 1.00)
 {
     this.source = source;
     this.low    = low;
     this.high   = high;
     this.Calculate();
 }
Ejemplo n.º 4
0
 public ImplicitBrightContrast(ImplicitModuleBase source, Double brightness = 0.00, Double contrastThreshold = 0.00, Double contrastFactor = 1.00)
 {
     this.Source            = source;
     this.Brightness        = new ImplicitConstant(brightness);
     this.ContrastThreshold = new ImplicitConstant(contrastThreshold);
     this.ContrastFactor    = new ImplicitConstant(contrastFactor);
 }
Ejemplo n.º 5
0
 public ImplicitRotateDomain(ImplicitModuleBase source, Double x, Double y, Double z, Double angle)
 {
     this.Source = source;
     this.X      = new ImplicitConstant(x);
     this.Y      = new ImplicitConstant(y);
     this.Z      = new ImplicitConstant(z);
     this.Angle  = new ImplicitConstant(angle);
 }
Ejemplo n.º 6
0
 public ImplicitSelect(ImplicitModuleBase source, Double low = 0.00, Double high = 0.00, Double falloff = 0.00, Double threshold = 0.00)
 {
     this.Source    = source;
     this.Low       = new ImplicitConstant(low);
     this.High      = new ImplicitConstant(high);
     this.Falloff   = new ImplicitConstant(falloff);
     this.Threshold = new ImplicitConstant(threshold);
 }
 public ImplicitRotateDomain(ImplicitModuleBase source, Double x, Double y, Double z, Double angle)
 {
     this.Source = source;
     this.X = new ImplicitConstant(x);
     this.Y = new ImplicitConstant(y);
     this.Z = new ImplicitConstant(z);
     this.Angle = new ImplicitConstant(angle);
 }
Ejemplo n.º 8
0
 public ImplicitRotateDomain(ImplicitModuleBase source, double x, double y, double z, double angle)
 {
     Source = source;
     X      = new ImplicitConstant(x);
     Y      = new ImplicitConstant(y);
     Z      = new ImplicitConstant(z);
     Angle  = new ImplicitConstant(angle);
 }
 public ImplicitSelect(ImplicitModuleBase source, Double low = 0.00, Double high = 0.00, Double falloff = 0.00, Double threshold = 0.00)
 {
     this.Source = source;
     this.Low = new ImplicitConstant(low);
     this.High = new ImplicitConstant(high);
     this.Falloff = new ImplicitConstant(falloff);
     this.Threshold = new ImplicitConstant(threshold);
 }
Ejemplo n.º 10
0
        public void SetSourceOverride(Int32 which, ImplicitModuleBase newSource)
        {
            if (which < 0 || which >= Noise.MAX_SOURCES)
            {
                return;
            }

            this.sources[which] = newSource;
        }
 public void SetScales(
     Double xScale = 1.00, Double yScale = 1.00, Double zScale = 1.00,
     Double wScale = 1.00, Double uScale = 1.00, Double vScale = 1.00)
 {
     this.XScale = new ImplicitConstant(xScale);
     this.YScale = new ImplicitConstant(yScale);
     this.ZScale = new ImplicitConstant(zScale);
     this.WScale = new ImplicitConstant(wScale);
     this.UScale = new ImplicitConstant(uScale);
     this.VScale = new ImplicitConstant(vScale);
 }
Ejemplo n.º 12
0
 public void SetScales(
     Double xScale = 1.00, Double yScale = 1.00, Double zScale = 1.00,
     Double wScale = 1.00, Double uScale = 1.00, Double vScale = 1.00)
 {
     this.XScale = new ImplicitConstant(xScale);
     this.YScale = new ImplicitConstant(yScale);
     this.ZScale = new ImplicitConstant(zScale);
     this.WScale = new ImplicitConstant(wScale);
     this.UScale = new ImplicitConstant(uScale);
     this.VScale = new ImplicitConstant(vScale);
 }
 public ImplicitScaleDomain(ImplicitModuleBase source, 
     Double xScale = 1.00, Double yScale = 1.00, Double zScale = 1.00,
     Double wScale = 1.00, Double uScale = 1.00, Double vScale = 1.00)
 {
     this.Source = source;
     this.XScale = new ImplicitConstant(xScale);
     this.YScale = new ImplicitConstant(yScale);
     this.ZScale = new ImplicitConstant(zScale);
     this.WScale = new ImplicitConstant(wScale);
     this.UScale = new ImplicitConstant(uScale);
     this.VScale = new ImplicitConstant(vScale);
 }
Ejemplo n.º 14
0
 public ImplicitScaleDomain(ImplicitModuleBase source,
                            Double xScale = 1.00, Double yScale = 1.00, Double zScale = 1.00,
                            Double wScale = 1.00, Double uScale = 1.00, Double vScale = 1.00)
 {
     this.Source = source;
     this.XScale = new ImplicitConstant(xScale);
     this.YScale = new ImplicitConstant(yScale);
     this.ZScale = new ImplicitConstant(zScale);
     this.WScale = new ImplicitConstant(wScale);
     this.UScale = new ImplicitConstant(uScale);
     this.VScale = new ImplicitConstant(vScale);
 }
Ejemplo n.º 15
0
 public ImplicitTranslateDomain(
     ImplicitModuleBase source,
     Double xAxis = 0.00, Double yAxis = 0.00, Double zAxis = 0.00,
     Double wAxis = 0.00, Double uAxis = 0.00, Double vAxis = 0.00)
 {
     this.Source = source;
     this.XAxis  = new ImplicitConstant(xAxis);
     this.YAxis  = new ImplicitConstant(yAxis);
     this.ZAxis  = new ImplicitConstant(zAxis);
     this.WAxis  = new ImplicitConstant(wAxis);
     this.UAxis  = new ImplicitConstant(uAxis);
     this.VAxis  = new ImplicitConstant(vAxis);
 }
 public ImplicitTranslateDomain(
     ImplicitModuleBase source,
     Double xAxis = 0.00, Double yAxis = 0.00, Double zAxis = 0.00,
     Double wAxis = 0.00, Double uAxis = 0.00, Double vAxis = 0.00)
 {
     this.Source = source;
     this.XAxis = new ImplicitConstant(xAxis);
     this.YAxis = new ImplicitConstant(yAxis);
     this.ZAxis = new ImplicitConstant(zAxis);
     this.WAxis = new ImplicitConstant(wAxis);
     this.UAxis = new ImplicitConstant(uAxis);
     this.VAxis = new ImplicitConstant(vAxis);
 }
 public ImplicitInvert(ImplicitModuleBase source)
 {
     this.Source = source;
 }
 public ImplicitGain(ImplicitModuleBase source, ImplicitModuleBase gain)
 {
     this.Source = source;
     this.Gain = gain;
 }
Ejemplo n.º 19
0
 public ImplicitPow(ImplicitModuleBase source, Double power)
 {
     this.Source = source;
     this.Power  = new ImplicitConstant(power);
 }
 public void RemoveSource(ImplicitModuleBase module)
 {
     this.sources.Remove(module);
 }
Ejemplo n.º 21
0
 public ImplicitBias(ImplicitModuleBase source, ImplicitModuleBase bias)
 {
     this.Source = source;
     this.Bias   = bias;
 }
Ejemplo n.º 22
0
 public ImplicitFloor(ImplicitModuleBase source) => Source = source;
Ejemplo n.º 23
0
 public ImplicitGain(ImplicitModuleBase source, ImplicitModuleBase gain)
 {
     this.Source = source;
     this.Gain   = gain;
 }
 public ImplicitBias(ImplicitModuleBase source, ImplicitModuleBase bias)
 {
     this.Source = source;
     this.Bias = bias;
 }
 public ImplicitCache(ImplicitModuleBase source)
 {
     this.Source = source;
 }
 public ImplicitLog(ImplicitModuleBase source) => Source = source;
Ejemplo n.º 27
0
 public ImplicitCos(ImplicitModuleBase source) => Source = source;
Ejemplo n.º 28
0
        public static void Map2D(MappingMode mappingMode, Double[,] array, ImplicitModuleBase module, MappingRanges ranges, Double z)
        {
            var width = array.GetLength(0);
            var height = array.GetLength(1);

            for (var x = 0; x < width; ++x)
            {
                for (var y = 0; y < height; ++y)
                {
                    var p = x / (Double)width;
                    var q = y / (Double)height;
                    Double r;
                    Double nx;
                    Double ny;
                    Double nz;
                    Double nw;
                    Double nu;
                    Double dx;
                    Double dy;
                    Double dz;
                    var val = 0.00;
                    switch (mappingMode)
                    {
                        case MappingMode.SeamlessNone:
                            nx = ranges.MapX0 + p * (ranges.MapX1 - ranges.MapX0);
                            ny = ranges.MapY0 + q * (ranges.MapY1 - ranges.MapY0);
                            nz = z;
                            val = module.Get(nx, ny, nz);
                            break;
                        case MappingMode.SeamlessX:
                            dx = ranges.LoopX1 - ranges.LoopX0;
                            dy = ranges.MapY1 - ranges.MapY0;
                            p = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                            nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                            ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                            nz = ranges.MapY0 + q * dy;
                            nw = z;
                            val = module.Get(nx, ny, nz, nw);
                            break;
                        case MappingMode.SeamlessY:
                            dx = ranges.MapX1 - ranges.MapX0;
                            dy = ranges.LoopY1 - ranges.LoopY0;
                            q = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                            nx = ranges.MapX0 + p * dx;
                            ny = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                            nz = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                            nw = z;
                            val = module.Get(nx, ny, nz, nw);
                            break;
                        case MappingMode.SeamlessZ:
                            dx = ranges.MapX1 - ranges.MapX0;
                            dy = ranges.MapY1 - ranges.MapY0;
                            dz = ranges.LoopZ1 - ranges.LoopZ0;
                            nx = ranges.MapX0 + p * dx;
                            ny = ranges.MapY0 + p * dy;
                            r = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                            var zval = r * (ranges.MapZ1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                            nz = ranges.LoopZ0 + Math.Cos(zval * PI2) * dz / PI2;
                            nw = ranges.LoopZ0 + Math.Sin(zval * PI2) * dz / PI2;
                            val = module.Get(nx, ny, nz, nw);
                            break;
                        case MappingMode.SeamlessXY:
                            dx = ranges.LoopX1 - ranges.LoopX0;
                            dy = ranges.LoopY1 - ranges.LoopY0;
                            p = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                            q = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                            nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                            ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                            nz = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                            nw = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                            nu = z;
                            val = module.Get(nx, ny, nz, nw, nu, 0);
                            break;
                        case MappingMode.SeamlessXZ:
                            dx = ranges.LoopX1 - ranges.LoopX0;
                            dy = ranges.MapY1 - ranges.MapY0;
                            dz = ranges.LoopZ1 - ranges.LoopZ0;
                            r = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                            var xzval = r * (ranges.MapX1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                            p = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                            nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                            ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                            nz = ranges.MapY0 + q * dy;
                            nw = ranges.LoopZ0 + Math.Cos(xzval * PI2) * dz / PI2;
                            nu = ranges.LoopZ0 + Math.Sin(xzval * PI2) * dz / PI2;
                            val = module.Get(nx, ny, nz, nw, nu, 0);
                            break;
                        case MappingMode.SeamlessYZ:
                            dx = ranges.MapX1 - ranges.MapX0;
                            dy = ranges.LoopY1 - ranges.LoopY0;
                            dz = ranges.LoopZ1 - ranges.LoopZ0;
                            r = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                            var yzval = r * (ranges.MapZ1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                            q = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                            nx = ranges.MapX0 + p * dx;
                            ny = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                            nz = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                            nw = ranges.LoopZ0 + Math.Cos(yzval * PI2) * dz / PI2;
                            nu = ranges.LoopZ0 + Math.Sin(yzval * PI2) * dz / PI2;
                            val = module.Get(nx, ny, nz, nw, nu, 0);
                            break;
                        case MappingMode.SeamlessXYZ:
                            dx = ranges.LoopX1 - ranges.LoopX0;
                            dy = ranges.LoopY1 - ranges.LoopY0;
                            dz = ranges.LoopZ1 - ranges.LoopZ0;
                            p = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                            q = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                            r = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                            var xyzval = r * (ranges.MapZ1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                            nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                            ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                            nz = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                            nw = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                            nu = ranges.LoopZ0 + Math.Cos(xyzval * PI2) * dz / PI2;
                            double nv = ranges.LoopZ0 + Math.Sin(xyzval * PI2) * dz / PI2;
                            val = module.Get(nx, ny, nz, nw, nu, nv);
                            break;
                    }
                    array[x, y] = val;
                }
            }
        }
Ejemplo n.º 29
0
        public static void Map2DNoZ(MappingMode mappingMode, Double[,] array, ImplicitModuleBase module, MappingRanges ranges)
        {
            var width = array.GetLength(0);
            var height = array.GetLength(1);

            for (var x = 0; x < width; ++x)
            {
                for (var y = 0; y < height; ++y)
                {
                    var p = x / (Double)width;
                    var q = y / (Double)height;
                    Double nx;
                    Double ny;
                    Double nz;
                    Double dx;
                    Double dy;
                    var val = 0.00;
                    switch (mappingMode)
                    {
                        case MappingMode.SeamlessNone:
                            nx = ranges.MapX0 + p * (ranges.MapX1 - ranges.MapX0);
                            ny = ranges.MapY0 + q * (ranges.MapY1 - ranges.MapY0);
                            val = module.Get(nx, ny);
                            break;
                        case MappingMode.SeamlessX:
                            dx = ranges.LoopX1 - ranges.LoopX0;
                            dy = ranges.MapY1 - ranges.MapY0;
                            p = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                            nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                            ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                            nz = ranges.MapY0 + q * dy;
                            val = module.Get(nx, ny, nz);
                            break;
                        case MappingMode.SeamlessY:
                            dx = ranges.MapX1 - ranges.MapX0;
                            dy = ranges.LoopY1 - ranges.LoopY0;
                            q = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                            nx = ranges.MapX0 + p * dx;
                            ny = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                            nz = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                            val = module.Get(nx, ny, nz);
                            break;

                        case MappingMode.SeamlessXY:
                            dx = ranges.LoopX1 - ranges.LoopX0;
                            dy = ranges.LoopY1 - ranges.LoopY0;
                            p = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                            q = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                            nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                            ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                            nz = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                            Double nw = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                            val = module.Get(nx, ny, nz, nw);
                            break;
                    }
                    array[x, y] = val;
                }
            }
        }
 public ImplicitTan(ImplicitModuleBase source) => Source = source;
Ejemplo n.º 31
0
 public ImplicitTiers(ImplicitModuleBase source, Int32 tiers = 0, Boolean smooth = true)
 {
     this.Source = source;
     this.Tiers  = tiers;
     this.Smooth = smooth;
 }
 public ImplicitGain(ImplicitModuleBase source, Double gain = 0.00)
 {
     this.Source = source;
     this.Gain = new ImplicitConstant(gain);
 }
Ejemplo n.º 33
0
 public ImplicitGain(ImplicitModuleBase source, Double gain = 0.00)
 {
     this.Source = source;
     this.Gain   = new ImplicitConstant(gain);
 }
Ejemplo n.º 34
0
 public void RemoveSource(ImplicitModuleBase module)
 {
     this.sources.Remove(module);
 }
 public ImplicitFloor(ImplicitModuleBase source)
 {
     this.Source = source;
 }
Ejemplo n.º 36
0
 public ImplicitConcurrentCache(ImplicitModuleBase source)
 {
     this.Source = source;
 }
Ejemplo n.º 37
0
 public ImplicitBias(ImplicitModuleBase source, Double bias)
 {
     this.Source = source;
     this.Bias   = new ImplicitConstant(bias);
 }
 public void AddSource(ImplicitModuleBase module)
 {
     this.sources.Add(module);
 }
 public ImplicitBias(ImplicitModuleBase source, Double bias)
 {
     this.Source = source;
     this.Bias = new ImplicitConstant(bias);
 }
 public ImplicitTiers(ImplicitModuleBase source, Int32 tiers = 0, Boolean smooth = true)
 {
     this.Source = source;
     this.Tiers = tiers;
     this.Smooth = smooth;
 }
Ejemplo n.º 41
0
 public ImplicitFloor(ImplicitModuleBase source)
 {
     this.Source = source;
 }
 public ImplicitPow(ImplicitModuleBase source, ImplicitModuleBase power)
 {
     this.Source = source;
     this.Power = power;
 }
Ejemplo n.º 43
0
 public void AddSource(ImplicitModuleBase module)
 {
     this.sources.Add(module);
 }
Ejemplo n.º 44
0
        public static void Map2DNoZ(MappingMode mappingMode, Double[,] array, ImplicitModuleBase module, MappingRanges ranges)
        {
            var width  = array.GetLength(0);
            var height = array.GetLength(1);

            for (var x = 0; x < width; ++x)
            {
                for (var y = 0; y < height; ++y)
                {
                    var    p = x / (Double)width;
                    var    q = y / (Double)height;
                    Double nx;
                    Double ny;
                    Double nz;
                    Double dx;
                    Double dy;
                    var    val = 0.00;
                    switch (mappingMode)
                    {
                    case MappingMode.SeamlessNone:
                        nx  = ranges.MapX0 + p * (ranges.MapX1 - ranges.MapX0);
                        ny  = ranges.MapY0 + q * (ranges.MapY1 - ranges.MapY0);
                        val = module.Get(nx, ny);
                        break;

                    case MappingMode.SeamlessX:
                        dx  = ranges.LoopX1 - ranges.LoopX0;
                        dy  = ranges.MapY1 - ranges.MapY0;
                        p   = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                        nx  = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                        ny  = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                        nz  = ranges.MapY0 + q * dy;
                        val = module.Get(nx, ny, nz);
                        break;

                    case MappingMode.SeamlessY:
                        dx  = ranges.MapX1 - ranges.MapX0;
                        dy  = ranges.LoopY1 - ranges.LoopY0;
                        q   = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                        nx  = ranges.MapX0 + p * dx;
                        ny  = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                        nz  = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                        val = module.Get(nx, ny, nz);
                        break;

                    case MappingMode.SeamlessXY:
                        dx = ranges.LoopX1 - ranges.LoopX0;
                        dy = ranges.LoopY1 - ranges.LoopY0;
                        p  = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                        q  = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                        nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                        ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                        nz = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                        Double nw = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                        val = module.Get(nx, ny, nz, nw);
                        break;
                    }
                    array[x, y] = val;
                }
            }
        }
 public ImplicitScaleOffset(ImplicitModuleBase source, Double scale = 1.00, Double offset = 0.00)
 {
     this.Source = source;
     this.Scale = new ImplicitConstant(scale);
     this.Offset = new ImplicitConstant(offset);
 }
Ejemplo n.º 46
0
        public void SetSourceOverride(Int32 which, ImplicitModuleBase newSource)
        {
            if (which < 0 || which >= Noise.MAX_SOURCES) return;

            this.sources[which] = newSource;
        }
 public ImplicitCeiling(ImplicitModuleBase source)
 {
     this.Source = source;
 }
 public ImplicitClamp(ImplicitModuleBase source, Double low = 0.00, Double high = 1.00)
 {
     this.Source = source;
     this.Low = new ImplicitConstant(low);
     this.High = new ImplicitConstant(high);
 }
Ejemplo n.º 49
0
 public ImplicitCos(ImplicitModuleBase source)
 {
     this.Source = source;
 }
 public ImplicitPow(ImplicitModuleBase source, ImplicitModuleBase power)
 {
     Source = source;
     Power  = power;
 }
 public ImplicitPow(ImplicitModuleBase source, Double power)
 {
     this.Source = source;
     this.Power = new ImplicitConstant(power);
 }
 public ImplicitPow(ImplicitModuleBase source, double power)
 {
     Source = source;
     Power  = new ImplicitConstant(power);
 }
Ejemplo n.º 53
0
        public static void Map2D(MappingMode mappingMode, Double[,] array, ImplicitModuleBase module, MappingRanges ranges, Double z)
        {
            var width  = array.GetLength(0);
            var height = array.GetLength(1);

            for (var x = 0; x < width; ++x)
            {
                for (var y = 0; y < height; ++y)
                {
                    var    p = x / (Double)width;
                    var    q = y / (Double)height;
                    Double r;
                    Double nx;
                    Double ny;
                    Double nz;
                    Double nw;
                    Double nu;
                    Double dx;
                    Double dy;
                    Double dz;
                    var    val = 0.00;
                    switch (mappingMode)
                    {
                    case MappingMode.SeamlessNone:
                        nx  = ranges.MapX0 + p * (ranges.MapX1 - ranges.MapX0);
                        ny  = ranges.MapY0 + q * (ranges.MapY1 - ranges.MapY0);
                        nz  = z;
                        val = module.Get(nx, ny, nz);
                        break;

                    case MappingMode.SeamlessX:
                        dx  = ranges.LoopX1 - ranges.LoopX0;
                        dy  = ranges.MapY1 - ranges.MapY0;
                        p   = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                        nx  = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                        ny  = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                        nz  = ranges.MapY0 + q * dy;
                        nw  = z;
                        val = module.Get(nx, ny, nz, nw);
                        break;

                    case MappingMode.SeamlessY:
                        dx  = ranges.MapX1 - ranges.MapX0;
                        dy  = ranges.LoopY1 - ranges.LoopY0;
                        q   = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                        nx  = ranges.MapX0 + p * dx;
                        ny  = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                        nz  = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                        nw  = z;
                        val = module.Get(nx, ny, nz, nw);
                        break;

                    case MappingMode.SeamlessZ:
                        dx = ranges.MapX1 - ranges.MapX0;
                        dy = ranges.MapY1 - ranges.MapY0;
                        dz = ranges.LoopZ1 - ranges.LoopZ0;
                        nx = ranges.MapX0 + p * dx;
                        ny = ranges.MapY0 + p * dy;
                        r  = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                        var zval = r * (ranges.MapZ1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                        nz  = ranges.LoopZ0 + Math.Cos(zval * PI2) * dz / PI2;
                        nw  = ranges.LoopZ0 + Math.Sin(zval * PI2) * dz / PI2;
                        val = module.Get(nx, ny, nz, nw);
                        break;

                    case MappingMode.SeamlessXY:
                        dx  = ranges.LoopX1 - ranges.LoopX0;
                        dy  = ranges.LoopY1 - ranges.LoopY0;
                        p   = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                        q   = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                        nx  = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                        ny  = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                        nz  = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                        nw  = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                        nu  = z;
                        val = module.Get(nx, ny, nz, nw, nu, 0);
                        break;

                    case MappingMode.SeamlessXZ:
                        dx = ranges.LoopX1 - ranges.LoopX0;
                        dy = ranges.MapY1 - ranges.MapY0;
                        dz = ranges.LoopZ1 - ranges.LoopZ0;
                        r  = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                        var xzval = r * (ranges.MapX1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                        p   = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                        nx  = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                        ny  = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                        nz  = ranges.MapY0 + q * dy;
                        nw  = ranges.LoopZ0 + Math.Cos(xzval * PI2) * dz / PI2;
                        nu  = ranges.LoopZ0 + Math.Sin(xzval * PI2) * dz / PI2;
                        val = module.Get(nx, ny, nz, nw, nu, 0);
                        break;

                    case MappingMode.SeamlessYZ:
                        dx = ranges.MapX1 - ranges.MapX0;
                        dy = ranges.LoopY1 - ranges.LoopY0;
                        dz = ranges.LoopZ1 - ranges.LoopZ0;
                        r  = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                        var yzval = r * (ranges.MapZ1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                        q   = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                        nx  = ranges.MapX0 + p * dx;
                        ny  = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                        nz  = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                        nw  = ranges.LoopZ0 + Math.Cos(yzval * PI2) * dz / PI2;
                        nu  = ranges.LoopZ0 + Math.Sin(yzval * PI2) * dz / PI2;
                        val = module.Get(nx, ny, nz, nw, nu, 0);
                        break;

                    case MappingMode.SeamlessXYZ:
                        dx = ranges.LoopX1 - ranges.LoopX0;
                        dy = ranges.LoopY1 - ranges.LoopY0;
                        dz = ranges.LoopZ1 - ranges.LoopZ0;
                        p  = p * (ranges.MapX1 - ranges.MapX0) / (ranges.LoopX1 - ranges.LoopX0);
                        q  = q * (ranges.MapY1 - ranges.MapY0) / (ranges.LoopY1 - ranges.LoopY0);
                        r  = (z - ranges.MapZ0) / (ranges.MapZ1 - ranges.MapZ0);
                        var xyzval = r * (ranges.MapZ1 - ranges.MapZ0) / (ranges.LoopZ1 - ranges.LoopZ0);
                        nx = ranges.LoopX0 + Math.Cos(p * PI2) * dx / PI2;
                        ny = ranges.LoopX0 + Math.Sin(p * PI2) * dx / PI2;
                        nz = ranges.LoopY0 + Math.Cos(q * PI2) * dy / PI2;
                        nw = ranges.LoopY0 + Math.Sin(q * PI2) * dy / PI2;
                        nu = ranges.LoopZ0 + Math.Cos(xyzval * PI2) * dz / PI2;
                        double nv = ranges.LoopZ0 + Math.Sin(xyzval * PI2) * dz / PI2;
                        val = module.Get(nx, ny, nz, nw, nu, nv);
                        break;
                    }
                    array[x, y] = val;
                }
            }
        }
 public ImplicitCeiling(ImplicitModuleBase source) => Source = source;
 public ImplicitLog(ImplicitModuleBase source)
 {
     this.Source = source;
 }
Ejemplo n.º 56
0
 public ImplicitClamp(ImplicitModuleBase source, Double low = 0.00, Double high = 1.00)
 {
     this.Source = source;
     this.Low    = new ImplicitConstant(low);
     this.High   = new ImplicitConstant(high);
 }