Remove CurrentSingleComponentFormat.
This commit is contained in:
parent
e68f76e6ab
commit
2439235e42
3 changed files with 3 additions and 15 deletions
|
|
@ -155,14 +155,4 @@ TexturedRect Image::texturedRect(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
GLint CurrentSingleComponentFormat() {
|
|
||||||
const auto context = QOpenGLContext::currentContext();
|
|
||||||
Assert(context != nullptr);
|
|
||||||
|
|
||||||
const auto format = context->format();
|
|
||||||
return (format.renderableType() == QSurfaceFormat::OpenGLES)
|
|
||||||
? GL_LUMINANCE
|
|
||||||
: GL_RED;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace Ui::GL
|
} // namespace Ui::GL
|
||||||
|
|
|
||||||
|
|
@ -134,8 +134,6 @@ private:
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
[[nodiscard]] GLint CurrentSingleComponentFormat();
|
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
inline constexpr auto kFormatRGBA = GL_BGRA_EXT;
|
inline constexpr auto kFormatRGBA = GL_BGRA_EXT;
|
||||||
inline constexpr auto kSwizzleRedBlue = false;
|
inline constexpr auto kSwizzleRedBlue = false;
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,9 @@ uniform sampler2D u_texture;
|
||||||
uniform sampler2D v_texture;
|
uniform sampler2D v_texture;
|
||||||
)",
|
)",
|
||||||
.body = R"(
|
.body = R"(
|
||||||
float y = texture2D(y_texture, v_texcoord).r - 0.0625;
|
float y = texture2D(y_texture, v_texcoord).a - 0.0625;
|
||||||
float u = texture2D(u_texture, v_texcoord).r - 0.5;
|
float u = texture2D(u_texture, v_texcoord).a - 0.5;
|
||||||
float v = texture2D(v_texture, v_texcoord).r - 0.5;
|
float v = texture2D(v_texture, v_texcoord).a - 0.5;
|
||||||
result = vec4(
|
result = vec4(
|
||||||
1.164 * y + 1.596 * v,
|
1.164 * y + 1.596 * v,
|
||||||
1.164 * y - 0.392 * u - 0.813 * v,
|
1.164 * y - 0.392 * u - 0.813 * v,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue