Exemplo n.º 1
0
    void DrawNumSub(int index)
    {
        Texture2D tex = new Texture2D(24, 24);

        Color[] cols = new Color[576];

        float[] vals = ConvolutionLayer.ImagePreProcessSubSample(m_texLoad.GetPixels(index, 0)).toArray();

        for (int i = 0; i < 576; ++i)
        {
            cols [i] = new Color(vals [i], vals [i], vals [i]);
        }

        tex.SetPixels(cols);

        tex.Apply();

        tex.filterMode = FilterMode.Point;

        m_visualizer.GetComponent <SpriteRenderer> ().sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), new Vector2(0.5f, 0.5f));
    }