LibraryLink Utilities  3.0.1
Modern C++ wrapper over LibraryLink and WSTP
LLU::ImageView Class Reference

Description

Simple, light-weight, non-owning wrappper over MImage.

Intended for use in functions that only need to access MImage metadata, where it can alleviate the need for introducing template parameters for MImage passing mode (like in GenericImage) or data type (like in Image class).

+ Inheritance diagram for LLU::ImageView:
+ Collaboration diagram for LLU::ImageView:

#include <Image.hpp>

Public Member Functions

 ImageView (const GenericImage &gIm)
 Create a ImageView from a GenericImage. More...
 
 ImageView (MImage mi)
 Create a ImageView from a raw MImage. More...
 
colorspace_t colorspace () const override
 Get colorspace which describes how colors are represented as numbers. More...
 
mint rows () const override
 Get number of rows. More...
 
mint columns () const override
 Get number of columns. More...
 
mint slices () const override
 Get number of slices. More...
 
mint channels () const override
 Get number of channels. More...
 
bool alphaChannelQ () const override
 Check if there is an alpha channel in the image. More...
 
bool interleavedQ () const override
 Check if the image is interleaved. More...
 
bool is3D () const override
 Check if the image is 3D. More...
 
mint getRank () const override
 Get rank. More...
 
mint getFlattenedLength () const override
 Get the total number of pixels in the image. More...
 
imagedata_t type () const final
 Get the data type of the image. More...
 
void * rawData () const override
 Get access to raw image data. More...
 

Constructor & Destructor Documentation

◆ ImageView() [1/2]

LLU::ImageView::ImageView ( const GenericImage gIm)
inline

Create a ImageView from a GenericImage.

Parameters
gIm- a GenericImage

◆ ImageView() [2/2]

LLU::ImageView::ImageView ( MImage  mi)
inline

Create a ImageView from a raw MImage.

Parameters
mi- a raw MImage

Member Function Documentation

◆ alphaChannelQ()

bool LLU::ImageView::alphaChannelQ ( ) const
inlineoverridevirtual

Check if there is an alpha channel in the image.

See also
http://reference.wolfram.com/language/LibraryLink/ref/callback/MImage_alphaChannelQ.html

Implements LLU::ImageInterface.

◆ channels()

mint LLU::ImageView::channels ( ) const
inlineoverridevirtual

◆ colorspace()

colorspace_t LLU::ImageView::colorspace ( ) const
inlineoverridevirtual

Get colorspace which describes how colors are represented as numbers.

See also
http://reference.wolfram.com/language/LibraryLink/ref/callback/MImage_getColorSpace.html

Implements LLU::ImageInterface.

◆ columns()

mint LLU::ImageView::columns ( ) const
inlineoverridevirtual

◆ getFlattenedLength()

mint LLU::ImageView::getFlattenedLength ( ) const
inlineoverridevirtual

◆ getRank()

mint LLU::ImageView::getRank ( ) const
inlineoverridevirtual

◆ interleavedQ()

bool LLU::ImageView::interleavedQ ( ) const
inlineoverridevirtual

◆ is3D()

bool LLU::ImageView::is3D ( ) const
inlineoverridevirtual

Check if the image is 3D.

Implements LLU::ImageInterface.

◆ rawData()

void* LLU::ImageView::rawData ( ) const
inlineoverridevirtual

Get access to raw image data.

Use with caution.

Returns
pointer to the raw data
See also
http://reference.wolfram.com/language/LibraryLink/ref/callback/MImage_getRawData.html

Implements LLU::ImageInterface.

◆ rows()

mint LLU::ImageView::rows ( ) const
inlineoverridevirtual

◆ slices()

mint LLU::ImageView::slices ( ) const
inlineoverridevirtual

◆ type()

imagedata_t LLU::ImageView::type ( ) const
inlinefinalvirtual

Get the data type of the image.

Returns
type of elements (see definition of imagedata_t)
See also
http://reference.wolfram.com/language/LibraryLink/ref/callback/MImage_getDataType.html

Implements LLU::ImageInterface.