Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
ACGL
acgl
Commits
ed155d8a
Commit
ed155d8a
authored
Oct 20, 2014
by
Janis Born
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix wrong color conversions between RGB and RGBA
parent
baed658e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
src/ACGL/OpenGL/Data/TextureData.cc
src/ACGL/OpenGL/Data/TextureData.cc
+3
-3
No files found.
src/ACGL/OpenGL/Data/TextureData.cc
View file @
ed155d8a
...
...
@@ -324,7 +324,7 @@ glm::vec4 convertTexelNumChannels(glm::vec4 _texel, GLsizei _from, GLsizei _to)
else
if
(
_from
==
2
)
{
switch
(
_to
)
{
case
1
:
return
glm
::
vec4
(
_texel
.
r
,
0.0
,
0.0
,
0.0
);
case
3
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
r
,
_texel
.
r
,
_texel
.
g
);
case
3
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
r
,
_texel
.
r
,
0.0
);
case
4
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
r
,
_texel
.
r
,
_texel
.
g
);
}
}
...
...
@@ -332,14 +332,14 @@ glm::vec4 convertTexelNumChannels(glm::vec4 _texel, GLsizei _from, GLsizei _to)
switch
(
_to
)
{
case
1
:
return
glm
::
vec4
(
grayscaleMixdown
(
_texel
.
r
,
_texel
.
g
,
_texel
.
b
),
0.0
,
0.0
,
0.0
);
case
2
:
return
glm
::
vec4
(
grayscaleMixdown
(
_texel
.
r
,
_texel
.
g
,
_texel
.
b
),
1.0
,
0.0
,
0.0
);
case
4
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
r
,
_texel
.
r
,
1.0
);
case
4
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
g
,
_texel
.
b
,
1.0
);
}
}
else
if
(
_from
==
4
)
{
switch
(
_to
)
{
case
1
:
return
glm
::
vec4
(
grayscaleMixdown
(
_texel
.
r
,
_texel
.
g
,
_texel
.
b
),
0.0
,
0.0
,
0.0
);
case
2
:
return
glm
::
vec4
(
grayscaleMixdown
(
_texel
.
r
,
_texel
.
g
,
_texel
.
b
),
1.0
,
0.0
,
0.0
);
case
3
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
r
,
_texel
.
r
,
0.0
);
case
3
:
return
glm
::
vec4
(
_texel
.
r
,
_texel
.
g
,
_texel
.
b
,
0.0
);
}
}
return
_texel
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment