public WorkflowRenderResult(FormulaRenderArguments formulaRenderArguments, FormulaRenderResult formulaRenderResult, FormulaBitmap bitmap, TimeSpan elapsedTime)
 {
     FormulaRenderArguments = formulaRenderArguments;
     FormulaRenderResult = formulaRenderResult;
     Bitmap = bitmap;
     ElapsedTime = elapsedTime;
 }
        public override void Update(FormulaRenderResult formulaRenderResult)
        {
            for (int i = 0; i < formulaRenderResult.Size.Square; i++)
                _pixelsBuffer[i] = Color.Argb(255, formulaRenderResult.RedChannel[i], formulaRenderResult.GreenChannel[i], formulaRenderResult.BlueChannel[i]);

            _bitmap.SetPixels(_pixelsBuffer, 0, Size.Width, 0, 0, Size.Width, Size.Height);
        }
        public override void Update(FormulaRenderResult formulaRenderResult)
        {
            for (int i = 0, j = 0; i < formulaRenderResult.RedChannel.Length; i++, j += 4)
            {
                _pixelsBuffer[j] = formulaRenderResult.BlueChannel[i];
                _pixelsBuffer[j + 1] = formulaRenderResult.GreenChannel[i];
                _pixelsBuffer[j + 2] = formulaRenderResult.RedChannel[i];
                _pixelsBuffer[j + 3] = 255;
            }

            _bitmap.WritePixels(_rect, _pixelsBuffer, _stride, 0);
        }
Exemple #4
0
        public static void Render(FormulaTree formulaTree, Range[] ranges, Size imageSize, ColorTransformation colorTransformation,
            bool reevaluateValues, int threadsCount, FormulaRenderResult formulaRenderResult)
        {
            using (ProgressReporter.CreateScope())
            {
                double evaluationSpan = 0;
                if (reevaluateValues)
                {
                    evaluationSpan = 0.93;
                    using (ProgressReporter.CreateScope(evaluationSpan))
                    {
                        EvaluateFormula(formulaTree, ranges, imageSize, threadsCount, formulaRenderResult.EvaluatedValuesBuffer);
                    }
                }

                using (ProgressReporter.CreateScope(1 - evaluationSpan))
                {
                    Render(colorTransformation, formulaRenderResult, threadsCount);
                }
            }
        }
 public FormulaRenderArgumentsGoodnessAnalyzer(int minVariablesCount)
 {
     MinVariablesCount = minVariablesCount;
     Size emptynessCheckImageSize = new Size(8, 8);
        _formulaRenderResult = new FormulaRenderResult(emptynessCheckImageSize);
 }
Exemple #6
0
 private static void Render(ColorTransformation colorTransformation, FormulaRenderResult formulaRenderResult, int threadsCount)
 {
     Stopwatch mapToRgbStopwatch = new Stopwatch();
     mapToRgbStopwatch.Start();
     ProgressReporter.CreateScope(3);
     MapToColorChannel(colorTransformation.RedChannelTransformation, formulaRenderResult.EvaluatedValuesBuffer, threadsCount, formulaRenderResult.ColorTranformedValuesBuffer, formulaRenderResult.RedChannel);
     ProgressReporter.Increase();
     MapToColorChannel(colorTransformation.GreenChannelTransformation, formulaRenderResult.EvaluatedValuesBuffer, threadsCount, formulaRenderResult.ColorTranformedValuesBuffer, formulaRenderResult.GreenChannel);
     ProgressReporter.Increase();
     MapToColorChannel(colorTransformation.BlueChannelTransformation, formulaRenderResult.EvaluatedValuesBuffer, threadsCount, formulaRenderResult.ColorTranformedValuesBuffer, formulaRenderResult.BlueChannel);
     ProgressReporter.Complete();
     mapToRgbStopwatch.Stop();
 }
Exemple #7
0
 public abstract void Update(FormulaRenderResult formulaRenderResult);