From: Steinar H. Gunderson Date: Sat, 15 Mar 2014 02:12:53 +0000 (+0100) Subject: Merge branch 'master' into epoxy X-Git-Tag: 1.1~12^2~30 X-Git-Url: https://git.sesse.net/?p=movit;a=commitdiff_plain;h=daca930fb2f404e8800c35715f1fc5c4897d19fb;hp=6462d4df1986c76e363cf21ee0c7734d1b312635 Merge branch 'master' into epoxy --- diff --git a/Makefile.in b/Makefile.in index 8164e38..cefbf78 100644 --- a/Makefile.in +++ b/Makefile.in @@ -8,13 +8,17 @@ datarootdir = @datarootdir@ datadir = @datadir@ top_builddir = @top_builddir@ with_demo_app = @with_demo_app@ +with_SDL2 = @with_SDL2@ with_coverage = @with_coverage@ CC=@CC@ CXX=@CXX@ -CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @Eigen3_CFLAGS@ @GLEW_CFLAGS@ -LDFLAGS=@GLEW_LIBS@ @SDL_LIBS@ -lpthread -DEMO_LDLIBS=@SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@ +CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @SDL2_CFLAGS@ @SDL_CFLAGS@ @Eigen3_CFLAGS@ @epoxy_CFLAGS@ +ifeq ($(with_SDL2),yes) +CXXFLAGS += -DHAVE_SDL2 +endif +LDFLAGS=@epoxy_LIBS@ @SDL2_LIBS@ @SDL_LIBS@ -lpthread +DEMO_LDLIBS=@SDL2_image_LIBS@ @SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@ SHELL=@SHELL@ LIBTOOL=@LIBTOOL@ --tag=CXX RANLIB=ranlib diff --git a/README b/README index 3f29bea..81bb4c9 100644 --- a/README +++ b/README @@ -21,12 +21,13 @@ OK, you need works fine on Linux and OS X, and Movit is not very POSIX-bound.) * GNU Make. * A GPU capable of running GLSL fragment shaders, - process floating-point textures, and a few other things. If your machine - is less than five years old _and you have the appropriate drivers_, - you're home free. + processing floating-point textures, and a few other things (all are + part of OpenGL 3.0 or newer, although most OpenGL 2.0 cards also + have what's needed through extensions). If your machine is less than five + years old _and you have the appropriate drivers_, you're home free. * The [Eigen 3] and [Google Test] libraries. (The library itself depends only on the former, but you probably want to run the unit tests.) -* The [GLEW] library, for dealing with OpenGL extensions on various +* The [epoxy] library, for dealing with OpenGL extensions on various platforms. Movit has been tested with Intel GPUs with the Mesa drivers @@ -53,7 +54,8 @@ all research-grade problems, and Movit is currently not there.) TL;DR, but I am interested in a programming example instead =========================================================== -Assuming you have an OpenGL context already set up: +Assuming you have an OpenGL context already set up (currently you need +a classic OpenGL context; a GL 3.2+ core context won't do): using namespace movit; diff --git a/alpha_division_effect_test.cpp b/alpha_division_effect_test.cpp index faa8b17..549b569 100644 --- a/alpha_division_effect_test.cpp +++ b/alpha_division_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for AlphaDivisionEffect. -#include +#include #include "gtest/gtest.h" #include "image_format.h" #include "test_util.h" diff --git a/alpha_multiplication_effect_test.cpp b/alpha_multiplication_effect_test.cpp index c63c0a3..2aa9b6d 100644 --- a/alpha_multiplication_effect_test.cpp +++ b/alpha_multiplication_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for AlphaMultiplicationEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/blur_effect.cpp b/blur_effect.cpp index 9397ca4..b0327e2 100644 --- a/blur_effect.cpp +++ b/blur_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/blur_effect.h b/blur_effect.h index d97f5bd..ad269f5 100644 --- a/blur_effect.h +++ b/blur_effect.h @@ -9,7 +9,7 @@ // which is what the user is intended to use, instantiates two copies of // SingleBlurPassEffect behind the scenes). -#include +#include #include #include #include diff --git a/blur_effect_test.cpp b/blur_effect_test.cpp index 1ef479e..fb4e025 100644 --- a/blur_effect_test.cpp +++ b/blur_effect_test.cpp @@ -1,5 +1,5 @@ // Unit tests for BlurEffect. -#include +#include #include #include diff --git a/colorspace_conversion_effect_test.cpp b/colorspace_conversion_effect_test.cpp index cf8aad7..1395140 100644 --- a/colorspace_conversion_effect_test.cpp +++ b/colorspace_conversion_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for ColorspaceConversionEffect. -#include +#include #include "colorspace_conversion_effect.h" #include "gtest/gtest.h" diff --git a/complex_modulate_effect.cpp b/complex_modulate_effect.cpp index 7048608..656de3a 100644 --- a/complex_modulate_effect.cpp +++ b/complex_modulate_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include "complex_modulate_effect.h" #include "effect_chain.h" diff --git a/complex_modulate_effect.h b/complex_modulate_effect.h index 52de229..fd4eb8b 100644 --- a/complex_modulate_effect.h +++ b/complex_modulate_effect.h @@ -21,7 +21,7 @@ // don't care about the actual FFT result, just that the convolution property // holds.) -#include +#include #include #include "effect.h" diff --git a/complex_modulate_effect_test.cpp b/complex_modulate_effect_test.cpp index 8c49d8a..b505d86 100644 --- a/complex_modulate_effect_test.cpp +++ b/complex_modulate_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for ComplexModulateEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/configure.ac b/configure.ac index 5e03234..f911746 100644 --- a/configure.ac +++ b/configure.ac @@ -7,17 +7,26 @@ AC_CONFIG_SRCDIR(effect.cpp) AC_PROG_CC AC_PROG_CXX PKG_CHECK_MODULES([Eigen3], [eigen3]) -PKG_CHECK_MODULES([GLEW], [glew]) +PKG_CHECK_MODULES([epoxy], [epoxy]) -# Needed for unit tests and the demo app. -PKG_CHECK_MODULES([SDL], [sdl]) +# Needed for unit tests and the demo app. We prefer SDL2 if possible, +# but can also use classic SDL. +with_SDL2=no +with_demo_app=yes +PKG_CHECK_MODULES([SDL2], [sdl2], [with_SDL2=yes], [ + PKG_CHECK_MODULES([SDL], [sdl]) +]) # These are only needed for the demo app. -with_demo_app=yes -PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +if test $with_SDL2 = "yes"; then + PKG_CHECK_MODULES([SDL2_image], [SDL2_image], [], [with_demo_app=no; AC_MSG_WARN([SDL2_image not found, demo program will not be built])]) +else + PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])]) +fi PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libpng12 not found, demo program will not be built])]) AC_SUBST([with_demo_app]) +AC_SUBST([with_SDL2]) with_coverage=no AC_ARG_ENABLE([coverage], [ --enable-coverage build with information needed to compute test coverage], [with_coverage=yes]) diff --git a/deconvolution_sharpen_effect.cpp b/deconvolution_sharpen_effect.cpp index f564b68..c4ad5cd 100644 --- a/deconvolution_sharpen_effect.cpp +++ b/deconvolution_sharpen_effect.cpp @@ -4,7 +4,7 @@ #include #include -#include +#include #include #include #include diff --git a/deconvolution_sharpen_effect.h b/deconvolution_sharpen_effect.h index e4cc9a5..1f68071 100644 --- a/deconvolution_sharpen_effect.h +++ b/deconvolution_sharpen_effect.h @@ -19,7 +19,7 @@ // // Jain, Anil K.: “Fundamentals of Digital Image Processing”, Prentice Hall, 1988. -#include +#include #include #include diff --git a/deconvolution_sharpen_effect_test.cpp b/deconvolution_sharpen_effect_test.cpp index 8829b9d..ab1a5a4 100644 --- a/deconvolution_sharpen_effect_test.cpp +++ b/deconvolution_sharpen_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for DeconvolutionSharpenEffect. -#include +#include #include #include diff --git a/demo.cpp b/demo.cpp index 845a776..c9b46ea 100644 --- a/demo.cpp +++ b/demo.cpp @@ -4,7 +4,17 @@ #define WIDTH 1280 #define HEIGHT 720 -#include +#include + +#ifdef HAVE_SDL2 +#include +#include +#include +#include +#include +#include +#include +#else #include #include #include @@ -13,6 +23,8 @@ #include #include #include +#endif + #include #include #include @@ -121,9 +133,11 @@ unsigned char *load_image(const char *filename, unsigned *w, unsigned *h) rgba_fmt.Gshift = 8; rgba_fmt.Bshift = 0; rgba_fmt.Ashift = 24; - + +#ifndef HAVE_SDL2 rgba_fmt.colorkey = 0; rgba_fmt.alpha = 255; +#endif SDL_Surface *converted = SDL_ConvertSurface(img, &rgba_fmt, SDL_SWSURFACE); @@ -175,8 +189,19 @@ int main(int argc, char **argv) SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + +#ifdef HAVE_SDL2 + SDL_Window *window = SDL_CreateWindow("OpenGL window", + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + WIDTH, HEIGHT, + SDL_WINDOW_OPENGL); + SDL_GLContext context = SDL_GL_CreateContext(window); + assert(context != NULL); +#else SDL_SetVideoMode(WIDTH, HEIGHT, 0, SDL_OPENGL); SDL_WM_SetCaption("OpenGL window", NULL); +#endif CHECK(init_movit(".", MOVIT_DEBUG_ON)); printf("GPU texture subpixel precision: about %.1f bits\n", @@ -288,7 +313,11 @@ int main(int argc, char **argv) draw_saturation_bar(0.75f, blur_radius / 100.0f); draw_saturation_bar(0.80f, blurred_mix_amount); +#ifdef HAVE_SDL2 + SDL_GL_SwapWindow(window); +#else SDL_GL_SwapBuffers(); +#endif check_error(); glBindBuffer(GL_PIXEL_PACK_BUFFER_ARB, pbo); diff --git a/diffusion_effect.h b/diffusion_effect.h index 2c31e4a..82eda93 100644 --- a/diffusion_effect.h +++ b/diffusion_effect.h @@ -12,7 +12,7 @@ // where we first blur the picture, and then overlay it on the original // using the original as a matte. -#include +#include #include #include diff --git a/diffusion_effect_test.cpp b/diffusion_effect_test.cpp index 7e50a04..e58c0de 100644 --- a/diffusion_effect_test.cpp +++ b/diffusion_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for DiffusionEffect. -#include +#include #include "diffusion_effect.h" #include "effect_chain.h" diff --git a/dither_effect.cpp b/dither_effect.cpp index 72a38de..17c577d 100644 --- a/dither_effect.cpp +++ b/dither_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/dither_effect.h b/dither_effect.h index 20fb025..9818603 100644 --- a/dither_effect.h +++ b/dither_effect.h @@ -43,7 +43,7 @@ // like many LCD monitors do, but it starts to get very hairy, again, for limited gains.) // The dither is also deterministic across runs. -#include +#include #include #include "effect.h" diff --git a/dither_effect_test.cpp b/dither_effect_test.cpp index 8801aa0..210a2e7 100644 --- a/dither_effect_test.cpp +++ b/dither_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for DitherEffect. -#include +#include #include #include "effect_chain.h" diff --git a/effect.cpp b/effect.cpp index eded11a..fb66514 100644 --- a/effect.cpp +++ b/effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/effect.h b/effect.h index 14cbe30..9d95705 100644 --- a/effect.h +++ b/effect.h @@ -10,7 +10,7 @@ // effect instance; use the macro PREFIX() around your identifiers to // automatically prepend that prefix. -#include +#include #include #include #include diff --git a/effect_chain.cpp b/effect_chain.cpp index c886155..ef44024 100644 --- a/effect_chain.cpp +++ b/effect_chain.cpp @@ -1,6 +1,6 @@ #define GL_GLEXT_PROTOTYPES 1 -#include +#include #include #include #include diff --git a/effect_chain.h b/effect_chain.h index cbc1221..02906fe 100644 --- a/effect_chain.h +++ b/effect_chain.h @@ -17,7 +17,7 @@ // the EffectChain holds textures and other OpenGL objects that are tied to the // context. -#include +#include #include #include #include diff --git a/effect_chain_test.cpp b/effect_chain_test.cpp index b1f0815..aabcc33 100644 --- a/effect_chain_test.cpp +++ b/effect_chain_test.cpp @@ -2,7 +2,7 @@ // // Note that this also contains the tests for some of the simpler effects. -#include +#include #include #include "effect.h" diff --git a/effect_util.cpp b/effect_util.cpp index 35a94a7..b671620 100644 --- a/effect_util.cpp +++ b/effect_util.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/effect_util.h b/effect_util.h index 65bd315..da0f95a 100644 --- a/effect_util.h +++ b/effect_util.h @@ -4,7 +4,7 @@ // Utilities that are often useful for implementing Effect instances, // but don't need to be included from effect.h. -#include +#include #include #include #include diff --git a/fft_pass_effect.cpp b/fft_pass_effect.cpp index 4069be9..ee0b983 100644 --- a/fft_pass_effect.cpp +++ b/fft_pass_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "effect_chain.h" diff --git a/fft_pass_effect.h b/fft_pass_effect.h index 460a946..90e88bc 100644 --- a/fft_pass_effect.h +++ b/fft_pass_effect.h @@ -50,7 +50,7 @@ // scaling), and as fp16 has quite limited range at times, this can be relevant // on some GPUs for larger sizes. -#include +#include #include #include #include diff --git a/fft_pass_effect_test.cpp b/fft_pass_effect_test.cpp index 284aa5f..015847a 100644 --- a/fft_pass_effect_test.cpp +++ b/fft_pass_effect_test.cpp @@ -3,11 +3,11 @@ #include #include #include +#include +#include #include "effect_chain.h" #include "fft_pass_effect.h" -#include "glew.h" -#include "gtest/gtest.h" #include "image_format.h" #include "multiply_effect.h" #include "test_util.h" diff --git a/flat_input.cpp b/flat_input.cpp index 46370d6..55c65cc 100644 --- a/flat_input.cpp +++ b/flat_input.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include "effect_util.h" #include "flat_input.h" diff --git a/flat_input.h b/flat_input.h index 965e34d..8ac98ba 100644 --- a/flat_input.h +++ b/flat_input.h @@ -1,7 +1,7 @@ #ifndef _MOVIT_FLAT_INPUT_H #define _MOVIT_FLAT_INPUT_H 1 -#include +#include #include #include diff --git a/flat_input_test.cpp b/flat_input_test.cpp index 58d9eb9..397cae3 100644 --- a/flat_input_test.cpp +++ b/flat_input_test.cpp @@ -1,6 +1,6 @@ // Unit tests for FlatInput. -#include +#include #include #include "effect_chain.h" diff --git a/gamma_compression_effect.h b/gamma_compression_effect.h index 83208cf..ee3985f 100644 --- a/gamma_compression_effect.h +++ b/gamma_compression_effect.h @@ -9,7 +9,7 @@ // Note that Movit's internal formats generally do not have enough accuracy // for 12-bit input or output. -#include +#include #include #include "effect.h" diff --git a/gamma_compression_effect_test.cpp b/gamma_compression_effect_test.cpp index 41fe776..6efbdea 100644 --- a/gamma_compression_effect_test.cpp +++ b/gamma_compression_effect_test.cpp @@ -5,7 +5,7 @@ // However, the accuracy tests are somewhat simpler, since we // only need to care about absolute errors and not relative. -#include +#include #include #include "gtest/gtest.h" diff --git a/gamma_expansion_effect.h b/gamma_expansion_effect.h index b5381ad..81f42d1 100644 --- a/gamma_expansion_effect.h +++ b/gamma_expansion_effect.h @@ -9,7 +9,7 @@ // Note that Movit's internal formats generally do not have enough accuracy // for 12-bit input or output. -#include +#include #include #include "effect.h" diff --git a/gamma_expansion_effect_test.cpp b/gamma_expansion_effect_test.cpp index d1d6d2a..499a0d4 100644 --- a/gamma_expansion_effect_test.cpp +++ b/gamma_expansion_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for GammaExpansionEffect. -#include +#include #include #include "gamma_expansion_effect.h" diff --git a/glow_effect.h b/glow_effect.h index af83307..2a2af16 100644 --- a/glow_effect.h +++ b/glow_effect.h @@ -4,7 +4,7 @@ // Glow: Cut out the highlights of the image (everything above a certain threshold), // blur them, and overlay them onto the original image. -#include +#include #include #include diff --git a/glow_effect_test.cpp b/glow_effect_test.cpp index 11083a9..174937b 100644 --- a/glow_effect_test.cpp +++ b/glow_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for GlowEffect. -#include +#include #include #include "effect_chain.h" diff --git a/gtest_sdl_main.cpp b/gtest_sdl_main.cpp index 39027e6..cd68777 100644 --- a/gtest_sdl_main.cpp +++ b/gtest_sdl_main.cpp @@ -1,8 +1,14 @@ #define GTEST_HAS_EXCEPTIONS 0 +#ifdef HAVE_SDL2 +#include +#include +#include +#else #include #include #include +#endif #include #include @@ -17,8 +23,28 @@ int main(int argc, char **argv) { SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, 0); SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + +#ifdef HAVE_SDL2 + // You can uncomment this if you want to try a core context. + // For Mesa, you can get the same effect by doing + // + // export MESA_GL_VERSION_OVERRIDE=3.1FC + // + // before running tests. +// SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE); +// SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 3); +// SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 2); + SDL_Window *window = SDL_CreateWindow("OpenGL window for unit test", + SDL_WINDOWPOS_UNDEFINED, + SDL_WINDOWPOS_UNDEFINED, + 32, 32, + SDL_WINDOW_OPENGL); + SDL_GLContext context = SDL_GL_CreateContext(window); + assert(context != NULL); +#else SDL_SetVideoMode(32, 32, 0, SDL_OPENGL); SDL_WM_SetCaption("OpenGL window for unit test", NULL); +#endif testing::InitGoogleTest(&argc, argv); int err = RUN_ALL_TESTS(); diff --git a/init.cpp b/init.cpp index 13a86df..671c507 100644 --- a/init.cpp +++ b/init.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include @@ -278,32 +278,43 @@ void measure_roundoff_problems() bool check_extensions() { // We fundamentally need FBOs and floating-point textures. - if (!glewIsSupported("GL_ARB_framebuffer_object")) return false; - if (!glewIsSupported("GL_ARB_texture_float")) return false; + // FBOs are covered by OpenGL 1.5, and are not an extension there. + // Floating-point textures are part of OpenGL 3.0 and newer. + if (epoxy_gl_version() < 15 && + !epoxy_has_gl_extension("GL_ARB_framebuffer_object")) return false; + if (epoxy_gl_version() < 30 && + !epoxy_has_gl_extension("GL_ARB_texture_float")) return false; // We assume that we can use non-power-of-two textures without restrictions. - if (!glewIsSupported("GL_ARB_texture_non_power_of_two")) return false; + if (epoxy_gl_version() < 20 && + !epoxy_has_gl_extension("GL_ARB_texture_non_power_of_two")) return false; // We also need GLSL fragment shaders. - if (!glewIsSupported("GL_ARB_fragment_shader")) return false; - if (!glewIsSupported("GL_ARB_shading_language_100")) return false; + if (epoxy_gl_version() < 20) { + if (!epoxy_has_gl_extension("GL_ARB_fragment_shader")) return false; + if (!epoxy_has_gl_extension("GL_ARB_shading_language_100")) return false; + } // FlatInput and YCbCrInput uses PBOs. (They could in theory do without, // but no modern card would really not provide it.) - if (!glewIsSupported("GL_ARB_pixel_buffer_object")) return false; + if (epoxy_gl_version() < 21 && + !epoxy_has_gl_extension("GL_ARB_pixel_buffer_object")) return false; // ResampleEffect uses RG textures to encode a two-component LUT. - if (!glewIsSupported("GL_ARB_texture_rg")) return false; + if (epoxy_gl_version() < 30 && + !epoxy_has_gl_extension("GL_ARB_texture_rg")) return false; // sRGB texture decode would be nice, but are not mandatory // (GammaExpansionEffect can do the same thing if needed). - movit_srgb_textures_supported = glewIsSupported("GL_EXT_texture_sRGB"); + movit_srgb_textures_supported = + (epoxy_gl_version() >= 21 || epoxy_has_gl_extension("GL_EXT_texture_sRGB")); // We may want to use round() at the end of the final shader, // if supported. We need either GLSL 1.30 or this extension to do that, // and 1.30 brings with it other things that we don't want to demand // for now. - movit_shader_rounding_supported = glewIsSupported("GL_EXT_gpu_shader4"); + movit_shader_rounding_supported = + (epoxy_gl_version() >= 30 || epoxy_has_gl_extension("GL_EXT_gpu_shader4")); return true; } @@ -319,11 +330,6 @@ bool init_movit(const string& data_directory, MovitDebugLevel debug_level) movit_data_directory = new string(data_directory); movit_debug_level = debug_level; - GLenum err = glewInit(); - if (err != GLEW_OK) { - return false; - } - // geez glPixelStorei(GL_PACK_ALIGNMENT, 1); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); diff --git a/lift_gamma_gain_effect.cpp b/lift_gamma_gain_effect.cpp index e9832f4..60cd7df 100644 --- a/lift_gamma_gain_effect.cpp +++ b/lift_gamma_gain_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "effect_util.h" diff --git a/lift_gamma_gain_effect.h b/lift_gamma_gain_effect.h index b500772..c93724d 100644 --- a/lift_gamma_gain_effect.h +++ b/lift_gamma_gain_effect.h @@ -20,7 +20,7 @@ // Also, gamma is a case where we would not want premultiplied alpha. // Thus, we have to divide away alpha first, and then re-multiply it back later. -#include +#include #include #include "effect.h" diff --git a/lift_gamma_gain_effect_test.cpp b/lift_gamma_gain_effect_test.cpp index 612901f..1be2847 100644 --- a/lift_gamma_gain_effect_test.cpp +++ b/lift_gamma_gain_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for LiftGammaGainEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/luma_mix_effect_test.cpp b/luma_mix_effect_test.cpp index 618b733..4a506f5 100644 --- a/luma_mix_effect_test.cpp +++ b/luma_mix_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for LumaMixEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/mix_effect_test.cpp b/mix_effect_test.cpp index 8432f1e..7e54ca5 100644 --- a/mix_effect_test.cpp +++ b/mix_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for MixEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/movit.pc.in b/movit.pc.in index f990618..6069a06 100644 --- a/movit.pc.in +++ b/movit.pc.in @@ -13,5 +13,5 @@ Description: Movit is a library for high-quality, high-performance video filters Version: git Requires: Conflicts: -Libs: -lmovit @GLEW_LIBS@ -Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @GLEW_CFLAGS@ +Libs: -lmovit @epoxy_LIBS@ +Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @epoxy_CFLAGS@ diff --git a/multiply_effect.h b/multiply_effect.h index 50612fc..92e98e3 100644 --- a/multiply_effect.h +++ b/multiply_effect.h @@ -6,7 +6,7 @@ // sending it through OverlayEffect, e.g. with R=G=B=A=0.3 to get 30% alpha // (remember, alpha is premultiplied). -#include +#include #include #include "effect.h" diff --git a/overlay_effect_test.cpp b/overlay_effect_test.cpp index 0a9682e..47c39b5 100644 --- a/overlay_effect_test.cpp +++ b/overlay_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for OverlayEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/padding_effect.cpp b/padding_effect.cpp index 15381a3..f576baa 100644 --- a/padding_effect.cpp +++ b/padding_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "effect_util.h" diff --git a/padding_effect.h b/padding_effect.h index 3bd4aac..901f892 100644 --- a/padding_effect.h +++ b/padding_effect.h @@ -12,7 +12,7 @@ // You may not change it after calling finalize(), since that could change the // graph (need_linear_light() etc. depend on the border color you choose). -#include +#include #include #include "effect.h" diff --git a/padding_effect_test.cpp b/padding_effect_test.cpp index 767f3e8..dd836ea 100644 --- a/padding_effect_test.cpp +++ b/padding_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for AlphaMultiplicationEffect. -#include +#include #include #include "effect_chain.h" diff --git a/resample_effect.cpp b/resample_effect.cpp index a677487..50b7c6b 100644 --- a/resample_effect.cpp +++ b/resample_effect.cpp @@ -1,7 +1,7 @@ // Three-lobed Lanczos, the most common choice. #define LANCZOS_RADIUS 3.0 -#include +#include #include #include #include diff --git a/resample_effect.h b/resample_effect.h index 44587bf..f0112b3 100644 --- a/resample_effect.h +++ b/resample_effect.h @@ -15,7 +15,7 @@ // which is what the user is intended to use, instantiates two copies of // SingleResamplePassEffect behind the scenes). -#include +#include #include #include #include diff --git a/resample_effect_test.cpp b/resample_effect_test.cpp index 211e6d1..95c2bcf 100644 --- a/resample_effect_test.cpp +++ b/resample_effect_test.cpp @@ -1,12 +1,11 @@ // Unit tests for ResampleEffect. -#include +#include +#include #include #include "effect_chain.h" #include "flat_input.h" -#include "glew.h" -#include "gtest/gtest.h" #include "image_format.h" #include "resample_effect.h" #include "test_util.h" diff --git a/resource_pool.cpp b/resource_pool.cpp index 72b3095..b515769 100644 --- a/resource_pool.cpp +++ b/resource_pool.cpp @@ -6,8 +6,8 @@ #include #include #include +#include -#include "glew.h" #include "init.h" #include "resource_pool.h" #include "util.h" diff --git a/resource_pool.h b/resource_pool.h index ea56d01..d8d8cec 100644 --- a/resource_pool.h +++ b/resource_pool.h @@ -16,7 +16,7 @@ // safely called from multiple threads at the same time, provided they have // separate (but sharing) OpenGL contexts. -#include +#include #include #include #include diff --git a/sandbox_effect.cpp b/sandbox_effect.cpp index 76e1f5c..1ec093d 100644 --- a/sandbox_effect.cpp +++ b/sandbox_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include "sandbox_effect.h" #include "util.h" diff --git a/sandbox_effect.h b/sandbox_effect.h index f06b2ef..25c7992 100644 --- a/sandbox_effect.h +++ b/sandbox_effect.h @@ -8,7 +8,7 @@ // throwaway code. When you're happy, you can do a bit of search and replace // to give it a proper name and its own place in the build system. -#include +#include #include #include "effect.h" diff --git a/saturation_effect_test.cpp b/saturation_effect_test.cpp index 941df99..6a711a4 100644 --- a/saturation_effect_test.cpp +++ b/saturation_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for SaturationEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/slice_effect.cpp b/slice_effect.cpp index 15f5392..3a88465 100644 --- a/slice_effect.cpp +++ b/slice_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include "effect_chain.h" #include "slice_effect.h" diff --git a/slice_effect.h b/slice_effect.h index 17202d7..1c363ea 100644 --- a/slice_effect.h +++ b/slice_effect.h @@ -10,7 +10,7 @@ // Note that vertical slices happen from the bottom, not the top, due to the // OpenGL coordinate system. -#include +#include #include #include "effect.h" diff --git a/slice_effect_test.cpp b/slice_effect_test.cpp index efa6803..410439a 100644 --- a/slice_effect_test.cpp +++ b/slice_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for SliceEffect. -#include +#include #include "effect_chain.h" #include "flat_input.h" diff --git a/test_util.cpp b/test_util.cpp index cb97236..ec9cbf9 100644 --- a/test_util.cpp +++ b/test_util.cpp @@ -2,11 +2,11 @@ #include #include #include +#include +#include +#include #include "flat_input.h" -#include "glew.h" -#include "gtest/gtest.h" -#include "gtest/gtest-message.h" #include "init.h" #include "resource_pool.h" #include "test_util.h" diff --git a/test_util.h b/test_util.h index ff568ba..e5e6551 100644 --- a/test_util.h +++ b/test_util.h @@ -1,7 +1,7 @@ #ifndef _MOVIT_TEST_UTIL_H #define _MOVIT_TEST_UTIL_H 1 -#include +#include #include "effect_chain.h" #include "image_format.h" diff --git a/unsharp_mask_effect.h b/unsharp_mask_effect.h index e6d3790..7a2052b 100644 --- a/unsharp_mask_effect.h +++ b/unsharp_mask_effect.h @@ -10,7 +10,7 @@ // See DeconvolutionSharpenEffect for a different, possibly better // sharpening algorithm. -#include +#include #include #include diff --git a/unsharp_mask_effect_test.cpp b/unsharp_mask_effect_test.cpp index 69ea5f7..e6750ce 100644 --- a/unsharp_mask_effect_test.cpp +++ b/unsharp_mask_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for UnsharpMaskEffect. -#include +#include #include #include "effect_chain.h" diff --git a/util.cpp b/util.cpp index 8162f71..372064b 100644 --- a/util.cpp +++ b/util.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/util.h b/util.h index c59231d..5c15c9f 100644 --- a/util.h +++ b/util.h @@ -3,7 +3,7 @@ // Various utilities. -#include +#include #include #include #include diff --git a/vignette_effect.cpp b/vignette_effect.cpp index 94383ff..d8b4f9b 100644 --- a/vignette_effect.cpp +++ b/vignette_effect.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include diff --git a/vignette_effect.h b/vignette_effect.h index 737a834..fdf1a11 100644 --- a/vignette_effect.h +++ b/vignette_effect.h @@ -4,7 +4,7 @@ // A circular vignette, falling off as cos² of the distance from the center // (the classic formula for approximating a real lens). -#include +#include #include #include "effect.h" diff --git a/vignette_effect_test.cpp b/vignette_effect_test.cpp index 9c28852..010fbc4 100644 --- a/vignette_effect_test.cpp +++ b/vignette_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for VignetteEffect. -#include +#include #include #include "effect_chain.h" diff --git a/white_balance_effect.cpp b/white_balance_effect.cpp index 0aa85da..69759ad 100644 --- a/white_balance_effect.cpp +++ b/white_balance_effect.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include "colorspace_conversion_effect.h" diff --git a/white_balance_effect.h b/white_balance_effect.h index 43bfccb..f438b91 100644 --- a/white_balance_effect.h +++ b/white_balance_effect.h @@ -3,7 +3,7 @@ // Color correction in LMS color space. -#include +#include #include #include "effect.h" diff --git a/white_balance_effect_test.cpp b/white_balance_effect_test.cpp index 5d51dd8..b064207 100644 --- a/white_balance_effect_test.cpp +++ b/white_balance_effect_test.cpp @@ -1,6 +1,6 @@ // Unit tests for WhiteBalanceEffect. -#include +#include #include "effect_chain.h" #include "gtest/gtest.h" diff --git a/widgets.cpp b/widgets.cpp index 3bf53c7..8726021 100644 --- a/widgets.cpp +++ b/widgets.cpp @@ -1,4 +1,4 @@ -#include +#include #include #include "widgets.h" diff --git a/ycbcr_input.cpp b/ycbcr_input.cpp index 4974715..dc5e4d9 100644 --- a/ycbcr_input.cpp +++ b/ycbcr_input.cpp @@ -1,6 +1,6 @@ #include #include -#include +#include #include #include #include diff --git a/ycbcr_input.h b/ycbcr_input.h index 2466eed..bf6d800 100644 --- a/ycbcr_input.h +++ b/ycbcr_input.h @@ -5,7 +5,7 @@ // imprecisely, called “YUV”), which is typically what you get from a video decoder. // It upsamples planes as needed, using the default linear upsampling OpenGL gives you. -#include +#include #include #include diff --git a/ycbcr_input_test.cpp b/ycbcr_input_test.cpp index 352fe29..6895b38 100644 --- a/ycbcr_input_test.cpp +++ b/ycbcr_input_test.cpp @@ -1,7 +1,7 @@ // Unit tests for YCbCrInput. // FIXME: This class really ought to support mipmaps. -#include +#include #include #include "effect_chain.h"