public void Request(int width, int height, INumberSampler sampler, IColorSampler colorSampler = null)
 {
     _numberSampler = sampler;
     _samplerColor  = colorSampler;
     _values        = new float[width, height];
     Init(width, height);
 }
Exemplo n.º 2
0
    public static Color[] ToColorMap(float[,] values, IColorSampler colorSampler = null)
    {
        int width  = values.GetLength(0);
        int height = values.GetLength(1);

        Color[] colorMap = new Color[width * height];
        for (int y = 0; y < height; y++)
        {
            for (int x = 0; x < width; x++)
            {
                Color c;
                if (colorSampler == null)
                {
                    c = GetMapValueColor(values[x, y]);
                }
                else
                {
                    c = colorSampler.GetColor(null, (values[x, y] + 1f) / 2f);
                }
                colorMap[y * width + x] = c;
            }
        }
        return(colorMap);
    }
 public void Request(int width, int height, List <UnityEngine.Vector3> positions)
 {
     _positions    = positions;
     _samplerColor = new Vector3DisplayColorSampler();
     Init(width, height);
 }
Exemplo n.º 4
0
 public DefaultParticleInfoProvider(IColorSampler sampler, Rect viewport, float step)
 {
     _sampler  = sampler ?? throw new ArgumentNullException(nameof(sampler));
     _viewport = viewport;
     _step     = math.clamp(step, 0, 1e2f);
 }
 public void StartTextureUpdateJob(int width, int height, INumberSampler numberSampler, IColorSampler samplerColor)
 {
     InitJob(width, height);
     _job.Request(width, height, numberSampler, samplerColor);
     _job.Start();
 }