Skip to content

Commit

Permalink
Update include locations.
Browse files Browse the repository at this point in the history
  • Loading branch information
tatsy committed Nov 24, 2016
1 parent e4fbcb7 commit 3fa98b4
Show file tree
Hide file tree
Showing 17 changed files with 32 additions and 30 deletions.
1 change: 1 addition & 0 deletions sources/viewer/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ if (${SPICA_BUILD_GUI})
set(CMAKE_AUTOMOC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

include_directories(${SPICA_ROOT_DIR}/sources)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

configure_file(shader_location.in.h
Expand Down
2 changes: 1 addition & 1 deletion sources/viewer/main.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include <QtWidgets/qapplication.h>

#include "../../include/spica.h"
#include "spica.h"
using namespace spica;

#include "scene_viewer.h"
Expand Down
22 changes: 11 additions & 11 deletions sources/viewer/report_engine.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#ifndef _SPICA_REPORT_ENGINE_H_
#define _SPICA_REPORT_ENGINE_H_

#include "../../include/spica.h"
#include "spica.h"

#include <QtCore/qobject.h>
#include <QtGui/qimage.h>
Expand Down Expand Up @@ -57,16 +57,16 @@ class ReportEngine : public QObject, public Engine {


auto callback = std::make_unique<std::function<void(const Image&)>>([&](const Image& image) {
QImage qimage(image.width(), image.height(), QImage::Format_ARGB32_Premultiplied);
for (int y = 0; y < image.height(); y++) {
for (int x = 0; x < image.width(); x++) {
RGBSpectrum rgb = image(x, y).toRGB();
int r = std::max(0, std::min((int)(rgb.red() * 255.0), 255));
int g = std::max(0, std::min((int)(rgb.green() * 255.0), 255));
int b = std::max(0, std::min((int)(rgb.blue() * 255.0), 255));
qimage.setPixel(x, y, qRgb(r, g, b));
}
}
QImage qimage(image.width(), image.height(), QImage::Format_ARGB32_Premultiplied);
for (int y = 0; y < image.height(); y++) {
for (int x = 0; x < image.width(); x++) {
RGBSpectrum rgb = image(x, y).toRGB();
int r = std::max(0, std::min((int)(rgb.red() * 255.0), 255));
int g = std::max(0, std::min((int)(rgb.green() * 255.0), 255));
int b = std::max(0, std::min((int)(rgb.blue() * 255.0), 255));
qimage.setPixel(x, y, qRgb(r, g, b));
}
}
emit imageSaved(qimage);
});

Expand Down
2 changes: 1 addition & 1 deletion sources/viewer/scene_viewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "opengl_viewer.h"
#include "render_worker.h"

#include "../../include/spica.h"
#include "spica.h"

namespace spica {

Expand Down
1 change: 1 addition & 0 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ if (${SPICA_BUILD_TESTS})
message(STATUS "[spica] Building unit tests.")

enable_testing()
include_directories(${SPICA_ROOT_DIR}/sources)
link_directories(${CMAKE_LIBRARY_OUTPUT_DIRECTORY})

if(WIN32)
Expand Down
4 changes: 2 additions & 2 deletions tests/test_color.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <sstream>
#include <tuple>

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

// -----------------------------------------------------------------------------
Expand Down Expand Up @@ -213,4 +213,4 @@ std::vector<Spectrum> colors = {
INSTANTIATE_TEST_CASE_P(, SpectrumTestWithParam,
::testing::Combine(::testing::ValuesIn(colors),
::testing::ValuesIn(colors)));


2 changes: 1 addition & 1 deletion tests/test_geometry.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <cmath>

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

// ------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/test_image.cc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "gtest/gtest.h"
#include "../include/spica.h"
#include "spica.h"
using namespace spica;

#include <string>
Expand Down Expand Up @@ -201,4 +201,4 @@ TEST_F(ImageTest, DurandTmo) {
EXPECT_NO_FATAL_FAILURE(image = tmo.apply(image));
EXPECT_NO_FATAL_FAILURE(image = GammaTmo(2.2).apply(image));
image.save(kTempDirectory + "durand.png");
}
}
2 changes: 1 addition & 1 deletion tests/test_matrix4x4.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

//! Fixture class.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_normal3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <ctime>

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

class Normal3dTest : public ::testing::Test {
Expand Down
4 changes: 2 additions & 2 deletions tests/test_point3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

#include <ctime>

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

class Point3dTest : public ::testing::Test {
Expand Down Expand Up @@ -123,4 +123,4 @@ TEST_F(Point3dTest, MultiplyAndDivision) {

double t = 0.0;
ASSERT_DEATH(p1 / t, "");
}
}
4 changes: 2 additions & 2 deletions tests/test_quaternion.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

#include <vector>
Expand Down Expand Up @@ -96,4 +96,4 @@ std::vector<Quaternion> quats = {
};

INSTANTIATE_TEST_CASE_P(, QuaternionUnaryTest,
::testing::ValuesIn(quats));
::testing::ValuesIn(quats));
2 changes: 1 addition & 1 deletion tests/test_ray.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

TEST(RayTest, DefaultInstanceTest) {
Expand Down
2 changes: 1 addition & 1 deletion tests/test_scene.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include <string>
#include <type_traits>

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

// -----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_transform.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

//! Fixture class.
Expand Down
2 changes: 1 addition & 1 deletion tests/test_vector2d.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "gtest/gtest.h"

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

template <class T>
Expand Down
4 changes: 2 additions & 2 deletions tests/test_vector3d.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include <tuple>
#include <algorithm>

#include "../include/spica.h"
#include "spica.h"
using namespace spica;

using Vector3dPair = std::tuple<Vector3d, Vector3d>;
Expand Down Expand Up @@ -249,4 +249,4 @@ INSTANTIATE_TEST_CASE_P(, Vector3dUnaryTest,

INSTANTIATE_TEST_CASE_P(, Vector3dPairwiseTest,
::testing::Combine(::testing::ValuesIn(vectors),
::testing::ValuesIn(vectors)));
::testing::ValuesIn(vectors)));

0 comments on commit 3fa98b4

Please sign in to comment.