Éanna Ó Catháin | 919c14e | 2020-09-14 17:36:49 +0100 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2020 Arm Ltd and Contributors. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
| 6 | #include "DetectedObject.hpp" |
| 7 | |
| 8 | namespace od |
| 9 | { |
| 10 | |
| 11 | DetectedObject::DetectedObject() : |
| 12 | DetectedObject(0u, "", BoundingBox(), 0u) |
| 13 | {} |
| 14 | |
| 15 | DetectedObject::DetectedObject( |
| 16 | unsigned int id, |
| 17 | std::string label, |
| 18 | const BoundingBox &boundingBox, |
| 19 | float score) : |
| 20 | m_Id(id), |
| 21 | m_Label(std::move(label)), |
| 22 | m_BoundingBox(boundingBox), |
| 23 | m_Score(score) |
| 24 | {} |
| 25 | |
| 26 | unsigned int DetectedObject::GetId() const |
| 27 | { |
| 28 | return m_Id; |
| 29 | } |
| 30 | |
| 31 | const std::string &DetectedObject::GetLabel() const |
| 32 | { |
| 33 | return m_Label; |
| 34 | } |
| 35 | |
| 36 | const BoundingBox &DetectedObject::GetBoundingBox() const |
| 37 | { |
| 38 | return m_BoundingBox; |
| 39 | } |
| 40 | |
| 41 | float DetectedObject::GetScore() const |
| 42 | { |
| 43 | return m_Score; |
| 44 | } |
| 45 | |
| 46 | void DetectedObject::SetId(unsigned int id) |
| 47 | { |
| 48 | m_Id = id; |
| 49 | } |
| 50 | |
| 51 | void DetectedObject::SetLabel(const std::string &label) |
| 52 | { |
| 53 | m_Label = label; |
| 54 | } |
| 55 | |
| 56 | void DetectedObject::SetBoundingBox(const BoundingBox &boundingBox) |
| 57 | { |
| 58 | m_BoundingBox = boundingBox; |
| 59 | } |
| 60 | |
| 61 | void DetectedObject::SetScore(float score) |
| 62 | { |
| 63 | m_Score = score; |
| 64 | } |
| 65 | }// namespace od |