Graphics

Detailed Description

Classes

struct  ImageHierarchy
 
class  ImageBaseInterface
 
class  ImageTextureInterface
 
class  ImageInterface
 
class  ImageLayerInterface
 
class  ImageFunctionsInterface
 
class  ImageChannelTypeInterface
 
class  ImageChannelInterface
 
struct  BlendPixelHandlerStruct
 
class  ImagePixelBlendInterface
 
struct  IsZeroInitialized< PixelFormatGroup >
 
struct  PixelConstBuffer
 
struct  PixelMutableBuffer
 
struct  ImageBufferTemplate< BASECLASS >
 
struct  ConvertFuncChannelHelper
 
class  PixelFormatInterface
 
class  PixelFormatsInterface
 
class  PixelFormatDynamicInterface
 
class  PixelFormatGroupInterface
 
class  PixelFormatIterator
 
class  PixelFormatIndexedColorInterface
 
class  VectorImageInterface
 

Macros

#define MAXON_REGISTER_PIXELFORMAT(group, name, className)
 
#define MAXON_REGISTER_PIXELFORMAT_X(group, name, className)
 
#define MAXON_REGISTER_PIXELFORMAT_TEMPLATE(group, name, className)
 
#define MAXON_REGISTER_PIXELFORMAT_TEMPLATE_X(group, name, className)
 
#define REGISTER_PIXELFORMATGROUP(name)
 

Typedefs

using Pix = UChar
 
using Pix8u = UChar
 
using Pix8s = Char
 
using Pix16u = UInt16
 
using Pix16s = Int16
 
using Pix32u = UInt32
 
using Pix32s = Int32
 
using Pix32f = Float32
 
using Pix64f = Float64
 
using Pix16f = HalfFloat
 
using BlendPixelHandlerRef = StrongRef< BlendPixelHandlerStruct >
 
using ChannelOffsets = Block< const BITS >
 
using ImageConstBuffer = ImageBufferTemplate< PixelConstBuffer >
 
using ImageMutableBuffer = ImageBufferTemplate< PixelMutableBuffer >
 
using CONVERTPIXELFUNC = Delegate< Result< void >(const PixelMutableBuffer &dst, Int count, const PixelConstBuffer &src, GETPIXELFLAGS flags)>
 
using CONVERTPIXELFUNCSTATIC = Result< void >(*)(const PixelMutableBuffer &dst, Int count, const PixelConstBuffer &src, GETPIXELFLAGS flags, const ChannelOffsets &dstChannelOffset, const ChannelOffsets &srcChannelOffset)
 
using ConvertFuncChannelHelperRef = StrongRef< ConvertFuncChannelHelper >
 

Enumerations

enum class  IMAGEHIERARCHY {
  TEXTURE ,
  IMAGE ,
  ALPHA ,
  LAYER ,
  MASK ,
  DEEPIMAGEDATA ,
  MAX_ELEMENTS
}
 
enum class  TRANSFORM_COLORS_FLAGS {
  NONE ,
  INVERSE_DIRECTION
}
 
enum class  BLENDPIXELFLAGS { NONE }
 
enum class  CONVERTPIXELFLAGS {
  NONE ,
  FORCECOLORPROFILECONVERSION
}
 
enum class  GETPIXELHANDLERFLAGS {
  NONE ,
  FORCECOLORPROFILECONVERSION ,
  DEEPIMAGE ,
  DONTAPPLYMASK ,
  ALLOW_INVALIDATE_ALPHA
}
 
enum class  GETPIXELFLAGS {
  NONE ,
  DEEPIMAGE
}
 
enum class  SETPIXELHANDLERFLAGS {
  NONE ,
  FORCECOLORPROFILECONVERSION ,
  DEEPIMAGE
}
 
enum class  SETPIXELFLAGS {
  NONE ,
  DEEPIMAGE
}
 

Functions

