|
Ocean
|
This class implements read and write functions for NPY (NumPy) images. More...
#include <ImageNpy.h>
Static Public Member Functions | |
| static Frame | decodeImage (const void *buffer, const size_t size) |
| Decodes a NPY image from a given binary buffer. | |
| static bool | encodeImage (const Frame &frame, std::vector< uint8_t > &buffer) |
| Encodes a given frame as NPY image to a resulting buffer. | |
| static bool | isPixelFormatSupported (const FrameType::PixelFormat pixelFormat) |
| Returns whether a given pixel format is supported natively. | |
| static bool | isPixelOriginSupported (const FrameType::PixelOrigin pixelOrigin) |
| Returns whether a given pixel origin is supported natively. | |
| static bool | isFrameTypeSupported (const FrameType::PixelFormat pixelFormat, const FrameType::PixelOrigin pixelOrigin) |
| Returns whether a given pixel format together with a given pixel origin is supported natively. | |
Static Protected Member Functions | |
| static bool | readHeader (const uint8_t *&data, size_t &size, FrameType &frameType, bool &isRowMajor) |
| Reads the header of a NPY file. | |
| static FrameType::PixelFormat | translatePixelFormat (const std::string &pixelFormat) |
| Translates the pixel format. | |
| static std::string | translatePixelFormat (const FrameType::PixelFormat pixelFormat) |
| Translates the pixel format. | |
This class implements read and write functions for NPY (NumPy) images.
|
static |
Decodes a NPY image from a given binary buffer.
| buffer | The buffer from which the image will be loaded, must be valid |
| size | The size of the given buffer in bytes, with range [1, infinity) |
|
static |
Encodes a given frame as NPY image to a resulting buffer.
| frame | The frame to be written, must be valid |
| buffer | The resulting buffer storing the binary information of the NPY image |
|
inlinestatic |
Returns whether a given pixel format together with a given pixel origin is supported natively.
| pixelFormat | The pixel format to be checked |
| pixelOrigin | The pixel origin to be checked |
|
inlinestatic |
Returns whether a given pixel format is supported natively.
| pixelFormat | The pixel format to be checked |
|
inlinestatic |
Returns whether a given pixel origin is supported natively.
| pixelOrigin | The pixel origin to be checked |
|
staticprotected |
Reads the header of a NPY file.
| data | The data buffer, will be moved if the header could be read successfully, must be valid |
| size | The size of the buffer in bytes, will be reduced if the header could be read successfully, must be valid |
| frameType | The resulting frame type |
| isRowMajor | True, if the data is given in row-major order; False, if the data is given in column-major order |
|
staticprotected |
Translates the pixel format.
| pixelFormat | The pixel format to be translated |
|
staticprotected |
Translates the pixel format.
| pixelFormat | The pixel format to be translated given as string |