示例#1
0
        public List <string> NintendoWatermarkImages(IReadOnlyCollection <Attachment> attachments)
        {
            var images = AttachmentHelper.DownloadAttachments(attachments);

            foreach (var image in images)
            {
                NintendoWatermarkImage(image);
            }

            return(images);
        }
示例#2
0
        public List <string> SaturateImages(IReadOnlyCollection <Attachment> attachments, float amount)
        {
            var images = AttachmentHelper.DownloadAttachments(attachments);

            foreach (var image in images)
            {
                SaturateImage(image, amount);
            }

            return(images);
        }
示例#3
0
        public List <string> MorrowindImages(IReadOnlyCollection <Attachment> attachments)
        {
            var images = AttachmentHelper.DownloadAttachments(attachments);

            foreach (var image in images)
            {
                MorrowindImage(image);
            }

            return(images);
        }
示例#4
0
        public List <string> PixelateImages(IReadOnlyCollection <Attachment> attachments, int size)
        {
            var images = AttachmentHelper.DownloadAttachments(attachments);

            foreach (var image in images)
            {
                PixelateImage(image, size);
            }

            return(images);
        }
        public List <string> ExecutePythonFiles(IReadOnlyCollection <Attachment> attachments)
        {
            List <string> pythonFiles     = AttachmentHelper.DownloadAttachments(attachments);
            List <string> allScriptOutput = new List <string>();

            //execute each python script and add its output to the return list
            foreach (string pythonFile in pythonFiles)
            {
                try
                {
                    string        scriptContents = File.ReadAllText(pythonFile);
                    List <string> scriptOutput   = ExecutePythonString(scriptContents);
                    allScriptOutput.AddRange(scriptOutput);
                }
                finally
                {
                    File.Delete(pythonFile);
                }
            }

            return(allScriptOutput);
        }