aws_sdk_rekognition/operation/compare_faces/
_compare_faces_output.rs

1// Code generated by software.amazon.smithy.rust.codegen.smithy-rs. DO NOT EDIT.
2#[allow(missing_docs)] // documentation missing in model
3#[non_exhaustive]
4#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::fmt::Debug)]
5pub struct CompareFacesOutput {
6    /// <p>The face in the source image that was used for comparison.</p>
7    pub source_image_face: ::std::option::Option<crate::types::ComparedSourceImageFace>,
8    /// <p>An array of faces in the target image that match the source image face. Each <code>CompareFacesMatch</code> object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.</p>
9    pub face_matches: ::std::option::Option<::std::vec::Vec<crate::types::CompareFacesMatch>>,
10    /// <p>An array of faces in the target image that did not match the source image face.</p>
11    pub unmatched_faces: ::std::option::Option<::std::vec::Vec<crate::types::ComparedFace>>,
12    /// <p>The value of <code>SourceImageOrientationCorrection</code> is always null.</p>
13    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
14    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
15    pub source_image_orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
16    /// <p>The value of <code>TargetImageOrientationCorrection</code> is always null.</p>
17    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
18    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
19    pub target_image_orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
20    _request_id: Option<String>,
21}
22impl CompareFacesOutput {
23    /// <p>The face in the source image that was used for comparison.</p>
24    pub fn source_image_face(&self) -> ::std::option::Option<&crate::types::ComparedSourceImageFace> {
25        self.source_image_face.as_ref()
26    }
27    /// <p>An array of faces in the target image that match the source image face. Each <code>CompareFacesMatch</code> object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.</p>
28    ///
29    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.face_matches.is_none()`.
30    pub fn face_matches(&self) -> &[crate::types::CompareFacesMatch] {
31        self.face_matches.as_deref().unwrap_or_default()
32    }
33    /// <p>An array of faces in the target image that did not match the source image face.</p>
34    ///
35    /// If no value was sent for this field, a default will be set. If you want to determine if no value was sent, use `.unmatched_faces.is_none()`.
36    pub fn unmatched_faces(&self) -> &[crate::types::ComparedFace] {
37        self.unmatched_faces.as_deref().unwrap_or_default()
38    }
39    /// <p>The value of <code>SourceImageOrientationCorrection</code> is always null.</p>
40    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
41    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
42    pub fn source_image_orientation_correction(&self) -> ::std::option::Option<&crate::types::OrientationCorrection> {
43        self.source_image_orientation_correction.as_ref()
44    }
45    /// <p>The value of <code>TargetImageOrientationCorrection</code> is always null.</p>
46    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
47    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
48    pub fn target_image_orientation_correction(&self) -> ::std::option::Option<&crate::types::OrientationCorrection> {
49        self.target_image_orientation_correction.as_ref()
50    }
51}
52impl ::aws_types::request_id::RequestId for CompareFacesOutput {
53    fn request_id(&self) -> Option<&str> {
54        self._request_id.as_deref()
55    }
56}
57impl CompareFacesOutput {
58    /// Creates a new builder-style object to manufacture [`CompareFacesOutput`](crate::operation::compare_faces::CompareFacesOutput).
59    pub fn builder() -> crate::operation::compare_faces::builders::CompareFacesOutputBuilder {
60        crate::operation::compare_faces::builders::CompareFacesOutputBuilder::default()
61    }
62}
63
64/// A builder for [`CompareFacesOutput`](crate::operation::compare_faces::CompareFacesOutput).
65#[derive(::std::clone::Clone, ::std::cmp::PartialEq, ::std::default::Default, ::std::fmt::Debug)]
66#[non_exhaustive]
67pub struct CompareFacesOutputBuilder {
68    pub(crate) source_image_face: ::std::option::Option<crate::types::ComparedSourceImageFace>,
69    pub(crate) face_matches: ::std::option::Option<::std::vec::Vec<crate::types::CompareFacesMatch>>,
70    pub(crate) unmatched_faces: ::std::option::Option<::std::vec::Vec<crate::types::ComparedFace>>,
71    pub(crate) source_image_orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
72    pub(crate) target_image_orientation_correction: ::std::option::Option<crate::types::OrientationCorrection>,
73    _request_id: Option<String>,
74}
75impl CompareFacesOutputBuilder {
76    /// <p>The face in the source image that was used for comparison.</p>
77    pub fn source_image_face(mut self, input: crate::types::ComparedSourceImageFace) -> Self {
78        self.source_image_face = ::std::option::Option::Some(input);
79        self
80    }
81    /// <p>The face in the source image that was used for comparison.</p>
82    pub fn set_source_image_face(mut self, input: ::std::option::Option<crate::types::ComparedSourceImageFace>) -> Self {
83        self.source_image_face = input;
84        self
85    }
86    /// <p>The face in the source image that was used for comparison.</p>
87    pub fn get_source_image_face(&self) -> &::std::option::Option<crate::types::ComparedSourceImageFace> {
88        &self.source_image_face
89    }
90    /// Appends an item to `face_matches`.
91    ///
92    /// To override the contents of this collection use [`set_face_matches`](Self::set_face_matches).
93    ///
94    /// <p>An array of faces in the target image that match the source image face. Each <code>CompareFacesMatch</code> object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.</p>
95    pub fn face_matches(mut self, input: crate::types::CompareFacesMatch) -> Self {
96        let mut v = self.face_matches.unwrap_or_default();
97        v.push(input);
98        self.face_matches = ::std::option::Option::Some(v);
99        self
100    }
101    /// <p>An array of faces in the target image that match the source image face. Each <code>CompareFacesMatch</code> object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.</p>
102    pub fn set_face_matches(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::CompareFacesMatch>>) -> Self {
103        self.face_matches = input;
104        self
105    }
106    /// <p>An array of faces in the target image that match the source image face. Each <code>CompareFacesMatch</code> object provides the bounding box, the confidence level that the bounding box contains a face, and the similarity score for the face in the bounding box and the face in the source image.</p>
107    pub fn get_face_matches(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::CompareFacesMatch>> {
108        &self.face_matches
109    }
110    /// Appends an item to `unmatched_faces`.
111    ///
112    /// To override the contents of this collection use [`set_unmatched_faces`](Self::set_unmatched_faces).
113    ///
114    /// <p>An array of faces in the target image that did not match the source image face.</p>
115    pub fn unmatched_faces(mut self, input: crate::types::ComparedFace) -> Self {
116        let mut v = self.unmatched_faces.unwrap_or_default();
117        v.push(input);
118        self.unmatched_faces = ::std::option::Option::Some(v);
119        self
120    }
121    /// <p>An array of faces in the target image that did not match the source image face.</p>
122    pub fn set_unmatched_faces(mut self, input: ::std::option::Option<::std::vec::Vec<crate::types::ComparedFace>>) -> Self {
123        self.unmatched_faces = input;
124        self
125    }
126    /// <p>An array of faces in the target image that did not match the source image face.</p>
127    pub fn get_unmatched_faces(&self) -> &::std::option::Option<::std::vec::Vec<crate::types::ComparedFace>> {
128        &self.unmatched_faces
129    }
130    /// <p>The value of <code>SourceImageOrientationCorrection</code> is always null.</p>
131    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
132    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
133    pub fn source_image_orientation_correction(mut self, input: crate::types::OrientationCorrection) -> Self {
134        self.source_image_orientation_correction = ::std::option::Option::Some(input);
135        self
136    }
137    /// <p>The value of <code>SourceImageOrientationCorrection</code> is always null.</p>
138    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
139    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
140    pub fn set_source_image_orientation_correction(mut self, input: ::std::option::Option<crate::types::OrientationCorrection>) -> Self {
141        self.source_image_orientation_correction = input;
142        self
143    }
144    /// <p>The value of <code>SourceImageOrientationCorrection</code> is always null.</p>
145    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
146    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
147    pub fn get_source_image_orientation_correction(&self) -> &::std::option::Option<crate::types::OrientationCorrection> {
148        &self.source_image_orientation_correction
149    }
150    /// <p>The value of <code>TargetImageOrientationCorrection</code> is always null.</p>
151    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
152    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
153    pub fn target_image_orientation_correction(mut self, input: crate::types::OrientationCorrection) -> Self {
154        self.target_image_orientation_correction = ::std::option::Option::Some(input);
155        self
156    }
157    /// <p>The value of <code>TargetImageOrientationCorrection</code> is always null.</p>
158    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
159    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
160    pub fn set_target_image_orientation_correction(mut self, input: ::std::option::Option<crate::types::OrientationCorrection>) -> Self {
161        self.target_image_orientation_correction = input;
162        self
163    }
164    /// <p>The value of <code>TargetImageOrientationCorrection</code> is always null.</p>
165    /// <p>If the input image is in .jpeg format, it might contain exchangeable image file format (Exif) metadata that includes the image's orientation. Amazon Rekognition uses this orientation information to perform image correction. The bounding box coordinates are translated to represent object locations after the orientation information in the Exif metadata is used to correct the image orientation. Images in .png format don't contain Exif metadata.</p>
166    /// <p>Amazon Rekognition doesn’t perform image correction for images in .png format and .jpeg images without orientation information in the image Exif metadata. The bounding box coordinates aren't translated and represent the object locations before the image is rotated.</p>
167    pub fn get_target_image_orientation_correction(&self) -> &::std::option::Option<crate::types::OrientationCorrection> {
168        &self.target_image_orientation_correction
169    }
170    pub(crate) fn _request_id(mut self, request_id: impl Into<String>) -> Self {
171        self._request_id = Some(request_id.into());
172        self
173    }
174
175    pub(crate) fn _set_request_id(&mut self, request_id: Option<String>) -> &mut Self {
176        self._request_id = request_id;
177        self
178    }
179    /// Consumes the builder and constructs a [`CompareFacesOutput`](crate::operation::compare_faces::CompareFacesOutput).
180    pub fn build(self) -> crate::operation::compare_faces::CompareFacesOutput {
181        crate::operation::compare_faces::CompareFacesOutput {
182            source_image_face: self.source_image_face,
183            face_matches: self.face_matches,
184            unmatched_faces: self.unmatched_faces,
185            source_image_orientation_correction: self.source_image_orientation_correction,
186            target_image_orientation_correction: self.target_image_orientation_correction,
187            _request_id: self._request_id,
188        }
189    }
190}