libCZI
Reading and Writing CZI documents made easy
Loading...
Searching...
No Matches
libCZI::CompressParameter Struct Reference

Simple variant type used for the compression-parameters-property-bag. More...

#include <libCZI_compress.h>

Public Types

enum class  Type { Invalid , Int32 , Uint32 , Boolean }
 Values that represent the type represented by this variant. More...
 

Public Member Functions

 CompressParameter ()
 Default constructor - setting the variant to 'invalid'.
 
 CompressParameter (std::int32_t v)
 
 CompressParameter (std::uint32_t v)
 
 CompressParameter (bool v)
 
void SetInt32 (std::int32_t v)
 
void SetUInt32 (std::uint32_t v)
 
void SetBoolean (bool v)
 
Type GetType () const
 
std::int32_t GetInt32 () const
 
std::uint32_t GetUInt32 () const
 
bool GetBoolean () const
 

Detailed Description

Simple variant type used for the compression-parameters-property-bag.

Member Enumeration Documentation

◆ Type

Values that represent the type represented by this variant.

Enumerator
Invalid 

An enum constant representing the 'invalid' type (so this instance has no value).

Int32 

An enum constant representing the 'int32' type.

Uint32 

An enum constant representing the 'uint32' type.

Boolean 

An enum constant representing the 'boolean' type.

Constructor & Destructor Documentation

◆ CompressParameter() [1/3]

libCZI::CompressParameter::CompressParameter ( std::int32_t  v)
inlineexplicit

Constructor for initializing the 'int32' type.

Parameters
vThe value to set the variant to.

◆ CompressParameter() [2/3]

libCZI::CompressParameter::CompressParameter ( std::uint32_t  v)
inlineexplicit

Constructor for initializing the 'uint32' type.

Parameters
vThe value to set the variant to.

◆ CompressParameter() [3/3]

libCZI::CompressParameter::CompressParameter ( bool  v)
inlineexplicit

Constructor for initializing the 'bool' type.

Parameters
vThe value to set the variant to.

Member Function Documentation

◆ GetBoolean()

bool libCZI::CompressParameter::GetBoolean ( ) const
inline

If the type of the variant is "Boolean", then this value is returned. Otherwise, an exception (of type "runtime_error") is thrown.

Returns
The value of the variant (of type "Boolean").

◆ GetInt32()

std::int32_t libCZI::CompressParameter::GetInt32 ( ) const
inline

If the type of the variant is "Int32", then this value is returned. Otherwise, an exception (of type "runtime_error") is thrown.

Returns
The value of the variant (of type "Int32").

◆ GetType()

Type libCZI::CompressParameter::GetType ( ) const
inline

Gets the type which is represented by the variant.

Returns
The type.

◆ GetUInt32()

std::uint32_t libCZI::CompressParameter::GetUInt32 ( ) const
inline

If the type of the variant is "Uint32", then this value is returned. Otherwise, an exception (of type "runtime_error") is thrown.

Returns
The value of the variant (of type "Uint32").

◆ SetBoolean()

void libCZI::CompressParameter::SetBoolean ( bool  v)
inline

Sets the type of the variant to "boolean" and the value to the specified value.

Parameters
vThe value to be set.

◆ SetInt32()

void libCZI::CompressParameter::SetInt32 ( std::int32_t  v)
inline

Sets the type of the variant to "int32" and the value to the specified value.

Parameters
vThe value to be set.

◆ SetUInt32()

void libCZI::CompressParameter::SetUInt32 ( std::uint32_t  v)
inline

Sets the type of the variant to "uint32" and the value to the specified value.

Parameters
vThe value to be set.

The documentation for this struct was generated from the following file: