示例#1
0
        public void GetChannels_DoesClamp()
        {
            int width    = 2;
            int bitDepth = 32;

            Texture1D tex = CreateXFilledTexture(width, bitDepth, TEXTURE_WRAP.CLAMP);

            float[] tmp = new float[2];

            tex.GetChannels(-1, tmp);
            Assert.AreEqual(0, tmp[0]);

            tex.GetChannels(2, tmp);
            Assert.AreEqual(1, tmp[0]);
        }
示例#2
0
        public void GetChannels()
        {
            int width    = 65;
            int channels = 3;
            int bitDepth = 32;

            Texture1D tex = CreateIndexFilledTexture(width, channels, bitDepth);

            float[] tmp = new float[channels];

            for (int x = 0; x < width; x++)
            {
                tex.GetChannels(x, tmp);

                for (int c = 0; c < channels; c++)
                {
                    int idx = (x * channels) + c;
                    Assert.AreEqual(idx, tmp[c]);
                }
            }
        }