enum maxon::IMAGEHIERARCHY MAXON_ENUM_LIST (IMAGEHIERARCHY)
 
enum maxon::TRANSFORM_COLORS_FLAGS MAXON_ENUM_FLAGS (TRANSFORM_COLORS_FLAGS)
 
const Class< ImagePixelStorage > & GetNormalPixelStorageClass ()
 
 MAXON_REGISTRY (Class< ImageBaseRef >, ImageBaseClasses, "net.maxon.image.registry.imagebaseclasses")
 
 MAXON_REGISTRY (Class< ImageTextureRef >, ImageTextureClasses, "net.maxon.image.registry.imagetextureclasses")
 
 MAXON_REGISTRY (Class< ImageRef >, ImageClasses, "net.maxon.image.registry.imageclasses")
 
 MAXON_REGISTRY (Class< ImageLayerRef >, ImageLayerClasses, "net.maxon.image.registry.imagelayerclasses")
 
ImageRef GetImageOf (const ImageBaseRef &bmp)
 
ImageLayerRef GetFirstAlphaOf (const ImageBaseRef &bmp)
 
Result< void > ConvertImageSequence (const Url &sourceUrl, const Url &destPath, const String &destFilePatern, const Class< MediaOutputUrlRef > &exportClass, const ValueReceiver< const Url & > &resultFiles)
 
Result< void > CopyImageData (const ImageBaseRef &source, const ImageRef &dest, Bool allowDifferentSize)
 
enum maxon::BLENDPIXELFLAGS MAXON_ENUM_FLAGS (BLENDPIXELFLAGS)
 
 MAXON_DATATYPE (BlendPixelHandlerRef, "net.maxon.datatype.blendpixelhandlerref", MAXON_IMPLEMENTATION_MODULE("net.maxon.image"))
 
 MAXON_REGISTRY (ImagePixelBlend, ImagePixelBlends, "net.maxon.render.registry.blendmodeclasses")
 
enum maxon::CONVERTPIXELFLAGS MAXON_ENUM_FLAGS (CONVERTPIXELFLAGS)
 
enum maxon::GETPIXELHANDLERFLAGS MAXON_ENUM_FLAGS (GETPIXELHANDLERFLAGS)
 
enum maxon::GETPIXELFLAGS MAXON_ENUM_FLAGS (GETPIXELFLAGS)
 
enum maxon::SETPIXELHANDLERFLAGS MAXON_ENUM_FLAGS (SETPIXELHANDLERFLAGS)
 
enum maxon::SETPIXELFLAGS MAXON_ENUM_FLAGS (SETPIXELFLAGS)
 
Result< CONVERTPIXELFUNCLambdaWrapper (CONVERTPIXELFUNCSTATIC func, const ChannelOffsets &dstChannelOffsets, const ChannelOffsets &srcChannelOffsets)
 
 MAXON_DECLARATION (Class< PixelFormat >, PixelFormatBaseClass, "net.maxon.image.class.pixelformatbase", MAXON_IMPLEMENTATION_MODULE("net.maxon.image"))
 
Result< PixelFormat > JoinPixelFormats (const PixelFormat &format1, const PixelFormat &format2)
 
 MAXON_REGISTRY (PixelFormatGroup, PixelFormats, "net.maxon.image.registry.pixelformats")
 
MAXON_ATTRIBUTE_FORCE_INLINE PixelFormat GetNativeFloatColorAlphaFormat ()
 
MAXON_ATTRIBUTE_FORCE_INLINE PixelFormat GetNativeFloatColorFormat ()
 
 MAXON_REGISTRY (Class< VectorImageRef >, VectorImageClasses, "net.maxon.image.registry.vectorimageclasses")
 
template<typename PIXELDEPTH >
ImageChannel GetChannel () const
 
static MAXON_FUNCTION Result< PixelFormat > FindOrCreatePixelFormat (const DataType &pixelType, const Block< const ImageChannelType > &imageChannelTypes)
 
