/// @brief scff_interprocess用に変換 public scff_interprocess.LayoutParameter ToInterprocess(int bound_width, int bound_height) { scff_interprocess.LayoutParameter output = new scff_interprocess.LayoutParameter(); // 相対比率→ピクセル値変換 // Left/Topは切り捨て、Right/Bottomは切り上げ output.bound_x = (Int32)Math.Ceiling(this.BoundRelativeLeft * bound_width); output.bound_y = (Int32)Math.Ceiling(this.BoundRelativeTop * bound_height); output.bound_width = (Int32)Math.Floor(this.BoundRelativeRight * bound_width) - output.bound_x; output.bound_height = (Int32)Math.Floor(this.BoundRelativeBottom * bound_height) - output.bound_y; output.window = (UInt64)this.Window; output.clipping_x = this.ClippingX; output.clipping_y = this.ClippingY; output.clipping_width = this.ClippingWidth; output.clipping_height = this.ClippingHeight; output.show_cursor = Convert.ToByte(this.ShowCursor); output.show_layered_window = Convert.ToByte(this.ShowLayeredWindow); // 拡大縮小設定 output.swscale_config = this.SWScaleConfig.ToInterprocess(); output.stretch = Convert.ToByte(this.Stretch); output.keep_aspect_ratio = Convert.ToByte(this.KeepAspectRatio); output.rotate_direction = (Int32)this.RotateDirection; return(output); }
/// @brief scff_interprocess用に変換 public scff_interprocess.LayoutParameter ToInterprocess(int bound_width, int bound_height) { scff_interprocess.LayoutParameter output = new scff_interprocess.LayoutParameter(); // 相対比率→ピクセル値変換 // Left/Topは切り捨て、Right/Bottomは切り上げ output.bound_x = (Int32)Math.Ceiling(this.BoundRelativeLeft * bound_width); output.bound_y = (Int32)Math.Ceiling(this.BoundRelativeTop * bound_height); output.bound_width = (Int32)Math.Floor(this.BoundRelativeRight * bound_width) - output.bound_x; output.bound_height = (Int32)Math.Floor(this.BoundRelativeBottom * bound_height) - output.bound_y; output.window = (UInt64)this.Window; output.clipping_x = this.ClippingX; output.clipping_y = this.ClippingY; output.clipping_width = this.ClippingWidth; output.clipping_height = this.ClippingHeight; output.show_cursor = Convert.ToByte(this.ShowCursor); output.show_layered_window = Convert.ToByte(this.ShowLayeredWindow); // 拡大縮小設定 output.swscale_config = this.SWScaleConfig.ToInterprocess(); output.stretch = Convert.ToByte(this.Stretch); output.keep_aspect_ratio = Convert.ToByte(this.KeepAspectRatio); output.rotate_direction = (Int32)this.RotateDirection; return output; }
/// @brief scff_interprocessモジュールのパラメータを生成 public static scff_interprocess.LayoutParameter ToInterprocess(LayoutParameter input, int bound_width, int bound_height) { scff_interprocess.LayoutParameter output = new scff_interprocess.LayoutParameter(); //-- GUIクライアント限定の処理! output.bound_x = (Int32)(bound_width * input.BoundRelativeLeft) / 100; output.bound_y = (Int32)(bound_height * input.BoundRelativeTop) / 100; output.bound_width = (Int32)(bound_width * input.BoundRelativeRight) / 100 - output.bound_x; output.bound_height = (Int32)(bound_height * input.BoundRelativeBottom) / 100 - output.bound_y; //-- output.window = (UInt64)input.Window; output.clipping_x = input.ClippingX; output.clipping_y = input.ClippingY; output.clipping_width = input.ClippingWidth; output.clipping_height = input.ClippingHeight; output.show_cursor = Convert.ToByte(input.ShowCursor); output.show_layered_window = Convert.ToByte(input.ShowLayeredWindow); // 拡大縮小設定 output.swscale_config = SWScaleConfigFactory.ToInterprocess(input.SWScaleConfig); output.stretch = Convert.ToByte(input.Stretch); output.keep_aspect_ratio = Convert.ToByte(input.KeepAspectRatio); output.rotate_direction = (Int32)input.RotateDirection; return output; }