改用原生画布HSL吸管与当前帧显示取样,准备139宿主验收
这个提交包含在:
1 父节点
2d7feb5aa2
当前提交
e6fecdad7b
11 个文件已更改
+65
-20
没有与搜索条件相匹配的文件
@@ -41,6 +41,16 @@
|
||||
- (NSData *)canvasHistogramAtTime:(CMTime)time {
|
||||
return [self finalSampleAtTime:time].canvasHistogram;
|
||||
}
|
||||
- (NSColor *)canvasColorAtPoint:(NSPoint)point atTime:(CMTime)time {
|
||||
if(!std::isfinite(point.x)||!std::isfinite(point.y)||point.x<0||point.x>1||point.y<0||point.y>1)return nil;
|
||||
DYScopeSample *sample=[self finalSampleAtTime:time];if(!sample||![sample.metadata[@"wholeImage"]boolValue])return nil;
|
||||
auto reference=[sample displayReferenceWithProfile:[self scopeProfileForSpace:sample.space]];
|
||||
if(!reference->converted||reference->pixels.size()!=dyscope::Width*dyscope::Height)return nil;
|
||||
size_t x=MIN(dyscope::Width-1,(size_t)(point.x*dyscope::Width)),y=MIN(dyscope::Height-1,(size_t)(point.y*dyscope::Height));
|
||||
const auto &p=reference->pixels[y*dyscope::Width+x];
|
||||
if(!std::isfinite(p.r)||!std::isfinite(p.g)||!std::isfinite(p.b)||p.a<=1e-6f)return nil;
|
||||
return [NSColor colorWithSRGBRed:std::clamp(p.r,0.f,1.f) green:std::clamp(p.g,0.f,1.f) blue:std::clamp(p.b,0.f,1.f) alpha:1];
|
||||
}
|
||||
- (DYColorProfile *)scopeProfileForSpace:(CGColorSpaceRef)space {
|
||||
if(!space)return nil;
|
||||
@synchronized(_scopeProfileLock){
|
||||
|
||||
在新工单中引用
屏蔽一个用户