template<typename PIXELTYPE >
Result< PixelFormat > FindOrCreatePixelFormat (const Block< const ImageChannelType > &imageChannelTypes)
 
template<typename PIXELTYPE , typename... CHANNELS>
Result< PixelFormat > FindOrCreatePixelFormat ()
 

Macro Definition Documentation

◆ MAXON_REGISTER_PIXELFORMAT

#define MAXON_REGISTER_PIXELFORMAT (   group,
  name,
  className 
)

Use this macro to define a new pixel format, e.g.: MAXON_REGISTER_PIXELFORMAT("rgb8i", PixelFormat::RGB::U8);

◆ MAXON_REGISTER_PIXELFORMAT_X

#define MAXON_REGISTER_PIXELFORMAT_X (   group,
  name,
  className 
)

◆ MAXON_REGISTER_PIXELFORMAT_TEMPLATE

#define MAXON_REGISTER_PIXELFORMAT_TEMPLATE (   group,
  name,
  className 
)

◆ MAXON_REGISTER_PIXELFORMAT_TEMPLATE_X

#define MAXON_REGISTER_PIXELFORMAT_TEMPLATE_X (   group,
  name,
  className 
)

◆ REGISTER_PIXELFORMATGROUP

#define REGISTER_PIXELFORMATGROUP (   name)

This macro allows to register a new pixel format group with a single line:

#define REGISTER_PIXELFORMATGROUP(name)
Definition: gfx_image_pixelformats.h:269

Typedef Documentation

◆ Pix

using Pix = UChar

unspecified pixel format depth.

◆ Pix8u

using Pix8u = UChar

pixel format with 8 bit unsigned integer values (0..255).

◆ Pix8s

using Pix8s = Char

pixel format with 8 bit signed integer values (-128..127).

◆ Pix16u

using Pix16u = UInt16

pixel format with 16 bit unsigned integer values (0..65535).

◆ Pix16s

using Pix16s = Int16

pixel format with 16 bit signed integer values (-32768..32767).

◆ Pix32u

using Pix32u = UInt32

pixel format with 32 bit unsigned integer values (0..0xFFFFFFFF).

◆ Pix32s

using Pix32s = Int32

pixel format with 32 bit signed integer values (-0x7FFFFFFF..0x7FFFFFFF).

◆ Pix32f

using Pix32f = Float32

pixel format with 32 bit floating point values.

◆ Pix64f

using Pix64f = Float64

pixel format with 64 bit floating point values.

◆ Pix16f

using Pix16f = HalfFloat

pixel format with 16 bit floating point values (half float).

◆ BlendPixelHandlerRef

◆ ChannelOffsets

using ChannelOffsets = Block<const BITS>

ChannelOffsets describe the offset of each channel of a pixel format. There is always one channel more than the channel count. This last value contains usually the total size.

◆ ImageConstBuffer

◆ ImageMutableBuffer

◆ CONVERTPIXELFUNC

◆ CONVERTPIXELFUNCSTATIC

using CONVERTPIXELFUNCSTATIC = Result<void>(*)(const PixelMutableBuffer& dst, Int count, const PixelConstBuffer& src, GETPIXELFLAGS flags, const ChannelOffsets& dstChannelOffset, const ChannelOffsets& srcChannelOffset)

◆ ConvertFuncChannelHelperRef

Enumeration Type Documentation

◆ IMAGEHIERARCHY

enum IMAGEHIERARCHY
strong

used by ImageBaseInterface to add layers/alphas/images to the right sub tree in the hierarchy.

Enumerator
TEXTURE 

Root of everything. Must not be used with AddChildren.

IMAGE 

Adds a subImage to a texture. Images are only allowed under Textures.

ALPHA 

Adds an alpha to a image. Alphas are allowed to insert under images.

LAYER 

Adds an image layer to a image. Layers are only allowed under Images or other layers.

MASK 

