Пример #1
0
        private void GenerateStippling(object obj)
        {
            generateStipplingParams_t param = (generateStipplingParams_t)obj;

            if (param.wangTilesPath.Length > 0)
            {
                // Stipple using Wang Tiles

                WangTileSet wts        = WangTileSet.FromFile(param.wangTilesPath);
                int         tonalRange = (int)Math.Pow(10, (int)(param.toneScaleBias * 6)) + 10000; // this is merely a heuristic trying to produce sensible values for the tonalRange variable from a [0,1] source range
                WTStipple   stipple    = new WTStipple(param.source, wts, tonalRange, param.result);
            }
            else
            {
                // Stipple using Adaptive Incremental algorithm
                if (AIS.OnAISDebugStep == null)
                {
                    AIS.OnAISDebugStep += OnAISDebugStep;
                }
                int K = (int)((1.0f - param.toneScaleBias) * 2048 + 64); // this is merely a heuristic trying to produce sensible values for the K variable from a [0,1] source range
                AIS.Stipple(param.source, K, param.result);
            }
            finishedStippling.Set();
        }
Пример #2
0
        private void GenerateStippling( object obj )
        {
            generateStipplingParams_t param = (generateStipplingParams_t)obj;
            if (param.wangTilesPath.Length > 0)
            {
                // Stipple using Wang Tiles

                WangTileSet wts = WangTileSet.FromFile(param.wangTilesPath);
                int tonalRange = (int)Math.Pow(10, (int)(param.toneScaleBias * 6)) + 10000; // this is merely a heuristic trying to produce sensible values for the tonalRange variable from a [0,1] source range
                WTStipple stipple = new WTStipple(param.source, wts, tonalRange, param.result);
            }
            else
            {
                // Stipple using Adaptive Incremental algorithm
                if (AIS.OnAISDebugStep == null) AIS.OnAISDebugStep += OnAISDebugStep;
                int K = (int)((1.0f - param.toneScaleBias) * 2048 + 64); // this is merely a heuristic trying to produce sensible values for the K variable from a [0,1] source range
                AIS.Stipple(param.source, K, param.result);
            }
            finishedStippling.Set();
        }