コード例 #1
0
        public void ResizeToNearestPowerOfTwo(SamplingFilter filter, bool regenerateMipMaps)
        {
            int width  = Width;
            int height = Height;
            int depth  = Depth;

            width  = MemoryHelper.RoundToNearestPowerOfTwo(width);
            height = MemoryHelper.RoundToNearestPowerOfTwo(height);
            depth  = MemoryHelper.RoundToNearestPowerOfTwo(depth);

            Bind();

            SamplingFilter oldFilter = ILU.GetSamplingFilter();

            ILU.SetSamplingFilter(filter);
            ILU.Scale(width, height, depth);

            if (regenerateMipMaps)
            {
                Bind();
                ILU.BuildMipMaps();
            }

            ILU.SetSamplingFilter(oldFilter);
        }
コード例 #2
0
 public bool BuildMipMaps(Image image)
 {
     if (image == null || !image.IsValid)
     {
         return(false);
     }
     IL.BindImage(image.ImageID);
     return(ILU.BuildMipMaps());
 }
コード例 #3
0
        public void Resize(int width, int height, int depth, SamplingFilter filter, bool regenerateMipMaps)
        {
            width  = Math.Max(1, width);
            height = Math.Max(1, height);
            depth  = Math.Max(1, depth);
            this.Bind();
            SamplingFilter samplingFilter = ILU.GetSamplingFilter();

            ILU.SetSamplingFilter(filter);
            ILU.Scale(width, height, depth);
            if (regenerateMipMaps)
            {
                this.Bind();
                ILU.BuildMipMaps();
            }
            ILU.SetSamplingFilter(samplingFilter);
        }
コード例 #4
0
        public void ResizeToNearestPowerOfTwo(SamplingFilter filter, bool regenerateMipMaps)
        {
            int width              = this.Width;
            int height             = this.Height;
            int depth              = this.Depth;
            int nearestPowerOfTwo1 = MemoryHelper.RoundToNearestPowerOfTwo(width);
            int nearestPowerOfTwo2 = MemoryHelper.RoundToNearestPowerOfTwo(height);
            int nearestPowerOfTwo3 = MemoryHelper.RoundToNearestPowerOfTwo(depth);

            this.Bind();
            SamplingFilter samplingFilter = ILU.GetSamplingFilter();

            ILU.SetSamplingFilter(filter);
            ILU.Scale(nearestPowerOfTwo1, nearestPowerOfTwo2, nearestPowerOfTwo3);
            if (regenerateMipMaps)
            {
                this.Bind();
                ILU.BuildMipMaps();
            }
            ILU.SetSamplingFilter(samplingFilter);
        }