Adds a layer mask to a layer. Layer masks are allowed to insert under layers (layer mask).

DEEPIMAGEDATA 

Adds deep image data to an image. Allowed to insert under images.

MAX_ELEMENTS 

◆ TRANSFORM_COLORS_FLAGS

Flags used by TransformColors.

Enumerator
NONE 

No flags.

INVERSE_DIRECTION 

Inverse direction.

◆ BLENDPIXELFLAGS

enum BLENDPIXELFLAGS
strong

Flags to control the BlendPixel functions.

Enumerator
NONE 

no options set.

◆ CONVERTPIXELFLAGS

enum CONVERTPIXELFLAGS
strong

Flags to control the GetPixel functions.

Enumerator
NONE 

no options set.

FORCECOLORPROFILECONVERSION 

if set it forces color profile conversion even if the color space are identical, otherwise the conversion will be performed only if the color spaces are different.

◆ GETPIXELHANDLERFLAGS

enum GETPIXELHANDLERFLAGS
strong

Flags to control the GetPixelHandler functions.

Enumerator
NONE 

no options set.

FORCECOLORPROFILECONVERSION 

if set it forces color profile conversion even if the color space are identical, otherwise the conversion will be performed only if the color spaces are different.

DEEPIMAGE 

request a deep image pixel handler.

DONTAPPLYMASK 

do not apply the alpha layer to the image data.

ALLOW_INVALIDATE_ALPHA 

Allow GetPixelCntP to invalidate the alpha. E.g. if the source image is RGB and the destination buffer is RGBA, the Alpha channel of the destination may contain garbage.

◆ GETPIXELFLAGS

enum GETPIXELFLAGS
strong

Flags to control the GetPixel functions.

Enumerator
NONE 

no options set.

DEEPIMAGE 

provided a DeepImageConst/MutableBuffer structure.

◆ SETPIXELHANDLERFLAGS

enum SETPIXELHANDLERFLAGS
strong

Flags to control the SetPixelHandler functions.

Enumerator
NONE 

No options set.

FORCECOLORPROFILECONVERSION 

if set it forces color profile conversion even if the color space are identical, otherwise the conversion will be performed only if the color spaces are different.

DEEPIMAGE 

request a deep image pixel handler.

◆ SETPIXELFLAGS

enum SETPIXELFLAGS
strong

Flags to control the SetPixel functions.

Enumerator
NONE 

No options set.

DEEPIMAGE 

provided a DeepImagePixelConst/MutableBuffer.

Function Documentation

◆ MAXON_ENUM_LIST()

enum maxon::IMAGEHIERARCHY maxon::MAXON_ENUM_LIST ( IMAGEHIERARCHY  )

◆ MAXON_ENUM_FLAGS() [1/7]

enum maxon::TRANSFORM_COLORS_FLAGS maxon::MAXON_ENUM_FLAGS ( TRANSFORM_COLORS_FLAGS  )

◆ GetNormalPixelStorageClass()

const Class<ImagePixelStorage>& maxon::GetNormalPixelStorageClass ( )

GetNormalPixelStorageClass returns ImagePixelStorageClasses::Normal() without including gfx_pixelstorage.h.

Returns
Class<ImagePixelStorage> on success.

◆ MAXON_REGISTRY() [1/7]

maxon::MAXON_REGISTRY ( Class< ImageBaseRef >  ,
ImageBaseClasses  ,
"net.maxon.image.registry.imagebaseclasses"   
)

◆ MAXON_REGISTRY() [2/7]

maxon::MAXON_REGISTRY ( Class< ImageTextureRef >  ,
ImageTextureClasses  ,
"net.maxon.image.registry.imagetextureclasses"   
)

◆ MAXON_REGISTRY() [3/7]

maxon::MAXON_REGISTRY ( Class< ImageRef >  ,
ImageClasses  ,
"net.maxon.image.registry.imageclasses"   
)

