<commit_before>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace SamSeifert.CSCV
{
    public enum NoiseType
    {
        Gaussian,
        Uniform,

        [Description("Salt and Pepper")]
        SaltAndPepper
    };

    public static partial class SingleImage
    {
        public static ToolboxReturn Noise(Sect inpt, NoiseType nt, Single p, ref Sect outp)
        {
            if (inpt == null)
            {
                outp = null;
                return ToolboxReturn.NullInput;
            }
            else
            {
                Random r = new Random(Environment.TickCount);

                Action<Sect, SectArray> act = (Sect anon_inpt, SectArray anon_outp) =>
                {

                    var sz = anon_outp.getPrefferedSize();
                    int w = sz.Width;
                    int h = sz.Height;

                    switch (nt)
                    {
                        case NoiseType.Gaussian:
                            {
                                for (int y = 0; y < h; y++)
                                {
                                    for (int x = 0; x < w; x++)
                                    {
                                        anon_outp[y, x] = anon_inpt[y, x] + Utilities.Statistics.NextGaussian(p, r);
                                    }
                                }
                                break;
                            }
                        case NoiseType.Uniform:
                            {
                                for (int y = 0; y < h; y++)
                                {
                                    for (int x = 0; x < w; x++)
                                    {
                                        anon_outp[y, x] = anon_inpt[y, x] + Utilities.Statistics.NextGaussian(p, r);
                                    }
                                }
                                break;
                            }
                        case NoiseType.SaltAndPepper:
                            {
                                for (int y = 0; y < h; y++)<commit_msg>Random Uniform<commit_after>﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.ComponentModel;

namespace SamSeifert.CSCV
{
    public enum NoiseType
    {
        Gaussian,
        Uniform,

        [Description("Salt and Pepper")]
        SaltAndPepper
    };

    public static partial class SingleImage
    {
        public static ToolboxReturn Noise(Sect inpt, NoiseType nt, Single p, ref Sect outp)
        {
            if (inpt == null)
            {
                outp = null;
                return ToolboxReturn.NullInput;
            }
            else
            {
                Random r = new Random(Environment.TickCount);

                Action<Sect, SectArray> act = (Sect anon_inpt, SectArray anon_outp) =>
                {

                    var sz = anon_outp.getPrefferedSize();
                    int w = sz.Width;
                    int h = sz.Height;

                    switch (nt)
                    {
                        case NoiseType.Gaussian:
                            {
                                for (int y = 0; y < h; y++)
                                {
                                    for (int x = 0; x < w; x++)
                                    {
                                        anon_outp[y, x] = anon_inpt[y, x] + Utilities.Statistics.NextGaussian(r, p);
                                    }
                                }
                                break;
                            }
                        case NoiseType.Uniform:
                            {
                                for (int y = 0; y < h; y++)
                                {
                                    for (int x = 0; x < w; x++)
                                    {
                                        anon_outp[y, x] = anon_inpt[y, x] + Utilities.Statistics.NextGaussian(r, p);
                                    }
                                }
                                break;
                            }
                        case NoiseType.SaltAndPepper:
                            {
                                for (int y = 0; y < h; y++)
{'fraction_non_alphanumeric': 0.0745230078563412, 'fraction_numerical': 0.002244668911335578, 'mean_word_length': 0.7138461538461538, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 32, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3057307', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1019, 'n_words': 250}