The main reason is that we would like to support GL 3.2+ core contexts,
and then later quite possibly GLES.
72 files changed:
-CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @Eigen3_CFLAGS@ @GLEW_CFLAGS@
-LDFLAGS=@GLEW_LIBS@ @SDL_LIBS@ -lpthread
+CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @Eigen3_CFLAGS@ @epoxy_CFLAGS@
+LDFLAGS=@epoxy_LIBS@ @SDL_LIBS@ -lpthread
DEMO_LDLIBS=@SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@
SHELL=@SHELL@
LIBTOOL=@LIBTOOL@ --tag=CXX
DEMO_LDLIBS=@SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@
SHELL=@SHELL@
LIBTOOL=@LIBTOOL@ --tag=CXX
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.)
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
platforms.
Movit has been tested with Intel GPUs with the Mesa drivers
// Unit tests for AlphaDivisionEffect.
// Unit tests for AlphaDivisionEffect.
#include "gtest/gtest.h"
#include "image_format.h"
#include "test_util.h"
#include "gtest/gtest.h"
#include "image_format.h"
#include "test_util.h"
// Unit tests for AlphaMultiplicationEffect.
// Unit tests for AlphaMultiplicationEffect.
#include "effect_chain.h"
#include "gtest/gtest.h"
#include "effect_chain.h"
#include "gtest/gtest.h"
#include <assert.h>
#include <math.h>
#include <algorithm>
#include <assert.h>
#include <math.h>
#include <algorithm>
// which is what the user is intended to use, instantiates two copies of
// SingleBlurPassEffect behind the scenes).
// which is what the user is intended to use, instantiates two copies of
// SingleBlurPassEffect behind the scenes).
#include <assert.h>
#include <stddef.h>
#include <string>
#include <assert.h>
#include <stddef.h>
#include <string>
// Unit tests for BlurEffect.
// Unit tests for BlurEffect.
#include <math.h>
#include <string.h>
#include <math.h>
#include <string.h>
// Unit tests for ColorspaceConversionEffect.
// Unit tests for ColorspaceConversionEffect.
#include "colorspace_conversion_effect.h"
#include "gtest/gtest.h"
#include "colorspace_conversion_effect.h"
#include "gtest/gtest.h"
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES([Eigen3], [eigen3])
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.
PKG_CHECK_MODULES([SDL], [sdl])
#include <Eigen/Dense>
#include <Eigen/Cholesky>
#include <Eigen/Dense>
#include <Eigen/Cholesky>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <stdio.h>
//
// Jain, Anil K.: “Fundamentals of Digital Image Processing”, Prentice Hall, 1988.
//
// Jain, Anil K.: “Fundamentals of Digital Image Processing”, Prentice Hall, 1988.
#include <Eigen/Dense>
#include <string>
#include <Eigen/Dense>
#include <string>
// Unit tests for DeconvolutionSharpenEffect.
// Unit tests for DeconvolutionSharpenEffect.
#include <math.h>
#include <stdlib.h>
#include <math.h>
#include <stdlib.h>
#define WIDTH 1280
#define HEIGHT 720
#define WIDTH 1280
#define HEIGHT 720
#include <SDL/SDL.h>
#include <SDL/SDL_error.h>
#include <SDL/SDL_events.h>
#include <SDL/SDL.h>
#include <SDL/SDL_error.h>
#include <SDL/SDL_events.h>
// where we first blur the picture, and then overlay it on the original
// using the original as a matte.
// where we first blur the picture, and then overlay it on the original
// using the original as a matte.
#include <assert.h>
#include <string>
#include <assert.h>
#include <string>
// Unit tests for DiffusionEffect.
// Unit tests for DiffusionEffect.
#include "diffusion_effect.h"
#include "effect_chain.h"
#include "diffusion_effect.h"
#include "effect_chain.h"
#include <assert.h>
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <stdio.h>
#include <algorithm>
// like many LCD monitors do, but it starts to get very hairy, again, for limited gains.)
// The dither is also deterministic across runs.
// like many LCD monitors do, but it starts to get very hairy, again, for limited gains.)
// The dither is also deterministic across runs.
#include <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for DitherEffect.
// Unit tests for DitherEffect.
#include <math.h>
#include "effect_chain.h"
#include <math.h>
#include "effect_chain.h"
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
// effect instance; use the macro PREFIX() around your identifiers to
// automatically prepend that prefix.
// effect instance; use the macro PREFIX() around your identifiers to
// automatically prepend that prefix.
#include <assert.h>
#include <stddef.h>
#include <map>
#include <assert.h>
#include <stddef.h>
#include <map>
#define GL_GLEXT_PROTOTYPES 1
#define GL_GLEXT_PROTOTYPES 1
#include <assert.h>
#include <locale.h>
#include <math.h>
#include <assert.h>
#include <locale.h>
#include <math.h>
// the EffectChain holds textures and other OpenGL objects that are tied to the
// context.
// the EffectChain holds textures and other OpenGL objects that are tied to the
// context.
#include <stdio.h>
#include <map>
#include <set>
#include <stdio.h>
#include <map>
#include <set>
//
// Note that this also contains the tests for some of the simpler effects.
//
// Note that this also contains the tests for some of the simpler effects.
#include <assert.h>
#include "effect.h"
#include <assert.h>
#include "effect.h"
#include <Eigen/Core>
#include <stddef.h>
#include <string>
#include <Eigen/Core>
#include <stddef.h>
#include <string>
// Utilities that are often useful for implementing Effect instances,
// but don't need to be included from effect.h.
// Utilities that are often useful for implementing Effect instances,
// but don't need to be included from effect.h.
#include <assert.h>
#include <stddef.h>
#include <Eigen/Core>
#include <assert.h>
#include <stddef.h>
#include <Eigen/Core>
#include <math.h>
#include "effect_util.h"
#include <math.h>
#include "effect_util.h"
// scaling), and as fp16 has quite limited range at times, this can be relevant
// on some GPUs for larger sizes.
// scaling), and as fp16 has quite limited range at times, this can be relevant
// on some GPUs for larger sizes.
#include <assert.h>
#include <stdio.h>
#include <string>
#include <assert.h>
#include <stdio.h>
#include <string>
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <string.h>
+#include <epoxy/gl.h>
+#include <gtest/gtest.h>
#include "effect_chain.h"
#include "fft_pass_effect.h"
#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"
#include "image_format.h"
#include "multiply_effect.h"
#include "test_util.h"
#include <string.h>
#include <assert.h>
#include <string.h>
#include <assert.h>
#include "effect_util.h"
#include "flat_input.h"
#include "effect_util.h"
#include "flat_input.h"
#ifndef _MOVIT_FLAT_INPUT_H
#define _MOVIT_FLAT_INPUT_H 1
#ifndef _MOVIT_FLAT_INPUT_H
#define _MOVIT_FLAT_INPUT_H 1
#include <assert.h>
#include <string>
#include <assert.h>
#include <string>
// Unit tests for FlatInput.
// Unit tests for FlatInput.
#include <stddef.h>
#include "effect_chain.h"
#include <stddef.h>
#include "effect_chain.h"
// Note that Movit's internal formats generally do not have enough accuracy
// for 12-bit input or output.
// Note that Movit's internal formats generally do not have enough accuracy
// for 12-bit input or output.
#include <string>
#include "effect.h"
#include <string>
#include "effect.h"
// However, the accuracy tests are somewhat simpler, since we
// only need to care about absolute errors and not relative.
// However, the accuracy tests are somewhat simpler, since we
// only need to care about absolute errors and not relative.
#include <math.h>
#include "gtest/gtest.h"
#include <math.h>
#include "gtest/gtest.h"
// Note that Movit's internal formats generally do not have enough accuracy
// for 12-bit input or output.
// Note that Movit's internal formats generally do not have enough accuracy
// for 12-bit input or output.
#include <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for GammaExpansionEffect.
// Unit tests for GammaExpansionEffect.
#include <math.h>
#include "gamma_expansion_effect.h"
#include <math.h>
#include "gamma_expansion_effect.h"
// Glow: Cut out the highlights of the image (everything above a certain threshold),
// blur them, and overlay them onto the original image.
// Glow: Cut out the highlights of the image (everything above a certain threshold),
// blur them, and overlay them onto the original image.
#include <assert.h>
#include <string>
#include <assert.h>
#include <string>
// Unit tests for GlowEffect.
// Unit tests for GlowEffect.
#include <math.h>
#include "effect_chain.h"
#include <math.h>
#include "effect_chain.h"
#include <assert.h>
#include <stddef.h>
#include <algorithm>
#include <assert.h>
#include <stddef.h>
#include <algorithm>
bool check_extensions()
{
// We fundamentally need FBOs and floating-point textures.
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;
+ if (!epoxy_has_gl_extension("GL_ARB_framebuffer_object")) return false;
+ if (!epoxy_has_gl_extension("GL_ARB_texture_float")) return false;
// We assume that we can use non-power-of-two textures without restrictions.
// 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_has_gl_extension("GL_ARB_texture_non_power_of_two")) return false;
// We also need GLSL fragment shaders.
// 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_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.)
// 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_has_gl_extension("GL_ARB_pixel_buffer_object")) return false;
// ResampleEffect uses RG textures to encode a two-component LUT.
// ResampleEffect uses RG textures to encode a two-component LUT.
- if (!glewIsSupported("GL_ARB_texture_rg")) return false;
+ if (!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).
// 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_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.
// 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_has_gl_extension("GL_EXT_gpu_shader4");
movit_data_directory = new string(data_directory);
movit_debug_level = 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);
// geez
glPixelStorei(GL_PACK_ALIGNMENT, 1);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
#include <math.h>
#include "effect_util.h"
#include <math.h>
#include "effect_util.h"
// 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.
// 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 <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for LiftGammaGainEffect.
// Unit tests for LiftGammaGainEffect.
#include "effect_chain.h"
#include "gtest/gtest.h"
#include "effect_chain.h"
#include "gtest/gtest.h"
// Unit tests for MixEffect.
// Unit tests for MixEffect.
#include "effect_chain.h"
#include "gtest/gtest.h"
#include "effect_chain.h"
#include "gtest/gtest.h"
Version: git
Requires:
Conflicts:
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@
// sending it through OverlayEffect, e.g. with R=G=B=A=0.3 to get 30% alpha
// (remember, alpha is premultiplied).
// sending it through OverlayEffect, e.g. with R=G=B=A=0.3 to get 30% alpha
// (remember, alpha is premultiplied).
#include <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for OverlayEffect.
// Unit tests for OverlayEffect.
#include "effect_chain.h"
#include "gtest/gtest.h"
#include "effect_chain.h"
#include "gtest/gtest.h"
#include <assert.h>
#include "effect_util.h"
#include <assert.h>
#include "effect_util.h"
// 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).
// 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 <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for AlphaMultiplicationEffect.
// Unit tests for AlphaMultiplicationEffect.
#include <stddef.h>
#include "effect_chain.h"
#include <stddef.h>
#include "effect_chain.h"
// Three-lobed Lanczos, the most common choice.
#define LANCZOS_RADIUS 3.0
// Three-lobed Lanczos, the most common choice.
#define LANCZOS_RADIUS 3.0
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
#include <limits.h>
#include <math.h>
// which is what the user is intended to use, instantiates two copies of
// SingleResamplePassEffect behind the scenes).
// which is what the user is intended to use, instantiates two copies of
// SingleResamplePassEffect behind the scenes).
#include <assert.h>
#include <stddef.h>
#include <string>
#include <assert.h>
#include <stddef.h>
#include <string>
// Unit tests for ResampleEffect.
// Unit tests for ResampleEffect.
+#include <epoxy/gl.h>
+#include <gtest/gtest.h>
#include <math.h>
#include "effect_chain.h"
#include "flat_input.h"
#include <math.h>
#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"
#include "image_format.h"
#include "resample_effect.h"
#include "test_util.h"
#include <map>
#include <string>
#include <utility>
#include <map>
#include <string>
#include <utility>
#include "init.h"
#include "resource_pool.h"
#include "util.h"
#include "init.h"
#include "resource_pool.h"
#include "util.h"
// safely called from multiple threads at the same time, provided they have
// separate (but sharing) OpenGL contexts.
// safely called from multiple threads at the same time, provided they have
// separate (but sharing) OpenGL contexts.
#include <pthread.h>
#include <stddef.h>
#include <list>
#include <pthread.h>
#include <stddef.h>
#include <list>
#include "sandbox_effect.h"
#include "util.h"
#include "sandbox_effect.h"
#include "util.h"
// 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.
// 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 <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for SaturationEffect.
// Unit tests for SaturationEffect.
#include "effect_chain.h"
#include "gtest/gtest.h"
#include "effect_chain.h"
#include "gtest/gtest.h"
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <stdio.h>
#include <algorithm>
+#include <epoxy/gl.h>
+#include <gtest/gtest.h>
+#include <gtest/gtest-message.h>
-#include "glew.h"
-#include "gtest/gtest.h"
-#include "gtest/gtest-message.h"
#include "init.h"
#include "resource_pool.h"
#include "test_util.h"
#include "init.h"
#include "resource_pool.h"
#include "test_util.h"
#ifndef _MOVIT_TEST_UTIL_H
#define _MOVIT_TEST_UTIL_H 1
#ifndef _MOVIT_TEST_UTIL_H
#define _MOVIT_TEST_UTIL_H 1
#include "effect_chain.h"
#include "image_format.h"
#include "effect_chain.h"
#include "image_format.h"
// See DeconvolutionSharpenEffect for a different, possibly better
// sharpening algorithm.
// See DeconvolutionSharpenEffect for a different, possibly better
// sharpening algorithm.
#include <assert.h>
#include <string>
#include <assert.h>
#include <string>
// Unit tests for UnsharpMaskEffect.
// Unit tests for UnsharpMaskEffect.
#include <math.h>
#include "effect_chain.h"
#include <math.h>
#include "effect_chain.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdio.h>
#include <stdlib.h>
#include <Eigen/Core>
#include <stdio.h>
#include <stdlib.h>
#include <Eigen/Core>
#include <assert.h>
#include <math.h>
#include <assert.h>
#include <math.h>
// A circular vignette, falling off as cos² of the distance from the center
// (the classic formula for approximating a real lens).
// A circular vignette, falling off as cos² of the distance from the center
// (the classic formula for approximating a real lens).
#include <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for VignetteEffect.
// Unit tests for VignetteEffect.
#include <math.h>
#include "effect_chain.h"
#include <math.h>
#include "effect_chain.h"
#include <Eigen/Core>
#include <Eigen/LU>
#include <Eigen/Core>
#include <Eigen/LU>
#include <assert.h>
#include "colorspace_conversion_effect.h"
#include <assert.h>
#include "colorspace_conversion_effect.h"
// Color correction in LMS color space.
// Color correction in LMS color space.
#include <string>
#include "effect.h"
#include <string>
#include "effect.h"
// Unit tests for WhiteBalanceEffect.
// Unit tests for WhiteBalanceEffect.
#include "effect_chain.h"
#include "gtest/gtest.h"
#include "effect_chain.h"
#include "gtest/gtest.h"
#include <math.h>
#include "widgets.h"
#include <math.h>
#include "widgets.h"
#include <Eigen/Core>
#include <Eigen/LU>
#include <Eigen/Core>
#include <Eigen/LU>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
// 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.
// 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 <assert.h>
#include <string>
#include <assert.h>
#include <string>
// Unit tests for YCbCrInput.
// FIXME: This class really ought to support mipmaps.
// Unit tests for YCbCrInput.
// FIXME: This class really ought to support mipmaps.
#include <stddef.h>
#include "effect_chain.h"
#include <stddef.h>
#include "effect_chain.h"