Skip to content

Commit 5b1a50e

Browse files
committed
Change all remaining oetf to transferFunction.
1 parent eefa63b commit 5b1a50e

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

tools/imageio/formatdesc.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ struct FormatDescriptor {
203203
uint32_t bLength, uint32_t offset,
204204
khr_df_sample_datatype_qualifiers_e dataType
205205
= static_cast<khr_df_sample_datatype_qualifiers_e>(0),
206-
khr_df_transfer_e oetf = KHR_DF_TRANSFER_UNSPECIFIED,
206+
khr_df_transfer_e tf = KHR_DF_TRANSFER_UNSPECIFIED,
207207
khr_df_model_e m = KHR_DF_MODEL_RGBSDA) {
208208
bitOffset = offset;
209209
bitLength = bLength - 1;
@@ -217,7 +217,7 @@ struct FormatDescriptor {
217217
qualifierSigned = (dataType & KHR_DF_SAMPLE_DATATYPE_SIGNED) != 0;
218218
qualifierExponent = (dataType & KHR_DF_SAMPLE_DATATYPE_EXPONENT) != 0;
219219
qualifierLinear = (dataType & KHR_DF_SAMPLE_DATATYPE_LINEAR) != 0;
220-
if (oetf > KHR_DF_TRANSFER_LINEAR
220+
if (tf > KHR_DF_TRANSFER_LINEAR
221221
&& channelType == KHR_DF_CHANNEL_RGBSDA_ALPHA) {
222222
qualifierLinear = 1;
223223
}
@@ -266,9 +266,9 @@ struct FormatDescriptor {
266266
uint32_t sampleLower, uint32_t sampleUpper,
267267
khr_df_sample_datatype_qualifiers_e dataType
268268
= static_cast<khr_df_sample_datatype_qualifiers_e>(0),
269-
khr_df_transfer_e oetf = KHR_DF_TRANSFER_UNSPECIFIED,
269+
khr_df_transfer_e tf = KHR_DF_TRANSFER_UNSPECIFIED,
270270
khr_df_model_e m = KHR_DF_MODEL_RGBSDA)
271-
: sample(chanType, bitLength, offset, dataType, oetf, m)
271+
: sample(chanType, bitLength, offset, dataType, tf, m)
272272
{
273273
if (qualifierFloat) {
274274
throw std::runtime_error(

tools/imageio/image.hpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -685,8 +685,8 @@ class Image {
685685
uint32_t getWidth() const { return width; }
686686
uint32_t getHeight() const { return height; }
687687
uint32_t getPixelCount() const { return width * height; }
688-
khr_df_transfer_e getOetf() const { return oetf; }
689-
void setOetf(khr_df_transfer_e noetf) { this->oetf = noetf; }
688+
khr_df_transfer_e getTransferFunction() const { return transferFunction; }
689+
void setTransferFunction(khr_df_transfer_e tf) { transferFunction = tf; }
690690
khr_df_primaries_e getPrimaries() const { return primaries; }
691691
void setPrimaries(khr_df_primaries_e nprimaries) {
692692
this->primaries = nprimaries;
@@ -733,11 +733,11 @@ class Image {
733733
protected:
734734
Image() : Image(0, 0) { }
735735
Image(uint32_t w, uint32_t h)
736-
: width(w), height(h), oetf(KHR_DF_TRANSFER_UNSPECIFIED),
736+
: width(w), height(h), transferFunction(KHR_DF_TRANSFER_UNSPECIFIED),
737737
primaries(KHR_DF_PRIMARIES_BT709) { }
738738

739739
uint32_t width, height; // In pixels
740-
khr_df_transfer_e oetf;
740+
khr_df_transfer_e transferFunction;
741741
khr_df_primaries_e primaries;
742742
};
743743

@@ -1113,7 +1113,7 @@ class ImageT : public Image {
11131113
using namespace basisu;
11141114

11151115
auto target = std::make_unique<ImageT<componentType, componentCount>>(targetWidth, targetHeight);
1116-
target->setOetf(oetf);
1116+
target->setTransferFunction(transferFunction);
11171117
target->setPrimaries(primaries);
11181118

11191119
const auto sourceWidth = width;
@@ -1149,7 +1149,7 @@ class ImageT : public Image {
11491149

11501150
const TransferFunctionSRGB tfSRGB;
11511151
const TransferFunctionLinear tfLinear;
1152-
const TransferFunction& tf = oetf == KHR_DF_TRANSFER_SRGB ?
1152+
const TransferFunction& tf = transferFunction == KHR_DF_TRANSFER_SRGB ?
11531153
static_cast<const TransferFunction&>(tfSRGB) :
11541154
static_cast<const TransferFunction&>(tfLinear);
11551155

@@ -1290,7 +1290,7 @@ class ImageT : public Image {
12901290
assert(getComponentSize() == dst.getComponentSize());
12911291
assert(width == dst.getWidth() && height == dst.getHeight());
12921292

1293-
dst.setOetf(oetf);
1293+
dst.setTransferFunction(transferFunction);
12941294
dst.setPrimaries(primaries);
12951295
for (size_t i = 0; i < getPixelCount(); i++) {
12961296
uint32_t c;

tools/ktxtools_mainpage.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ The command-line syntax and semantics differ from the old tools including, but n
4242
* The `ktx validate` tool also supports validating KTX 2.0 files against the additional restrictions defined by the _KHR\_texture\_basisu_ extension. Use the `--gltf-basisu` command-line option to verify glTF and WebGL compatibility.
4343
* The new `ktx info` tool produces a unified and complete output of all metadata in KTX 2.0 files and can provide output in human readable text format or in JSON format (both formatted and minified options are available), as controlled by the `--format` command-line option.
4444
* The source repository also includes the JSON schemas that the JSON outputs of the `ktx info` and `ktx validate` tools comply to.
45-
* The `ktx create` tool takes an explicit Vulkan format argument (`--format`) instead of inferring the format based on the provided input files as `toktx`, and thus doesn't perform any implicit color-space conversions except gamma 2.2 to sRGB. Use the `--assign-oetf`, `--convert-oetf`, `--assign-primaries`, and the new `--convert-primaries` for fine grained control over color-space interpretation and conversion.
45+
* The `ktx create` tool takes an explicit Vulkan format argument (`--format`) instead of inferring the format based on the provided input files as `toktx`, and thus doesn't perform any implicit color-space conversions except gamma 2.2 to sRGB. Use the `--assign-tf`, `--convert-tf`, `--assign-primaries`, and the new `--convert-primaries` for fine grained control over color-space interpretation and conversion.
4646
* The `ktx create` tool does not support resizing or scaling like `toktx`, and, in general, does not perform any image transformations except the optional color-space conversion and mipmap generation options. Users should resize input images to the appropriate resolution before converting them to KTX 2.0 files.
4747
* The `ktx create` and `ktx extract` tools consume and produce, respectively, image file formats that best suit the used Vulkan format. In general, barring special cases, 8-bit and 16-bit normalized integer formats are imported from and exported to PNG files, while integer and floating point formats are imported from and exported to EXR files based on predefined rules. This may be extended in the future using additional command line options and in response to support for other image file formats.
4848
* The new tools and updated `libktx` support ZLIB supercompression besides the BasisLZ and Zstd supercompression schemes supported previously.

tools/toktx/toktx.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1103,7 +1103,7 @@ toktxApp::createImage(const targetImageSpec& target, ImageInput& in)
11031103
}
11041104
}
11051105
image->setPrimaries((khr_df_primaries_e)target.format().primaries());
1106-
image->setOetf((khr_df_transfer_e)target.format().transfer());
1106+
image->setTransferFunction((khr_df_transfer_e)target.format().transfer());
11071107

11081108
if (options.scale != 1.0f) {
11091109
auto scaledWidth = image->getWidth() * options.scale;

0 commit comments

Comments
 (0)