Face Engine SDK  5.14.0
A face detection, recognition and tracking engine.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
SubImage.h
1 #pragma once
2 
3 namespace fsdk
4 {
10  struct SubImage
11  {
12  void* data;
13 
14  int pitch;
15 
16  int x;
17  int y;
18 
19  int width;
20  int height;
21 
23 
26  SubImage() noexcept
27  : data(nullptr)
28  , pitch(0)
29  , x(0), y(0)
30  , width(0)
31  , height(0) {}
32 
35  template<typename T>
36  T* getDataAs() noexcept {
37  return reinterpret_cast<T*>(data);
38  }
39 
42  template<typename T>
43  const T* getDataAs() const noexcept {
44  return reinterpret_cast<const T*>(data);
45  }
46 
48  Point2i getOrigin() const noexcept {
49  return Point2i(x, y);
50  }
51 
53  Size getSize() const noexcept {
54  return Size(width, height);
55  }
56 
59  Rect getRect() const noexcept {
60  return Rect(x, y, width, height);
61  }
62  };
63 }
Size getSize() const noexcept
Definition: SubImage.h:53
Vector2< int > Point2i
Definition: Vector2.h:290
Image format.
Definition: Format.h:11
int x
Sub image origin x coordinate.
Definition: SubImage.h:16
int height
Sub image height.
Definition: SubImage.h:20
Format format
Sub image format.
Definition: SubImage.h:22
int pitch
Number of bytes to the next scanline of the sub image.
Definition: SubImage.h:14
int y
Sub image origin y coordinate.
Definition: SubImage.h:17
const T * getDataAs() const noexcept
Definition: SubImage.h:43
Point2i getOrigin() const noexcept
Definition: SubImage.h:48
void * data
Beginning of data sub image data.
Definition: SubImage.h:12
int width
Sub image width.
Definition: SubImage.h:19
SubImage() noexcept
intializes empty sub image.
Definition: SubImage.h:26
Rect getRect() const noexcept
Definition: SubImage.h:59
T * getDataAs() noexcept
Definition: SubImage.h:36
Sub Image.
Definition: SubImage.h:10
Vector2< int > Size
Definition: Vector2.h:299