NVTX C++ API Reference 1.0
C++ convenience wrappers for NVTX v3 C API
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
nvtx3::v1::color Class Reference

Represents a custom color that can be associated with an NVTX event via its event_attributes. More...

#include <nvtx3.hpp>

Public Types

using value_type = uint32_t
 Type used for the color's value.
 

Public Member Functions

constexpr color (value_type hex_code) noexcept
 Constructs a color using the value provided by hex_code.
 
constexpr color (argb argb_) noexcept
 Construct a color using the alpha, red, green, blue components in argb.
 
constexpr color (rgb rgb_) noexcept
 Construct a color using the red, green, blue components in rgb.
 
constexpr value_type get_value () const noexcept
 Returns the colors argb hex code.
 
constexpr nvtxColorType_t get_type () const noexcept
 Return the NVTX color type of the color.
 
 color (color const &)=default
 
coloroperator= (color const &)=default
 
 color (color &&)=default
 
coloroperator= (color &&)=default
 

Detailed Description

Represents a custom color that can be associated with an NVTX event via its event_attributes.

Specifying colors for NVTX events is a convenient way to visually differentiate among different events in a visualization tool such as Nsight Systems.

Definition at line 1046 of file nvtx3.hpp.

Member Typedef Documentation

◆ value_type

using nvtx3::v1::color::value_type = uint32_t

Type used for the color's value.

Definition at line 1049 of file nvtx3.hpp.

Constructor & Destructor Documentation

◆ color() [1/3]

constexpr nvtx3::v1::color::color ( value_type  hex_code)
inlineexplicitconstexprnoexcept

Constructs a color using the value provided by hex_code.

hex_code is expected to be a 4 byte argb hex code.

The most significant byte indicates the value of the alpha channel (opacity) (0-255)

The next byte indicates the value of the red channel (0-255)

The next byte indicates the value of the green channel (0-255)

The least significant byte indicates the value of the blue channel (0-255)

Parameters
hex_codeThe hex code used to construct the color

Definition at line 1068 of file nvtx3.hpp.

◆ color() [2/3]

constexpr nvtx3::v1::color::color ( argb  argb_)
inlineconstexprnoexcept

Construct a color using the alpha, red, green, blue components in argb.

Parameters
argb_The alpha, red, green, blue components of the desired color

Definition at line 1076 of file nvtx3.hpp.

◆ color() [3/3]

constexpr nvtx3::v1::color::color ( rgb  rgb_)
inlineconstexprnoexcept

Construct a color using the red, green, blue components in rgb.

Uses maximum value for the alpha channel (opacity) of the color.

Parameters
rgb_The red, green, blue components of the desired color

Definition at line 1089 of file nvtx3.hpp.

Member Function Documentation

◆ get_type()

constexpr nvtxColorType_t nvtx3::v1::color::get_type ( ) const
inlineconstexprnoexcept

Return the NVTX color type of the color.

Definition at line 1104 of file nvtx3.hpp.

◆ get_value()

constexpr value_type nvtx3::v1::color::get_value ( ) const
inlineconstexprnoexcept

Returns the colors argb hex code.

Definition at line 1098 of file nvtx3.hpp.


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