◆ MAXON_REGISTRY() [4/7]

maxon::MAXON_REGISTRY ( Class< ImageLayerRef >  ,
ImageLayerClasses  ,
"net.maxon.image.registry.imagelayerclasses"   
)

◆ GetImageOf()

ImageRef maxon::GetImageOf ( const ImageBaseRef &  bmp)

GetImageOf extracts the first image in a texture or if bmp is already a bmp itself.

Parameters
[in]bmpImageBaseRef of type texture or image.
Returns
ImageRef pointing the the first image of a texture or itself if it was a texture.

◆ GetFirstAlphaOf()

ImageLayerRef maxon::GetFirstAlphaOf ( const ImageBaseRef &  bmp)

GetFirstAlphaOf returns the alpha channel of a texture or image.

Parameters
[in]bmpTexture or image.
Returns
Alpha channel on success.

◆ ConvertImageSequence()

Result<void> maxon::ConvertImageSequence ( const Url sourceUrl,
const Url destPath,
const String destFilePatern,
const Class< MediaOutputUrlRef > &  exportClass,
const ValueReceiver< const Url & > &  resultFiles 
)

ConvertAnim converts a given image stream into image sequence.

Parameters
[in]sourceUrlUrl of the source movie/image sequence.
[in]destPathUrl of the destination folder.
[in]destFilePaternFormat string of the destination files.
[in]exportClassExport Image class to use.
[out]resultFilesReceives the generated files.
Returns
OK on success. example: Url loadUrl = Application::GetUrl(APPLICATION_URLTYPE::CURRENT_MODULE_RESOURCE_DIR).Append("modules"_s).Append("images"_s).Append("c4d_logo_with_alpha.avi"_s) iferr_return; Url saveUrl = Application::GetUrl(APPLICATION_URLTYPE::USER_DOCUMENTS_DIR) iferr_return; ConvertImageSequence(loadUrl, saveUrl, "_logo_with_alpha@{4'0'}.png"_s, ImageSaverClasses::Png(), nullptr) iferr_return;

or to convert a image sequence Url loadUrl = Application::GetUrl(APPLICATION_URLTYPE::CURRENT_MODULE_RESOURCE_DIR).Append("modules"_s).Append("images"_s).Append("logo_with_alpha@{4'0'}.png"_s) iferr_return; loadUrl.Set(URLFLAGS::IMAGESEQUENCE_FPS, 1.0) iferr_return; Url saveUrl = Url saveUrl = Application::GetUrl(APPLICATION_URLTYPE::USER_DOCUMENTS_DIR) iferr_return; ConvertImageSequence(loadUrl, saveUrl, "_logo_with_alpha@{4'0'}.png"_s, ImageSaverClasses::Png(), nullptr) iferr_return;

◆ CopyImageData()

Result<void> maxon::CopyImageData ( const ImageBaseRef &  source,
const ImageRef &  dest,
Bool  allowDifferentSize 
)

◆ MAXON_ENUM_FLAGS() [2/7]

enum maxon::BLENDPIXELFLAGS maxon::MAXON_ENUM_FLAGS ( BLENDPIXELFLAGS  )

◆ MAXON_DATATYPE()

maxon::MAXON_DATATYPE ( BlendPixelHandlerRef  ,
"net.maxon.datatype.blendpixelhandlerref"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.image")   
)

◆ MAXON_REGISTRY() [5/7]

maxon::MAXON_REGISTRY ( ImagePixelBlend  ,
ImagePixelBlends  ,
"net.maxon.render.registry.blendmodeclasses"   
)

◆ MAXON_ENUM_FLAGS() [3/7]

enum maxon::CONVERTPIXELFLAGS maxon::MAXON_ENUM_FLAGS ( CONVERTPIXELFLAGS  )

◆ MAXON_ENUM_FLAGS() [4/7]

