NVIDIA NvNeural SDK  2022.2
GPU inference framework for NVIDIA Nsight Deep Learning Designer
nvneural::IFileImage Class Referenceabstract

Defines file I/O operations for IImage objects. More...

#include <CpuImage.h>

Inheritance diagram for nvneural::IFileImage:
nvneural::IRefObject

Public Member Functions

virtual NeuralResult fromFill (std::size_t height, std::size_t width, std::size_t channels, std::uint8_t fillValue) noexcept=0
 Loads an image by tiling a fill value. More...
 
virtual NeuralResult fromRandomValues (std::size_t height, std::size_t width, std::size_t channels) noexcept=0
 Loads an image by generating normally distributed noise in the range [0, 255]. More...
 
virtual NeuralResult loadFromDescriptors (const std::vector< ImageDescriptor > &descriptors) noexcept=0
 Loads an image from a chained set of descriptors. More...
 
virtual NeuralResult loadFromFile (const std::string &filename) noexcept=0
 Loads an image from a single bitmap file. More...
 
virtual NeuralResult saveToFile (const std::string &filename) noexcept=0
 Saves the resulting image as a file. More...
 
- Public Member Functions inherited from nvneural::IRefObject
virtual RefCount addRef () const noexcept=0
 Increments the object's reference count. More...
 
virtual const void * queryInterface (TypeId interface) const noexcept=0
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
virtual void * queryInterface (TypeId interface) noexcept=0
 Retrieves a new object interface pointer. More...
 
virtual RefCount release () const noexcept=0
 Decrements the object's reference count and destroy the object if the reference count reaches zero. More...
 

Static Public Attributes

static const IRefObject::TypeId typeID = 0x6c7a3cb3f81db69bul
 Interface TypeId for InterfaceOf purposes.
 
- Static Public Attributes inherited from nvneural::IRefObject
static const TypeId typeID = 0x14ecc3f9de638e1dul
 Interface TypeId for InterfaceOf purposes.
 

Additional Inherited Members

- Public Types inherited from nvneural::IRefObject
using RefCount = std::uint32_t
 Typedef used to track the number of active references to an object.
 
using TypeId = std::uint64_t
 Every interface must define a unique TypeId. This should be randomized.
 
- Protected Member Functions inherited from nvneural::IRefObject
virtual ~IRefObject ()=default
 A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
 

Detailed Description

Defines file I/O operations for IImage objects.

Warning
This interface uses C++ standard library types that are not ABI-stable. Objects implementing this interface are safe to pass across module boundaries (usually as IImage), but the IFileImage members should be accessed only from the module where the object was originally created.

Member Function Documentation

◆ fromFill()

virtual NeuralResult nvneural::IFileImage::fromFill ( std::size_t  height,
std::size_t  width,
std::size_t  channels,
std::uint8_t  fillValue 
)
pure virtualnoexcept

Loads an image by tiling a fill value.

Replaces existing data.

Parameters
heightHeight of the resulting image
widthWidth of the resulting image
channelsChannel count of the resulting image
fillValueByte to fill the image with; per-channel fills are not supported

◆ fromRandomValues()

virtual NeuralResult nvneural::IFileImage::fromRandomValues ( std::size_t  height,
std::size_t  width,
std::size_t  channels 
)
pure virtualnoexcept

Loads an image by generating normally distributed noise in the range [0, 255].

Replaces existing data.

Parameters
heightHeight of the resulting image
widthWidth of the resulting image
channelsChannel count of the resulting image

◆ loadFromDescriptors()

virtual NeuralResult nvneural::IFileImage::loadFromDescriptors ( const std::vector< ImageDescriptor > &  descriptors)
pure virtualnoexcept

Loads an image from a chained set of descriptors.

Replaces existing data.

At this time, only a single descriptor is supported. Future versions of the framework may support concatenation of image data using sets of descriptors. Loading from npy files is the recommended alternative.

Parameters
descriptorsList of descriptors

◆ loadFromFile()

virtual NeuralResult nvneural::IFileImage::loadFromFile ( const std::string &  filename)
pure virtualnoexcept

Loads an image from a single bitmap file.

Replaces existing data.

Parameters
filenameFile path to load

◆ saveToFile()

virtual NeuralResult nvneural::IFileImage::saveToFile ( const std::string &  filename)
pure virtualnoexcept

Saves the resulting image as a file.

Parameters
filenameFile path to save

The documentation for this class was generated from the following file: