package com.its.vms.xnettcp.vms.protocol.dto;

import com.its.vms.xnettcp.vms.protocol.enums.eVmsFormObjectKind;
import lombok.Getter;
import lombok.Setter;

/**
 * Bitmap Object
 */
@Getter
@Setter
public class VmsFormObjBitmap extends VmsFormObj {
    private int width;      // 2
    private int height;     // 2
    private int type;       // 1
    private int reserved;   // 1
    private byte[] image;   // n

    public VmsFormObjBitmap(int objSize, int blinking, int posX, int posY, int bkClr, int width, int height, int type, byte[] image) {
        super(eVmsFormObjectKind.OBJECT_BITMAP.getValue(), objSize, blinking, posX, posY, bkClr);

        this.width = width;
        this.height = height;
        this.type = type;
        this.reserved = 0;
        this.image = image;
    }

    @Override
    public void calSize() {
        setSize(6 + this.image.length);
    }

}
