package com.ycwl.basic.model.viid.entity;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;

@Data
public class FacePositionObject {
    private Integer imgWidth;
    private Integer imgHeight;
    private Integer ltX;
    private Integer ltY;
    private Integer rbX;
    private Integer rbY;
    @JsonProperty("width")
    public Integer getWidth(){
        return rbX - ltX;
    }
    @JsonProperty("height")
    public Integer getHeight(){
        return rbY - ltY;
    }

    public Integer centerX(){
        return (ltX + rbX) / 2;
    }
    public Integer centerY(){
        return (ltY + rbY) / 2;
    }
}
