Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Project_Phoenix
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LuFG VR VIS
VR-Group
Project_Phoenix
Commits
21ce5574
Commit
21ce5574
authored
6 years ago
by
Jan Müller
Browse files
Options
Downloads
Patches
Plain Diff
add some kind of test for texture1D creation
#470
parent
6b894217
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!151
Feature/#470 create a color lookup table
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/src/test_lookup_table.cpp
+12
-2
12 additions, 2 deletions
tests/src/test_lookup_table.cpp
with
12 additions
and
2 deletions
tests/src/test_lookup_table.cpp
+
12
−
2
View file @
21ce5574
...
@@ -20,19 +20,24 @@
...
@@ -20,19 +20,24 @@
// limitations under the License.
// limitations under the License.
//------------------------------------------------------------------------------
//------------------------------------------------------------------------------
#include
"catch/catch.hpp"
#include
"phx/resources/types/lookup_table.hpp"
#include
"phx/resources/types/lookup_table.hpp"
#include
"phx/resources/types/transfer_function.hpp"
#include
"phx/resources/types/transfer_function.hpp"
#include
"catch/catch.hpp"
#include
"trompeloeil.hpp"
#include
"mocks/opengl_mock.hpp"
SCENARIO
(
"Creating and accesing a Lookup Table"
,
"[phx][phx::LookupTable]"
)
{
SCENARIO
(
"Creating and accesing a Lookup Table"
,
"[phx][phx::LookupTable]"
)
{
OPENGL_MOCK_ALLOW_ANY_CALL
GIVEN
(
"A test transfer function"
)
{
GIVEN
(
"A test transfer function"
)
{
phx
::
TransferFunction
transfer_function
;
phx
::
TransferFunction
transfer_function
;
glm
::
vec4
red_color
{
1.0f
,
0.0f
,
0.0f
,
0.0f
};
glm
::
vec4
red_color
{
1.0f
,
0.0f
,
0.0f
,
0.0f
};
glm
::
vec4
black_color
{
0.0f
,
0.0f
,
0.0f
,
0.0f
};
glm
::
vec4
black_color
{
0.0f
,
0.0f
,
0.0f
,
0.0f
};
transfer_function
.
SetEntries
({{
0.0f
,
red_color
},
{
1.0f
,
black_color
}});
transfer_function
.
SetEntries
({{
0.0f
,
red_color
},
{
1.0f
,
black_color
}});
WHEN
(
"We create Lookup Table
from
the given Transfer function"
)
{
WHEN
(
"We create Lookup Table
with
the given Transfer function"
)
{
phx
::
LookupTable
lut
(
transfer_function
,
11
);
phx
::
LookupTable
lut
(
transfer_function
,
11
);
THEN
(
"The Lookup Table is generated correctly"
)
{
THEN
(
"The Lookup Table is generated correctly"
)
{
...
@@ -48,6 +53,11 @@ SCENARIO("Creating and accesing a Lookup Table", "[phx][phx::LookupTable]") {
...
@@ -48,6 +53,11 @@ SCENARIO("Creating and accesing a Lookup Table", "[phx][phx::LookupTable]") {
REQUIRE
(
lut
.
GetIndex
(
1.0f
)
==
10
);
REQUIRE
(
lut
.
GetIndex
(
1.0f
)
==
10
);
REQUIRE
(
lut
.
GetIndex
(
0.56f
)
==
6
);
REQUIRE
(
lut
.
GetIndex
(
0.56f
)
==
6
);
}
}
THEN
(
"We can ask for a lookup table as texture1D"
)
{
REQUIRE_CALL
(
open_gl_mock
,
glCreateTextures
(
_
,
_
,
_
));
auto
lookup_texture
=
lut
.
GetTexture1D
();
}
}
}
WHEN
(
"We ask for a nearest neighbor interpolated Lookup Table"
)
{
WHEN
(
"We ask for a nearest neighbor interpolated Lookup Table"
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment