├── .gitignore ├── CHANGELOG.md ├── CHANGELOG.md.meta ├── Dependencies.meta ├── Dependencies ├── SkiaSharp.meta └── SkiaSharp │ ├── SkiaSharp.dll │ ├── SkiaSharp.dll.meta │ ├── System.Buffers.dll │ ├── System.Buffers.dll.meta │ ├── System.Memory.dll │ ├── System.Memory.dll.meta │ ├── System.Runtime.CompilerServices.Unsafe.dll │ ├── System.Runtime.CompilerServices.Unsafe.dll.meta │ ├── android.meta │ ├── android │ ├── android-arm.meta │ ├── android-arm │ │ ├── native.meta │ │ └── native │ │ │ ├── libSkiaSharp.so │ │ │ └── libSkiaSharp.so.meta │ ├── android-arm64.meta │ ├── android-arm64 │ │ ├── native.meta │ │ └── native │ │ │ ├── libSkiaSharp.so │ │ │ └── libSkiaSharp.so.meta │ ├── android-x64.meta │ ├── android-x64 │ │ ├── native.meta │ │ └── native │ │ │ ├── libSkiaSharp.so │ │ │ └── libSkiaSharp.so.meta │ ├── android-x86.meta │ └── android-x86 │ │ ├── native.meta │ │ └── native │ │ ├── libSkiaSharp.so │ │ └── libSkiaSharp.so.meta │ ├── ios.meta │ ├── ios │ ├── native.meta │ └── native │ │ ├── libSkiaSharp.framework.meta │ │ └── libSkiaSharp.framework │ │ ├── Info.plist │ │ ├── Info.plist.meta │ │ ├── Modules.meta │ │ ├── Modules │ │ ├── module.modulemap │ │ └── module.modulemap.meta │ │ ├── _CodeSignature.meta │ │ ├── _CodeSignature │ │ ├── CodeResources │ │ └── CodeResources.meta │ │ ├── libSkiaSharp │ │ └── libSkiaSharp.meta │ ├── linux.meta │ ├── linux │ ├── linux-x64.meta │ └── linux-x64 │ │ ├── native.meta │ │ └── native │ │ ├── libSkiaSharp.so │ │ └── libSkiaSharp.so.meta │ ├── osx.meta │ ├── osx │ ├── native.meta │ └── native │ │ ├── libSkiaSharp.dylib │ │ └── libSkiaSharp.dylib.meta │ ├── win.meta │ └── win │ ├── win-x64.meta │ ├── win-x64 │ ├── native.meta │ └── native │ │ ├── libSkiaSharp.dll │ │ └── libSkiaSharp.dll.meta │ ├── win-x86.meta │ └── win-x86 │ ├── native.meta │ └── native │ ├── libSkiaSharp.dll │ └── libSkiaSharp.dll.meta ├── LICENCE.md ├── LICENCE.md.meta ├── README.md ├── README.md.meta ├── Runtime.meta ├── Runtime ├── Core.meta ├── Core │ ├── AsyncImage.cs │ ├── AsyncImage.cs.meta │ ├── ImageLoadSave.cs │ ├── ImageLoadSave.cs.meta │ ├── ImageProcess.cs │ ├── ImageProcess.cs.meta │ ├── ResizeQuality.cs │ ├── ResizeQuality.cs.meta │ ├── TextAlign.cs │ └── TextAlign.cs.meta ├── Helper.meta ├── Helper │ ├── MainThreadQueuer.cs │ ├── MainThreadQueuer.cs.meta │ ├── StaticCoroutine.cs │ ├── StaticCoroutine.cs.meta │ ├── UnityMainThread.cs │ └── UnityMainThread.cs.meta ├── SrejonKhan.AsyncImageLibrary.Runtime.asmdef └── SrejonKhan.AsyncImageLibrary.Runtime.asmdef.meta ├── package.json └── package.json.meta /.gitignore: -------------------------------------------------------------------------------- 1 | # Asset meta data should only be ignored when the corresponding asset is also ignored 2 | !/[Aa]ssets/**/*.meta 3 | 4 | # Uncomment this line if you wish to ignore the asset store tools plugin 5 | # /[Aa]ssets/AssetStoreTools* 6 | 7 | # Autogenerated Jetbrains Rider plugin 8 | [Aa]ssets/Plugins/Editor/JetBrains* 9 | 10 | # Visual Studio cache directory 11 | .vs/ 12 | 13 | # Gradle cache directory 14 | .gradle/ 15 | 16 | # Autogenerated VS/MD/Consulo solution and project files 17 | ExportedObj/ 18 | .consulo/ 19 | *.csproj 20 | *.unityproj 21 | *.sln 22 | *.suo 23 | *.tmp 24 | *.user 25 | *.userprefs 26 | *.pidb 27 | *.booproj 28 | *.svd 29 | *.pdb 30 | *.mdb 31 | *.opendb 32 | *.VC.db 33 | 34 | # Unity3D generated meta files 35 | *.pidb.meta 36 | *.pdb.meta 37 | *.mdb.meta 38 | 39 | # Unity3D generated file on crash reports 40 | sysinfo.txt 41 | 42 | # Builds 43 | *.apk 44 | *.unitypackage 45 | 46 | # Crashlytics generated file 47 | crashlytics-build.properties 48 | 49 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | ## [0.2.0] - 18-12-2023 2 | 3 | ### Added 4 | 5 | - OpenUPM registry. 6 | 7 | ### Changed 8 | 9 | - Bumped library version to 0.2.0. 10 | - Updated README with new information (versions). 11 | - Updated libSkiaSharp for Linux. 12 | 13 | ## [0.2.0-preview.1] - 16-08-2023 14 | 15 | Update SkiaSharp dependency 16 | 17 | ### Changed 18 | 19 | - Bump SkiaSharp dependency version to v2.88.3 20 | 21 | ## [0.1.0] - 04-09-2021 22 | 23 | Initially added AsyncImage loading, resize, draw text and SkiaSharp Library. 24 | 25 | ### Added 26 | 27 | - Async Image Load 28 | - Image Resize 29 | - Draw Text 30 | - SkiaSharp Library and dependencies add 31 | -------------------------------------------------------------------------------- /CHANGELOG.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8c2f3f17676e2347a937104a7f178b1 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Dependencies.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a198624f24f4ab843ab92b83465730c7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba6fbbd02602d31498cf93a65b995e7f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/SkiaSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/SkiaSharp.dll -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/SkiaSharp.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6a9c280102f98fb47b4d23bcdec0b942 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/System.Buffers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/System.Buffers.dll -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/System.Buffers.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5b70f67e69706064eba9d29eaab4f2d0 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/System.Memory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/System.Memory.dll -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/System.Memory.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 01ff54e476530ac4fa8a2775418689b5 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude WebGL: 0 24 | Exclude Win: 0 25 | Exclude Win64: 0 26 | Exclude iOS: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 1 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 1 50 | settings: 51 | CPU: AnyCPU 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 1 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | WebGL: WebGL 72 | second: 73 | enabled: 1 74 | settings: {} 75 | - first: 76 | Windows Store Apps: WindowsStoreApps 77 | second: 78 | enabled: 0 79 | settings: 80 | CPU: AnyCPU 81 | - first: 82 | iPhone: iOS 83 | second: 84 | enabled: 1 85 | settings: 86 | AddToEmbeddedBinaries: false 87 | CPU: AnyCPU 88 | CompileFlags: 89 | FrameworkDependencies: 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/System.Runtime.CompilerServices.Unsafe.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/System.Runtime.CompilerServices.Unsafe.dll -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/System.Runtime.CompilerServices.Unsafe.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b21f9bb58893c5745b4fcf4cf79a7f34 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3dd39c61ba2ba9242a16c6448be2151e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0c52d0d599e837b44b883dd32367f0c5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 676d845823065c2438c3233229a93a87 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm/native/libSkiaSharp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/android/android-arm/native/libSkiaSharp.so -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm/native/libSkiaSharp.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10ae5d6421693b64d8019e224e3c437e 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c528123d0d4aa4a488df8786daf993d8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm64/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e78df4d52017f643a3f0d67f42aee9b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm64/native/libSkiaSharp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/android/android-arm64/native/libSkiaSharp.so -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-arm64/native/libSkiaSharp.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eee6981213b5e714c916c9f2a12da95c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: ARM64 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43108c0b915d47d42aa736292666d801 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x64/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3379e9bd087894240a04f4271abdf645 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x64/native/libSkiaSharp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/android/android-x64/native/libSkiaSharp.so -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x64/native/libSkiaSharp.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5835f64c02a64a4f9a5984594eca4fa 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: X86_64 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ddc6352f662c3f243b5b8650e8fa257c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x86/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cab8e218c043db944a382c900b98abef 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x86/native/libSkiaSharp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/android/android-x86/native/libSkiaSharp.so -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/android/android-x86/native/libSkiaSharp.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e63098e46c8b4247988369b98f69f91 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: X86 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d5f5fd8998eda784ca616b493fcbd296 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99d27dd9125ab704fbc747c388f98b93 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7574fc4b8ca3dcb41b105b91d86492c8 3 | folderAsset: yes 4 | PluginImporter: 5 | externalObjects: {} 6 | serializedVersion: 2 7 | iconMap: {} 8 | executionOrder: {} 9 | defineConstraints: [] 10 | isPreloaded: 0 11 | isOverridable: 1 12 | isExplicitlyReferenced: 0 13 | validateReferences: 1 14 | platformData: 15 | - first: 16 | : Any 17 | second: 18 | enabled: 0 19 | settings: 20 | Exclude Android: 1 21 | Exclude Editor: 1 22 | Exclude Linux64: 1 23 | Exclude OSXUniversal: 1 24 | Exclude WebGL: 1 25 | Exclude Win: 1 26 | Exclude Win64: 1 27 | Exclude iOS: 0 28 | - first: 29 | Android: Android 30 | second: 31 | enabled: 0 32 | settings: 33 | CPU: ARMv7 34 | - first: 35 | Any: 36 | second: 37 | enabled: 0 38 | settings: {} 39 | - first: 40 | Editor: Editor 41 | second: 42 | enabled: 0 43 | settings: 44 | CPU: AnyCPU 45 | DefaultValueInitialized: true 46 | OS: AnyOS 47 | - first: 48 | Standalone: Linux64 49 | second: 50 | enabled: 0 51 | settings: 52 | CPU: None 53 | - first: 54 | Standalone: OSXUniversal 55 | second: 56 | enabled: 0 57 | settings: 58 | CPU: None 59 | - first: 60 | Standalone: Win 61 | second: 62 | enabled: 0 63 | settings: 64 | CPU: None 65 | - first: 66 | Standalone: Win64 67 | second: 68 | enabled: 0 69 | settings: 70 | CPU: None 71 | - first: 72 | iPhone: iOS 73 | second: 74 | enabled: 1 75 | settings: 76 | AddToEmbeddedBinaries: false 77 | CPU: AnyCPU 78 | CompileFlags: 79 | FrameworkDependencies: 80 | userData: 81 | assetBundleName: 82 | assetBundleVariant: 83 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/Info.plist: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/Info.plist -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 11f2823651a19bf4880383694656197d 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/Modules.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 451e458469ec262478bc77502ba96644 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/Modules/module.modulemap: -------------------------------------------------------------------------------- 1 | framework module libSkiaSharp { 2 | umbrella header "libSkiaSharp.h" 3 | 4 | export * 5 | module * { export * } 6 | } 7 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/Modules/module.modulemap.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2d14f951edd1ad94f948bb4afcc6a6c0 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/_CodeSignature.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 36da26a0e24d3674cbcf9168734d6df6 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/_CodeSignature/CodeResources: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | files 6 | 7 | Info.plist 8 | 9 | Fm2Odmd9OJOzlSoGPvcGtjk1CFY= 10 | 11 | Modules/module.modulemap 12 | 13 | FfJ+5JYQrrllDZ0Bu9J8D2uWSB8= 14 | 15 | 16 | files2 17 | 18 | Modules/module.modulemap 19 | 20 | hash 21 | 22 | FfJ+5JYQrrllDZ0Bu9J8D2uWSB8= 23 | 24 | hash2 25 | 26 | oSPtbh7fPzy0xccYYuaImKJk9tNE94qayVliW9uG6RE= 27 | 28 | 29 | 30 | rules 31 | 32 | ^.* 33 | 34 | ^.*\.lproj/ 35 | 36 | optional 37 | 38 | weight 39 | 1000 40 | 41 | ^.*\.lproj/locversion.plist$ 42 | 43 | omit 44 | 45 | weight 46 | 1100 47 | 48 | ^Base\.lproj/ 49 | 50 | weight 51 | 1010 52 | 53 | ^version.plist$ 54 | 55 | 56 | rules2 57 | 58 | .*\.dSYM($|/) 59 | 60 | weight 61 | 11 62 | 63 | ^(.*/)?\.DS_Store$ 64 | 65 | omit 66 | 67 | weight 68 | 2000 69 | 70 | ^.* 71 | 72 | ^.*\.lproj/ 73 | 74 | optional 75 | 76 | weight 77 | 1000 78 | 79 | ^.*\.lproj/locversion.plist$ 80 | 81 | omit 82 | 83 | weight 84 | 1100 85 | 86 | ^Base\.lproj/ 87 | 88 | weight 89 | 1010 90 | 91 | ^Info\.plist$ 92 | 93 | omit 94 | 95 | weight 96 | 20 97 | 98 | ^PkgInfo$ 99 | 100 | omit 101 | 102 | weight 103 | 20 104 | 105 | ^embedded\.provisionprofile$ 106 | 107 | weight 108 | 20 109 | 110 | ^version\.plist$ 111 | 112 | weight 113 | 20 114 | 115 | 116 | 117 | 118 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/_CodeSignature/CodeResources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c76b482418628594e94ce34e48eefafd 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/libSkiaSharp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/libSkiaSharp -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/ios/native/libSkiaSharp.framework/libSkiaSharp.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 96b77a6b0e401b548b459c80ac46eea4 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/linux.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d9beb02071a751b41bdb63d1057c1f5d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/linux/linux-x64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e26c7311763a024eb3761c5fc7e2f3c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/linux/linux-x64/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aafb67ad81b944a46aee15276e7828f1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/linux/linux-x64/native/libSkiaSharp.so: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/linux/linux-x64/native/libSkiaSharp.so -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/linux/linux-x64/native/libSkiaSharp.so.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a4f731734b4549346897a3814ad08e71 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 1 23 | Exclude WebGL: 1 24 | Exclude Win: 0 25 | Exclude Win64: 0 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: x86_64 44 | DefaultValueInitialized: true 45 | OS: Linux 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 1 50 | settings: 51 | CPU: AnyCPU 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/osx.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1d7507144d9d95e4581c9a0ff68853ee 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/osx/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4af8a1d7f8194064fb8cfbf9b8bcae71 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/osx/native/libSkiaSharp.dylib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/osx/native/libSkiaSharp.dylib -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/osx/native/libSkiaSharp.dylib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1832f2199c551944b215ab13aec5769 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 1 22 | Exclude OSXUniversal: 0 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: OSX 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 1 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 133a6d592c2c15948a4ebac6bd4e9f59 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd9b71c26faa0994fa637e6064233669 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x64/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7265d6d451483c74a972bb103b7b2d4a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x64/native/libSkiaSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/win/win-x64/native/libSkiaSharp.dll -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x64/native/libSkiaSharp.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24e40ecd54edf6d4cb699ef4ef3968d5 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude WebGL: 1 24 | Exclude Win: 1 25 | Exclude Win64: 0 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: x86_64 44 | DefaultValueInitialized: true 45 | OS: Windows 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 1 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 1 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 0 62 | settings: 63 | CPU: None 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f89f55944e0c1eb4ba89a8fc310e0940 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x86/native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cd1e4a98fed72e408ad6aedd3155fba 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x86/native/libSkiaSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SrejonKhan/AsyncImageLibrary/9bd5946d2853db9626776bb76f3a5d0274f4a1a7/Dependencies/SkiaSharp/win/win-x86/native/libSkiaSharp.dll -------------------------------------------------------------------------------- /Dependencies/SkiaSharp/win/win-x86/native/libSkiaSharp.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a0ab58a9d21767943b7130d209339dbc 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 1 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | : Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 1 20 | Exclude Editor: 0 21 | Exclude Linux64: 0 22 | Exclude OSXUniversal: 0 23 | Exclude WebGL: 1 24 | Exclude Win: 0 25 | Exclude Win64: 1 26 | Exclude iOS: 1 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 0 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 1 42 | settings: 43 | CPU: x86 44 | DefaultValueInitialized: true 45 | OS: Windows 46 | - first: 47 | Standalone: Linux64 48 | second: 49 | enabled: 1 50 | settings: 51 | CPU: None 52 | - first: 53 | Standalone: OSXUniversal 54 | second: 55 | enabled: 1 56 | settings: 57 | CPU: None 58 | - first: 59 | Standalone: Win 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Win64 66 | second: 67 | enabled: 0 68 | settings: 69 | CPU: None 70 | - first: 71 | iPhone: iOS 72 | second: 73 | enabled: 0 74 | settings: 75 | AddToEmbeddedBinaries: false 76 | CPU: AnyCPU 77 | CompileFlags: 78 | FrameworkDependencies: 79 | userData: 80 | assetBundleName: 81 | assetBundleVariant: 82 | -------------------------------------------------------------------------------- /LICENCE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2021 Srejon Khan 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 4 | 5 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 6 | 7 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /LICENCE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 542ec3d972e49794ab0c3d13a6c73b7a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Async Image Library 2 | 3 | Load Image asynchronously from external environment without blocking Main-Thread. And powerful SkiaSharp Library implemented and wrapped for better and convenient usage. 4 | 5 | - SkiaSharp Version - 2.88.3 6 | - Unity Version - 2019.3.x or newer 7 | - Build Support (Tested Only) - 8 | - [x] Windows (IL2CPP) 9 | - [x] Windows (Mono) 10 | - [x] Android (IL2CPP) 11 | - [x] Android (Mono) 12 | - [x] iOS (IL2CPP) 13 | - [ ] Mac 14 | - [x] Linux Distribution (Ubuntu tested) 15 | - [Sample Project](https://github.com/SrejonKhan/AsyncImageLibrary-Sample) 16 | 17 | # Installation 18 | 19 | ## Using Git 20 | 21 | Open Package Manager in Unity and Click on Plus Icon -> Add package from git URL, paste following link 22 | 23 | ```console 24 | https://github.com/SrejonKhan/AsyncImageLibrary.git 25 | ``` 26 | 27 | and click Add. 28 | 29 | ## Using OpenUPM 30 | 31 | This package is available at [OpenUPM](https://openupm.com/packages/com.srejonkhan.asyncimagelibrary/). To install with `openupm-cli` - 32 | 33 | ```console 34 | openupm add com.srejonkhan.asyncimagelibrary 35 | ``` 36 | 37 | Other methods (Asset Store, Release Page) will be added later after a stable release. 38 | 39 | # Manual 40 | 41 | To use this library, `AsyncImageLibrary` namespace should be defined, like this `using AsyncImageLibrary;` 42 | 43 | ## AsyncImage (Class) 44 | 45 | AsyncImage specifies an Image. It provides methods and properties for Loading, Saving and Processing an Image. 46 | 47 | #### Constructor 48 | 49 | | Name | Details | 50 | | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- | 51 | | AsyncImage() | Default Constructor. Every property sets to default value. Path or Buffer should be set before loading. | 52 | | AsyncImage(string path) | For creating Bitmap from Local File Path. | 53 | | AsyncImage(string path, bool shouldGenerateTexture) | For creating Bitmap from Local File Path and define if to Generate Texture upon Loading Bitmap. | 54 | | AsyncImage(string path, bool shouldGenerateTexture, bool shouldQueueTextureProcess) | For creating Bitmap from Local File Path and define if to Generate Texture when Bitmap is loaded and Queue Texture Generation Process in Main Thread. | 55 | | AsyncImage(byte[] buffer) | For creating Bitmap from Buffer. Suitable for creating Bitmap from Remote Image Buffer. | 56 | | AsyncImage(byte[] buffer, bool shouldGenerateTexture) | For creating Bitmap from Buffer. Define if to generate Texture when Bitmap is loaded. | 57 | | AsyncImage(byte[] buffer, bool shouldGenerateTexture, bool shouldQueueTextureProcess) | For creating Bitmap from Buffer. Define if to generate Texture when Bitmap is loaded and queue Texture Generation Process in Main Thread. | 58 | 59 | #### Properties 60 | 61 | | Name | Details | 62 | | ------------------------- | --------------------------------------------------------------------- | 63 | | Width\* | Width of Image | 64 | | Height\* | Height of Image | 65 | | Path | Local file path of Image | 66 | | IsPathValidated | If the assigned path is validated by calling `ValidatePath()` | 67 | | Bitmap\* | SKBitmap reference | 68 | | Texture\*\* | Texture2D of Image | 69 | | ShouldGenerateTexture | Generate Texture along with Bitmap, if true. | 70 | | ShouldQueueTextureProcess | Queue Texture Generation Process in MainThreadQueue to process later. | 71 | 72 | \*Available when Bitmap is Loaded. 73 | 74 | \*\*Available when Texture is generated. 75 | 76 | #### Methods 77 | 78 | | Name | Details | 79 | | ----------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | 80 | | ValidatePath() | Validate assigned Path of Image without loading it. | 81 | | Load() | Load Bitmap from given path. | 82 | | Load(Action cb) | Load Bitmap from given path and callback upon completion. | 83 | | GenerateTexture() | Generate Texture2D from Bitmap. If Bitmap is not loaded, **this will be queued for execute after Bitmaps load**. | 84 | | GenerateTexture(Action cb) | Generate Texture2D from Bitmap. Get queued when Bitmap is not loaded. Callback when texture is generated. (Same as `OnLoad` delegate) | 85 | | Save(string path, SKEncodedImageFormat format, int quality) | Save Image to specified format. | 86 | | Save(string path, SKEncodedImageFormat format, int quality, Action onComplete) | Save Image to specified format. | 87 | | GetEncodedBuffer(SKEncodedImageFormat format, int quality) | Get Encoded Byte Array of Bitmap | 88 | | Crop(Vector2 position, Vector2 targetDimension) | Crop Bitmap to specified size in specified rect position. | 89 | | Resize(int divideBy, ResizeQuality quality) | Resize to (Actual Dimension / divideBy). | 90 | | Resize(int divideBy, ResizeQuality quality, Action onComplete) | Resize to (Actual Dimension / divideBy). Callback when completed. | 91 | | Resize(Vector2 targetDimensions, ResizeQuality quality) | Resize to given dimension. | 92 | | Resize(Vector2 targetDimensions, ResizeQuality quality, Action onComplete) | Resize to given dimension. Callback when completed. | 93 | | DrawText(string text, Vector2 position, TextAlign textAlign, Color color, float textSize) | Draw Text on Bitmap. | 94 | | DrawText(string text, Vector2 position, TextAlign textAlign, Color color, float textSize, string fontFamilyName) | Draw Text on Bitmap. | 95 | | DrawText(string text, Vector2 position, TextAlign textAlign, Color color, float textSize, string fontFamilyName, Action onComplete) | Draw Text on Bitmap. | 96 | | DrawText(string text, Vector2 position, SKPaint paint) | Draw Text on Bitmap, proving SKPaint for styling. | 97 | | DrawText(string text, Vector2 position, SKPaint paint, Action onComplete) | Draw Text on Bitmap, proving SKPaint for styling. Callback upon completion. | 98 | 99 | #### Delegates 100 | 101 | | Name | Details | 102 | | ---------------- | -------------------------------------------------------------- | 103 | | OnLoad | Callback when Bitmap is loaded. | 104 | | OnSave | Callback when Bitmap is saved. | 105 | | OnTextureLoad | Callback when Texture2D is loaded. | 106 | | OnPathValidation | Callback when Path is validated, true indicates path is valid. | 107 | 108 | # Usage 109 | 110 | ## Loading Image from Local 111 | 112 | ```csharp 113 | AsyncImage image = new AsyncImage(path); 114 | image.Load(); 115 | ``` 116 | 117 | ## Loading Image from Remote 118 | 119 | ```csharp 120 | string remoteImageUrl = "https://example.com/image.png"; 121 | 122 | AsyncImage image = new AsyncImage(remoteImageUrl); 123 | image.Load(); 124 | ``` 125 | 126 | ## Validate Image Path 127 | 128 | ```csharp 129 | string imageUrl = "https://example.com/image.png"; 130 | //string imageUrl = "E:\image.png"; 131 | 132 | AsyncImage image = new AsyncImage(imageUrl); 133 | 134 | image.OnPathValidation += (isValid) => 135 | { 136 | // retry/fallback logic 137 | }; 138 | 139 | image.ValidatePath(); 140 | 141 | if(image.IsPathValidated == null) // null indicates that ValidatePath() wasn't called. 142 | { 143 | Debug.Log("Didn't validated the path."); 144 | } 145 | 146 | if(image.IsPathValidated == false) 147 | { 148 | Debug.Log("The path is invalid."); 149 | return; 150 | } 151 | 152 | if(image.IsPathValidated == true) 153 | { 154 | Debug.Log("The path is valid."); 155 | return; 156 | } 157 | ``` 158 | 159 | ## Loading Texture 160 | 161 | To load texture, the Bitmap must be loaded. Calling `image.GenerateTexture()` will throw error if the Bitmap is not loaded. Also, calling `image.GenerateTexture()` just after `image.Load()` won't work most cases as it's an asynchronous call. So, it's better to load a texture like this - 162 | 163 | ```csharp 164 | AsyncImage image = new AsyncImage(path); 165 | 166 | image.OnTextureLoad += () => 167 | { 168 | Texture2D loadedTexture = image.Texture; 169 | }; 170 | 171 | image.Load(); 172 | ``` 173 | 174 | If AsyncImage is constructed by the following way - 175 | 176 | ```csharp 177 | AsyncImage image = new AsyncImage(path, false); 178 | ``` 179 | 180 | or, defined not to generate texture - 181 | 182 | ```csharp 183 | AsyncImage image = new AsyncImage(path); 184 | image.ShouldGenerateTexture = false; // don't generate texture on Load 185 | ``` 186 | 187 | It won't **Generate Texture Automatically** after bitmap is loaded. So, in that circumstances, we have to generate Texture manually. we have to keep in mind that, we can only generate Texture when bitmap is loaded. Please check next section for how to deal with that. 188 | 189 | ## Generate `Texture2D` on demand 190 | 191 | By default, `Texture2D` automatically generated on main thread after bitmap is loadeed. After it is generated, it can be accessible by `image.Texture`. 192 | 193 | Whatever, in some scenerio, it's not necessery to generate `Texture2D` along with loading Bitmap. In that case, we can define **_not to load_** it by simply passing another argument in constructor - 194 | 195 | ```csharp 196 | AsyncImage image = new AsyncImage(path, false); 197 | ``` 198 | 199 | For generating Texture2D - 200 | 201 | ```csharp 202 | image.GenerateTexture(() => 203 | { 204 | Debug.Log("Texture2D loaded!"); 205 | }); 206 | ``` 207 | 208 | Alternatively - 209 | 210 | ```csharp 211 | image.OnTextureLoad += () => 212 | { 213 | Debug.Log("Texture2D loaded!"); 214 | }; 215 | // generate Texture2D 216 | image.GenerateTexture(); 217 | ``` 218 | 219 | ## Saving Bitmap 220 | 221 | For saving, Bitmap must be loaded. To save a Bitmap - 222 | 223 | ```csharp 224 | AsyncImage image = new AsyncImage(path); 225 | 226 | image.Save(@"E:\image.png", SkiaSharp.SKEncodedImageFormat.Png, 100); 227 | ``` 228 | 229 | ## Listen to Events 230 | 231 | There are 2 important events where you can subscribe. 232 | 233 | ### `OnLoad` 234 | 235 | `OnLoad` will be called as soon as the Bitmap is loaded. It's ideal to use when you would like to know when Bitmap is loaded and do other works e.g calling `GenerateTexture()`. 236 | 237 | ```csharp 238 | AsyncImage image = new AsyncImage(path); 239 | image.OnLoad += () => 240 | { 241 | Debug.Log("Bitmap loaded!"); 242 | // do your works 243 | }; 244 | image.Load(); 245 | ``` 246 | 247 | ### `OnSave` 248 | 249 | `OnSave` will be called as soon as the Bitmap is saved to local file. It returns bool in callback as result. `true = successfully saved`, `false = error encountered while saving` 250 | 251 | ```csharp 252 | AsyncImage image = new AsyncImage(path); 253 | image.OnSave += (result) => 254 | { 255 | // result is boolean 256 | Debug.Log("Saved - " + result); 257 | }; 258 | image.Save(@"E:\image.png", SkiaSharp.SKEncodedImageFormat.Png, 100); 259 | ``` 260 | 261 | ### `OnTextureLoad` 262 | 263 | `OnTextureLoad` will be called when `Texture2D` is generated from the Bitmap. By default, whenever `Load()` is called, it generates `Texture2D` after Bitmap is loaded. It can be defined either to generate `Texture2D` afterward or call `GenerateTexture()` later on-demand. 264 | 265 | ```csharp 266 | AsyncImage image = new AsyncImage(path); 267 | image.OnTextureLoad += () => 268 | { 269 | Debug.Log("Texture2D loaded!"); 270 | // do your works 271 | }; 272 | image.Load(); 273 | ``` 274 | 275 | ## Load Image Info Only 276 | 277 | To load Image info only - 278 | 279 | ```csharp 280 | AsyncImage image = new AsyncImage(path); 281 | 282 | var (info, format) = image.GetInfo(); 283 | ``` 284 | 285 | Learn more about info [(SKImageInfo)](https://docs.microsoft.com/en-us/dotnet/api/skiasharp.skimageinfo?view=skiasharp-2.80.2) and format [(SKEncodedImageFormat)](https://docs.microsoft.com/en-us/dotnet/api/skiasharp.skencodedimageformat?view=skiasharp-2.80.2). 286 | 287 | Note that, it's not possible to get Info from Image that is generated from Buffer. 288 | 289 | # Image Process 290 | 291 | ## Resizing 292 | 293 | There are two ways to resize an Image. 294 | 295 | ### Divide By 296 | 297 | Let's say we have a image of 1000px _ 1000px dimension. To resize it down to half of it's resolution, 500px _ 500px, we need to divide it by 2 (1000px/2 = 500px). So, we can simply - 298 | 299 | ```csharp 300 | AsyncImage image = new AsyncImage(path); 301 | 302 | image.Resize(2, ResizeQuality.Medium); // resize 303 | 304 | image.OnTextureLoad += MethodA; 305 | image.Load(); 306 | ``` 307 | 308 | ### Target Dimensions 309 | 310 | To resize an Image to a defined dimension - 311 | 312 | ```csharp 313 | AsyncImage image = new AsyncImage(path); 314 | 315 | // x of Vector2 is Width, y of Vector2 is Height 316 | image.Resize(new Vector2(200,200), ResizeQuality.Medium); 317 | 318 | image.OnTextureLoad += MethodA; 319 | image.Load(); 320 | ``` 321 | 322 | ## Draw Text 323 | 324 | ### Simple 325 | 326 | Simply draw a text by passing straight-forward parameters. 327 | 328 | ```csharp 329 | public void DrawText(string text, Vector2 position, TextAlign textAlign, Color color, float textSize, string fontFamilyName = "Arial", Action onComplete = null) 330 | ``` 331 | 332 | | Parameters | Details | 333 | | ---------------- | ---------------------------------------------------------- | 334 | | text | Text to draw on Image | 335 | | position | The x & y coordinate of the origin of the text being drawn | 336 | | textAlign | Text Align (Left, Center, Right) | 337 | | color | Color of Text (RGB) | 338 | | textSize | Text Height in Pixel | 339 | | fontFamilyName\* | Font family name for typeface | 340 | | onComplete\* | Callback on completion | 341 | 342 | \*Optional Parameters. 343 | 344 | #### Example 345 | 346 | ```csharp 347 | AsyncImage image = new AsyncImage(path); 348 | 349 | var (info, format) = image.GetInfo(); 350 | 351 | // drawing text at the center (vertically and horizontally) 352 | image.DrawText("Hello from the other side!", new Vector2(info.Width/2, info.Height / 2), TextAlign.Center, Color.white); 353 | 354 | image.OnTextureLoad += MethodA; 355 | image.Load(); 356 | ``` 357 | 358 | ### Advanced (SKPaint) 359 | 360 | Draw text with [SKPaint](https://docs.microsoft.com/en-us/dotnet/api/skiasharp.skpaint?view=skiasharp-2.80.2), more flexibility to use SkiaSharp directly. SKPaint gives a lot of Properties and Methods to apply any filters or whatsoever. 361 | 362 | ```csharp 363 | public void DrawText(string text, Vector2 position, SKPaint paint, Action onComplete = null) 364 | ``` 365 | 366 | | Parameters | Details | 367 | | ------------ | ---------------------------------------------------------- | 368 | | text | Text to draw on Image | 369 | | position | The x & y coordinate of the origin of the text being drawn | 370 | | paint | SKPaint object reference, for styling text. | 371 | | onComplete\* | Callback on completion | 372 | 373 | \*Optional Parameters. 374 | 375 | #### Example 376 | 377 | ```csharp 378 | AsyncImage image = new AsyncImage(path); 379 | 380 | var (info, format) = image.GetInfo(); 381 | 382 | string text = "Leaves are on the ground, fall has come."; 383 | 384 | var paint = new SKPaint(); 385 | // Convert RGB color to HSV color 386 | Color.RGBToHSV(Color.white, out float h, out float s, out float v); 387 | paint.Color = SKColor.FromHsv(h * 360, s * 100, v * 100); 388 | // Text Align 389 | paint.TextAlign = SKTextAlign.Center; 390 | // Loading Font from file 391 | paint.Typeface = SKTypeface.FromFile(@"E:\Font\Hack-Italic.ttf", 0); 392 | // Adjust TextSize property so text is 90% of screen width 393 | float textWidth = paint.MeasureText(text); 394 | paint.TextSize = 0.9f * info.Width * paint.TextSize / textWidth; 395 | 396 | // drawing text at the center (vertically and horizontally) 397 | image.DrawText(text, new Vector2(info.Width / 2, info.Height/2), paint); 398 | 399 | image.OnTextureLoad += MethodA; 400 | image.Load(); 401 | ``` 402 | 403 | **Note:** MeasureText() should be called after a certain typeface loads. Or, it will lead to miscalculation. **`Arial`** is the fallback font for `DrawText()`. In case of font was not loaded, it will try to load Arial. 404 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7b6c1df92e19014d8681fae98af6ca9 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2adf4067aa418d543a9995800a2d7e61 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6635a36e350621748a17aa2e18fcbf39 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Core/AsyncImage.cs: -------------------------------------------------------------------------------- 1 | using SkiaSharp; 2 | using System; 3 | using System.Collections; 4 | using System.Threading; 5 | using UnityEngine; 6 | 7 | namespace AsyncImageLibrary 8 | { 9 | public class AsyncImage 10 | { 11 | private int width; 12 | public int Width { get => bitmap != null ? bitmap.Width : width; internal set => width = value; } 13 | 14 | private int height; 15 | public int Height { get => bitmap != null ? bitmap.Height : height; internal set => height = value; } 16 | 17 | private string path; 18 | internal string Path { get => path; set => path = value; } 19 | 20 | private byte[] buffer; 21 | public byte[] Buffer { get => buffer; internal set => buffer = value; } 22 | 23 | private SKBitmap bitmap; 24 | public SKBitmap Bitmap { get => bitmap; internal set => bitmap = value; } 25 | 26 | private bool shouldGenerateTexture = true; 27 | public bool ShouldGenerateTexture { get => shouldGenerateTexture; set => shouldGenerateTexture = value; } 28 | 29 | private bool shouldQueueTextureProcess = false; 30 | public bool ShouldQueueTextureProcess { get => shouldQueueTextureProcess; set => shouldQueueTextureProcess = value; } 31 | 32 | private bool shouldTextureBeReadable = false; 33 | public bool ShouldTextureBeReadable { get => shouldTextureBeReadable; set => shouldTextureBeReadable = value; } 34 | 35 | private bool? isPathValidated; 36 | public bool? IsPathValidated { get => isPathValidated; internal set => isPathValidated = value; } 37 | 38 | private Texture2D texture; 39 | public Texture2D Texture { get => texture; internal set => texture = value; } 40 | 41 | private Action onTextureLoad; 42 | public Action OnTextureLoad { get => onTextureLoad; set => onTextureLoad = value; } 43 | 44 | private Action onPathValidation; 45 | public Action OnPathValidation { get => onPathValidation; set => onPathValidation = value; } 46 | 47 | private Action onLoad; 48 | public Action OnLoad { get => onLoad; set => onLoad = value; } 49 | 50 | private Action onSave; 51 | public Action OnSave { get => onSave; set => onSave = value; } 52 | 53 | internal Action queuedProcess; 54 | internal bool isExecutingQueuedProcess = false; 55 | 56 | private bool constructedFromBuffer = false; 57 | 58 | /// 59 | /// Default Constructor. Every property sets to default value. Path or Buffer should be set before loading. 60 | /// 61 | public AsyncImage() { } 62 | 63 | /// 64 | /// Constructor for creating Bitmap from Local File Path. 65 | /// 66 | /// Path of Local File 67 | public AsyncImage(string path) 68 | { 69 | this.path = path; 70 | } 71 | 72 | /// 73 | /// Constructor for creating Bitmap from Local File Path. 74 | /// 75 | /// Local File Path 76 | /// Generate Texture2D when Bitmap is loaded. 77 | /// Queue Texture Generation Progress in Main Thread without executing. 78 | public AsyncImage(string path, bool shouldGenerateTexture = true, bool shouldQueueTextureProcess = false) 79 | { 80 | this.path = path; 81 | this.shouldGenerateTexture = shouldGenerateTexture; 82 | this.shouldQueueTextureProcess = shouldQueueTextureProcess; 83 | } 84 | 85 | /// 86 | /// Constuctor for creating Bitmap from Buffer. Suitable for creating Bitmap from Remote Image Buffer. 87 | /// 88 | /// File Buffer 89 | /// Generate Texture2D when Bitmap is loaded. 90 | /// Queue Texture Generation Progress in Main Thread without executing. 91 | public AsyncImage(byte[] buffer, bool shouldGenerateTexture = true, bool shouldQueueTextureProcess = false) 92 | { 93 | constructedFromBuffer = true; 94 | this.buffer = buffer; 95 | this.shouldGenerateTexture = shouldGenerateTexture; 96 | this.shouldQueueTextureProcess = shouldQueueTextureProcess; 97 | } 98 | 99 | /// 100 | /// Get Info of from loaded Bitmap. Works when Image is loaded. 101 | /// 102 | /// SKImageInfo & SKEncodedImageFormat 103 | public (SKImageInfo?, SKEncodedImageFormat?) GetInfoFromBitmap() 104 | { 105 | if (bitmap == null) 106 | throw new NullReferenceException("Image has not loaded yet. Please load image by calling Load()."); 107 | 108 | return new ImageLoadSave().GetImageInfoFromBitmap(this); 109 | } 110 | 111 | /// 112 | /// Get Info of Image without loading it. Applicable for only local file. 113 | /// 114 | /// SKImageInfo & SKEncodedImageFormat 115 | public (SKImageInfo?, SKEncodedImageFormat?) GetInfoFromFile() 116 | { 117 | if (string.IsNullOrEmpty(path)) 118 | throw new NullReferenceException("Could not get info for AsyncImage when Path is not present."); 119 | 120 | return new ImageLoadSave().GetImageInfoFromFile(this); 121 | } 122 | 123 | /// 124 | /// Load Bitmap from given path 125 | /// 126 | /// Callback upon loaded. Overwrites OnLoad delegates. 127 | public void Load(Action cb = null) 128 | { 129 | onLoad = cb != null ? cb : onLoad; 130 | new ImageLoadSave().Load(this); 131 | } 132 | 133 | /// 134 | /// Generate Texture2D from Bitmap. If Bitmap is not loaded, this will be queued for execute after Bitmaps load. 135 | /// 136 | /// Callback upon loaded. Overwrites OnTextureLoad delegates. 137 | public void GenerateTexture(Action cb = null) 138 | { 139 | if (bitmap == null) 140 | throw new NullReferenceException("Image has not loaded yet. Please load image by calling Load()."); 141 | 142 | onTextureLoad = cb != null ? cb : onTextureLoad; 143 | new ImageProcess().GenerateTexture(this, onTextureLoad); 144 | } 145 | 146 | /// 147 | /// Resize Bitmap to (Actual Dimension / divideBy) 148 | /// 149 | /// Integer to divide actual dimension. 150 | /// Resize Quality 151 | /// Callback upon Resize Completes. 152 | public void Resize(int divideBy, ResizeQuality quality, Action onComplete = null) 153 | { 154 | ThreadPool.QueueUserWorkItem(cb => 155 | new ImageProcess().Resize(this, divideBy, quality, onComplete) 156 | ); 157 | } 158 | 159 | /// 160 | /// Resize Bitmap to Target Dimensions. 161 | /// 162 | /// X Axis is Width, Y Axis is Height 163 | /// Resize Quality 164 | /// Callback upon Resize Completes. 165 | public void Resize(Vector2 targetDimensions, ResizeQuality quality, Action onComplete = null) 166 | { 167 | ThreadPool.QueueUserWorkItem(cb => 168 | new ImageProcess().Resize(this, targetDimensions, quality, onComplete) 169 | ); 170 | } 171 | 172 | /// 173 | /// Draw Text on Bitmap 174 | /// 175 | /// Text to Draw 176 | /// Position in Bitmap 177 | /// SKPaint for Styling 178 | /// Callback upon DrawText completes. 179 | public void DrawText(string text, Vector2 position, SKPaint paint, Action onComplete = null) 180 | { 181 | if(paint == null) 182 | { 183 | throw new ArgumentNullException("SKPaint can not be null."); 184 | } 185 | new ImageProcess().DrawText(this, text, position, paint, "Arial", onComplete); 186 | } 187 | 188 | /// 189 | /// Draw Text on Bitmap 190 | /// 191 | /// Text to Draw 192 | /// Position in Bitmap 193 | /// TextAlign of Text 194 | /// Text Color 195 | /// Text Size in Pixel Format. 196 | /// Font Family Name. Default is Arial. 197 | /// Callback upon DrawText completes. 198 | public void DrawText(string text, Vector2 position, TextAlign textAlign, Color color, float textSize, string fontFamilyName = "Arial", Action onComplete = null) 199 | { 200 | if (bitmap == null) 201 | { 202 | queuedProcess += () => DrawText(text, position, textAlign, color, textSize, fontFamilyName, onComplete); 203 | return; 204 | } 205 | 206 | Color.RGBToHSV(color, out float h, out float s, out float v); 207 | 208 | var paint = new SKPaint(); 209 | paint.Color = SKColor.FromHsv(h * 360, s * 100, v * 100); 210 | paint.TextSize = textSize; 211 | paint.TextAlign = (SKTextAlign)((int)textAlign); 212 | paint.Typeface = SKTypeface.FromFamilyName(fontFamilyName); 213 | 214 | // execute in same thread where loading task is ongoing 215 | if (isExecutingQueuedProcess) 216 | { 217 | new ImageProcess().DrawText(this, text, position, paint, fontFamilyName, onComplete); 218 | } 219 | // Called from main thread 220 | else 221 | { 222 | ThreadPool.QueueUserWorkItem(cb => 223 | new ImageProcess().DrawText(this, text, position, paint, fontFamilyName, onComplete)); 224 | } 225 | } 226 | 227 | public void OverlapImage() 228 | { 229 | // TODO - Overlap Image 230 | throw new NotImplementedException(); 231 | } 232 | 233 | /// 234 | /// Crop bitmap 235 | /// 236 | /// From where to start rect 237 | /// Rect size 238 | public void Crop(Vector2 position, Vector2 targetDimension) 239 | { 240 | if (bitmap == null) 241 | { 242 | queuedProcess += () => Crop(position, targetDimension); 243 | return; 244 | } 245 | 246 | new ImageProcess().Crop(this, position, targetDimension); 247 | } 248 | 249 | /// 250 | /// Save Bitmap to Local File 251 | /// 252 | /// Save Path with Filename and Extension 253 | /// Image Format 254 | /// Save Quality 255 | /// Callback upon save. Overwrites OnSave delegates. 256 | public void Save(string path, SKEncodedImageFormat format, int quality, Action onComplete = null) 257 | { 258 | onSave = onComplete != null ? onComplete : onSave; 259 | 260 | ThreadPool.QueueUserWorkItem(cb => 261 | new ImageLoadSave().TrySave(this, path, format, quality)); 262 | } 263 | 264 | public byte[] GetEncodedBuffer(SKEncodedImageFormat format, int quality) 265 | { 266 | return new ImageLoadSave().GetEncodedBuffer(this, format, quality); 267 | } 268 | 269 | /// 270 | /// Validate assigned Path of Image without loading it. 271 | /// 272 | public void ValidatePath() 273 | { 274 | new ImageLoadSave().ValidatePath(this); 275 | } 276 | } 277 | } -------------------------------------------------------------------------------- /Runtime/Core/AsyncImage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f38f40bfa2b9f74aa7f6a2680922952 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Core/ImageLoadSave.cs: -------------------------------------------------------------------------------- 1 | using SkiaSharp; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using System.IO; 6 | using System.Runtime.InteropServices; 7 | using System.Threading; 8 | using UnityEngine; 9 | using UnityEngine.Networking; 10 | 11 | namespace AsyncImageLibrary 12 | { 13 | internal class ImageLoadSave 14 | { 15 | public ImageLoadSave() { } 16 | 17 | internal void Load(AsyncImage asyncImage) 18 | { 19 | // Initialize Unity Main Thread for thread sensitive call 20 | UnityMainThread.Init(); 21 | // Initialize Queuer if queueing is required 22 | if (asyncImage.ShouldQueueTextureProcess) MainThreadQueuer.Init(); 23 | // Setup Threadpool for current environment 24 | ThreadPool.SetMaxThreads(Environment.ProcessorCount, Environment.ProcessorCount); 25 | // Load Bitmap 26 | if (!string.IsNullOrEmpty(asyncImage.Path)) 27 | { 28 | // android / remote file 29 | if (asyncImage.Path.Contains("://") || asyncImage.Path.Contains(":///")) 30 | StaticCoroutine.StartCoroutine(LoadBufferUwr(asyncImage)); 31 | else 32 | ThreadPool.QueueUserWorkItem(cb => LoadBitmapFromFileStream(asyncImage)); 33 | } 34 | else if (asyncImage.Buffer != null) 35 | { 36 | ThreadPool.QueueUserWorkItem(cb => LoadBitmapFromBuffer(asyncImage)); 37 | } 38 | } 39 | 40 | void LoadBitmapFromBuffer(AsyncImage asyncImage) 41 | { 42 | SKBitmap bitmap = SKBitmap.Decode(asyncImage.Buffer); 43 | // Process Bitmap 44 | ProcessBitmap(asyncImage, bitmap); 45 | } 46 | 47 | void LoadBitmapFromFileStream(AsyncImage asyncImage) 48 | { 49 | // validate the file path 50 | if (asyncImage.IsPathValidated == null) 51 | ValidatePath(asyncImage); 52 | if (!(bool)asyncImage.IsPathValidated) 53 | return; 54 | 55 | var input = File.OpenRead(asyncImage.Path); 56 | var inputStream = new SKManagedStream(input); 57 | var encodedOrigin = ReadOrigin(asyncImage.Path); 58 | 59 | // Decode Bitmap 60 | SKBitmap bitmap = SKBitmap.Decode(inputStream); 61 | bitmap = ChangeOrientation(bitmap, encodedOrigin); 62 | 63 | // Process Bitmap 64 | ProcessBitmap(asyncImage, bitmap); 65 | 66 | input.Dispose(); 67 | inputStream.Dispose(); 68 | } 69 | 70 | IEnumerator LoadBufferUwr(AsyncImage asyncImage) 71 | { 72 | // check if remote image exist by sending a HEAD req 73 | yield return DryUwrValidatePath(asyncImage); 74 | if (!(bool)asyncImage.IsPathValidated) 75 | yield break; 76 | 77 | using (UnityWebRequest uwr = UnityWebRequestTexture.GetTexture(asyncImage.Path)) 78 | { 79 | yield return uwr.SendWebRequest(); 80 | 81 | if (uwr.result == UnityWebRequest.Result.ConnectionError || uwr.result == UnityWebRequest.Result.DataProcessingError) 82 | { 83 | Debug.LogError(uwr.error); 84 | yield break; 85 | } 86 | 87 | asyncImage.Buffer = uwr.downloadHandler.data; 88 | ThreadPool.QueueUserWorkItem(cb => LoadBitmapFromBuffer(asyncImage)); 89 | } 90 | } 91 | 92 | void ProcessBitmap(AsyncImage asyncImage, SKBitmap bitmap) 93 | { 94 | asyncImage.Bitmap = bitmap; 95 | 96 | // Execute queued process 97 | asyncImage.isExecutingQueuedProcess = true; 98 | try 99 | { 100 | asyncImage.queuedProcess?.Invoke(); 101 | } 102 | catch (Exception ex) 103 | { 104 | Debug.Log(ex.Message); 105 | } 106 | asyncImage.queuedProcess = null; 107 | asyncImage.isExecutingQueuedProcess = false; 108 | 109 | // Flip image 110 | SKBitmap flippedBitmap = FlipBitmap(asyncImage.Bitmap); 111 | 112 | asyncImage.Bitmap = flippedBitmap; 113 | asyncImage.Width = bitmap.Width; 114 | asyncImage.Height = bitmap.Height; 115 | 116 | if (asyncImage.ShouldGenerateTexture) 117 | { 118 | Action generateTexture = () => 119 | new ImageProcess().GenerateTexture(asyncImage, asyncImage.OnTextureLoad); 120 | 121 | if (asyncImage.ShouldQueueTextureProcess) 122 | MainThreadQueuer.Queue(generateTexture); 123 | else 124 | UnityMainThread.Execute(generateTexture); 125 | } 126 | 127 | if (asyncImage.OnLoad != null) 128 | UnityMainThread.Execute(asyncImage.OnLoad); 129 | } 130 | 131 | SKBitmap FlipBitmap(SKBitmap bitmap) 132 | { 133 | SKBitmap flippedBitmap = new SKBitmap(bitmap.Width, bitmap.Height); 134 | 135 | using (SKCanvas c = new SKCanvas(flippedBitmap)) 136 | { 137 | c.Clear(); 138 | c.Scale(1, -1, 0, bitmap.Height / 2); 139 | c.DrawBitmap(bitmap, new SKPoint()); 140 | } 141 | return flippedBitmap; 142 | } 143 | 144 | SKEncodedOrigin ReadOrigin(string path) 145 | { 146 | SKEncodedOrigin encodedOrigin; 147 | 148 | using (var codec = SKCodec.Create(path)) 149 | { 150 | encodedOrigin = codec.EncodedOrigin; 151 | return encodedOrigin; 152 | } 153 | } 154 | 155 | internal (SKImageInfo?, SKEncodedImageFormat?) GetImageInfoFromBitmap(AsyncImage asyncImage) 156 | { 157 | if(asyncImage.Bitmap != null) 158 | { 159 | SKImageInfo info = new SKImageInfo(asyncImage.Bitmap.Width, asyncImage.Bitmap.Height); 160 | return (info, null); 161 | } 162 | return (null, null); 163 | } 164 | 165 | internal (SKImageInfo? info, SKEncodedImageFormat? encodedFormat) GetImageInfoFromFile(AsyncImage asyncImage) 166 | { 167 | // validate the file path 168 | if (asyncImage.IsPathValidated == null) 169 | ValidatePath(asyncImage); 170 | if (!(bool)asyncImage.IsPathValidated) 171 | return (null, null); 172 | 173 | using (var codec = SKCodec.Create(asyncImage.Path)) 174 | { 175 | return (codec.Info, codec.EncodedFormat); 176 | } 177 | } 178 | 179 | SKBitmap ChangeOrientation(SKBitmap bitmap, SKEncodedOrigin orientation) 180 | { 181 | SKBitmap rotated; 182 | switch (orientation) 183 | { 184 | case SKEncodedOrigin.BottomRight: 185 | 186 | using (var surface = new SKCanvas(bitmap)) 187 | { 188 | surface.RotateDegrees(180, bitmap.Width / 2, bitmap.Height / 2); 189 | surface.DrawBitmap(bitmap.Copy(), 0, 0); 190 | } 191 | 192 | return bitmap; 193 | 194 | case SKEncodedOrigin.RightTop: 195 | rotated = new SKBitmap(bitmap.Height, bitmap.Width); 196 | 197 | using (var surface = new SKCanvas(rotated)) 198 | { 199 | surface.Translate(rotated.Width, 0); 200 | surface.RotateDegrees(90); 201 | surface.DrawBitmap(bitmap, 0, 0); 202 | } 203 | 204 | return rotated; 205 | 206 | case SKEncodedOrigin.LeftBottom: 207 | rotated = new SKBitmap(bitmap.Height, bitmap.Width); 208 | 209 | using (var surface = new SKCanvas(rotated)) 210 | { 211 | surface.Translate(0, rotated.Height); 212 | surface.RotateDegrees(270); 213 | surface.DrawBitmap(bitmap, 0, 0); 214 | } 215 | 216 | return rotated; 217 | 218 | default: 219 | return bitmap; 220 | } 221 | } 222 | 223 | internal void TrySave(AsyncImage asyncImage, string path, SKEncodedImageFormat format, int quality) 224 | { 225 | try 226 | { 227 | using (MemoryStream memStream = new MemoryStream()) 228 | { 229 | using (SKManagedWStream wstream = new SKManagedWStream(memStream)) 230 | { 231 | SKBitmap flippedBitmap = FlipBitmap(asyncImage.Bitmap); 232 | 233 | flippedBitmap.Encode(wstream, format, quality); 234 | byte[] data = memStream.ToArray(); 235 | 236 | // save file 237 | File.WriteAllBytes(path, data); 238 | } 239 | } 240 | asyncImage.OnSave?.Invoke(true); 241 | } 242 | catch (Exception ex) 243 | { 244 | Debug.LogError(ex.Message); 245 | asyncImage.OnSave?.Invoke(false); 246 | } 247 | } 248 | 249 | internal byte[] GetEncodedBuffer(AsyncImage asyncImage, SKEncodedImageFormat format, int quality) 250 | { 251 | byte[] buffer = null; 252 | try 253 | { 254 | using (MemoryStream memStream = new MemoryStream()) 255 | using (SKManagedWStream wstream = new SKManagedWStream(memStream)) 256 | { 257 | SKBitmap flippedBitmap = FlipBitmap(asyncImage.Bitmap); 258 | 259 | flippedBitmap.Encode(wstream, format, quality); 260 | buffer = memStream.ToArray(); 261 | } 262 | } 263 | catch (Exception ex) 264 | { 265 | Debug.LogError(ex.Message); 266 | } 267 | 268 | return buffer; 269 | } 270 | 271 | internal void ValidatePath(AsyncImage asyncImage) 272 | { 273 | if (string.IsNullOrEmpty(asyncImage.Path)) 274 | { 275 | asyncImage.IsPathValidated = false; 276 | asyncImage.OnPathValidation.Invoke(false); 277 | return; 278 | } 279 | 280 | // android / remote file 281 | if (asyncImage.Path.Contains("://") || asyncImage.Path.Contains(":///")) 282 | { 283 | StaticCoroutine.StartCoroutine(DryUwrValidatePath(asyncImage)); 284 | return; 285 | } 286 | 287 | if (!File.Exists(asyncImage.Path)) 288 | { 289 | asyncImage.IsPathValidated = false; 290 | asyncImage.OnPathValidation.Invoke(false); 291 | return; 292 | } 293 | asyncImage.IsPathValidated = true; 294 | asyncImage.OnPathValidation.Invoke(true); 295 | } 296 | 297 | private IEnumerator DryUwrValidatePath(AsyncImage asyncImage) 298 | { 299 | // check if remote image exist by sending a HEAD req 300 | using (UnityWebRequest headReq = UnityWebRequest.Head(asyncImage.Path)) 301 | { 302 | yield return headReq.SendWebRequest(); 303 | 304 | if (!(headReq.responseCode >= 200 && headReq.responseCode < 300)) 305 | { 306 | asyncImage.IsPathValidated = false; 307 | asyncImage.OnPathValidation?.Invoke(false); 308 | yield break; 309 | } 310 | } 311 | asyncImage.IsPathValidated = true; 312 | asyncImage.OnPathValidation?.Invoke(true); 313 | } 314 | } 315 | } -------------------------------------------------------------------------------- /Runtime/Core/ImageLoadSave.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fcee7b1d26bc20447a6a6a16cab2bc7d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Core/ImageProcess.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | using SkiaSharp; 4 | 5 | namespace AsyncImageLibrary 6 | { 7 | internal class ImageProcess 8 | { 9 | public void Resize(AsyncImage asyncImage, int divideBy, ResizeQuality quality, Action onComplete) 10 | { 11 | if (divideBy <= 0) 12 | throw new ArgumentException("DivideBy should not be less than Zero (0) or equal to Zero (0)."); 13 | 14 | // If image isn't loaded yet, we will queue it for later 15 | if (asyncImage.Bitmap == null) 16 | { 17 | asyncImage.queuedProcess += () => Resize(asyncImage, divideBy, quality, onComplete); 18 | return; 19 | } 20 | var resizeInfo = new SKImageInfo(asyncImage.Bitmap.Width / divideBy, asyncImage.Bitmap.Height / divideBy); 21 | SKFilterQuality filterQuality = (SKFilterQuality)((int)quality); 22 | asyncImage.Bitmap = asyncImage.Bitmap.Resize(resizeInfo, filterQuality); 23 | 24 | // callback 25 | if (onComplete != null) UnityMainThread.Execute(onComplete); 26 | } 27 | 28 | internal void Resize(AsyncImage asyncImage, Vector2 targetDimensions, ResizeQuality quality, Action onComplete) 29 | { 30 | if (targetDimensions.x == 0 || targetDimensions.y == 0) 31 | throw new ArgumentException("Target Dimensions should not be equal to Zero (0)."); 32 | 33 | // If image isn't loaded yet, we will queue it for later 34 | if (asyncImage.Bitmap == null) 35 | { 36 | asyncImage.queuedProcess += () => Resize(asyncImage, targetDimensions, quality, onComplete); 37 | return; 38 | } 39 | var resizeInfo = new SKImageInfo((int)targetDimensions.x, (int)targetDimensions.y); 40 | SKFilterQuality filterQuality = (SKFilterQuality)((int)quality); 41 | asyncImage.Bitmap = asyncImage.Bitmap.Resize(resizeInfo, filterQuality); 42 | 43 | // callback 44 | if (onComplete != null) UnityMainThread.Execute(onComplete); 45 | } 46 | 47 | internal void DrawText(AsyncImage asyncImage, string text, Vector2 position, SKPaint paint, string fontFamilyName, Action onComplete) 48 | { 49 | // If image isn't loaded yet, we will queue it for later 50 | if (asyncImage.Bitmap == null) 51 | { 52 | asyncImage.queuedProcess += () => DrawText(asyncImage, text, position, paint, fontFamilyName, onComplete); 53 | return; 54 | } 55 | SKCanvas canvas = new SKCanvas(asyncImage.Bitmap); 56 | 57 | // Fallback font 58 | if (paint.Typeface == null) 59 | { 60 | paint.Typeface = SKTypeface.FromFamilyName(fontFamilyName); 61 | } 62 | // Draw Text 63 | canvas.DrawText(text, position.x, position.y, paint); 64 | 65 | onComplete?.Invoke(); 66 | 67 | canvas.Dispose(); 68 | } 69 | 70 | internal void GenerateTexture(AsyncImage asyncImage, Action onComplete) 71 | { 72 | TextureFormat textureFormat = asyncImage.Bitmap.Info.ColorType == SKColorType.Rgba8888 ? 73 | TextureFormat.RGBA32 : TextureFormat.BGRA32; 74 | Texture2D texture = new Texture2D(asyncImage.Bitmap.Width, asyncImage.Bitmap.Height, textureFormat, false); 75 | texture.LoadRawTextureData(asyncImage.Bitmap.GetPixels(), asyncImage.Bitmap.RowBytes * asyncImage.Bitmap.Height); 76 | texture.Apply(false, !asyncImage.ShouldTextureBeReadable); 77 | asyncImage.Texture = texture; 78 | onComplete?.Invoke(); 79 | } 80 | 81 | internal void Crop(AsyncImage asyncImage, Vector2 position, Vector2 targetDimension) 82 | { 83 | SKRectI cropRect = SKRectI.Create((int)position.x, (int)position.y, (int)targetDimension.x, (int)targetDimension.y); 84 | SKBitmap newBitmap = new SKBitmap(cropRect.Width, cropRect.Height); 85 | asyncImage.Bitmap.ExtractSubset(newBitmap, cropRect); 86 | asyncImage.Bitmap = newBitmap; 87 | 88 | } 89 | } 90 | } -------------------------------------------------------------------------------- /Runtime/Core/ImageProcess.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 43acad731cc9edf4aa3aac61944fe1e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Core/ResizeQuality.cs: -------------------------------------------------------------------------------- 1 | namespace AsyncImageLibrary 2 | { 3 | public enum ResizeQuality 4 | { 5 | None, Low, Medium, High 6 | } 7 | } -------------------------------------------------------------------------------- /Runtime/Core/ResizeQuality.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 108b21895de37844fb31cdb67d8775b3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Core/TextAlign.cs: -------------------------------------------------------------------------------- 1 | namespace AsyncImageLibrary 2 | { 3 | public enum TextAlign 4 | { 5 | Left, Center, Right 6 | } 7 | } -------------------------------------------------------------------------------- /Runtime/Core/TextAlign.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cf0c7d27bf67bde41a0913939857decc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Helper.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 644fc127d06aab8418810eb51a5f1f0a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Helper/MainThreadQueuer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace AsyncImageLibrary 7 | { 8 | public class MainThreadQueuer : MonoBehaviour 9 | { 10 | private static List queuedProcess = new List(); 11 | 12 | private static MainThreadQueuer instance; 13 | 14 | public static void Init() 15 | { 16 | if (instance != null) return; 17 | GameObject obj = new GameObject("MainThreadQueuer"); 18 | DontDestroyOnLoad(obj); 19 | instance = obj.AddComponent(); 20 | } 21 | 22 | public static void Queue(Action process) 23 | { 24 | queuedProcess.Add(process); 25 | } 26 | 27 | public static void ClearAllQueue() 28 | { 29 | queuedProcess.Clear(); 30 | } 31 | 32 | public static IEnumerator ExecuteProcessPerFrame() 33 | { 34 | if (queuedProcess.Count == 0) yield break; 35 | 36 | for (int i = 0; i < queuedProcess.Count; i++) 37 | { 38 | queuedProcess[i].Invoke(); 39 | yield return new WaitForEndOfFrame(); // wait a frame 40 | } 41 | queuedProcess.Clear(); 42 | } 43 | } 44 | } -------------------------------------------------------------------------------- /Runtime/Helper/MainThreadQueuer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5652bfb272fbd064b960eb46a4b934ae 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Helper/StaticCoroutine.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace AsyncImageLibrary 6 | { 7 | // credit : Proyecto26 8 | public static class StaticCoroutine 9 | { 10 | private class CoroutineHolder : MonoBehaviour { } 11 | 12 | private static CoroutineHolder _runner; 13 | private static CoroutineHolder Runner 14 | { 15 | get 16 | { 17 | if (_runner == null) 18 | { 19 | _runner = new GameObject("Static Coroutine AsyncImageLibrary").AddComponent(); 20 | Object.DontDestroyOnLoad(_runner); 21 | } 22 | return _runner; 23 | } 24 | } 25 | 26 | public static Coroutine StartCoroutine(IEnumerator coroutine) 27 | { 28 | return Runner.StartCoroutine(coroutine); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Runtime/Helper/StaticCoroutine.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ef3002a158409144b719b024ae3d704 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/Helper/UnityMainThread.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace AsyncImageLibrary 7 | { 8 | public class UnityMainThread : MonoBehaviour 9 | { 10 | private static List queuedMethods = new List(); //List of methods to execute in Main Thread 11 | private static List cQueuedMethods = new List(); //List for caching 12 | 13 | private volatile static bool isFree = true; 14 | 15 | private static UnityMainThread instance; 16 | 17 | public static void Init() 18 | { 19 | if (instance != null) return; 20 | 21 | GameObject obj = new GameObject("UnityMainThread"); 22 | DontDestroyOnLoad(obj); 23 | instance = obj.AddComponent(); 24 | } 25 | 26 | public static void Execute(Action action) 27 | { 28 | if (instance == null) return; 29 | 30 | lock (queuedMethods) 31 | { 32 | queuedMethods.Add(action); 33 | isFree = false; 34 | } 35 | } 36 | 37 | void Update() 38 | { 39 | if (isFree) return; 40 | 41 | cQueuedMethods.Clear(); //Clear previously cached methods 42 | 43 | lock (queuedMethods) 44 | { 45 | //Cache to new list and free 46 | cQueuedMethods.AddRange(queuedMethods); 47 | queuedMethods.Clear(); 48 | isFree = true; 49 | } 50 | 51 | for (int i = 0; i < cQueuedMethods.Count; i++) 52 | { 53 | cQueuedMethods[i].Invoke(); 54 | } 55 | } 56 | 57 | public void OnDisable() 58 | { 59 | if (instance == this) instance = null; 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Runtime/Helper/UnityMainThread.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bd9b3d1241b62040bd6ccb4c5e5fe15 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Runtime/SrejonKhan.AsyncImageLibrary.Runtime.asmdef: -------------------------------------------------------------------------------- 1 | { 2 | "name": "SrejonKhan.AsyncImageLibrary.Runtime" 3 | } 4 | -------------------------------------------------------------------------------- /Runtime/SrejonKhan.AsyncImageLibrary.Runtime.asmdef.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f580279d9854f6243aaa00ca526b31b2 3 | AssemblyDefinitionImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "com.srejonkhan.asyncimagelibrary", 3 | "version": "0.2.1", 4 | "displayName": "Async Image Library", 5 | "description": "Load Image asynchronously from external environment without blocking Main-Thread. And powerful SkiaSharp Library implemented and wrapped for better and convenient usage.", 6 | "unity": "2019.1", 7 | "unityRelease": "0b5", 8 | "documentationUrl": "https://github.com/SrejonKhan/AsyncImageLibrary/wiki", 9 | "changelogUrl": "https://github.com/SrejonKhan/AsyncImageLibrary/blob/main/CHANGELOG.md", 10 | "licensesUrl": "https://github.com/SrejonKhan/AsyncImageLibrary/blob/main/LICENCE.md", 11 | "keywords": [ 12 | "Async Image Library", 13 | "Async", 14 | "Image", 15 | "Texture2d", 16 | "AsyncLoad" 17 | ], 18 | "author": { 19 | "name": "Srejon Khan", 20 | "email": "srejonkhan9@gmail.com", 21 | "url": "https://srejonkhan.github.io" 22 | }, 23 | "type": "library" 24 | } 25 | -------------------------------------------------------------------------------- /package.json.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 00f77a8c5307ce9419cdb977a96a0387 3 | PackageManifestImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | --------------------------------------------------------------------------------