You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
80 lines
1.9 KiB
80 lines
1.9 KiB
using UnityEngine;
|
|
using UnityEngine.UI;
|
|
|
|
namespace FFmpeg.Demo
|
|
{
|
|
public class WatermarkView : MonoBehaviour
|
|
{
|
|
WatermarkData config = new WatermarkData();
|
|
|
|
public Text imageScaleText;
|
|
public Slider imageScaleSlider;
|
|
|
|
public Text xPosNormalText;
|
|
public Slider xPosNormalSlider;
|
|
|
|
public Text yPosNormalText;
|
|
public Slider yPosNormalSlider;
|
|
|
|
//------------------------------
|
|
|
|
void Awake()
|
|
{
|
|
OnImageScale(imageScaleSlider.value);
|
|
OnXPositionNormalized(xPosNormalSlider.value);
|
|
OnYPositionNormalized(yPosNormalSlider.value);
|
|
}
|
|
|
|
//------------------------------
|
|
|
|
public void Open()
|
|
{
|
|
gameObject.SetActive(true);
|
|
}
|
|
|
|
//------------------------------
|
|
|
|
public void OnVideoInputPath(string fullPath)
|
|
{
|
|
config.inputPath = fullPath;
|
|
}
|
|
|
|
public void OnImageInputPath(string fullPath)
|
|
{
|
|
config.imagePath = fullPath;
|
|
}
|
|
|
|
public void OnOutputPath(string fullPath)
|
|
{
|
|
config.outputPath = fullPath;
|
|
}
|
|
|
|
public void OnImageScale(float multiplier)
|
|
{
|
|
config.imageScale = multiplier;
|
|
imageScaleText.text = "Image Scale: " + multiplier;
|
|
}
|
|
|
|
public void OnXPositionNormalized(float x)
|
|
{
|
|
config.xPosNormal = x;
|
|
xPosNormalText.text = "Normalized X of image center: " + x;
|
|
}
|
|
|
|
public void OnYPositionNormalized(float y)
|
|
{
|
|
config.yPosNormal = y;
|
|
yPosNormalText.text = "Normalized Y of image center: " + y;
|
|
}
|
|
|
|
//------------------------------
|
|
|
|
public void OnWatermark()
|
|
{
|
|
FFmpegCommands.Watermark(config);
|
|
gameObject.SetActive(false);
|
|
}
|
|
|
|
//------------------------------
|
|
}
|
|
} |