Face Engine SDK  4.7.0
A face detection, recognition and tracking engine.
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 }
fsdk::SubImage::width
int width
Sub image width.
Definition: SubImage.h:19
fsdk::SubImage::SubImage
SubImage() noexcept
intializes empty sub image.
Definition: SubImage.h:26
fsdk::Vector2< int >
fsdk::SubImage::format
Format format
Sub image format.
Definition: SubImage.h:22
fsdk::SubImage::getOrigin
Point2i getOrigin() const noexcept
Definition: SubImage.h:48
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::BaseRect< int >
fsdk::Format
Image format.
Definition: Format.h:11
fsdk::SubImage::pitch
int pitch
Number of bytes to the next scanline of the sub image.
Definition: SubImage.h:14
fsdk::SubImage::y
int y
Sub image origin y coordinate.
Definition: SubImage.h:17
fsdk::SubImage::getRect
Rect getRect() const noexcept
Definition: SubImage.h:59
fsdk::Size
Vector2< int > Size
Definition: Vector2.h:301
fsdk::SubImage::getDataAs
const T * getDataAs() const noexcept
Definition: SubImage.h:43
fsdk::SubImage::data
void * data
Beginning of data sub image data.
Definition: SubImage.h:12
fsdk::SubImage::height
int height
Sub image height.
Definition: SubImage.h:20
fsdk::Point2i
Vector2< int > Point2i
Definition: Vector2.h:292
fsdk::SubImage::x
int x
Sub image origin x coordinate.
Definition: SubImage.h:16
fsdk::SubImage
Sub Image.
Definition: SubImage.h:11
fsdk::SubImage::getSize
Size getSize() const noexcept
Definition: SubImage.h:53
fsdk::SubImage::getDataAs
T * getDataAs() noexcept
Definition: SubImage.h:36