enum maxon::GETPIXELHANDLERFLAGS maxon::MAXON_ENUM_FLAGS ( GETPIXELHANDLERFLAGS  )

◆ MAXON_ENUM_FLAGS() [5/7]

enum maxon::GETPIXELFLAGS maxon::MAXON_ENUM_FLAGS ( GETPIXELFLAGS  )

◆ MAXON_ENUM_FLAGS() [6/7]

enum maxon::SETPIXELHANDLERFLAGS maxon::MAXON_ENUM_FLAGS ( SETPIXELHANDLERFLAGS  )

◆ MAXON_ENUM_FLAGS() [7/7]

enum maxon::SETPIXELFLAGS maxon::MAXON_ENUM_FLAGS ( SETPIXELFLAGS  )

◆ LambdaWrapper()

Result<CONVERTPIXELFUNC> maxon::LambdaWrapper ( CONVERTPIXELFUNCSTATIC  func,
const ChannelOffsets dstChannelOffsets,
const ChannelOffsets srcChannelOffsets 
)

◆ MAXON_DECLARATION()

maxon::MAXON_DECLARATION ( Class< PixelFormat >  ,
PixelFormatBaseClass  ,
"net.maxon.image.class.pixelformatbase"  ,
MAXON_IMPLEMENTATION_MODULE("net.maxon.image")   
)

Base channels which implements a bunch of default functions for all pixel formats.

◆ JoinPixelFormats()

Result<PixelFormat> maxon::JoinPixelFormats ( const PixelFormat &  format1,
const PixelFormat &  format2 
)

Joins 2 pixel formats together. The result pixel format will have all channels from the first format followed by the channels of the second format.

Parameters
[in]format1First pixel format.
[in]format2Second pixel format.
Returns
Returns the new joined pixel format.

◆ MAXON_REGISTRY() [6/7]

maxon::MAXON_REGISTRY ( PixelFormatGroup  ,
PixelFormats  ,
"net.maxon.image.registry.pixelformats"   
)

◆ GetNativeFloatColorAlphaFormat()

MAXON_ATTRIBUTE_FORCE_INLINE PixelFormat maxon::GetNativeFloatColorAlphaFormat ( )

GetNativeFloatColorAlphaFormat returns the ColorA 32 or 64 PixelFormat depending on the system.

Returns
PixelFormat on success.

◆ GetNativeFloatColorFormat()

MAXON_ATTRIBUTE_FORCE_INLINE PixelFormat maxon::GetNativeFloatColorFormat ( )

GetNativeFloatColorFormat returns the Color 32 or 64 PixelFormat depending on the system.

Returns
PixelFormat on success.

◆ MAXON_REGISTRY() [7/7]

maxon::MAXON_REGISTRY ( Class< VectorImageRef >  ,
VectorImageClasses  ,
"net.maxon.image.registry.vectorimageclasses"   
)

◆ GetChannel()

ImageChannel GetChannel ( ) const

◆ FindOrCreatePixelFormat() [1/3]

Result< PixelFormat > FindOrCreatePixelFormat ( const DataType pixelType,
const Block< const ImageChannelType > &  imageChannelTypes 
)
static

Create of find a pixel format. This function simplifies the usage without the need to create the array of channels on the stack:

Parameters
[in]pixelTypePixel data type e.g. GetDataType<Pix32f>().
[in]imageChannelTypesImage Channel types.
PixelFormat formatGBR32f = PixelFormatsInterface::FindOrCreatePixelFormat<ImageChannels::Green, ImageChannels::Blue, ImageChannels::Red>() iferr_return;
#define iferr_return
Definition: resultbase.h:1524
Returns
Pixel format on success.

◆ FindOrCreatePixelFormat() [2/3]

Result<PixelFormat> FindOrCreatePixelFormat ( const Block< const ImageChannelType > &  imageChannelTypes)

◆ FindOrCreatePixelFormat() [3/3]

Result<PixelFormat> FindOrCreatePixelFormat ( )