Defines file I/O operations for IImage objects.
More...
#include <CpuImage.h>
|
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...
|
|
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...
|
|
|
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.
|
|
virtual | ~IRefObject ()=default |
| A protected destructor prevents accidental stack-allocation of IRefObjects or use with other smart pointer classes like std::unique_ptr.
|
|
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.
◆ 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
-
height | Height of the resulting image |
width | Width of the resulting image |
channels | Channel count of the resulting image |
fillValue | Byte 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
-
height | Height of the resulting image |
width | Width of the resulting image |
channels | Channel count of the resulting image |
◆ loadFromDescriptors()
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
-
descriptors | List 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
-
filename | File path to load |
◆ saveToFile()
virtual NeuralResult nvneural::IFileImage::saveToFile |
( |
const std::string & |
filename | ) |
|
|
pure virtualnoexcept |
Saves the resulting image as a file.
- Parameters
-
filename | File path to save |
The documentation for this class was generated from the following file: