|
@@ -710,7 +710,7 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
|
|
/// <param name="includeCanvas">Should the color be picked from the canvas</param>
|
|
/// <param name="includeCanvas">Should the color be picked from the canvas</param>
|
|
/// <param name="referenceTopmost">Is the reference layer topmost. (Only affects the result is includeReference and includeCanvas are set.)</param>
|
|
/// <param name="referenceTopmost">Is the reference layer topmost. (Only affects the result is includeReference and includeCanvas are set.)</param>
|
|
public Color PickColor(VecD pos, DocumentScope scope, bool includeReference, bool includeCanvas, int frame,
|
|
public Color PickColor(VecD pos, DocumentScope scope, bool includeReference, bool includeCanvas, int frame,
|
|
- bool referenceTopmost = false)
|
|
|
|
|
|
+ bool referenceTopmost = false, string? customOutput = null)
|
|
{
|
|
{
|
|
if (scope == DocumentScope.SingleLayer && includeReference && includeCanvas)
|
|
if (scope == DocumentScope.SingleLayer && includeReference && includeCanvas)
|
|
includeReference = false;
|
|
includeReference = false;
|
|
@@ -736,7 +736,10 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
|
|
}
|
|
}
|
|
|
|
|
|
if (includeCanvas)
|
|
if (includeCanvas)
|
|
- return PickColorFromCanvas((VecI)pos, scope, frame);
|
|
|
|
|
|
+ {
|
|
|
|
+ return PickColorFromCanvas((VecI)pos, scope, frame, customOutput);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (includeReference)
|
|
if (includeReference)
|
|
return PickColorFromReferenceLayer(pos) ?? Colors.Transparent;
|
|
return PickColorFromReferenceLayer(pos) ?? Colors.Transparent;
|
|
return Colors.Transparent;
|
|
return Colors.Transparent;
|
|
@@ -758,7 +761,7 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
|
|
return bitmap.GetSRGBPixel(new VecI((int)transformed.X, (int)transformed.Y));
|
|
return bitmap.GetSRGBPixel(new VecI((int)transformed.X, (int)transformed.Y));
|
|
}
|
|
}
|
|
|
|
|
|
- public Color PickColorFromCanvas(VecI pos, DocumentScope scope, KeyFrameTime frameTime)
|
|
|
|
|
|
+ public Color PickColorFromCanvas(VecI pos, DocumentScope scope, KeyFrameTime frameTime, string? customOutput = null)
|
|
{
|
|
{
|
|
// there is a tiny chance that the image might get disposed by another thread
|
|
// there is a tiny chance that the image might get disposed by another thread
|
|
try
|
|
try
|
|
@@ -768,7 +771,7 @@ internal partial class DocumentViewModel : PixiObservableObject, IDocument
|
|
if (scope == DocumentScope.Canvas)
|
|
if (scope == DocumentScope.Canvas)
|
|
{
|
|
{
|
|
using Surface tmpSurface = new Surface(SizeBindable); // new Surface is on purpose, Surface.ForDisplay doesn't work here
|
|
using Surface tmpSurface = new Surface(SizeBindable); // new Surface is on purpose, Surface.ForDisplay doesn't work here
|
|
- Renderer.RenderDocument(tmpSurface.DrawingSurface, frameTime, SizeBindable);
|
|
|
|
|
|
+ Renderer.RenderDocument(tmpSurface.DrawingSurface, frameTime, SizeBindable, customOutput);
|
|
|
|
|
|
return tmpSurface.GetSrgbPixel(pos);
|
|
return tmpSurface.GetSrgbPixel(pos);
|
|
}
|
|
}
|