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.

43 lines
728 B

  1. export class BoundingBoxItem {
  2. constructor(
  3. public id: number,
  4. public uuid: string,
  5. public label: number,
  6. public x: number,
  7. public y: number,
  8. public width: number,
  9. public height: number
  10. ) {}
  11. static valueOf({
  12. id,
  13. uuid,
  14. label,
  15. x,
  16. y,
  17. width,
  18. height
  19. }: {
  20. id: number
  21. uuid: string
  22. label: number
  23. x: number
  24. y: number
  25. width: number
  26. height: number
  27. }): BoundingBoxItem {
  28. return new BoundingBoxItem(id, uuid, label, x, y, width, height)
  29. }
  30. toObject(): Object {
  31. return {
  32. id: this.id,
  33. uuid: this.uuid,
  34. label: this.label,
  35. x: this.x,
  36. y: this.y,
  37. width: this.width,
  38. height: this.height
  39. }
  40. }
  41. }