 |
LibraryLink Utilities
3.0.1
Modern C++ wrapper over LibraryLink and WSTP
|
Go to the documentation of this file.
5 #ifndef LLU_CONTAINERS_GENERIC_IMAGE_HPP
6 #define LLU_CONTAINERS_GENERIC_IMAGE_HPP
40 MContainer(mint width, mint height, mint channels, imagedata_t type, colorspace_t colorSpace, mbool interleaving)
41 :
MContainer(0, width, height, channels, type, colorSpace, interleaving) {}
53 MContainer(mint slices, mint width, mint height, mint channels, imagedata_t type, colorspace_t colorSpace, mbool interleaving);
62 GenericImage convert(imagedata_t t, mbool interleavingQ)
const;
71 return convert(t,
static_cast<mbool
>(interleavedQ()));
89 mint
rows()
const override {
134 imagedata_t
type()
const override {
148 Container cloneImpl()
const override;
154 mint shareCountImpl() const noexcept
override {
159 void passImpl(MArgument& res)
const noexcept
override {
160 MArgument_setMImage(res, this->getContainer());
166 #endif // LLU_CONTAINERS_GENERIC_IMAGE_HPP
Template of the base class for all generic containers.
Definition: Base.hpp:35
MContainer()=default
Default constructor, the MContainer does not manage any instance of MImage.
Main namespace of LibraryLink Utilities.
Definition: Queue.h:13
MContainer is an abstract class template for generic containers. Only specializations shall be used.
Definition: Base.hpp:245
mint columns() const override
Get number of columns.
Definition: Generic/Image.hpp:94
MContainer clone() const
Clone this MContainer, performs a deep copy of the underlying MImage.
Definition: Generic/Image.hpp:79
bool is3D() const override
Check if the image is 3D.
Definition: Generic/Image.hpp:119
imagedata_t type() const override
Get the data type of the image.
Definition: Generic/Image.hpp:134
MContainer(mint width, mint height, mint channels, imagedata_t type, colorspace_t colorSpace, mbool interleaving)
Create new 2D MImage based on given parameters.
Definition: Generic/Image.hpp:40
Abstract class that defines a basic set of operations on an image.
Definition: Interfaces.h:17
mint getFlattenedLength() const override
Get the total number of pixels in the image.
Definition: Generic/Image.hpp:129
MContainer specialization for MImage.
Definition: Generic/Image.hpp:23
mint getRank() const override
Get rank.
Definition: Generic/Image.hpp:124
@ Library
The library (LLU) is responsible for managing the container's memory. Used for Manual passing and con...
static const st_WolframImageLibrary_Functions * ImageAPI()
Get a pointer to structure with function pointers to MImage API.
Definition: LibraryData.cpp:41
bool alphaChannelQ() const override
Check if there is an alpha channel in the image.
Definition: Generic/Image.hpp:109
GenericImage convert(imagedata_t t) const
Convert this object to a new GenericImage of given datatype.
Definition: Generic/Image.hpp:70
mint channels() const override
Get number of channels.
Definition: Generic/Image.hpp:104
mint slices() const override
Get number of slices.
Definition: Generic/Image.hpp:99
MContainer< MArgumentType::Image > Image
Image stands for a GenericImage - type agnostic wrapper over MImage.
Definition: TypedMArgument.h:56
Definitions of MContainerBase and MContainer class templates.
MArgumentType
Strongly type enum with possible types of data stored in MArgument.
Definition: MArgument.h:22
void * rawData() const override
Get access to raw image data.
Definition: Generic/Image.hpp:139
bool interleavedQ() const override
Check if the image is interleaved.
Definition: Generic/Image.hpp:114
colorspace_t colorspace() const override
Get colorspace which describes how colors are represented as numbers.
Definition: Generic/Image.hpp:84
mint rows() const override
Get number of rows.
Definition: Generic/Image.hpp:89