/// <summary> /// Initializes a new instance of the <see cref="ReceiveImage"/> class. /// </summary> /// <param name="schema">takes the object schema to unpack the rawstring received from networking</param> /// <param name="compression">compression takes the compression object to use decompress to get back the pixeliamge</param> /// <param name="communication">this is the signalling class object of image module which would deliver /// the raw string from network</param> public ReceiveImage(ISchema schema, ICompression compression, ImageCommunication communication) { this.Schema = schema; this.Compression = compression; communication.SubscribeForSignalReceival(Signal.Image, this.OnRecievingimage); this.ErrorFlag = false; }
/// <summary> /// Initializes a new instance of the ImageProcessingClient class. /// </summary> /// <param name="schema">Takes the schema class object to encode the Image.</param> /// <param name="imageCommunication">ImageCommunication class object to subscribe for different events.</param> /// <param name="compression">Takes the Compression class object to compress the image.</param> public ImageProcessingClient(ISchema schema, ImageCommunication imageCommunication, Compression compression) { if (schema == null || compression == null || imageCommunication == null) { this.ErrorFlag = true; return; } this.schemaObject = schema; this.compressionObject = compression; this.imageCommunicationObject = imageCommunication; this.ErrorFlag = false; this.imageCommunicationObject.SubscribeForSignalReceival(Signal.Start, this.StartSharingEventHandler); this.imageCommunicationObject.SubscribeForSignalReceival(Signal.Stop, this.StopSharingEventHandler); this.imageCommunicationObject.SubscribeForSignalReceival(Signal.Resend, this.ResendEventHandler); }