feat: load LUT libraries and selections in background with cancellation and visible-only thumbnails

这个提交包含在:
mac 于 2026-11-01 11:08:10 +08:00 提交
1 父节点 57830ca744
当前提交 87baa785fd
9 个文件已更改
+710 -100

没有与搜索条件相匹配的文件

+11
查看文件
@@ -13,6 +13,11 @@ FOUNDATION_EXPORT BOOL DYLUTReadCube(NSString *path, std::vector<float>& values,
NSUInteger& dimension, NSError * _Nullable * _Nullable error);
#endif
/// Parse/warm the shared table cache off the UI thread. Completion is always on
/// the main queue; cancel suppresses application of the result.
FOUNDATION_EXPORT NSProgress *DYLUTPrepareAsync(NSString *path,
void (^completion)(NSError * _Nullable error));
/// Float RGBA in display-encoded RGB, matching the renderer's 320×180 preview.
/// Empty path means identity. Alpha is preserved; invalid samples become clear.
FOUNDATION_EXPORT NSData * _Nullable DYLUTTransformRGBA(NSData *sourceRGBA,
@@ -35,6 +40,12 @@ FOUNDATION_EXPORT NSImage * _Nullable DYLUTThumbnail(NSString * _Nullable path,
- (instancetype)initWithRootURL:(NSURL *)rootURL NS_DESIGNATED_INITIALIZER;
/// Does not follow symbolic links or create a missing root directory.
- (BOOL)reload:(NSError * _Nullable * _Nullable)error;
/// Background file work is serialized separately from the short snapshot lock.
/// The returned progress supports cancellation and per-file status; callbacks
/// always run on the main queue. Existing snapshots remain readable meanwhile.
- (NSProgress *)reloadAsync:(void (^)(NSError * _Nullable error))completion;
- (NSProgress *)importURLsAsync:(NSArray<NSURL *> *)urls
completion:(void (^)(NSArray<NSDictionary *> * _Nullable imported, NSError * _Nullable error))completion;
/// Copies Cube files (recursing into folders) into the library. No existing file
/// is replaced. Names receive numeric suffixes on collision. Source data stays put.
/// Returns imported entry dictionaries, or nil on preflight/copy failure.