public LocalResourceLoader(IResourceProvider provider, string rootPath, string resourcePath, IRawConverter <TResource> converter, Action <string> logAction) : base(provider, resourcePath) { RootPath = rootPath; this.logAction = logAction; this.converter = converter; }
public PhotoProcessor(PhotoPathHelper pathHelper, IPhotoOptimizer photoOptimizer, IRawConverter rawConverter, IExifReader exifReader, IQualitySearcher qualitySearcher, ProcessingTarget sourceTarget, ProcessingTarget printTarget, ProcessingTarget xsTarget, ProcessingTarget smTarget, ProcessingTarget mdTarget, ProcessingTarget lgTarget, bool quiet) { _quiet = quiet; _pathHelper = pathHelper; _optimizer = photoOptimizer; _rawConverter = rawConverter; _exifReader = exifReader; _qualitySearcher = qualitySearcher; SourceTarget = sourceTarget; PrintTarget = printTarget; XsTarget = xsTarget; SmTarget = smTarget; MdTarget = mdTarget; LgTarget = lgTarget; }
/// <summary> /// Adds a resource type converter. /// </summary> public void AddConverter <T> (IRawConverter <T> converter) { if (converters.ContainsKey(typeof(T))) { return; } converters.Add(typeof(T), converter); }
public LocalResourceLoader(string rootPath, Resource <TResource> resource, IRawConverter <TResource> converter, Action <string> logAction) { RootPath = rootPath; Resource = resource; this.logAction = logAction; this.converter = converter; }
/// <summary> /// Adds a resource type converter. /// </summary> public void AddConverter <T> (IRawConverter <T> converter) { if (converters.ContainsKey(typeof(T))) { return; } converters.Add(typeof(T), converter); LogMessage($"Converter '{typeof(T).Name}' added."); }
public RAWExposureData( IRawConverter rawConverter, byte[] rawBytes, string rawType, int bitDepth, ImageMetaData metaData) : base(bitDepth, metaData) { this.rawConverter = rawConverter; this.rawBytes = rawBytes; this.rawType = rawType; }
public GoogleDriveResourceLoader(IResourceProvider provider, string rootPath, string resourcePath, IRawConverter <TResource> converter, Action <string> logAction) : base(provider, resourcePath) { RootPath = rootPath; useNativeRequests = nativeRequestTypes.Contains(typeof(TResource)); this.logAction = logAction; // MP3 is not supported in native requests on the standalone platforms. Fallback to raw converters. #if UNITY_STANDALONE || UNITY_EDITOR foreach (var r in converter.Representations) { if (WebUtils.EvaluateAudioTypeFromMime(r.MimeType) == AudioType.MPEG) { useNativeRequests = false; } } #endif this.converter = converter; }
public static List <string> LocateResources(string rootPath, string resourcesPath, IRawConverter <TResource> converter) { var locatedResources = new List <string>(); // 1. Resolving parent folder. var folderPath = Application.dataPath; if (!string.IsNullOrEmpty(rootPath) && !string.IsNullOrEmpty(resourcesPath)) { folderPath += string.Concat('/', rootPath, '/', resourcesPath); } else if (string.IsNullOrEmpty(rootPath)) { folderPath += string.Concat('/', resourcesPath); } else { folderPath += string.Concat('/', rootPath); } var parendFolder = new DirectoryInfo(folderPath); if (!parendFolder.Exists) { return(locatedResources); } // 2. Searching for the files in the folder. var results = new Dictionary <RawDataRepresentation, List <FileInfo> >(); foreach (var representation in converter.Representations.DistinctBy(r => r.Extension)) { var files = parendFolder.GetFiles(string.Concat("*", representation.Extension)).ToList(); if (files != null && files.Count > 0) { results.Add(representation, files); } } // 3. Create resources using located files. foreach (var result in results) { foreach (var file in result.Value) { var fileName = string.IsNullOrEmpty(result.Key.Extension) ? file.Name : file.Name.GetBeforeLast("."); var filePath = string.IsNullOrEmpty(resourcesPath) ? fileName : string.Concat(resourcesPath, '/', fileName); locatedResources.Add(filePath); } } return(locatedResources); }
public LocalResourceLocator(IResourceProvider provider, string rootPath, string resourcesPath, IRawConverter <TResource> converter) : base(provider, resourcesPath) { RootPath = rootPath; this.converter = converter; }
public LocalResourceLocator(string rootPath, string resourcesPath, IRawConverter <TResource> converter) { RootPath = rootPath; ResourcesPath = resourcesPath; this.converter = converter; }
public FastReviewPhotoProcessor(PhotoPathHelper pathHelper, IRawConverter rawConverter) { _pathHelper = pathHelper; _rawConverter = rawConverter; }