| Face Engine SDK 5.12.0 A face detection, recognition and tracking engine.

Image.h
1 #pragma once
2
3 #include <fsdk/Def.h>
4 #include <fsdk/Types/Format.h>
5 #include <fsdk/Types/Rect.h>
6 #include <fsdk/Types/Result.h>
7 #include <fsdk/Types/Sizer.h>
8 #include <fsdk/Types/SubImage.h>
9
10 namespace fsdk
11 {
12
13 struct IArchive;
14
38 struct Image {
39
43 enum class Type: uint8_t {
44 BMP,
45 JPG,
46 PNG,
47 PPM,
48 TIFF,
49 Unknown
50 };
51
55 enum class TargetDevice {
56 CPU,
57 GPU,
58 NPU,
59 };
60
67 enum class ImageCompression {
68 IC_NO_COMPRESSION,
69 IC_SMALL_COMPRESSION,
70 IC_MEDIUM_COMPRESSION,
71 IC_HARD_COMPRESSION,
72 IC_BEST_COMPRESSION,
73 };
77 enum class Error: uint32_t {
78 Ok,
79 InvalidWidth,
80 InvalidHeight,
81 InvalidDataPtr,
82 InvalidDataSize,
83 InvalidImage,
84 InvalidArchive,
85 InvalidPath,
86 InvalidType,
87 InvalidFormat,
88 InvalidBitmap,
89 InvalidMemory,
90 InvalidConversion,
91 InvalidResidence,
92 InvalidDevice,
93 FailedToSave,
94 FailedToLoad,
95 FailedToInitialize,
96 ReleasedInOtherThread
97 };
98
104 enum class MemoryResidence: uint32_t {
105 MemoryCPU,
106 MemoryGPU,
107 MemoryNPU,
108 MemoryNPU_DPP,
109 };
110
113 FSDK_API Image() noexcept;
114
125 FSDK_API Image(
126 int width,
127 int height,
128 Format format,
129 MemoryResidence residence = MemoryResidence::MemoryCPU,
130 int deviceId = 0) noexcept;
131
144 FSDK_API Image(
145 int width,
146 int height,
147 Format format,
148 const void* data,
149 MemoryResidence residence = MemoryResidence::MemoryCPU,
150 int deviceId = 0) noexcept;
151
169 FSDK_API Image(
170 int width,
171 int height,
172 Format format,
173 void* data,
174 bool copy,
175 MemoryResidence residence = MemoryResidence::MemoryCPU,
176 int deviceId = 0) noexcept;
177
182 FSDK_API Image(const Image& other) noexcept;
183
188 FSDK_API Image(Image&& other) noexcept;
189
195 FSDK_API explicit Image(const SubImage& subImage) noexcept;
196
197 FSDK_API ~Image();
198
213 FSDK_API Result<Error> create(
214 int width,
215 int height,
216 Format format,
217 bool cleanup = true,
218 MemoryResidence residence = MemoryResidence::MemoryCPU,
219 int deviceId = 0) noexcept;
220
236 FSDK_API Result<Error> create(
237 int width,
238 int height,
239 Format format,
240 const void* data,
241 MemoryResidence residence = MemoryResidence::MemoryCPU,
242 int deviceId = 0) noexcept;
243
263 FSDK_API Result<Error> create(
264 int width,
265 int height,
266 Format format,
267 void* data,
268 bool copy,
269 MemoryResidence residence = MemoryResidence::MemoryCPU,
270 int deviceId = 0) noexcept;
271
281 FSDK_API Result<Error> create(const fsdk::Image& source, MemoryResidence residence, int deviceId = 0) noexcept;
282
300 FSDK_API Result<Error> set(
301 int width,
302 int height,
303 Format format,
304 const void* data,
305 MemoryResidence residence = MemoryResidence::MemoryCPU,
306 int deviceId = 0) noexcept;
307
329 FSDK_API Result<Error> set(
330 int width,
331 int height,
332 Format format,
333 void* data,
334 bool copy,
335 MemoryResidence residence = MemoryResidence::MemoryCPU,
336 int deviceId = 0) noexcept;
337
343 FSDK_API Result<Error> set(const Image& other) noexcept;
344
350 FSDK_API Result<Error> set(const SubImage& subImage) noexcept;
351
364 FSDK_API SubImage map(int x, int y, int width, int height) const noexcept;
365
373 SubImage map(const Rect& rect) const noexcept {
374 return map(rect.x, rect.y, rect.width, rect.height);
375 }
376
386 SubImage map(const Size& size) const noexcept {
387 return map(Point2i(0, 0), size);
388 }
389
398 SubImage map(const Point2i& origin, const Size& size) const noexcept {
399 return map(origin.x, origin.y, size.x, size.y);
400 }
401
415 FSDK_API Image extract(int x, int y, int width, int height) const noexcept;
416
425 Image extract(const Rect& rect) const noexcept {
426 return extract(rect.x, rect.y, rect.width, rect.height);
427 }
428
439 Image extract(const Size& size) const noexcept {
440 return extract(Point2i(0, 0), size);
441 }
442
452 Image extract(const Point2i& origin, const Size& size) const noexcept {
453 return extract(origin.x, origin.y, size.x, size.y);
454 }
455
463 FSDK_API static Result<Error> guessTypeFromMemory(const void* data, const uint32_t sizeInBytes, Type& type) noexcept;
464
470 Image clone() const noexcept {
471 return {
472 getWidth(),
473 getHeight(),
474 getFormat(),
475 getData(),
476 getMemoryResidence(),
477 getDeviceId()
478 };
479 }
480
499 FSDK_API Result<Image::Error> convert(Image& dest, int x, int y, int width, int height, Format format, TargetDevice device = TargetDevice::CPU) const noexcept;
500
515 Result<Image::Error> convert(Image& dest, const Point2i& origin, const Size& size, Format format, TargetDevice device = TargetDevice::CPU) const noexcept {
516 return convert(dest, origin.x, origin.y, size.x, size.y, format, device);
517 }
518
534 Result<Image::Error> convert(Image& dest, const Size& size, Format format, TargetDevice device = TargetDevice::CPU) const noexcept {
535 return convert(dest, Point2i(0, 0), size, format, device);
536 }
537
551 Result<Image::Error> convert(Image& dest, const Rect& rect, Format format, TargetDevice device = TargetDevice::CPU) const noexcept {
552 return convert(dest, rect.x, rect.y, rect.width, rect.height, format, device);
553 }
554
565 Result<Image::Error> convert(Image& dest, Format format, TargetDevice device = TargetDevice::CPU) const noexcept {
566 return convert(dest, getRect(), format, device);
567 }
568
574 FSDK_API Image rescale(float scale) const noexcept;
575
586 FSDK_API Result <Image::Error> save(const char* path,
587 fsdk::Image::ImageCompression additionalFlag =
588 fsdk::Image::ImageCompression::IC_NO_COMPRESSION) const noexcept;
589
600 FSDK_API Result<Error> save(
601 const char* path,
602 const Format format) const noexcept;
603
614 FSDK_API Result <Image::Error>
615 saveToMemory(Image::Type type,
616 IArchive* archive,
617 fsdk::Image::ImageCompression additionalFlag = fsdk::Image::ImageCompression::IC_NO_COMPRESSION) const noexcept;
618
630 FSDK_API Result <Image::Error> saveToMemory(
631 Image::Type type,
632 IArchive* archive,
633 const Format format) const noexcept;
634
647 FSDK_API Result<Error> load(const char* path) noexcept;
648
658 FSDK_API Result<Error> load(
659 const char* path,
660 const Format format) noexcept;
661
675 FSDK_API Result<Error> loadFromMemory(
676 const void* data,
677 const uint32_t sizeInBytes) noexcept;
678
689 FSDK_API Result<Error> loadFromMemory(
690 const void* data,
691 const uint32_t sizeInBytes,
692 const Format format) noexcept;
693
709 FSDK_API Result<Error> loadFromMemoryOfType(
710 const void* data,
711 const uint32_t sizeInBytes,
712 const Type type) noexcept;
713
725 FSDK_API Result<Error> loadFromMemoryOfType(
726 const void* data,
727 const uint32_t sizeInBytes,
728 const Type type,
729 const Format format) noexcept;
730
734 Image& operator = (const Image& other) noexcept {
735 set(other);
736
737 return *this;
738 }
739
743 Image& operator = (Image&& other) noexcept {
744 if(this != &other) {
745 release();
746 swap(other);
747 }
748
749 return *this;
750 }
751
753 bool isNull() const noexcept {
754 return getData() == nullptr;
755 }
756
760 bool isValid() const noexcept {
761 return !isNull() &&
762 getHeight() > 0 &&
763 getWidth() > 0 &&
764 getFormat().isValid();
765 }
766
770 operator bool () const noexcept {
771 return isValid();
772 }
773
778 FSDK_API void* getScanLine(int y) noexcept;
779
784 FSDK_API const void* getScanLine(int y) const noexcept;
785
788 FSDK_API int getDataSize() const noexcept;
789
793 FSDK_API void getDataSize(Sizer& sizer) const noexcept;
794
799 template<typename T>
800 T* getScanLineAs(int y) noexcept {
801 return reinterpret_cast<T*>(getScanLine(y));
802 }
803
808 template<typename T>
809 const T* getScanLineAs(int y) const noexcept {
810 return reinterpret_cast<const T*>(getScanLine(y));
811 }
812
815 void* getData() noexcept {
816 return m_data;
817 }
818
821 const void* getData() const noexcept {
822 return m_data;
823 }
824
827 template<typename T>
828 T* getDataAs() noexcept {
829 return reinterpret_cast<T*>(getData());
830 }
831
834 template<typename T>
835 const T* getDataAs() const noexcept {
836 return reinterpret_cast<const T*>(getData());
837 }
838
840 int getRowSize() const noexcept {
841 return getFormat().computePitch(getWidth());
842 }
843
845 int getWidth() const noexcept {
846 return m_width;
847 }
848
850 int getHeight() const noexcept {
851 return m_height;
852 }
853
855 float getAspectRatio() const noexcept {
856 return
857 static_cast<float>(getWidth()) /
858 static_cast<float>(getHeight());
859 }
860
862 Format getFormat() const noexcept {
863 return m_format;
864 }
865
866 MemoryResidence getMemoryResidence() const noexcept {
867 return m_residence;
868 }
869
870 int getDeviceId() const noexcept {
871 return m_deviceId;
872 }
873
875 Size getSize() const noexcept {
876 return Size(getWidth(), getHeight());
877 }
878
882 Rect getRect() const noexcept {
883 return Rect(0, 0, getWidth(), getHeight());
884 }
885
890 bool ownsData() const noexcept {
891 return !!m_ref;
892 }
893
898 bool isSharedWith(const Image& other) const noexcept {
899 return getData() == other.getData();
900 }
901
905 void swap(Image& other) noexcept {
906 std::swap(m_data, other.m_data);
907 std::swap(m_ref, other.m_ref);
908 std::swap(m_height, other.m_height);
909 std::swap(m_width, other.m_width);
910 std::swap(m_format, other.m_format);
911 std::swap(m_residence, other.m_residence);
912 }
913
916 void reset() noexcept {
917 Image().swap(*this);
918 }
919
925 bool equalWeak(const fsdk::Image& other) const noexcept {
926 return
927 m_width == other.getWidth() &&
928 m_height == other.getHeight() &&
929 m_format == other.getFormat() &&
930 m_residence == other.getMemoryResidence();
931 }
932
938 bool equalStrong(const fsdk::Image& other) const noexcept {
939 return equalWeak(other) && m_data == other.getData();
940 }
941
942
943 FSDK_API void putPixel(uint32_t x, uint32_t y) noexcept;
944
945 protected:
946 void* m_data;
947 int* m_ref;
948 int m_height;
949 int m_width;
950 int m_deviceId;
951 Format m_format;
952 MemoryResidence m_residence;
953
958 FSDK_API static void* allocate(int size) noexcept;
959
963 FSDK_API static void deallocate(void* memory) noexcept;
964
968 FSDK_API int retain() noexcept;
969
973 FSDK_API int release() noexcept;
974
978 FSDK_API int getRefCount() const noexcept;
979 };
980
984 template<>
985 struct ErrorTraits<Image::Error> {
986
987 static bool isOk(Image::Error error) noexcept {
988 return error == Image::Error::Ok;
989 }
990
991 static const char* toString (Image::Error error) noexcept {
992 switch(error) {
993 case Image::Error::Ok: return "Ok";
994 case Image::Error::InvalidType: return "Unsupported type";
995 case Image::Error::InvalidPath: return "Invalid path";
996 case Image::Error::FailedToSave: return "Error during image saving";
997 case Image::Error::FailedToLoad: return "Error during image loading";
998 case Image::Error::InvalidImage: return "Invalid image";
999 case Image::Error::InvalidWidth: return "Invalid image width";
1000 case Image::Error::InvalidHeight: return "Invalid image height";
1001 case Image::Error::InvalidFormat: return "Unsupported format";
1002 case Image::Error::InvalidMemory: return "Memory error";
1003 case Image::Error::InvalidBitmap: return "Bitmap error";
1004 case Image::Error::InvalidArchive: return "Archive error";
1005 case Image::Error::InvalidDataPtr: return "Bad input data pointer";
1006 case Image::Error::InvalidDataSize: return "Bad input data size";
1007 case Image::Error::InvalidConversion: return "Required conversion not implemented";
1008 case Image::Error::InvalidDevice: return "Selected Target Device is not supported for this system";
1009 case Image::Error::FailedToInitialize: return "Error during initialization";
1010 case Image::Error::ReleasedInOtherThread: return "Failed to retain image: it was released in another thread.";
1011 default: return "Unknown error";
1012 }
1013 }
1014 };
1015
1019 using ImageType = Image::Type;
1020 using ImageError = Image::Error;
1021 using TargetDevice = Image::TargetDevice;
1022 using ImageCompression = Image::ImageCompression;
1023
1024 }
fsdk::Image::Error::InvalidMemory
Error at memory opening.
fsdk::Image::ImageCompression::IC_MEDIUM_COMPRESSION
medium compression (only for png or jpg)
FSDK_API
#define FSDK_API
Dummy.
Definition: Def.h:27
fsdk
SDK namespace.
Definition: IAGSEstimator.h:8
fsdk::Image::loadFromMemory
FSDK_API Result< Error > loadFromMemory(const void *data, const uint32_t sizeInBytes) noexcept
Load image from memory.
fsdk::Image::getAspectRatio
float getAspectRatio() const noexcept
Definition: Image.h:855
fsdk::Result
A structure that encapsulates an action result enumeration.
Definition: Result.h:29
fsdk::Image::reset
void reset() noexcept
Reset image contents.
Definition: Image.h:916
fsdk::Image::deallocate
static FSDK_API void deallocate(void *memory) noexcept
Free memory.
fsdk::Image::equalStrong
bool equalStrong(const fsdk::Image &other) const noexcept
Performs strong comparison of this image with other. Beside weak comparison strong comparison also ch...
Definition: Image.h:938
fsdk::Point2i
Vector2< int > Point2i
Definition: Vector2.h:290
fsdk::Image::getRect
Rect getRect() const noexcept
Definition: Image.h:882
fsdk::Image::MemoryResidence::MemoryNPU_DPP
Image in NPU PreProcessing module memory.
fsdk::Image::m_height
int m_height
image height.
Definition: Image.h:948
fsdk::Image::convert
FSDK_API Result< Image::Error > convert(Image &dest, int x, int y, int width, int height, Format format, TargetDevice device=TargetDevice::CPU) const noexcept
Convert image format.
fsdk::Image::ImageCompression::IC_BEST_COMPRESSION
maximum compression level (only for png or jpg)
fsdk::Image::Error::InvalidFormat
Unsupported format.
fsdk::Format::computePitch
int computePitch(int rowWidth) const noexcept
Compute row size in bytes.
Definition: Format.h:140
fsdk::Format::isValid
bool isValid() const noexcept
Definition: Format.h:193
fsdk::Image::convert
Result< Image::Error > convert(Image &dest, const Point2i &origin, const Size &size, Format format, TargetDevice device=TargetDevice::CPU) const noexcept
Convert image format.
Definition: Image.h:515
fsdk::Format
Image format.
Definition: Format.h:11
fsdk::Image::isNull
bool isNull() const noexcept
Definition: Image.h:753
fsdk::Image::Error::InvalidPath
Bad path for saving / loading.
fsdk::Image::load
FSDK_API Result< Error > load(const char *path) noexcept
Load image from file.
fsdk::Image::Error::Ok
Ok.
fsdk::Image::getData
void * getData() noexcept
Definition: Image.h:815
fsdk::Image::getFormat
Format getFormat() const noexcept
Definition: Image.h:862
fsdk::Image::getData
const void * getData() const noexcept
Definition: Image.h:821
fsdk::Image::getDataAs
const T * getDataAs() const noexcept
Definition: Image.h:835
fsdk::Image::saveToMemory
FSDK_API Result< Image::Error > saveToMemory(Image::Type type, IArchive *archive, fsdk::Image::ImageCompression additionalFlag=fsdk::Image::ImageCompression::IC_NO_COMPRESSION) const noexcept
Save image to memory buffer.
fsdk::Image::set
FSDK_API Result< Error > set(int width, int height, Format format, const void *data, MemoryResidence residence=MemoryResidence::MemoryCPU, int deviceId=0) noexcept
Initializes an image with provided data. If current image is not empty and it&#39;s size and format match...
fsdk::Image::getRowSize
int getRowSize() const noexcept
Definition: Image.h:840
fsdk::Image::getScanLineAs
T * getScanLineAs(int y) noexcept
Get image scanline data.
Definition: Image.h:800
fsdk::Image::extract
FSDK_API Image extract(int x, int y, int width, int height) const noexcept
Extract a sub image of this image. The new image will have it&#39;s own reference count.
fsdk::Image::rescale
FSDK_API Image rescale(float scale) const noexcept
Rescale image keeping proportions.
fsdk::ErrorTraits
Definition: Result.h:9
fsdk::Image::Error::InvalidBitmap
Bitmap error occurred.
fsdk::Image::MemoryResidence
MemoryResidence
Memory residence.
Definition: Image.h:104
fsdk::Image::getHeight
int getHeight() const noexcept
Definition: Image.h:850
fsdk::Image::Error::InvalidConversion
Conversion not implemented.
fsdk::Image::m_format
Format m_format
image format (
Definition: Image.h:951
Def.h
Common SDK definitions.
fsdk::Image::Error::InvalidResidence
Invalid memory residence.
fsdk::Image::Error::InvalidDataSize
Bad input data size.
fsdk::Image::map
SubImage map(const Size &size) const noexcept
Map image contents to a given area.
Definition: Image.h:386
fsdk::Image::isSharedWith
bool isSharedWith(const Image &other) const noexcept
Definition: Image.h:898
fsdk::Image::m_data
void * m_data
raw image data.
Definition: Image.h:946
fsdk::Image::convert
Result< Image::Error > convert(Image &dest, const Size &size, Format format, TargetDevice device=TargetDevice::CPU) const noexcept
Convert image format.
Definition: Image.h:534
fsdk::Image::create
FSDK_API Result< Error > create(int width, int height, Format format, bool cleanup=true, MemoryResidence residence=MemoryResidence::MemoryCPU, int deviceId=0) noexcept
Initializes an empty image and preallocates storage buffer of given size.
fsdk::Image::m_ref
int * m_ref
reference counter. nullptr if image does not own data.
Definition: Image.h:947
fsdk::Image::getScanLineAs
const T * getScanLineAs(int y) const noexcept
Get image scanline data.
Definition: Image.h:809
fsdk::Image::getRefCount
FSDK_API int getRefCount() const noexcept
Obtain reference count.
fsdk::Image::Error::FailedToSave
Error during image saving.
fsdk::Image::m_deviceId
int m_deviceId
id of the device where image memory is allocated
Definition: Image.h:950
fsdk::Image::map
FSDK_API SubImage map(int x, int y, int width, int height) const noexcept
Map image contents to a given area.
fsdk::Image::extract
Image extract(const Point2i &origin, const Size &size) const noexcept
Extract a sub image of this image. The new image will have it&#39;s own reference count.
Definition: Image.h:452
fsdk::Image::allocate
static FSDK_API void * allocate(int size) noexcept
Allocate memory.
fsdk::Image::Type
Type
Supported image types.
Definition: Image.h:43
fsdk::Image::equalWeak
bool equalWeak(const fsdk::Image &other) const noexcept
Performs weak comparison of this image with other. Weak in this context means only image parameters s...
Definition: Image.h:925
fsdk::Image::swap
void swap(Image &other) noexcept
Swap contents with another image.
Definition: Image.h:905
fsdk::Image::Error::FailedToLoad
Error during image loading.
fsdk::Image::Error::ReleasedInOtherThread
Failed to retain image: it was released in another thread.
fsdk::Image::m_width
int m_width
image width.
Definition: Image.h:949
fsdk::Image::MemoryResidence::MemoryGPU
Image in Cuda device memory.
fsdk::Image::Error::InvalidType
Unsupported type.
fsdk::Image::ImageCompression
ImageCompression
Supported compression type is used only for jpg and png types.
Definition: Image.h:67
fsdk::Image
Image.
Definition: Image.h:38
fsdk::Image::ImageCompression::IC_SMALL_COMPRESSION
compression with minimal (or without) quality loss (only for png or jpg image)
fsdk::Image::Error::InvalidArchive
Archive error.
fsdk::Image::getDataAs
T * getDataAs() noexcept
Definition: Image.h:828
fsdk::Image::getDataSize
FSDK_API int getDataSize() const noexcept
fsdk::Image::Error::InvalidDevice
Target Device is not supported for this system.
fsdk::Image::operator=
Image & operator=(const Image &other) noexcept
Assign other image.
Definition: Image.h:734
fsdk::Image::release
FSDK_API int release() noexcept
Decrease reference count.
fsdk::Image::MemoryResidence::MemoryCPU
Image in Host device memory.
fsdk::Image::Error::InvalidImage
Invalid image.
fsdk::Image::ImageCompression::IC_NO_COMPRESSION
no compression (only for png or jpg image)
fsdk::Image::convert
Result< Image::Error > convert(Image &dest, const Rect &rect, Format format, TargetDevice device=TargetDevice::CPU) const noexcept
Convert image format.
Definition: Image.h:551
fsdk::IArchive
Archive interface.
Definition: IObject.h:37
fsdk::Image::map
SubImage map(const Point2i &origin, const Size &size) const noexcept
Map image contents to a given area.
Definition: Image.h:398
fsdk::BaseRect< int >
fsdk::Image::extract
Image extract(const Size &size) const noexcept
Extract a sub image of this image. The new image will have it&#39;s own reference count.
Definition: Image.h:439
fsdk::Image::Error::InvalidDataPtr
Bad input data pointer.
fsdk::Image::loadFromMemoryOfType
FSDK_API Result< Error > loadFromMemoryOfType(const void *data, const uint32_t sizeInBytes, const Type type) noexcept
Load image from memory of specific type.
fsdk::Image::getScanLine
FSDK_API void * getScanLine(int y) noexcept
Get image scanline data.
fsdk::Image::Error
Error
Image error codes.
Definition: Image.h:77
fsdk::Image::ownsData
bool ownsData() const noexcept
Definition: Image.h:890
fsdk::Image::Error::InvalidWidth
Invalid width.
fsdk::SubImage
Sub Image.
Definition: SubImage.h:10
fsdk::Image::convert
Result< Image::Error > convert(Image &dest, Format format, TargetDevice device=TargetDevice::CPU) const noexcept
Convert image format.
Definition: Image.h:565
fsdk::Image::Image
FSDK_API Image() noexcept
Initializes an empty image.
fsdk::Image::ImageCompression::IC_HARD_COMPRESSION
more than medium compression (only for png or jpg)
fsdk::Image::Error::FailedToInitialize
Error during initialization.
fsdk::Image::clone
Image clone() const noexcept
Create a copy of this image. The new image will have it&#39;s own reference count.
Definition: Image.h:470
fsdk::Image::save
FSDK_API Result< Image::Error > save(const char *path, fsdk::Image::ImageCompression additionalFlag=fsdk::Image::ImageCompression::IC_NO_COMPRESSION) const noexcept
Save image.
fsdk::Image::Error::InvalidHeight
Invalid height.
fsdk::Image::TargetDevice
TargetDevice
Target device that fsdk::Image algorithms will be running on.
Definition: Image.h:55
fsdk::Image::extract
Image extract(const Rect &rect) const noexcept
Extract a sub image of this image. The new image will have it&#39;s own reference count.
Definition: Image.h:425
fsdk::Sizer
Helper entity to measure size of dynamic objects in memory.
Definition: Sizer.h:10
fsdk::Image::retain
FSDK_API int retain() noexcept
Increase reference count.
fsdk::Size
Vector2< int > Size
Definition: Vector2.h:299
fsdk::Image::getSize
Size getSize() const noexcept
Definition: Image.h:875
fsdk::Vector2< int >
fsdk::Image::getWidth
int getWidth() const noexcept
Definition: Image.h:845
fsdk::Image::MemoryResidence::MemoryNPU
Image in NPU device memory.
fsdk::Image::isValid
bool isValid() const noexcept
Definition: Image.h:760
fsdk::Image::guessTypeFromMemory
static FSDK_API Result< Error > guessTypeFromMemory(const void *data, const uint32_t sizeInBytes, Type &type) noexcept
Guess type of image written into memory.