check point
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using Hawkeye.VisionBuilder.Workflow.Datatypes;
|
||||
using Hawkeye.VisionBuilder.Workflow.Operations.Attributes;
|
||||
|
||||
namespace Hawkeye.VisionBuilder.Workflow.Operations.Image;
|
||||
|
||||
[Category("Image")]
|
||||
public class GetChannelOperation: BaseOperation
|
||||
{
|
||||
public int Channel { get; set; }
|
||||
|
||||
public GetChannelOperation()
|
||||
{
|
||||
CanHaveProcessingError = false;
|
||||
}
|
||||
|
||||
protected override void InterpretInternal(Context context)
|
||||
{
|
||||
var channel = context.ActiveImage.ImageData.ExtractChannel(Channel);
|
||||
context.ActiveImage = new HawkeyeImage() {ImageData = channel};
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
return $"Get channel {Channel}";
|
||||
}
|
||||
|
||||
public override void Save(BinaryWriter bw)
|
||||
{
|
||||
base.Save(bw);
|
||||
bw.Write(Channel);
|
||||
}
|
||||
|
||||
public override void Load(BinaryReader br)
|
||||
{
|
||||
base.Load(br);
|
||||
Channel = br.ReadInt32();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user