public override int GetHashCode() { if (IsEmpty) { return(0); } return(Lsb.GetHashCode() ^ Msb.GetHashCode() * 5); }
public void Setup() { originalBitmap = CreateOriginal(); watermarkBitmap = CreateWatermark(); bitsForWatermark = 1; parameters = new LsbParameters(originalBitmap.TransformToEffectiveBitmap(), watermarkBitmap.TransformToEffectiveBitmap(), null, bitsForWatermark); algorithm = new Lsb(parameters); }
protected override Task ProcessRemoving(CancellationToken ct) { return(Task.Run(async() => { var p = ReadParameters(); var algorithm = new Lsb(p); var result = algorithm.RemoveWatermark(ct); await ShowAlgorithmOutput(result); })); }
protected override Task ProcessAdding(CancellationToken ct) { return(Task.Run(async() => { ct.ThrowIfCancellationRequested(); var p = ReadParameters(); ct.ThrowIfCancellationRequested(); var algorithm = new Lsb(p); var result = algorithm.AddWatermark(ct); await ShowAlgorithmOutput(result); })); }