From 60202749d89e1cd668ae4ec2ab1b82c4b316a38d Mon Sep 17 00:00:00 2001 From: ljqing Date: Fri, 30 Dec 2022 11:02:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0EnableBlending,SetBlendingOve?= =?UTF-8?q?rlap=E5=8D=8F=E8=AE=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/common/ClientConnection.ts | 28 +++++++++++++++++++ src/entities/WSProtocol.ts | 50 ++++++++++++++++++++++++++++++++++ 2 files changed, 78 insertions(+) diff --git a/src/common/ClientConnection.ts b/src/common/ClientConnection.ts index 16b3902..32dd11b 100644 --- a/src/common/ClientConnection.ts +++ b/src/common/ClientConnection.ts @@ -1397,6 +1397,34 @@ export default class ClientConnection { ); } + public async EnableBlending( + enable: boolean + ) { + return await this.doRpc( + new Protocol.EnableBlendingRequestEntity( + enable + ) + ); + } + + public async SetBlendingOverlap( + row: number, + column: number, + location: number, + enable: boolean, + width: number + ) { + return await this.doRpc( + new Protocol.SetBlendingOverlapRequestEntity( + row, + column, + location, + enable, + width + ) + ); + } + public destory() { this.ws?.close(); if (this.ws) { diff --git a/src/entities/WSProtocol.ts b/src/entities/WSProtocol.ts index 6ae18fc..2a653dc 100644 --- a/src/entities/WSProtocol.ts +++ b/src/entities/WSProtocol.ts @@ -502,6 +502,12 @@ export namespace Protocol { public static get kSetBlendingGammaParam() { return Commands.PROTOCOL_PREFIX + "SetBlendingGammaParam"; } + public static get kEnableBlending() { + return Commands.PROTOCOL_PREFIX + "EnableBlending"; + } + public static get kSetBlendingOverlap() { + return Commands.PROTOCOL_PREFIX + "SetBlendingOverlap"; + } static _all_commands = new Set([ Commands.kUnKnowCommand, @@ -627,6 +633,8 @@ export namespace Protocol { Commands.kSetBlendingAlphaParam, Commands.kSetBlendingPowerParam, Commands.kSetBlendingGammaParam, + Commands.kEnableBlending, + Commands.kSetBlendingOverlap, ]); public static get AllCommands() { return this._all_commands; @@ -3285,4 +3293,46 @@ export namespace Protocol { location = 0; //0:左融合带,1:上融合带,2:右融合带,3:下融合带 value = 0.0; } + + export class EnableBlendingRequestEntity extends PacketEntity { + constructor( + enable: boolean, + rpc_id = 0 + ) { + super(); + super.command = Commands.kEnableBlending; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.enable = row ?? false; + } + enable = false; + } + + export class SetBlendingOverlapRequestEntity extends PacketEntity { + constructor( + row: number, + column: number, + location: number, + enable: boolean, + width: number, + rpc_id = 0 + ) { + super(); + super.command = Commands.kSetBlendingOverlap; + super.flag = PacketEntity.FLAG_REQUEST; + super.rpc_id = rpc_id; + + this.row = row ?? 0; + this.column = column ?? 0; + this.location = location ?? 0; + this.enable = row ?? false; + this.width = width ?? 0; + } + row = 0; + column = 0; + location = 0; //0:左融合带,1:上融合带,2:右融合带,3:下融合带 + enable = false; + width = 0; + } }