]> git.sesse.net Git - movit/commitdiff
Move everything into “namespace movit”.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Feb 2014 01:04:19 +0000 (02:04 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Wed, 12 Feb 2014 01:04:19 +0000 (02:04 +0100)
This is a pretty hard API break, but it's probably the last big API
break before 1.0, and some of the names (e.g. Effect, Input ResourcePool)
are really so generic that they should not be allowed to pollute the global
namespace.

96 files changed:
README
alpha_division_effect.cpp
alpha_division_effect.h
alpha_division_effect_test.cpp
alpha_multiplication_effect.cpp
alpha_multiplication_effect.h
alpha_multiplication_effect_test.cpp
blur_effect.cpp
blur_effect.h
blur_effect_test.cpp
colorspace_conversion_effect.cpp
colorspace_conversion_effect.h
colorspace_conversion_effect_test.cpp
d65.h
deconvolution_sharpen_effect.cpp
deconvolution_sharpen_effect.h
deconvolution_sharpen_effect_test.cpp
demo.cpp
diffusion_effect.cpp
diffusion_effect.h
diffusion_effect_test.cpp
dither_effect.cpp
dither_effect.h
dither_effect_test.cpp
effect.cpp
effect.h
effect_chain.cpp
effect_chain.h
effect_chain_test.cpp
effect_util.cpp
effect_util.h
fft_pass_effect.cpp
fft_pass_effect.h
fft_pass_effect_test.cpp
flat_input.cpp
flat_input.h
flat_input_test.cpp
gamma_compression_effect.cpp
gamma_compression_effect.h
gamma_compression_effect_test.cpp
gamma_expansion_effect.cpp
gamma_expansion_effect.h
gamma_expansion_effect_test.cpp
glow_effect.cpp
glow_effect.h
glow_effect_test.cpp
image_format.h
init.cpp
init.h
input.h
lift_gamma_gain_effect.cpp
lift_gamma_gain_effect.h
lift_gamma_gain_effect_test.cpp
mirror_effect.cpp
mirror_effect.h
mix_effect.cpp
mix_effect.h
mix_effect_test.cpp
multiply_effect.cpp
multiply_effect.h
overlay_effect.cpp
overlay_effect.h
overlay_effect_test.cpp
padding_effect.cpp
padding_effect.h
padding_effect_test.cpp
resample_effect.cpp
resample_effect.h
resample_effect_test.cpp
resize_effect.cpp
resize_effect.h
resource_pool.cpp
resource_pool.h
sandbox_effect.cpp
sandbox_effect.h
saturation_effect.cpp
saturation_effect.h
saturation_effect_test.cpp
test_util.cpp
test_util.h
unsharp_mask_effect.cpp
unsharp_mask_effect.h
unsharp_mask_effect_test.cpp
util.cpp
util.h
vignette_effect.cpp
vignette_effect.h
vignette_effect_test.cpp
white_balance_effect.cpp
white_balance_effect.h
white_balance_effect_test.cpp
widgets.cpp
widgets.h
ycbcr_input.cpp
ycbcr_input.h
ycbcr_input_test.cpp

diff --git a/README b/README
index 702f29a6445e2309b5769277a3ab0b9c94773212..3f29bea69b8a7230c2309384f74aab8b885f03c7 100644 (file)
--- a/README
+++ b/README
@@ -56,6 +56,7 @@ TL;DR, but I am interested in a programming example instead
 Assuming you have an OpenGL context already set up:
 
 <code>
+  using namespace movit;
   EffectChain chain(1280, 720);
 
   ImageFormat inout_format;
index 177a52cc23b37d9bb82036a02f69d3ec143ec5a7..45836ce7eadf1d4da9831969e6dd479a3aa46110 100644 (file)
@@ -3,7 +3,11 @@
 
 using namespace std;
 
+namespace movit {
+
 string AlphaDivisionEffect::output_fragment_shader()
 {
        return read_file("alpha_division_effect.frag");
 }
+
+}  // namespace
index b95e9fe77c61fb8074e548e1f361ae43f1dfdf3e..6fcc716d48bf93e180f8656f99af0a48b868a100 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class AlphaDivisionEffect : public Effect {
 public:
        AlphaDivisionEffect() {}
@@ -14,4 +16,6 @@ public:
        std::string output_fragment_shader();
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_ALPHA_DIVISION_EFFECT_H)
index b9c16b3f082c32063fcf065bae376e4958140706..faa8b173b99648e8376ee44bd6801878422b26e8 100644 (file)
@@ -5,6 +5,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(AlphaDivisionEffectTest, SimpleTest) {
        const int size = 2;
        float data[4 * size] = {
@@ -35,3 +37,5 @@ TEST(AlphaDivisionEffectTest, ZeroAlphaIsPreserved) {
        EXPECT_EQ(0.0f, out_data[3]);
        EXPECT_EQ(0.0f, out_data[7]);
 }
+
+}  // namespace movit
index 64414852b4b04e304fe47685e57758ef776f54f3..3bc94590b327aedacba475a5acc85dc8a529bdfb 100644 (file)
@@ -3,7 +3,11 @@
 
 using namespace std;
 
+namespace movit {
+
 string AlphaMultiplicationEffect::output_fragment_shader()
 {
        return read_file("alpha_multiplication_effect.frag");
 }
+
+}  // namespace movit
index b9cf251e6719fb022e8f651b1f4d952461433895..bc66d72214d8f612bf3f8425cb2ed39f4a3d837e 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class AlphaMultiplicationEffect : public Effect {
 public:
        AlphaMultiplicationEffect() {}
@@ -14,4 +16,6 @@ public:
        std::string output_fragment_shader();
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_ALPHA_MULTIPLICATION_EFFECT_H)
index 62863e92ac1f846c60161b8d6fc8d99e203088b3..c63c0a3087841c3d90244b60dea312751b03acae 100644 (file)
@@ -7,6 +7,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(AlphaMultiplicationEffectTest, SimpleTest) {
        const int size = 3;
        float data[4 * size] = {
@@ -25,3 +27,5 @@ TEST(AlphaMultiplicationEffectTest, SimpleTest) {
 
        expect_equal(expected_data, out_data, 4, size);
 }
+
+}  // namespace movit
index 80aef747c8a6bba0da40f20b0a06e91b810e2937..9397ca423d429853a9a21c470217447ec688f2a3 100644 (file)
@@ -12,6 +12,8 @@
 #define NUM_TAPS 16
 
 using namespace std;
+
+namespace movit {
        
 BlurEffect::BlurEffect()
        : radius(3.0f),
@@ -196,3 +198,5 @@ void SingleBlurPassEffect::set_gl_state(GLuint glsl_program_num, const string &p
 void SingleBlurPassEffect::clear_gl_state()
 {
 }
+
+}  // namespace movit
index 84dd6ba6b1037852dc644c25c8edea4856dffeb7..d97f5bdcd2b05352c331ddafb552783444ac8235 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class EffectChain;
 class Node;
 class SingleBlurPassEffect;
@@ -92,4 +94,6 @@ private:
        int width, height, virtual_width, virtual_height;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_BLUR_EFFECT_H)
index 4114bcbc45bff018a271f8d360b388bbde85bca6..1ef479ec478d8a9be52ac3f70d87a46be761bd62 100644 (file)
@@ -9,6 +9,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(BlurEffectTest, IdentityTransformDoesNothing) {
        const int size = 4;
 
@@ -99,3 +101,5 @@ TEST(BlurEffectTest, BlurTwoDotsLargeRadius) {
 
        expect_equal(expected_data, out_data, size, size, 0.1f, 1e-3);
 }
+
+}  // namespace movit
index 0fcea612c4198b8cf8d8a96d40bfbea4c8b25f8e..2b8a0ca329fd34b3d535fca0cbdfb56584b8ff1d 100644 (file)
@@ -9,6 +9,8 @@
 using namespace Eigen;
 using namespace std;
 
+namespace movit {
+
 // Color coordinates from Rec. 709; sRGB uses the same primaries.
 static const double rec709_x_R = 0.640, rec709_x_G = 0.300, rec709_x_B = 0.150;
 static const double rec709_y_R = 0.330, rec709_y_G = 0.600, rec709_y_B = 0.060;
@@ -142,3 +144,5 @@ string ColorspaceConversionEffect::output_fragment_shader()
        return output_glsl_mat3("PREFIX(conversion_matrix)", m) +
                read_file("colorspace_conversion_effect.frag");
 }
+
+}  // namespace movit
index ab8a8aa3ea630a7ebb98bc729b5b2ae643c87d8c..76246d6519e4b6c668d38d3b6d3595541091578d 100644 (file)
@@ -14,6 +14,8 @@
 #include "effect.h"
 #include "image_format.h"
 
+namespace movit {
+
 class ColorspaceConversionEffect : public Effect {
 private:
        // Should not be instantiated by end users.
@@ -34,4 +36,6 @@ private:
        Colorspace source_space, destination_space;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_COLORSPACE_CONVERSION_EFFECT_H)
index 18f66efeb74a99bf3711c0aaab451f23d0edf036..cf8aad7e4bd41daa8a3737f578d9dc855b4d890d 100644 (file)
@@ -6,6 +6,8 @@
 #include "gtest/gtest.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(ColorspaceConversionEffectTest, Reversible) {
        float data[] = {
                0.0f, 0.0f, 0.0f, 1.0f,
@@ -278,3 +280,5 @@ TEST(ColorspaceConversionEffectTest, sRGBToRec601_525) {
 
        expect_equal(expected_data, out_data, 4, 6);
 }
+
+}  // namespace movit
diff --git a/d65.h b/d65.h
index 807c274ece6ce645a4f14b0699e63ae83cf9d37e..313fa45fdc83fc8a3b1d5f53296f4fbf697bc45b 100644 (file)
--- a/d65.h
+++ b/d65.h
@@ -1,6 +1,8 @@
 #ifndef _MOVIT_D65_H
 #define _MOVIT_D65_H 1
 
+namespace movit {
+
 // The D65 illuminant, which is the standard white point (ie. what you should get
 // for R=G=B=1) for almost all video color spaces in common use. It has a color
 // temperature roughly around 6500 K, which is sort of bluish; it is intended to
@@ -14,5 +16,7 @@ static const double d65_X = d65_x / d65_y;
 static const double d65_Y = 1.0;
 static const double d65_Z = d65_z / d65_y;
 
+}  // namespace movit
+
 #endif  // !defined(_MOVIT_D65_H)
 
index c663d653360350c624bc769047269d69b89827c2..f564b68c4bcc62f350b88ca929d46d4f4cd1bec3 100644 (file)
@@ -19,6 +19,8 @@
 using namespace Eigen;
 using namespace std;
 
+namespace movit {
+
 DeconvolutionSharpenEffect::DeconvolutionSharpenEffect()
        : R(5),
          circle_radius(2.0f),
@@ -444,3 +446,5 @@ void DeconvolutionSharpenEffect::set_gl_state(GLuint glsl_program_num, const str
 
        set_uniform_vec4_array(glsl_program_num, prefix, "samples", samples, (R + 1) * (R + 1));
 }
+
+}  // namespace movit
index 9279abf52f9686ca60bac6c652fa9e5b14db9971..e4cc9a556d224e239e411b98c2c1596374ff182e 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class DeconvolutionSharpenEffect : public Effect {
 public:
        DeconvolutionSharpenEffect();
@@ -68,4 +70,6 @@ private:
        void update_deconvolution_kernel();
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_DECONVOLUTION_SHARPEN_EFFECT_H)
index ba821cee6231a6f133827f743325b448ab772300..8829b9da21de959685e7346cf7b4374a16b2e936 100644 (file)
@@ -10,6 +10,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(DeconvolutionSharpenEffectTest, IdentityTransformDoesNothing) {
        const int size = 4;
 
@@ -232,3 +234,5 @@ TEST(DeconvolutionSharpenEffectTest, CircularDeconvolutionKeepsAlpha) {
 
        expect_equal(expected_alpha, out_data, size, size);
 }
+
+}  // namespace movit
index 81bda2d60cf7de5659bcd4391e9bb1bc81e782f5..3201f1e0abcb0a729fb4cc6671a16e338bc44d15 100644 (file)
--- a/demo.cpp
+++ b/demo.cpp
@@ -35,6 +35,8 @@
 #include "util.h"
 #include "widgets.h"
 
+using namespace movit;
+
 unsigned char result[WIDTH * HEIGHT * 4];
 
 float lift_theta = 0.0f, lift_rad = 0.0f, lift_v = 0.0f;
index fb78bb76a4cadfe6b4609a1f4fcddaacc565bc23..145eaf695860608040afec87bc0120eb08188c6d 100644 (file)
@@ -8,6 +8,8 @@
 
 using namespace std;
 
+namespace movit {
+
 DiffusionEffect::DiffusionEffect()
        : blur(new BlurEffect),
          overlay_matte(new OverlayMatteEffect)
@@ -46,3 +48,5 @@ string OverlayMatteEffect::output_fragment_shader()
 {
        return read_file("overlay_matte_effect.frag");
 }
+
+}  // namespace movit
index 390787d9a3dc4c54c2dd8408538fd43d480ab471..2c31e4ae348524e23ba2b55e344a739d01b2092c 100644 (file)
@@ -18,6 +18,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class BlurEffect;
 class EffectChain;
 class Node;
@@ -58,5 +60,6 @@ private:
        float blurred_mix_amount;
 };
 
+}  // namespace movit
 
 #endif // !defined(_MOVIT_DIFFUSION_EFFECT_H)
index 9faa7baf7443f426003edc02a73d9dd8852f52bd..7e50a04d8bcc7071167b026aae8dcfcf84c30da6 100644 (file)
@@ -8,6 +8,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(DiffusionEffectTest, IdentityTransformDoesNothing) {
        const int size = 4;
 
@@ -62,3 +64,5 @@ TEST(DiffusionEffectTest, FlattensOutWhitePyramid) {
 
        expect_equal(expected_data, out_data, size, size, 0.05f, 0.002);
 }
+
+}  // namespace movit
index 6e1ddd8d8ed4b7451698fd0b9d70382560bf0c52..e9ea19f226006e8f30584b7dbc9c1ee95cfd350d 100644 (file)
@@ -10,6 +10,8 @@
 
 using namespace std;
 
+namespace movit {
+
 namespace {
 
 // A simple LCG (linear congruental generator) random generator.
@@ -122,3 +124,5 @@ void DitherEffect::set_gl_state(GLuint glsl_program_num, const string &prefix, u
        set_uniform_float(glsl_program_num, prefix, "round_fac", round_fac);
        set_uniform_float(glsl_program_num, prefix, "inv_round_fac", 1.0f / round_fac);
 }
+
+}  // namespace movit
index a6c3c9cc856e895b8b662f753d1dba37e2697637..20fb025532d5fea4e92329c7733d06669354b39d 100644 (file)
@@ -48,6 +48,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class DitherEffect : public Effect {
 private:
        // Should not be instantiated by end users;
@@ -77,4 +79,6 @@ private:
        GLuint texnum;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_DITHER_EFFECT_H)
index 6fd46dbf402feba053183e16790157602dd91277..8801aa0f94022697976462f44ef3fb2c84f139ac 100644 (file)
@@ -8,6 +8,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(DitherEffectTest, NoDitherOnExactValues) {
        const int size = 4;
 
@@ -55,3 +57,5 @@ TEST(DitherEffectTest, SinusoidBelowOneLevelComesThrough) {
 
        EXPECT_NEAR(amplitude, sum / (size * 255.0f), 1.1e-5);
 }
+
+}  // namespace movit
index 93ba41a09bef116324cb956d473d6c3cac8e2a23..eded11a7ef5746a6563bd9f157019bb0abcc1a2c 100644 (file)
@@ -9,6 +9,8 @@
 
 using namespace std;
 
+namespace movit {
+
 bool Effect::set_int(const string &key, int value)
 {
        if (params_int.count(key) == 0) {
@@ -145,3 +147,5 @@ void Effect::set_gl_state(GLuint glsl_program_num, const string& prefix, unsigne
 }
 
 void Effect::clear_gl_state() {}
+
+}  // namespace movit
index a7d426c723981bc11e10006fa9d44d6b3f5d8db5..ce07df472e46327a45e0533650bd98163638232b 100644 (file)
--- a/effect.h
+++ b/effect.h
@@ -18,6 +18,8 @@
 
 #include "defs.h"
 
+namespace movit {
+
 class EffectChain;
 class Node;
 
@@ -271,4 +273,6 @@ private:
        std::map<std::string, float *> params_vec4;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_EFFECT_H)
index ec64b83fc336800eeb29a0f66520adfa79a332a5..9aa092ba207db4f614abfe5f45617c0eff3f3849 100644 (file)
@@ -29,6 +29,8 @@
 
 using namespace std;
 
+namespace movit {
+
 EffectChain::EffectChain(float aspect_nom, float aspect_denom, ResourcePool *resource_pool)
        : aspect_nom(aspect_nom),
          aspect_denom(aspect_denom),
@@ -1576,3 +1578,5 @@ void EffectChain::render_to_fbo(GLuint dest_fbo, unsigned width, unsigned height
                check_error();
        }
 }
+
+}  // namespace movit
index 1f850519dec8af1f1032492d6ae4e601cfa542f9..642f079201f037219b1ead3c02aebf3e85bfb28d 100644 (file)
@@ -26,6 +26,8 @@
 
 #include "image_format.h"
 
+namespace movit {
+
 class Effect;
 class Input;
 struct Phase;
@@ -266,4 +268,6 @@ private:
        bool owns_resource_pool;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_EFFECT_CHAIN_H)
index 25cd50a26839ba5942998d13b872f42ea13225ef..cf725f1131bb1eae8a1722c1e2989893d8c178be 100644 (file)
@@ -19,6 +19,8 @@
 
 using namespace std;
 
+namespace movit {
+
 TEST(EffectChainTest, EmptyChain) {
        float data[] = {
                0.0f, 0.25f, 0.3f,
@@ -1019,3 +1021,5 @@ TEST(EffectChainTest, IdentityWithOwnPool) {
        // Reset the debug status again.
        movit_debug_level = MOVIT_DEBUG_OFF;
 }
+
+}  // namespace movit
index f49b47707bde4920fbace424fca80113c979de59..35a94a7c3e999b0ebc2795f92b40e0d10d0009cb 100644 (file)
@@ -6,6 +6,8 @@
 
 using namespace std;
 
+namespace movit {
+
 GLint get_uniform_location(GLuint glsl_program_num, const string &prefix, const string &key)
 {
        string name = prefix + "_" + key;
@@ -97,3 +99,5 @@ void set_uniform_mat3(GLuint glsl_program_num, const string &prefix, const strin
        glUniformMatrix3fv(location, 1, GL_FALSE, matrixf);
        check_error();
 }
+
+}  // namespace movit
index 1c2e92c26d7313eec5e49813be014402a949d92c..65bd315855c5f004b2ec73bc6dc73f3b3c96aaec 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "util.h"
 
+namespace movit {
+
 class EffectChain;
 class Node;
 
@@ -27,4 +29,6 @@ void set_uniform_vec4(GLuint glsl_program_num, const std::string &prefix, const
 void set_uniform_vec4_array(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const float *values, size_t num_values);
 void set_uniform_mat3(GLuint glsl_program_num, const std::string &prefix, const std::string &key, const Eigen::Matrix3d &matrix);
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_EFFECT_UTIL_H)
index 9e1b7b54af52bfcc087fff958a1f31e5cf7128f0..ccca74dd05df7ef7696378ddccb62f4e615dede7 100644 (file)
@@ -7,6 +7,8 @@
 
 using namespace std;
 
+namespace movit {
+
 FFTPassEffect::FFTPassEffect()
        : input_width(1280),
          input_height(720),
@@ -156,3 +158,5 @@ void FFTPassEffect::set_gl_state(GLuint glsl_program_num, const string &prefix,
        assert(input_size % fft_size == 0);
        set_uniform_float(glsl_program_num, prefix, "num_repeats", input_size / fft_size);
 }
+
+}  // namespace movit
index f12bda7e416ce3eeefe0f02e55ea4f0bbefa59a9..1fd4ea2c1886ed0bd6fb1f358954989770e0e5da 100644 (file)
@@ -57,6 +57,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class FFTPassEffect : public Effect {
 public:
        FFTPassEffect();
@@ -108,4 +110,6 @@ private:
        int inverse;  // 0 = forward (FFT), 1 = reverse (IFFT).
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_FFT_PASS_EFFECT_H)
index 1d6693c09ac694d39076a9ef296efa231826bc62..eb4e37cf3c439addad6c8726b607a209dda0ef7c 100644 (file)
@@ -12,6 +12,8 @@
 #include "multiply_effect.h"
 #include "test_util.h"
 
+namespace movit {
+
 namespace {
 
 // Generate a random number uniformly distributed between [-1.0, 1.0].
@@ -333,3 +335,5 @@ TEST(FFTPassEffectTest, BigFFTAccuracy) {
                expect_equal(in, out2, 4, fft_size, max_error, rms_limit);
        }
 }
+
+}  // namespace movit
index d19cd4ee7a272d4147a53f25446bf84b7a0b62d0..ed8e3e96f835e5a2f39d281340ae6bdb9de36451 100644 (file)
@@ -9,6 +9,8 @@
 
 using namespace std;
 
+namespace movit {
+
 FlatInput::FlatInput(ImageFormat image_format, MovitPixelFormat pixel_format, GLenum type, unsigned width, unsigned height)
        : image_format(image_format),
           pixel_format(pixel_format),
@@ -118,3 +120,5 @@ void FlatInput::invalidate_pixel_data()
                texture_num = 0;
        }
 }
+
+}  // namespace movit
index 57f6f5a27d75213f92e668065dbd23991ef91781..dec0f1c2ea2498b2eb9d30af1a319a0de07c7883 100644 (file)
@@ -11,6 +11,8 @@
 #include "init.h"
 #include "input.h"
 
+namespace movit {
+
 class ResourcePool;
 
 // A FlatInput is the normal, “classic” case of an input, where everything
@@ -104,4 +106,6 @@ private:
        ResourcePool *resource_pool;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_FLAT_INPUT_H)
index a29762326ddac60b8d1e7e4046353ba8b3feb484..58d9eb94b199a2c807c7a44397e23caed79eba69 100644 (file)
@@ -9,6 +9,8 @@
 #include "test_util.h"
 #include "util.h"
 
+namespace movit {
+
 TEST(FlatInput, SimpleGrayscale) {
        const int size = 4;
 
@@ -264,3 +266,5 @@ TEST(FlatInput, PBO) {
 
        glDeleteBuffers(1, &pbo);
 }
+
+}  // namespace movit
index a90d67a4d4a65c7e999df72042d99a74f2d20c22..079f849e16a62445c6862f6477fa84a511f920be 100644 (file)
@@ -6,6 +6,8 @@
 
 using namespace std;
 
+namespace movit {
+
 GammaCompressionEffect::GammaCompressionEffect()
        : destination_curve(GAMMA_LINEAR)
 {
@@ -110,3 +112,5 @@ void GammaCompressionEffect::set_gl_state(GLuint glsl_program_num, const string
                set_uniform_float(glsl_program_num, prefix, "beta", 0.0181);
        }
 }
+
+}  // namespace movit
index 9577e020954461ff5fb6e1ee2c1145d115a5f1a9..83208cf0dcc44d77412c5a595f6cab9906b75e0a 100644 (file)
@@ -15,6 +15,8 @@
 #include "effect.h"
 #include "image_format.h"
 
+namespace movit {
+
 class GammaCompressionEffect : public Effect {
 private:
        // Should not be instantiated by end users.
@@ -36,4 +38,6 @@ private:
        GammaCurve destination_curve;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_GAMMA_COMPRESSION_EFFECT_H)
index 41a700ca0b0c188f5997c8364110c74c38f929ba..41fe776c28079e1783d05065fcd6bc0d80796db2 100644 (file)
@@ -13,6 +13,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(GammaCompressionEffectTest, sRGB_KeyValues) {
        float data[] = {
                0.0f, 1.0f,
@@ -212,3 +214,5 @@ TEST(GammaCompressionEffectTest, Rec2020_12Bit_Inaccuracy) {
        // precision and inaccuracies in the polynomial approximation.
        expect_equal(expected_data, out_data, 4096, 1, 1.2 / 4095.0, 1e-5);
 }
+
+}  // namespace movit
index 696815ed40273ea9fb8daab2e2a1d29bff30684b..24e8ea51aae3f08ab564e11f7a82cd7cb0aeac53 100644 (file)
@@ -6,6 +6,8 @@
 
 using namespace std;
 
+namespace movit {
+
 GammaExpansionEffect::GammaExpansionEffect()
        : source_curve(GAMMA_LINEAR)
 {
@@ -121,3 +123,5 @@ void GammaExpansionEffect::set_gl_state(GLuint glsl_program_num, const string &p
                set_uniform_float(glsl_program_num, prefix, "beta", 0.0181 * 4.5);
        }
 }
+
+}  // namespace movit
index 92f05171cd4d84ff08ad802cbef89138401c5d48..b5381ad38cdc76fa3b5aa2eb01da20df64111c4b 100644 (file)
@@ -15,6 +15,8 @@
 #include "effect.h"
 #include "image_format.h"
 
+namespace movit {
+
 class GammaExpansionEffect : public Effect {
 private:
        // Should not be instantiated by end users.
@@ -37,4 +39,6 @@ private:
        GammaCurve source_curve;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_GAMMA_EXPANSION_EFFECT_H)
index 0e7670d093876d5c845278a841630fc28bf6fd11..d1d6d2a0ac0afabac906311adb5812e7ef17858f 100644 (file)
@@ -8,6 +8,8 @@
 #include "gtest/gtest-message.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(GammaExpansionEffectTest, sRGB_KeyValues) {
        float data[] = {
                0.0f, 1.0f,
@@ -250,3 +252,5 @@ TEST(GammaExpansionEffectTest, Rec2020_12Bit_Inaccuracy) {
        //
        test_accuracy(expected_data, out_data, 4096, 1e-3, 0.01, 2.50, 1e-4);
 }
+
+}  // namespace movit
index 2cc6d0101478ef508e8c86da729935cf5b03ce14..778c55752fecceb984e4a9f97d39ba7cc4186e9d 100644 (file)
@@ -9,6 +9,8 @@
 
 using namespace std;
 
+namespace movit {
+
 GlowEffect::GlowEffect()
        : blur(new BlurEffect),
          cutoff(new HighlightCutoffEffect),
@@ -57,3 +59,5 @@ string HighlightCutoffEffect::output_fragment_shader()
 {
        return read_file("highlight_cutoff_effect.frag");
 }
+
+}  // namespace movit
index 91106e03b08927ab3498d784f3611b05e36aafa8..af833070558a05ce46e4aa5865516da0714cd740 100644 (file)
@@ -10,6 +10,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class BlurEffect;
 class EffectChain;
 class HighlightCutoffEffect;
@@ -55,4 +57,6 @@ private:
        float cutoff;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_GLOW_EFFECT_H)
index 4570d6f5ada16b9e151ed5ac21bda7c07e49bd12..11083a9ca75a3412fe88a9c6b2e4c4914df6b7d5 100644 (file)
@@ -9,6 +9,8 @@
 #include "image_format.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(GlowEffectTest, NoAmountDoesNothing) {
        const int size = 4;
 
@@ -108,3 +110,5 @@ TEST(GlowEffectTest, GlowsOntoZeroAlpha) {
 
        expect_equal(expected_data, out_data, 4, size);
 }
+
+}  // namespace movit
index 7ca334c36016e4324f0cc75fac9ab8fe87af5cb3..77838ececa33918b061744e31b5f5cc58adbb9bf 100644 (file)
@@ -11,6 +11,8 @@
 // where Y' is derived from R'G'B' instead of RGB, since this is the same
 // system as used in Rec. 601 and 709.
 
+namespace movit {
+
 enum MovitPixelFormat {
        FORMAT_RGB,
        FORMAT_RGBA_PREMULTIPLIED_ALPHA,
@@ -52,4 +54,6 @@ struct ImageFormat {
        GammaCurve gamma_curve;
 };
 
+}  // namespace movit
+
 #endif  // !defined(_MOVIT_IMAGE_FORMAT_H)
index fd22778f4ccec152cc973f2ebe1f6ffa51d1d935..5717dda8d43ad1a3416a3be618c0866fe3d886e0 100644 (file)
--- a/init.cpp
+++ b/init.cpp
@@ -9,6 +9,8 @@
 
 using namespace std;
 
+namespace movit {
+
 bool movit_initialized = false;
 MovitDebugLevel movit_debug_level = MOVIT_DEBUG_ON;
 float movit_texel_subpixel_precision;
@@ -314,3 +316,5 @@ bool init_movit(const string& data_directory, MovitDebugLevel debug_level)
        movit_initialized = true;
        return true;
 }
+
+}  // namespace movit
diff --git a/init.h b/init.h
index 25869d17b1d266e5440bfedaeda8a79e0633ec4d..d6f6dd40b005b71c338bac61e151c83701a9323c 100644 (file)
--- a/init.h
+++ b/init.h
@@ -4,6 +4,8 @@
 #include "defs.h"
 #include <string>
 
+namespace movit {
+
 enum MovitDebugLevel {
        MOVIT_DEBUG_OFF = 0,
        MOVIT_DEBUG_ON = 1,
@@ -65,4 +67,6 @@ extern bool movit_shader_rounding_supported;
 // Whether the GPU in use supports GL_EXT_texture_sRGB.
 extern bool movit_srgb_textures_supported;
 
+}  // namespace movit
+
 #endif  // !defined(_MOVIT_INIT_H)
diff --git a/input.h b/input.h
index e0febb1712895876758c9bffe9459b4c32feb8c7..7652e1793a4599d01fb726bfbf939741ac01d2aa 100644 (file)
--- a/input.h
+++ b/input.h
@@ -6,6 +6,8 @@
 #include "effect.h"
 #include "image_format.h"
 
+namespace movit {
+
 // An input is a degenerate case of an effect; it represents the picture data
 // that comes from the user. As such, it has zero “inputs” itself.
 //
@@ -28,4 +30,6 @@ public:
        virtual GammaCurve get_gamma_curve() const = 0;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_INPUT_H)
index 5bc989aba08fbb5e2a5291cfcbf142469705f57f..e9832f458a6cb83f07cbe86de93aefb2f0462043 100644 (file)
@@ -7,6 +7,8 @@
 
 using namespace std;
 
+namespace movit {
+
 LiftGammaGainEffect::LiftGammaGainEffect()
        : lift(0.0f, 0.0f, 0.0f),
          gamma(1.0f, 1.0f, 1.0f),
@@ -38,3 +40,5 @@ void LiftGammaGainEffect::set_gl_state(GLuint glsl_program_num, const string &pr
                2.2f / gamma.b);
        set_uniform_vec3(glsl_program_num, prefix, "inv_gamma_22", (float *)&inv_gamma_22);
 }
+
+}  // namespace movit
index 60978f45047c3272e78662ae31f7c1e4f289eea2..b5007721710b28173130e6701650474df57cc20d 100644 (file)
@@ -25,6 +25,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class LiftGammaGainEffect : public Effect {
 public:
        LiftGammaGainEffect();
@@ -38,4 +40,6 @@ private:
        RGBTriplet lift, gamma, gain;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_LIFT_GAMMA_GAIN_EFFECT_H)
index a9e866d28c73985572616be4eae3c80725e88cce..612901f4a2cfcd1feab73a6c1e58d2a4041c81a4 100644 (file)
@@ -8,6 +8,8 @@
 #include "lift_gamma_gain_effect.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(LiftGammaGainEffectTest, DefaultIsNoop) {
        float data[] = {
                0.0f, 0.0f, 0.0f, 1.0f,
@@ -116,3 +118,5 @@ TEST(LiftGammaGainEffectTest, OutOfGamutColorsAreClipped) {
 
        expect_equal(expected_data, out_data, 4, 3);
 }
+
+}  // namespace movit
index 2aa1fea4415fe8ae1ffa79b0da7c8bc1010c48fe..d3c7a83152211925468eea21394e8e482935b38c 100644 (file)
@@ -3,6 +3,8 @@
 
 using namespace std;
 
+namespace movit {
+
 MirrorEffect::MirrorEffect()
 {
 }
@@ -11,3 +13,5 @@ string MirrorEffect::output_fragment_shader()
 {
        return read_file("mirror_effect.frag");
 }
+
+}  // namespace movit
index bd319ccb79c17b9eec1828cd828f920e4d87cdb4..c4b46dbb6ff61cff94554bf845bbc8238cec8340 100644 (file)
@@ -7,6 +7,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class MirrorEffect : public Effect {
 public:
        MirrorEffect();
@@ -18,4 +20,6 @@ public:
        virtual AlphaHandling alpha_handling() const { return DONT_CARE_ALPHA_TYPE; }
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_MIRROR_EFFECT_H)
index 6e279cbebaac173979738b9a56bab1fd4da9b26a..9e27b1243dfd8dc61caf9cb575ce459aa495a392 100644 (file)
@@ -3,6 +3,8 @@
 
 using namespace std;
 
+namespace movit {
+
 MixEffect::MixEffect()
        : strength_first(0.5f), strength_second(0.5f)
 {
@@ -14,3 +16,5 @@ string MixEffect::output_fragment_shader()
 {
        return read_file("mix_effect.frag");
 }
+
+}  // namespace movit
index fda06a6f9426426e9794637348c19f907a5894d5..9abe6010a86d1aabb4640759c99fef537cb4caae 100644 (file)
@@ -8,6 +8,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class MixEffect : public Effect {
 public:
        MixEffect();
@@ -25,4 +27,6 @@ private:
        float strength_first, strength_second;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_MIX_EFFECT_H)
index babb76630dd185cdea4613ff8fc93dc581666d54..8432f1e1a96b7c6145e991cf732b3b50500323eb 100644 (file)
@@ -9,6 +9,8 @@
 #include "mix_effect.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(MixEffectTest, FiftyFiftyMix) {
        float data_a[] = {
                0.0f, 0.25f,
@@ -138,3 +140,5 @@ TEST(MixEffectTest, MixesLinearlyDespitesRGBInputsAndOutputs) {
 
        expect_equal(expected_data, out_data, 2, 2);
 }
+
+}  // namespace movit
index e0fc5340ed960c6e1b66a76edcadb0b309b912d3..4eb072e645fd99fc96bc9f4c3afff16d655891b8 100644 (file)
@@ -3,6 +3,8 @@
 
 using namespace std;
 
+namespace movit {
+
 MultiplyEffect::MultiplyEffect()
        : factor(1.0f, 1.0f, 1.0f, 1.0f)
 {
@@ -13,3 +15,5 @@ string MultiplyEffect::output_fragment_shader()
 {
        return read_file("multiply_effect.frag");
 }
+
+}  // namespace movit
index 8de261aebaff82465b6e9c3671abb76b30b1db45..50612fc941f1a5bf50894d39437bd872225034ad 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class MultiplyEffect : public Effect {
 public:
        MultiplyEffect();
@@ -21,4 +23,6 @@ private:
        RGBATuple factor;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_MULTIPLY_EFFECT_H)
index 09c16389cf39cece08c3c0fab88a0c839eb17592..3a42240a0b063914292cff2fa65f0de62c8ea4c8 100644 (file)
@@ -3,9 +3,13 @@
 
 using namespace std;
 
+namespace movit {
+
 OverlayEffect::OverlayEffect() {}
 
 string OverlayEffect::output_fragment_shader()
 {
        return read_file("overlay_effect.frag");
 }
+
+}  // namespace movit
index 444fe3f67298c33acc0ec12c4287210802458c65..489d8d78168c449ccf8bf6e35c86182732f1a04f 100644 (file)
@@ -14,6 +14,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class OverlayEffect : public Effect {
 public:
        OverlayEffect();
@@ -31,4 +33,6 @@ public:
        virtual AlphaHandling alpha_handling() const { return INPUT_PREMULTIPLIED_ALPHA_KEEP_BLANK; }
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_OVERLAY_EFFECT_H)
index 5d86ec2d409159e7ac13875d8ee7b51e20a4cc90..0a9682e0392e8e2c61959d9565f30695ac1c28c1 100644 (file)
@@ -9,6 +9,8 @@
 #include "overlay_effect.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(OverlayEffectTest, TopDominatesBottomWhenNoAlpha) {
        float data_a[] = {
                0.0f, 0.25f,
@@ -91,3 +93,5 @@ TEST(OverlayEffectTest, PhotoshopReferenceTest) {
 
        expect_equal(expected_data, out_data, 4, 1);
 }
+
+}  // namespace movit
index 9d93aca26f141149df80889472c2b6237aefed6b..15381a32567e7bdd6ffed157c8aea6b52cdf4aff 100644 (file)
@@ -7,6 +7,8 @@
 
 using namespace std;
 
+namespace movit {
+
 PaddingEffect::PaddingEffect()
        : border_color(0.0f, 0.0f, 0.0f, 0.0f),
          output_width(1280),
@@ -130,3 +132,5 @@ void PaddingEffect::inform_input_size(unsigned input_num, unsigned width, unsign
        input_width = width;
        input_height = height;
 }
+
+}  // namespace movit
index 9a32abbe41c343661abdef7bfa9d0e289a48d85e..3bd4aacb321a54c80ce98e23526d941a9f1bce58 100644 (file)
@@ -17,6 +17,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class PaddingEffect : public Effect {
 public:
        PaddingEffect();
@@ -39,4 +41,6 @@ private:
        float top, left;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_PADDING_EFFECT_H)
index 36e7790fe1b3aec302fe2872756ffa3edcecd5d7..767f3e8d4f3a79c654553c3aa9e843f57e629ef4 100644 (file)
@@ -11,6 +11,8 @@
 #include "test_util.h"
 #include "util.h"
 
+namespace movit {
+
 TEST(PaddingEffectTest, SimpleCenter) {
        float data[2 * 2] = {
                1.0f, 0.5f,
@@ -241,3 +243,5 @@ TEST(PaddingEffectTest, AlphaIsCorrectEvenWithNonLinearInputsAndOutputs) {
        tester.run(out_data, GL_RGBA, COLORSPACE_REC_601_625, GAMMA_REC_709, OUTPUT_ALPHA_FORMAT_POSTMULTIPLIED);
        expect_equal(expected_data, out_data, 4, 4);
 }
+
+}  // namespace movit
index 367e8b4d52604043d6529fcdb5b392ed77136ec2..dbc57883897e6fc4ba3488661c6376c8d186d480 100644 (file)
@@ -15,6 +15,8 @@
 
 using namespace std;
 
+namespace movit {
+
 namespace {
 
 float sinc(float x)
@@ -404,3 +406,5 @@ void SingleResamplePassEffect::set_gl_state(GLuint glsl_program_num, const strin
        glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
        check_error();
 }
+
+}  // namespace movit
index 74585d6d94dae0d3be0ed5fc1da119e8cfc1fc91..628c61a348ea3ba22904370a4a572f753dfed8aa 100644 (file)
@@ -22,6 +22,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class EffectChain;
 class Node;
 class SingleResamplePassEffect;
@@ -99,4 +101,6 @@ private:
        float slice_height;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_RESAMPLE_EFFECT_H)
index dee08e3584c2f90c9da43aaff82c2e99a35817d2..971e694347e28d8e61760b13abb5027341413a83 100644 (file)
@@ -11,6 +11,8 @@
 #include "resample_effect.h"
 #include "test_util.h"
 
+namespace movit {
+
 namespace {
 
 float sinc(float x)
@@ -208,3 +210,5 @@ TEST(ResampleEffectTest, HeavyResampleGetsSumRight) {
        // for 8-bit accuracy, though.
        expect_equal(expected_data, out_data, dwidth, dheight, 0.5 / 1023.0);
 }
+
+}  // namespace movit
index 70efea0d78e36b3218d8a0686fd896df9cb1d15a..5fd761a7acee1f55cfc0cd78c1a9e10352d0e576 100644 (file)
@@ -3,6 +3,8 @@
 
 using namespace std;
 
+namespace movit {
+
 ResizeEffect::ResizeEffect()
        : width(1280), height(720)
 {
@@ -20,3 +22,5 @@ void ResizeEffect::get_output_size(unsigned *width, unsigned *height, unsigned *
        *virtual_width = *width = this->width;
        *virtual_height = *height = this->height;
 }
+
+}  // namespace movit
index 774f510de592aedc4e0ae1991916629d62c64842..dff6dccdc3c02b0bc6e35103a553dcd0e6eff6fc 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class ResizeEffect : public Effect {
 public:
        ResizeEffect();
@@ -28,4 +30,6 @@ private:
        int width, height;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_RESIZE_EFFECT_H)
index 81a6bd4afc7f1f09f8083d9eef02e2ec8e5c679d..4f2cc2b9ade1e6cc98ec50b50eb30fccbd550a55 100644 (file)
@@ -14,6 +14,8 @@
 
 using namespace std;
 
+namespace movit {
+
 ResourcePool::ResourcePool(size_t program_freelist_max_length,
                            size_t texture_freelist_max_bytes)
        : program_freelist_max_length(program_freelist_max_length),
@@ -258,3 +260,5 @@ size_t ResourcePool::estimate_texture_size(const Texture2D &texture_format)
 
        return texture_format.width * texture_format.height * bytes_per_pixel;
 }
+
+}  // namespace movit
index ae89d9f517e5c09a36bd0ea0eba99777990b0c56..ea56d0184fd6f1a49d4238034d526acfd3672185 100644 (file)
@@ -24,6 +24,8 @@
 #include <string>
 #include <utility>
 
+namespace movit {
+
 class ResourcePool {
 public:
        // program_freelist_max_length is how many compiled programs that are unused to keep
@@ -106,4 +108,6 @@ private:
        static size_t estimate_texture_size(const Texture2D &texture_format);
 };
 
+}  // namespace movit
+
 #endif  // !defined(_MOVIT_RESOURCE_POOL_H)
index 840611eb51f958efb269e4ad29096c5625fa8cbb..76e1f5cf81625944f3f0df1faa3d1ccef5f31121 100644 (file)
@@ -5,6 +5,8 @@
 
 using namespace std;
 
+namespace movit {
+
 SandboxEffect::SandboxEffect()
        : parm(0.0f)
 {
@@ -22,3 +24,5 @@ void SandboxEffect::set_gl_state(GLuint glsl_program_num, const string &prefix,
 
        // Any OpenGL state you might want to set, goes here.
 }
+
+}  // namespace movit
index 80ef8a23adfa6bca98b20b0b98bca56620026fdc..f06b2ef3758d17cb95f014f0d7a1e0508a1218df 100644 (file)
@@ -13,6 +13,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class SandboxEffect : public Effect {
 public:
        SandboxEffect();
@@ -25,4 +27,6 @@ private:
        float parm;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_SANDBOX_EFFECT_H)
index 637da862ad297889fc2051644041e26304fbf2d0..f2206104f2126a525d42ec870c25222bccab7308 100644 (file)
@@ -5,6 +5,8 @@
 
 using namespace std;
 
+namespace movit {
+
 SaturationEffect::SaturationEffect()
        : saturation(1.0f)
 {
@@ -15,3 +17,5 @@ string SaturationEffect::output_fragment_shader()
 {
        return read_file("saturation_effect.frag");
 }
+
+}  // namespace movit
index f4d69e680ddda7b03a730a0724452d72f6e8394f..a80740fefc0946508d23776f4b7c63ff1d33ef70 100644 (file)
@@ -11,6 +11,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class SaturationEffect : public Effect {
 public:
        SaturationEffect();
@@ -22,4 +24,6 @@ private:
        float saturation;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_SATURATION_EFFECT_H)
index dadb964ef35b8b68eac504f889508110aa21db44..941df9924bfbeb4ee5642b37c490fb793a1560e4 100644 (file)
@@ -8,6 +8,8 @@
 #include "saturation_effect.h"
 #include "test_util.h"
 
+namespace movit {
+
 TEST(SaturationEffectTest, SaturationOneIsPassThrough) {
        float data[] = {
                1.0f, 0.5f, 0.75f, 0.6f,
@@ -66,3 +68,5 @@ TEST(SaturationEffectTest, DoubleSaturation) {
 
        expect_equal(expected_data, out_data, 4, 3);
 }
+
+}  // namespace movit
index 61c3918810d1bb9fea9f0ef1da4fcb32690caaf0..c7c2ac01d13343a660c0231d0429e60b15de9186 100644 (file)
@@ -14,6 +14,8 @@
 
 using namespace std;
 
+namespace movit {
+
 class Input;
 
 namespace {
@@ -244,3 +246,5 @@ void test_accuracy(const float *expected, const float *result, unsigned num_valu
        double rms = sqrt(squared_difference) / num_values;
        EXPECT_LT(rms, rms_limit);
 }
+
+}  // namespace movit
index 992ca46bab9e68a736282ea715b8fb9a0cc2a29b..8fb17bfecf77cb6cef3604808730d90e3fa57e9a 100644 (file)
@@ -5,6 +5,8 @@
 #include "effect_chain.h"
 #include "image_format.h"
 
+namespace movit {
+
 class Input;
 
 class EffectChainTester {
@@ -35,4 +37,6 @@ void expect_equal(const float *ref, const float *result, unsigned width, unsigne
 void expect_equal(const unsigned char *ref, const unsigned char *result, unsigned width, unsigned height, unsigned largest_difference_limit = 1, float rms_limit = 0.2);
 void test_accuracy(const float *expected, const float *result, unsigned num_values, double absolute_error_limit, double relative_error_limit, double local_relative_error_limit, double rms_limit);
 
+}  // namespace movit
+
 #endif  // !defined(_MOVIT_TEST_UTIL_H)
index 115553b49f998ba0365e556c3a86a2d81df7aa94..9c6804917eef8dc44b6fd5b8ca5670976951e0ad 100644 (file)
@@ -9,6 +9,8 @@
 
 using namespace std;
 
+namespace movit {
+
 UnsharpMaskEffect::UnsharpMaskEffect()
        : blur(new BlurEffect),
          mix(new MixEffect)
@@ -39,3 +41,5 @@ bool UnsharpMaskEffect::set_float(const string &key, float value) {
        }
        return blur->set_float(key, value);
 }
+
+}  // namespace movit
index ba54a96f048ca12df0bd9015cd45a7f9e8b02ba6..e6d3790b86a1a6763ba1f00b627a00fe5bc73765 100644 (file)
@@ -16,6 +16,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class BlurEffect;
 class EffectChain;
 class MixEffect;
@@ -43,4 +45,6 @@ private:
        MixEffect *mix;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_UNSHARP_MASK_EFFECT_H)
index a44c4073052352b7a90e07e0e15fb784be4c764c..69ea5f706af5a31e025c790cf7c524619632c4fd 100644 (file)
@@ -9,6 +9,8 @@
 #include "test_util.h"
 #include "unsharp_mask_effect.h"
 
+namespace movit {
+
 TEST(UnsharpMaskEffectTest, NoAmountDoesNothing) {
        const int size = 4;
 
@@ -72,3 +74,5 @@ TEST(UnsharpMaskEffectTest, UnblursGaussianBlur) {
        // Add some leeway for the rest; unsharp masking is not expected to be extremely good.
        expect_equal(expected_data, out_data, size, size, 0.1, 0.001);
 }
+
+}  // namespace movit
index 3b15c3787d7e82644d6c5633d9ea05387e0efb88..9e18e9f71cd4999ddbbda88cf38f4a2568c4d485 100644 (file)
--- a/util.cpp
+++ b/util.cpp
@@ -11,6 +11,8 @@
 
 using namespace std;
 
+namespace movit {
+
 extern string *movit_data_directory;
 
 void hsv2rgb(float h, float s, float v, float *r, float *g, float *b)
@@ -175,3 +177,5 @@ void combine_two_samples(float w1, float w2, float *offset, float *total_weight,
        assert(*offset >= 0.0f);
        assert(*offset <= 1.0f);
 }
+
+}  // namespace movit
diff --git a/util.h b/util.h
index 79b5987ae05a329691ba73f546390c7a0f364c11..cc8256189f84872ec2f4a6b69a140352136fa390 100644 (file)
--- a/util.h
+++ b/util.h
@@ -11,6 +11,8 @@
 
 #define BUFFER_OFFSET(i) ((char *)NULL + (i))
 
+namespace movit {
+
 // Converts a HSV color to RGB. Assumes h in [0, 2pi> or [-pi, pi>
 void hsv2rgb(float h, float s, float v, float *r, float *g, float *b);
 
@@ -41,6 +43,8 @@ std::string output_glsl_mat3(const std::string &name, const Eigen::Matrix3d &m);
 // (estimated) squared errors of the two weights.
 void combine_two_samples(float w1, float w2, float *offset, float *total_weight, float *sum_sq_error);
 
+}  // namespace movit
+
 #ifdef NDEBUG
 #define check_error()
 #else
index 38bb8785220adbc6f284ebc22b3a5f9146fd100a..94383ff4839aee7010d78777d84d21c9d711d741 100644 (file)
@@ -8,6 +8,8 @@
 
 using namespace std;
 
+namespace movit {
+
 VignetteEffect::VignetteEffect()
        : center(0.5f, 0.5f),
          aspect_correction(1.0f, 1.0f),
@@ -43,3 +45,5 @@ void VignetteEffect::set_gl_state(GLuint glsl_program_num, const string &prefix,
        Point2D flipped_center(center.x, 1.0f - center.y);
        set_uniform_vec2(glsl_program_num, prefix, "flipped_center", (float *)&flipped_center);
 }
+
+}  // namespace movit
index 4501ebea45978846a12d8b868b0f7a746c643b63..737a834cb68556a063404063a0e92a18f5be88c9 100644 (file)
@@ -9,6 +9,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class VignetteEffect : public Effect {
 public:
        VignetteEffect();
@@ -26,4 +28,6 @@ private:
        float radius, inner_radius;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_VIGNETTE_EFFECT_H)
index 5d79d2d22fe6753fef1d761a73d30a0a5a3de08b..9c28852dfdbbf5045d5364b593b7601fa8dc37ae 100644 (file)
@@ -9,6 +9,8 @@
 #include "test_util.h"
 #include "vignette_effect.h"
 
+namespace movit {
+
 TEST(VignetteEffectTest, HugeInnerRadiusDoesNothing) {
        const int size = 4;
 
@@ -91,3 +93,5 @@ TEST(VignetteEffectTest, BurstFromUpperLeftCorner) {
 
        expect_equal(expected_data, out_data, width, height);
 }
+
+}  // namespace movit
index ef60e7a92174f0627703128131bf087dcba263db..0aa85da66f0159ca7bfd94e8b7ff1e132c73746a 100644 (file)
@@ -13,6 +13,8 @@
 using namespace Eigen;
 using namespace std;
 
+namespace movit {
+
 namespace {
 
 // Temperature is in Kelvin. Formula from http://en.wikipedia.org/wiki/Planckian_locus#Approximation .
@@ -148,3 +150,5 @@ void WhiteBalanceEffect::set_gl_state(GLuint glsl_program_num, const string &pre
                rgb_to_xyz_matrix;
        set_uniform_mat3(glsl_program_num, prefix, "correction_matrix", corr_matrix);
 }
+
+}  // namespace movit
index 5a8ecd548d6cf8efd4143feb3d457d97d76cf930..43bfccb1f132bf93d01ae57a7aaad481647c6e3d 100644 (file)
@@ -8,6 +8,8 @@
 
 #include "effect.h"
 
+namespace movit {
+
 class WhiteBalanceEffect : public Effect {
 public:
        WhiteBalanceEffect();
@@ -26,4 +28,6 @@ private:
        float output_color_temperature;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_WHITE_BALANCE_EFFECT_H)
index 99afce5f892fca3447feeb179edf2a2e93f376ed..5d51dd89a46abec302bb19c1e6f73482d18e74b3 100644 (file)
@@ -8,6 +8,8 @@
 #include "test_util.h"
 #include "white_balance_effect.h"
 
+namespace movit {
+
 TEST(WhiteBalanceEffectTest, GrayNeutralDoesNothing) {
        float data[] = {
                0.0f, 0.0f, 0.0f, 1.0f,
@@ -102,3 +104,5 @@ TEST(WhiteBalanceEffectTest, HigherColorTemperatureIncreasesBlue) {
        EXPECT_GT(out_data[4 * 1 + 2] - out_data[4 * 1 + 1], 0.05);
        EXPECT_GT(out_data[4 * 1 + 1] - out_data[4 * 1 + 0], 0.05);
 }
+
+}  // namespace movit
index 1c7313669f0c1211044bc5a4ee6407d85ddf8691..3bf53c77e428530dc5b731f33460077b35db2f27 100644 (file)
@@ -6,6 +6,8 @@
 
 #define HSV_WHEEL_SIZE 128
 
+namespace movit {
+
 GLuint hsv_wheel_num;
 
 void draw_hsv_wheel(float y, float rad, float theta, float value)
@@ -155,3 +157,5 @@ void read_colorwheel(float xf, float yf, float *rad, float *theta, float *value)
        }
 }
 
+
+}  // namespace movit
index 18a833493ba19cd4fa43f937d539bc6a63110077..eb89a743642dfb4e1d03f91a2ff7f8e86005d3df 100644 (file)
--- a/widgets.h
+++ b/widgets.h
@@ -3,9 +3,13 @@
 
 // Some simple UI widgets for test use.
 
+namespace movit {
+
 void draw_hsv_wheel(float y, float rad, float theta, float value);
 void draw_saturation_bar(float y, float saturation);
 void make_hsv_wheel_texture();
 void read_colorwheel(float xf, float yf, float *rad, float *theta, float *value);
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_WIDGETS_H)
index 476f083af05d1ad9b5f26c1fd1b9a60a3393738b..d3d71749a5be4eef4bdbbc1f50768b21e0af7e33 100644 (file)
@@ -13,6 +13,8 @@
 using namespace Eigen;
 using namespace std;
 
+namespace movit {
+
 namespace {
 
 // OpenGL has texel center in (0.5, 0.5), but different formats have
@@ -249,3 +251,5 @@ void YCbCrInput::invalidate_pixel_data()
                }
        }
 }
+
+}  // namespace movit
index 997eb481bc57d5ed3fbf491f7b9c2dc7fd44dafc..2466eedf0307beb7e6f613ea9695cef740d20437 100644 (file)
@@ -14,6 +14,8 @@
 #include "image_format.h"
 #include "input.h"
 
+namespace movit {
+
 class ResourcePool;
 
 struct YCbCrFormat {
@@ -101,4 +103,6 @@ private:
        ResourcePool *resource_pool;
 };
 
+}  // namespace movit
+
 #endif // !defined(_MOVIT_YCBCR_INPUT_H)
index 4beaaa33cb53d013f4319ed57698d1257be4ee6c..352fe290dffc4143c27a44e62bf27bef842f2980 100644 (file)
@@ -10,6 +10,8 @@
 #include "util.h"
 #include "ycbcr_input.h"
 
+namespace movit {
+
 TEST(YCbCrInput, Simple444) {
        const int width = 1;
        const int height = 5;
@@ -474,3 +476,5 @@ TEST(YCbCrInput, PBO) {
 
        glDeleteBuffers(1, &pbo);
 }
+
+}  // namespace movit