nvtt
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
nvtt::EncodeSettings Struct Reference

#include <nvtt_lowlevel.h>

Public Member Functions

NVTT_API EncodeSettingsSetFormat (Format _format)
 
NVTT_API EncodeSettingsSetQuality (Quality _quality)
 
NVTT_API EncodeSettingsSetRGBPixelType (PixelType _rgb_pixel_type)
 
NVTT_API EncodeSettingsSetTimingContext (TimingContext *_timing_context)
 
NVTT_API EncodeSettingsSetUseGPU (bool _use_gpu)
 
NVTT_API EncodeSettingsSetOutputToGPUMem (bool _to_device_mem)
 
NVTT_API EncodeSettingsSetIsOpaque (bool _is_opaque)
 

Public Attributes

uint32_t sType = EncodeSettings_Version_1
 
Format format = Format_Unset
 The desired compression format.
 
Quality quality = Quality_Normal
 The desired compression quality.
 
PixelType rgb_pixel_type = (PixelType)0
 
TimingContexttiming_context = nullptr
 
uint32_t encode_flags = EncodeFlags_UseGPU
 

Detailed Description

Low-level settings including the compression format, where compressed data should be written, and how to encode the data. This can be used in the low-level compression API (

See also
nvtt_encode) for any format NVTT supports.

Most new apps will only need to use format and SetOutputToGPUMem(). EncodeSettings' functions provide concise ways to change individual properties. For instance, here's one way to configure it to encode data to ASTC 4x4 at Production quality, attach a timing context, and output data on the GPU:

using namespace nvtt;
.SetQuality(Quality_Production)
.SetTimingContext(&tc)
Namespace for all public non-macro NVTT fields.
Definition nvtt.h:52
@ Format_ASTC_LDR_4x4
ASTC - LDR - format, tile size 4x4.
Definition nvtt_lowlevel.h:274
Definition nvtt_lowlevel.h:388
NVTT_API EncodeSettings & SetFormat(Format _format)
NVTT_API EncodeSettings & SetOutputToGPUMem(bool _to_device_mem)
A TimingContext is a way to collect timing data from a number of functions, and report how much time ...
Definition nvtt.h:1722

If your compiler supports C++20 aggregate initialization, it can also be used (and the C wrapper supports C99's designated initialization):

const EncodeSettings settings{
.quality = Quality_Production,
.timing_context = &tc,
@ EncodeFlags_OutputToGPUMem
Definition nvtt_lowlevel.h:349
@ EncodeFlags_UseGPU
Compress on the GPU if CUDA is available, instead of the CPU.
Definition nvtt_lowlevel.h:345
Format format
The desired compression format.
Definition nvtt_lowlevel.h:395
Since
NVTT 3.2

Member Function Documentation

◆ SetFormat()

NVTT_API EncodeSettings & nvtt::EncodeSettings::SetFormat ( Format _format)

Functions that set this object's fields and return this object. These allows setters to be chained.

◆ SetIsOpaque()

NVTT_API EncodeSettings & nvtt::EncodeSettings::SetIsOpaque ( bool _is_opaque)

◆ SetOutputToGPUMem()

NVTT_API EncodeSettings & nvtt::EncodeSettings::SetOutputToGPUMem ( bool _to_device_mem)

◆ SetUseGPU()

NVTT_API EncodeSettings & nvtt::EncodeSettings::SetUseGPU ( bool _use_gpu)

Member Data Documentation

◆ encode_flags

uint32_t nvtt::EncodeSettings::encode_flags = EncodeFlags_UseGPU

A bitmask of EncodeFlags. This can be set using bit operations, like encode_flags = EncodeFlags_UseGPU | EncodeFlags_Opaque, or using EncodeSettings' functions for individual flags.

◆ format

Format nvtt::EncodeSettings::format = Format_Unset

The desired compression format.

See also
Format

◆ quality

Quality nvtt::EncodeSettings::quality = Quality_Normal

The desired compression quality.

See also
Quality

◆ rgb_pixel_type

PixelType nvtt::EncodeSettings::rgb_pixel_type = (PixelType)0

When format is Format_RGB, this defines the type of the output data.

◆ sType

uint32_t nvtt::EncodeSettings::sType = EncodeSettings_Version_1

The structure type and version. This is here to allow this struct to be identified from its first 32 bits, and to allow future NVTT versions to add new members to this struct without breaking backwards compatibility. It should not be changed from the default.

◆ timing_context

TimingContext* nvtt::EncodeSettings::timing_context = nullptr

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