├── .gitignore
├── .idea
└── .gitignore
├── README.md
├── build.gradle
├── demo
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── atech
│ │ └── cameraapi
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── java
│ │ └── com
│ │ │ └── atech
│ │ │ └── cameraapi
│ │ │ ├── FilterAdapter.java
│ │ │ ├── FilterInfo.java
│ │ │ ├── MainActivity.java
│ │ │ └── SelectedListener.java
│ └── res
│ │ ├── drawable-v24
│ │ └── ic_launcher_foreground.xml
│ │ ├── drawable
│ │ ├── camera.png
│ │ ├── capture.png
│ │ ├── filter.png
│ │ ├── filter_thumb_1977.jpg
│ │ ├── filter_thumb_amoro.jpg
│ │ ├── filter_thumb_antique.png
│ │ ├── filter_thumb_beauty.png
│ │ ├── filter_thumb_blackcat.png
│ │ ├── filter_thumb_brannan.jpg
│ │ ├── filter_thumb_brooklyn.jpg
│ │ ├── filter_thumb_calm.png
│ │ ├── filter_thumb_cool.png
│ │ ├── filter_thumb_crayon.jpg
│ │ ├── filter_thumb_earlybird.jpg
│ │ ├── filter_thumb_emerald.png
│ │ ├── filter_thumb_evergreen.png
│ │ ├── filter_thumb_fairytale.png
│ │ ├── filter_thumb_freud.jpg
│ │ ├── filter_thumb_healthy.png
│ │ ├── filter_thumb_hefe.jpg
│ │ ├── filter_thumb_hudson.jpg
│ │ ├── filter_thumb_inkwell.jpg
│ │ ├── filter_thumb_kevin.jpg
│ │ ├── filter_thumb_latte.png
│ │ ├── filter_thumb_lomo.jpg
│ │ ├── filter_thumb_nashville.jpg
│ │ ├── filter_thumb_nostalgia.png
│ │ ├── filter_thumb_original.png
│ │ ├── filter_thumb_piaxr.jpg
│ │ ├── filter_thumb_rise.jpg
│ │ ├── filter_thumb_romance.png
│ │ ├── filter_thumb_sakura.png
│ │ ├── filter_thumb_sierra.jpg
│ │ ├── filter_thumb_sketch.png
│ │ ├── filter_thumb_sunrise.png
│ │ ├── filter_thumb_sunset.png
│ │ ├── filter_thumb_sutro.jpg
│ │ ├── filter_thumb_sweets.png
│ │ ├── filter_thumb_tender.png
│ │ ├── filter_thumb_toastero.jpg
│ │ ├── filter_thumb_valencia.jpg
│ │ ├── filter_thumb_walden.jpg
│ │ ├── filter_thumb_warm.png
│ │ ├── filter_thumb_whitecat.png
│ │ ├── filter_thumb_xpro.jpg
│ │ ├── ic_launcher.png
│ │ ├── ic_launcher_background.xml
│ │ ├── ic_switch_camera.png
│ │ ├── selector_filter_selected.xml
│ │ ├── take_filter_confirm_btn_skin_flat.png
│ │ ├── take_filter_favorite_btn01_layer00_skin_flat.png
│ │ ├── take_filter_favorite_btn01_layer01_skin_flat.png
│ │ ├── take_filter_favorite_btn02_skin_flat.png
│ │ ├── take_filter_favorite_icon01_skin_flat.png
│ │ ├── take_filter_favorite_icon02_skin_flat.png
│ │ └── take_filter_random_btn_skin_flat.png
│ │ ├── layout
│ │ ├── activity_main.xml
│ │ └── item_filter.xml
│ │ ├── mipmap-anydpi-v26
│ │ ├── ic_launcher.xml
│ │ └── ic_launcher_round.xml
│ │ ├── mipmap-hdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-mdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ ├── mipmap-xxxhdpi
│ │ ├── ic_launcher.png
│ │ └── ic_launcher_round.png
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── atech
│ └── cameraapi
│ └── ExampleUnitTest.java
├── glcamera
├── .gitignore
├── build.gradle
├── proguard-rules.pro
└── src
│ ├── androidTest
│ └── java
│ │ └── com
│ │ └── atech
│ │ └── glcamera
│ │ └── ExampleInstrumentedTest.java
│ ├── main
│ ├── AndroidManifest.xml
│ ├── assets
│ │ └── shaders
│ │ │ ├── fshader_0.glsl
│ │ │ ├── fshader_1.glsl
│ │ │ ├── fshader_10.glsl
│ │ │ ├── fshader_11.glsl
│ │ │ ├── fshader_12.glsl
│ │ │ ├── fshader_13.glsl
│ │ │ ├── fshader_14.glsl
│ │ │ ├── fshader_15.glsl
│ │ │ ├── fshader_16.glsl
│ │ │ ├── fshader_17.glsl
│ │ │ ├── fshader_18.glsl
│ │ │ ├── fshader_19.glsl
│ │ │ ├── fshader_2.glsl
│ │ │ ├── fshader_23.glsl
│ │ │ ├── fshader_24.glsl
│ │ │ ├── fshader_25.glsl
│ │ │ ├── fshader_26.glsl
│ │ │ ├── fshader_27.glsl
│ │ │ ├── fshader_28.glsl
│ │ │ ├── fshader_29.glsl
│ │ │ ├── fshader_3.glsl
│ │ │ ├── fshader_30.glsl
│ │ │ ├── fshader_31.glsl
│ │ │ ├── fshader_32.glsl
│ │ │ ├── fshader_33.glsl
│ │ │ ├── fshader_4.glsl
│ │ │ ├── fshader_5.glsl
│ │ │ ├── fshader_6.glsl
│ │ │ ├── fshader_7.glsl
│ │ │ ├── fshader_8.glsl
│ │ │ └── fshader_9.glsl
│ ├── cpp
│ │ ├── CMakeLists.txt
│ │ ├── JniImpl.cpp
│ │ ├── context
│ │ │ ├── RenderContext.cpp
│ │ │ └── RenderContext.h
│ │ ├── glm
│ │ │ ├── CMakeLists.txt
│ │ │ ├── common.hpp
│ │ │ ├── detail
│ │ │ │ ├── _features.hpp
│ │ │ │ ├── _fixes.hpp
│ │ │ │ ├── _noise.hpp
│ │ │ │ ├── _swizzle.hpp
│ │ │ │ ├── _swizzle_func.hpp
│ │ │ │ ├── _vectorize.hpp
│ │ │ │ ├── dummy.cpp
│ │ │ │ ├── func_common.hpp
│ │ │ │ ├── func_common.inl
│ │ │ │ ├── func_exponential.hpp
│ │ │ │ ├── func_exponential.inl
│ │ │ │ ├── func_geometric.hpp
│ │ │ │ ├── func_geometric.inl
│ │ │ │ ├── func_integer.hpp
│ │ │ │ ├── func_integer.inl
│ │ │ │ ├── func_matrix.hpp
│ │ │ │ ├── func_matrix.inl
│ │ │ │ ├── func_noise.hpp
│ │ │ │ ├── func_noise.inl
│ │ │ │ ├── func_packing.hpp
│ │ │ │ ├── func_packing.inl
│ │ │ │ ├── func_trigonometric.hpp
│ │ │ │ ├── func_trigonometric.inl
│ │ │ │ ├── func_vector_relational.hpp
│ │ │ │ ├── func_vector_relational.inl
│ │ │ │ ├── glm.cpp
│ │ │ │ ├── intrinsic_common.hpp
│ │ │ │ ├── intrinsic_common.inl
│ │ │ │ ├── intrinsic_exponential.hpp
│ │ │ │ ├── intrinsic_exponential.inl
│ │ │ │ ├── intrinsic_geometric.hpp
│ │ │ │ ├── intrinsic_geometric.inl
│ │ │ │ ├── intrinsic_integer.hpp
│ │ │ │ ├── intrinsic_integer.inl
│ │ │ │ ├── intrinsic_matrix.hpp
│ │ │ │ ├── intrinsic_matrix.inl
│ │ │ │ ├── intrinsic_trigonometric.hpp
│ │ │ │ ├── intrinsic_trigonometric.inl
│ │ │ │ ├── intrinsic_vector_relational.hpp
│ │ │ │ ├── intrinsic_vector_relational.inl
│ │ │ │ ├── precision.hpp
│ │ │ │ ├── setup.hpp
│ │ │ │ ├── type_float.hpp
│ │ │ │ ├── type_gentype.hpp
│ │ │ │ ├── type_gentype.inl
│ │ │ │ ├── type_half.hpp
│ │ │ │ ├── type_half.inl
│ │ │ │ ├── type_int.hpp
│ │ │ │ ├── type_mat.hpp
│ │ │ │ ├── type_mat.inl
│ │ │ │ ├── type_mat2x2.hpp
│ │ │ │ ├── type_mat2x2.inl
│ │ │ │ ├── type_mat2x3.hpp
│ │ │ │ ├── type_mat2x3.inl
│ │ │ │ ├── type_mat2x4.hpp
│ │ │ │ ├── type_mat2x4.inl
│ │ │ │ ├── type_mat3x2.hpp
│ │ │ │ ├── type_mat3x2.inl
│ │ │ │ ├── type_mat3x3.hpp
│ │ │ │ ├── type_mat3x3.inl
│ │ │ │ ├── type_mat3x4.hpp
│ │ │ │ ├── type_mat3x4.inl
│ │ │ │ ├── type_mat4x2.hpp
│ │ │ │ ├── type_mat4x2.inl
│ │ │ │ ├── type_mat4x3.hpp
│ │ │ │ ├── type_mat4x3.inl
│ │ │ │ ├── type_mat4x4.hpp
│ │ │ │ ├── type_mat4x4.inl
│ │ │ │ ├── type_vec.hpp
│ │ │ │ ├── type_vec.inl
│ │ │ │ ├── type_vec1.hpp
│ │ │ │ ├── type_vec1.inl
│ │ │ │ ├── type_vec2.hpp
│ │ │ │ ├── type_vec2.inl
│ │ │ │ ├── type_vec3.hpp
│ │ │ │ ├── type_vec3.inl
│ │ │ │ ├── type_vec4.hpp
│ │ │ │ ├── type_vec4.inl
│ │ │ │ ├── type_vec4_avx.inl
│ │ │ │ ├── type_vec4_avx2.inl
│ │ │ │ └── type_vec4_sse2.inl
│ │ │ ├── exponential.hpp
│ │ │ ├── ext.hpp
│ │ │ ├── fwd.hpp
│ │ │ ├── geometric.hpp
│ │ │ ├── glm.hpp
│ │ │ ├── gtc
│ │ │ │ ├── bitfield.hpp
│ │ │ │ ├── bitfield.inl
│ │ │ │ ├── constants.hpp
│ │ │ │ ├── constants.inl
│ │ │ │ ├── epsilon.hpp
│ │ │ │ ├── epsilon.inl
│ │ │ │ ├── integer.hpp
│ │ │ │ ├── integer.inl
│ │ │ │ ├── matrix_access.hpp
│ │ │ │ ├── matrix_access.inl
│ │ │ │ ├── matrix_integer.hpp
│ │ │ │ ├── matrix_inverse.hpp
│ │ │ │ ├── matrix_inverse.inl
│ │ │ │ ├── matrix_transform.hpp
│ │ │ │ ├── matrix_transform.inl
│ │ │ │ ├── noise.hpp
│ │ │ │ ├── noise.inl
│ │ │ │ ├── packing.hpp
│ │ │ │ ├── packing.inl
│ │ │ │ ├── quaternion.hpp
│ │ │ │ ├── quaternion.inl
│ │ │ │ ├── random.hpp
│ │ │ │ ├── random.inl
│ │ │ │ ├── reciprocal.hpp
│ │ │ │ ├── reciprocal.inl
│ │ │ │ ├── round.hpp
│ │ │ │ ├── round.inl
│ │ │ │ ├── type_precision.hpp
│ │ │ │ ├── type_precision.inl
│ │ │ │ ├── type_ptr.hpp
│ │ │ │ ├── type_ptr.inl
│ │ │ │ ├── ulp.hpp
│ │ │ │ ├── ulp.inl
│ │ │ │ ├── vec1.hpp
│ │ │ │ └── vec1.inl
│ │ │ ├── gtx
│ │ │ │ ├── associated_min_max.hpp
│ │ │ │ ├── associated_min_max.inl
│ │ │ │ ├── bit.hpp
│ │ │ │ ├── bit.inl
│ │ │ │ ├── closest_point.hpp
│ │ │ │ ├── closest_point.inl
│ │ │ │ ├── color_space.hpp
│ │ │ │ ├── color_space.inl
│ │ │ │ ├── color_space_YCoCg.hpp
│ │ │ │ ├── color_space_YCoCg.inl
│ │ │ │ ├── common.hpp
│ │ │ │ ├── common.inl
│ │ │ │ ├── compatibility.hpp
│ │ │ │ ├── compatibility.inl
│ │ │ │ ├── component_wise.hpp
│ │ │ │ ├── component_wise.inl
│ │ │ │ ├── dual_quaternion.hpp
│ │ │ │ ├── dual_quaternion.inl
│ │ │ │ ├── euler_angles.hpp
│ │ │ │ ├── euler_angles.inl
│ │ │ │ ├── extend.hpp
│ │ │ │ ├── extend.inl
│ │ │ │ ├── extented_min_max.hpp
│ │ │ │ ├── extented_min_max.inl
│ │ │ │ ├── fast_exponential.hpp
│ │ │ │ ├── fast_exponential.inl
│ │ │ │ ├── fast_square_root.hpp
│ │ │ │ ├── fast_square_root.inl
│ │ │ │ ├── fast_trigonometry.hpp
│ │ │ │ ├── fast_trigonometry.inl
│ │ │ │ ├── gradient_paint.hpp
│ │ │ │ ├── gradient_paint.inl
│ │ │ │ ├── handed_coordinate_space.hpp
│ │ │ │ ├── handed_coordinate_space.inl
│ │ │ │ ├── integer.hpp
│ │ │ │ ├── integer.inl
│ │ │ │ ├── intersect.hpp
│ │ │ │ ├── intersect.inl
│ │ │ │ ├── io.hpp
│ │ │ │ ├── io.inl
│ │ │ │ ├── log_base.hpp
│ │ │ │ ├── log_base.inl
│ │ │ │ ├── matrix_cross_product.hpp
│ │ │ │ ├── matrix_cross_product.inl
│ │ │ │ ├── matrix_decompose.hpp
│ │ │ │ ├── matrix_decompose.inl
│ │ │ │ ├── matrix_interpolation.hpp
│ │ │ │ ├── matrix_interpolation.inl
│ │ │ │ ├── matrix_major_storage.hpp
│ │ │ │ ├── matrix_major_storage.inl
│ │ │ │ ├── matrix_operation.hpp
│ │ │ │ ├── matrix_operation.inl
│ │ │ │ ├── matrix_query.hpp
│ │ │ │ ├── matrix_query.inl
│ │ │ │ ├── matrix_transform_2d.hpp
│ │ │ │ ├── matrix_transform_2d.inl
│ │ │ │ ├── mixed_product.hpp
│ │ │ │ ├── mixed_product.inl
│ │ │ │ ├── multiple.hpp
│ │ │ │ ├── multiple.inl
│ │ │ │ ├── norm.hpp
│ │ │ │ ├── norm.inl
│ │ │ │ ├── normal.hpp
│ │ │ │ ├── normal.inl
│ │ │ │ ├── normalize_dot.hpp
│ │ │ │ ├── normalize_dot.inl
│ │ │ │ ├── number_precision.hpp
│ │ │ │ ├── number_precision.inl
│ │ │ │ ├── optimum_pow.hpp
│ │ │ │ ├── optimum_pow.inl
│ │ │ │ ├── orthonormalize.hpp
│ │ │ │ ├── orthonormalize.inl
│ │ │ │ ├── perpendicular.hpp
│ │ │ │ ├── perpendicular.inl
│ │ │ │ ├── polar_coordinates.hpp
│ │ │ │ ├── polar_coordinates.inl
│ │ │ │ ├── projection.hpp
│ │ │ │ ├── projection.inl
│ │ │ │ ├── quaternion.hpp
│ │ │ │ ├── quaternion.inl
│ │ │ │ ├── range.hpp
│ │ │ │ ├── raw_data.hpp
│ │ │ │ ├── raw_data.inl
│ │ │ │ ├── rotate_normalized_axis.hpp
│ │ │ │ ├── rotate_normalized_axis.inl
│ │ │ │ ├── rotate_vector.hpp
│ │ │ │ ├── rotate_vector.inl
│ │ │ │ ├── scalar_multiplication.hpp
│ │ │ │ ├── scalar_relational.hpp
│ │ │ │ ├── scalar_relational.inl
│ │ │ │ ├── simd_mat4.hpp
│ │ │ │ ├── simd_mat4.inl
│ │ │ │ ├── simd_quat.hpp
│ │ │ │ ├── simd_quat.inl
│ │ │ │ ├── simd_vec4.hpp
│ │ │ │ ├── simd_vec4.inl
│ │ │ │ ├── spline.hpp
│ │ │ │ ├── spline.inl
│ │ │ │ ├── std_based_type.hpp
│ │ │ │ ├── std_based_type.inl
│ │ │ │ ├── string_cast.hpp
│ │ │ │ ├── string_cast.inl
│ │ │ │ ├── transform.hpp
│ │ │ │ ├── transform.inl
│ │ │ │ ├── transform2.hpp
│ │ │ │ ├── transform2.inl
│ │ │ │ ├── type_aligned.hpp
│ │ │ │ ├── type_aligned.inl
│ │ │ │ ├── vector_angle.hpp
│ │ │ │ ├── vector_angle.inl
│ │ │ │ ├── vector_query.hpp
│ │ │ │ ├── vector_query.inl
│ │ │ │ ├── wrap.hpp
│ │ │ │ └── wrap.inl
│ │ │ ├── integer.hpp
│ │ │ ├── mat2x2.hpp
│ │ │ ├── mat2x3.hpp
│ │ │ ├── mat2x4.hpp
│ │ │ ├── mat3x2.hpp
│ │ │ ├── mat3x3.hpp
│ │ │ ├── mat3x4.hpp
│ │ │ ├── mat4x2.hpp
│ │ │ ├── mat4x3.hpp
│ │ │ ├── mat4x4.hpp
│ │ │ ├── matrix.hpp
│ │ │ ├── packing.hpp
│ │ │ ├── trigonometric.hpp
│ │ │ ├── vec2.hpp
│ │ │ ├── vec3.hpp
│ │ │ ├── vec4.hpp
│ │ │ └── vector_relational.hpp
│ │ ├── render
│ │ │ ├── ByteFlowDef.h
│ │ │ ├── ByteFlowRender.h
│ │ │ ├── GLByteFlowRender.cpp
│ │ │ ├── GLByteFlowRender.h
│ │ │ ├── GLShaders.h
│ │ │ ├── GLUtils.cpp
│ │ │ └── GLUtils.h
│ │ └── util
│ │ │ ├── ImageDef.h
│ │ │ ├── LogUtil.h
│ │ │ └── SyncLock.h
│ ├── java
│ │ └── com
│ │ │ └── atech
│ │ │ └── glcamera
│ │ │ ├── CameraActivity.java
│ │ │ ├── MyRecyclerViewAdapter.java
│ │ │ ├── camera
│ │ │ ├── Camera2FrameCallback.java
│ │ │ ├── Camera2Wrapper.java
│ │ │ └── CameraUtil.java
│ │ │ ├── frame
│ │ │ ├── ByteFlowFrame.java
│ │ │ └── FrameUtil.java
│ │ │ └── render
│ │ │ ├── ByteFlowRender.java
│ │ │ └── GLByteFlowRender.java
│ └── res
│ │ ├── drawable
│ │ ├── ascii_mapping.png
│ │ ├── bg_camera.xml
│ │ ├── camera.png
│ │ ├── dzzz.jpg
│ │ ├── lut_a.png
│ │ ├── lut_b.png
│ │ ├── lut_c.png
│ │ └── lut_d.png
│ │ ├── layout
│ │ ├── activity_camera.xml
│ │ ├── sample_item_layout.xml
│ │ └── sample_selected_layout.xml
│ │ └── values
│ │ ├── colors.xml
│ │ ├── strings.xml
│ │ └── styles.xml
│ └── test
│ └── java
│ └── com
│ └── atech
│ └── glcamera
│ └── ExampleUnitTest.java
├── gradle.properties
├── gradle
└── wrapper
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradlew
├── gradlew.bat
├── images
├── tu1.jpg
├── tu2.jpg
└── tu3.gif
└── settings.gradle
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .gradle
3 | /local.properties
4 | /.idea/codeStyles
5 | /.idea/caches
6 | /.idea/libraries
7 | /.idea/modules.xml
8 | /.idea/workspace.xml
9 | /.idea/navEditor.xml
10 | /.idea/assetWizardSettings.xml
11 | /.idea/tasks.xml
12 | /.idea/.name
13 | /.idea/compiler.xml
14 | /.idea/copyright/profiles_settings.xml
15 | /.idea/encodings.xml
16 | /.idea/scopes/scope_settings.xml
17 | /.idea/gradle.xml
18 | /.idea/jarRepositories.xml
19 | /.idea/misc.xml
20 | /.idea/runConfigurations.xml
21 | /.idea/vcs.xml
22 | .DS_Store
23 | /build
24 | /captures
25 | .externalNativeBuild
26 | .cxx
27 |
--------------------------------------------------------------------------------
/.idea/.gitignore:
--------------------------------------------------------------------------------
1 | # Default ignored files
2 | /shelf/
3 | /workspace.xml
4 |
--------------------------------------------------------------------------------
/build.gradle:
--------------------------------------------------------------------------------
1 | // Top-level build file where you can add configuration options common to all sub-projects/modules.
2 |
3 | buildscript {
4 |
5 | repositories {
6 | google()
7 | jcenter()
8 | }
9 | dependencies {
10 | classpath 'com.android.tools.build:gradle:4.1.2'
11 |
12 |
13 | // NOTE: Do not place your application dependencies here; they belong
14 | // in the individual module build.gradle files
15 | }
16 | }
17 |
18 | allprojects {
19 | repositories {
20 | google()
21 | jcenter()
22 | }
23 | }
24 |
25 | task clean(type: Delete) {
26 | delete rootProject.buildDir
27 | }
28 |
--------------------------------------------------------------------------------
/demo/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/demo/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.application'
2 |
3 | android {
4 | compileSdkVersion 30
5 |
6 | defaultConfig {
7 | applicationId "com.atech.cameraapi"
8 | minSdkVersion 21
9 | targetSdkVersion 30
10 | versionCode 1
11 | versionName "1.0"
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 | }
14 | buildTypes {
15 | release {
16 | minifyEnabled false
17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
18 | }
19 | }
20 |
21 | compileOptions {
22 | sourceCompatibility 1.8
23 | targetCompatibility 1.8
24 | }
25 |
26 | }
27 |
28 | dependencies {
29 | implementation fileTree(include: ['*.jar'], dir: 'libs')
30 | implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
31 | implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta4'
32 | testImplementation 'junit:junit:4.12'
33 | androidTestImplementation 'androidx.test:runner:1.3.0-alpha04'
34 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha04'
35 | implementation project(':glcamera')
36 | implementation 'com.google.android.material:material:1.2.0-alpha05'
37 | }
38 |
--------------------------------------------------------------------------------
/demo/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/demo/src/androidTest/java/com/atech/cameraapi/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.atech.cameraapi;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.atech.cameraapi", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/demo/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
--------------------------------------------------------------------------------
/demo/src/main/java/com/atech/cameraapi/FilterInfo.java:
--------------------------------------------------------------------------------
1 | package com.atech.cameraapi;
2 |
3 | public class FilterInfo {
4 |
5 | public int filterImg;
6 | public String filterName;
7 |
8 | public FilterInfo(int filterImg,String filterName){
9 |
10 | this.filterImg = filterImg;
11 | this.filterName = filterName;
12 |
13 | }
14 |
15 | }
16 |
--------------------------------------------------------------------------------
/demo/src/main/java/com/atech/cameraapi/MainActivity.java:
--------------------------------------------------------------------------------
1 | package com.atech.cameraapi;
2 |
3 | import android.content.Intent;
4 | import android.os.Bundle;
5 | import android.view.View;
6 | import android.widget.Button;
7 |
8 | import androidx.appcompat.app.AppCompatActivity;
9 |
10 | import com.atech.glcamera.CameraActivity;
11 |
12 | public class MainActivity extends AppCompatActivity {
13 |
14 | @Override
15 | protected void onCreate(Bundle savedInstanceState) {
16 | super.onCreate(savedInstanceState);
17 | setContentView(R.layout.activity_main);
18 |
19 | Button btn = findViewById(R.id.btn);
20 | btn.setOnClickListener(new View.OnClickListener() {
21 | @Override
22 | public void onClick(View view) {
23 |
24 | startActivity(new Intent(MainActivity.this, CameraActivity.class));
25 | }
26 | });
27 |
28 | }
29 |
30 |
31 | }
32 |
--------------------------------------------------------------------------------
/demo/src/main/java/com/atech/cameraapi/SelectedListener.java:
--------------------------------------------------------------------------------
1 | package com.atech.cameraapi;
2 |
3 | public interface SelectedListener {
4 |
5 | void onFilterSelected(int pos);
6 |
7 | }
8 |
--------------------------------------------------------------------------------
/demo/src/main/res/drawable-v24/ic_launcher_foreground.xml:
--------------------------------------------------------------------------------
1 |
7 |
12 |
13 |
19 |
22 |
25 |
26 |
27 |
28 |
34 |
35 |
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/camera.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/capture.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/capture.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_1977.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_1977.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_amoro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_amoro.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_antique.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_antique.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_beauty.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_beauty.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_blackcat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_blackcat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_brannan.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_brannan.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_brooklyn.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_brooklyn.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_calm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_calm.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_cool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_cool.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_crayon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_crayon.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_earlybird.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_earlybird.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_emerald.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_emerald.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_evergreen.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_evergreen.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_fairytale.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_fairytale.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_freud.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_freud.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_healthy.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_healthy.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_hefe.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_hefe.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_hudson.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_hudson.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_inkwell.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_inkwell.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_kevin.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_kevin.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_latte.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_latte.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_lomo.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_lomo.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_nashville.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_nashville.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_nostalgia.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_nostalgia.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_original.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_original.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_piaxr.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_piaxr.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_rise.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_rise.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_romance.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_romance.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sakura.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sakura.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sierra.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sierra.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sketch.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sketch.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sunrise.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sunrise.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sunset.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sunset.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sutro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sutro.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_sweets.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_sweets.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_tender.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_tender.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_toastero.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_toastero.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_valencia.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_valencia.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_walden.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_walden.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_warm.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_warm.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_whitecat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_whitecat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/filter_thumb_xpro.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/filter_thumb_xpro.jpg
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/ic_switch_camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/ic_switch_camera.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/selector_filter_selected.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_confirm_btn_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_confirm_btn_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_favorite_btn01_layer00_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_favorite_btn01_layer00_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_favorite_btn01_layer01_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_favorite_btn01_layer01_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_favorite_btn02_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_favorite_btn02_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_favorite_icon01_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_favorite_icon01_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_favorite_icon02_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_favorite_icon02_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/drawable/take_filter_random_btn_skin_flat.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/drawable/take_filter_random_btn_skin_flat.png
--------------------------------------------------------------------------------
/demo/src/main/res/layout/activity_main.xml:
--------------------------------------------------------------------------------
1 |
2 |
8 |
9 |
15 |
16 |
--------------------------------------------------------------------------------
/demo/src/main/res/layout/item_filter.xml:
--------------------------------------------------------------------------------
1 |
2 |
10 |
13 |
19 |
24 |
28 |
34 |
35 |
36 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-anydpi-v26/ic_launcher.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-hdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-hdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-hdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-mdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-mdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-mdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-xhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-xhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-xxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-xxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-xxxhdpi/ic_launcher.png
--------------------------------------------------------------------------------
/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/demo/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png
--------------------------------------------------------------------------------
/demo/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 |
7 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/strings.xml:
--------------------------------------------------------------------------------
1 |
2 | OpenCamera
3 |
4 | 原图
5 | 白猫
6 | 黑猫
7 | 浪漫
8 | 樱花
9 | 复古
10 | 美肤
11 | 平静
12 | 冰冷
13 | 祖母绿
14 | 常青
15 | 童话
16 | 健康
17 | 拿铁
18 | 怀旧
19 | 温柔
20 | 温暖
21 | 甜品
22 | 日出
23 | 日落
24 | 美白
25 | 蜡笔
26 | 素描
27 |
28 | 滤镜
29 | 编辑
30 | 装饰
31 | 边框
32 | 美颜
33 |
34 | 对比度
35 | 曝光
36 | 自然饱和度
37 | 饱和度
38 | 锐化
39 | 亮度
40 | 色调
41 |
42 |
--------------------------------------------------------------------------------
/demo/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
10 |
11 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/demo/src/test/java/com/atech/cameraapi/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.atech.cameraapi;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 |
18 |
19 |
20 |
21 |
22 | /**
23 | * Capture the current image with the size as it is displayed and retrieve it as Bitmap.
24 | *
25 | * @return current output as Bitmap
26 | * @throws InterruptedException
27 | */
28 |
29 |
30 |
31 | }
--------------------------------------------------------------------------------
/glcamera/.gitignore:
--------------------------------------------------------------------------------
1 | /build
2 |
--------------------------------------------------------------------------------
/glcamera/build.gradle:
--------------------------------------------------------------------------------
1 | apply plugin: 'com.android.library'
2 |
3 | android {
4 | compileSdkVersion 30
5 |
6 | defaultConfig {
7 | minSdkVersion 21
8 | targetSdkVersion 30
9 | versionCode 1
10 | versionName "1.0"
11 |
12 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
13 |
14 |
15 | }
16 |
17 | compileOptions {
18 | sourceCompatibility 1.8
19 | targetCompatibility 1.8
20 | }
21 |
22 | buildTypes {
23 | release {
24 | minifyEnabled false
25 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
26 | }
27 | }
28 | externalNativeBuild {
29 | cmake {
30 | path file('src/main/cpp/CMakeLists.txt')
31 | }
32 | }
33 |
34 | }
35 |
36 | dependencies {
37 | implementation fileTree(dir: 'libs', include: ['*.jar'])
38 |
39 | implementation 'androidx.appcompat:appcompat:1.2.0-alpha03'
40 | implementation 'com.google.android.material:material:1.4.+'
41 | implementation 'androidx.constraintlayout:constraintlayout:2.1.3'
42 | testImplementation 'junit:junit:4.12'
43 | androidTestImplementation 'androidx.test:runner:1.3.0-alpha04'
44 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha04'
45 | }
46 |
--------------------------------------------------------------------------------
/glcamera/proguard-rules.pro:
--------------------------------------------------------------------------------
1 | # Add project specific ProGuard rules here.
2 | # You can control the set of applied configuration files using the
3 | # proguardFiles setting in build.gradle.
4 | #
5 | # For more details, see
6 | # http://developer.android.com/guide/developing/tools/proguard.html
7 |
8 | # If your project uses WebView with JS, uncomment the following
9 | # and specify the fully qualified class name to the JavaScript interface
10 | # class:
11 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview {
12 | # public *;
13 | #}
14 |
15 | # Uncomment this to preserve the line number information for
16 | # debugging stack traces.
17 | #-keepattributes SourceFile,LineNumberTable
18 |
19 | # If you keep the line number information, uncomment this to
20 | # hide the original source file name.
21 | #-renamesourcefileattribute SourceFile
22 |
--------------------------------------------------------------------------------
/glcamera/src/androidTest/java/com/atech/glcamera/ExampleInstrumentedTest.java:
--------------------------------------------------------------------------------
1 | package com.atech.glcamera;
2 |
3 | import android.content.Context;
4 | import android.support.test.InstrumentationRegistry;
5 | import android.support.test.runner.AndroidJUnit4;
6 |
7 | import org.junit.Test;
8 | import org.junit.runner.RunWith;
9 |
10 | import static org.junit.Assert.*;
11 |
12 | /**
13 | * Instrumented test, which will execute on an Android device.
14 | *
15 | * @see Testing documentation
16 | */
17 | @RunWith(AndroidJUnit4.class)
18 | public class ExampleInstrumentedTest {
19 | @Test
20 | public void useAppContext() {
21 | // Context of the app under test.
22 | Context appContext = InstrumentationRegistry.getTargetContext();
23 |
24 | assertEquals("com.atech.glcamera.test", appContext.getPackageName());
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/glcamera/src/main/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
5 |
6 |
7 |
8 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_0.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 | precision highp float;
3 | varying vec2 v_texcoord;
4 | uniform lowp sampler2D s_textureY;
5 | uniform lowp sampler2D s_textureU;
6 | uniform lowp sampler2D s_textureV;
7 | void main() {
8 | float y, u, v, r, g, b;
9 | y = texture2D(s_textureY, v_texcoord).r;
10 | u = texture2D(s_textureU, v_texcoord).r;
11 | v = texture2D(s_textureV, v_texcoord).r;
12 | u = u - 0.5;
13 | v = v - 0.5;
14 | r = y + 1.403 * v;
15 | g = y - 0.344 * u - 0.714 * v;
16 | b = y + 1.770 * u;
17 | gl_FragColor = vec4(r, g, b, 1.0);
18 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_1.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 | precision highp float;
3 | varying vec2 v_texcoord;
4 | uniform lowp sampler2D s_textureY;
5 | uniform lowp sampler2D s_textureU;
6 | uniform lowp sampler2D s_textureV;
7 | vec4 YuvToRgb(vec2 uv) {
8 | float y, u, v, r, g, b;
9 | y = texture2D(s_textureY, uv).r;
10 | u = texture2D(s_textureU, uv).r;
11 | v = texture2D(s_textureV, uv).r;
12 | u = u - 0.5;
13 | v = v - 0.5;
14 | r = y + 1.403 * v;
15 | g = y - 0.344 * u - 0.714 * v;
16 | b = y + 1.770 * u;
17 | return vec4(r, g, b, 1.0);
18 | }
19 | void main() {
20 | vec4 sample0, sample1, sample2, sample3;
21 | float blurStep = 0.5;
22 | float step = blurStep / 100.0;
23 | sample0 = YuvToRgb(vec2(v_texcoord.x - step, v_texcoord.y - step));
24 | sample1 = YuvToRgb(vec2(v_texcoord.x + step, v_texcoord.y + step));
25 | sample2 = YuvToRgb(vec2(v_texcoord.x + step, v_texcoord.y - step));
26 | sample3 = YuvToRgb(vec2(v_texcoord.x - step, v_texcoord.y + step));
27 | gl_FragColor = (sample0 + sample1 + sample2 + sample3) / 4.0;
28 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_11.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | void main() {
9 | float y, u, v, r, g, b;
10 | y = texture2D(s_textureY, v_texcoord).r;
11 | u = texture2D(s_textureU, v_texcoord).r;
12 | v = texture2D(s_textureV, v_texcoord).r;
13 | u = u - 0.5;
14 | v = v - 0.5;
15 | r = y + 1.403 * v;
16 | g = y - 0.344 * u - 0.714 * v;
17 | b = y + 1.770 * u;
18 | vec3 color = vec3(r, g, b);
19 | vec2 uv = v_texcoord.xy;
20 | vec3 colors[3];
21 | colors[0] = vec3(0.,0.,1.);
22 | colors[1] = vec3(1.,1.,0.);
23 | colors[2] = vec3(1.,0.,0.);
24 | float lum = (color.r + color.g + color.b)/3.;
25 | int idx = (lum < 0.5) ? 0 : 1;
26 | vec3 rgb = mix(colors[idx],colors[idx+1],(lum-float(idx)*0.5)/0.5);
27 | gl_FragColor = vec4(rgb, 1.0);
28 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_12.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform vec2 texSize;
9 | vec4 YuvToRgb(vec2 uv) {
10 | float y, u, v, r, g, b;
11 | y = texture2D(s_textureY, uv).r;
12 | u = texture2D(s_textureU, uv).r;
13 | v = texture2D(s_textureV, uv).r;
14 | u = u - 0.5;
15 | v = v - 0.5;
16 | r = y + 1.403 * v;
17 | g = y - 0.344 * u - 0.714 * v;
18 | b = y + 1.770 * u;
19 | return vec4(r, g, b, 1.0);
20 | }
21 | void main() {
22 | vec4 color;
23 | color.rgb = vec3(0.5);
24 | vec2 onePixel = vec2(1.0 / texSize.x, 1.0 / texSize.y);
25 | color -= YuvToRgb(v_texcoord - onePixel) * 5.0;
26 | color += YuvToRgb(v_texcoord + onePixel) * 5.0;
27 | color.rgb = vec3((color.r + color.g + color.b) / 3.0);
28 | gl_FragColor = vec4(color.rgb, 1.0);
29 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_13.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 | precision highp float;
3 | varying vec2 v_texcoord;
4 | uniform lowp sampler2D s_textureY;
5 | uniform lowp sampler2D s_textureU;
6 | uniform lowp sampler2D s_textureV;
7 | uniform vec2 texSize;
8 | vec4 YuvToRgb(vec2 uv) {
9 | float y, u, v, r, g, b;
10 | y = texture2D(s_textureY, uv).r;
11 | u = texture2D(s_textureU, uv).r;
12 | v = texture2D(s_textureV, uv).r;
13 | u = u - 0.5;
14 | v = v - 0.5;
15 | r = y + 1.403 * v;
16 | g = y - 0.344 * u - 0.714 * v;
17 | b = y + 1.770 * u;
18 | return vec4(r, g, b, 1.0);
19 | }
20 | void main() {
21 | float newY, newX;
22 | if(v_texcoord.y <= 1.0/3.0)
23 | {
24 | newY = v_texcoord.y + 1.0/3.0;
25 | }
26 | else if(1.0/3.0 <= v_texcoord.y && v_texcoord.y <= 2.0/3.0)
27 | {
28 | newY = v_texcoord.y;
29 | }
30 | else
31 | {
32 | newY = v_texcoord.y - 1.0/3.0;
33 | }
34 |
35 | if(v_texcoord.x <= 1.0/3.0)
36 | {
37 | newX = v_texcoord.x + 1.0/3.0;
38 | }
39 | else if(1.0/3.0 <= v_texcoord.x && v_texcoord.x <= 2.0/3.0)
40 | {
41 | newX = v_texcoord.x;
42 | }
43 | else
44 | {
45 | newX = v_texcoord.x - 1.0/3.0;
46 | }
47 |
48 | gl_FragColor = YuvToRgb(vec2(newX, newY));
49 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_14.glsl:
--------------------------------------------------------------------------------
1 | //分色偏移
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform float u_offset;
9 | vec4 YuvToRgb(vec2 uv) {
10 | float y, u, v, r, g, b;
11 | y = texture2D(s_textureY, uv).r;
12 | u = texture2D(s_textureU, uv).r;
13 | v = texture2D(s_textureV, uv).r;
14 | u = u - 0.5;
15 | v = v - 0.5;
16 | r = y + 1.403 * v;
17 | g = y - 0.344 * u - 0.714 * v;
18 | b = y + 1.770 * u;
19 | return vec4(r, g, b, 1.0);
20 | }
21 | void main()
22 | {
23 | vec4 originColor = YuvToRgb(v_texcoord);
24 | vec4 offsetColor0 = YuvToRgb(vec2(v_texcoord.x + u_offset, v_texcoord.y + u_offset));
25 | vec4 offsetColor1 = YuvToRgb(vec2(v_texcoord.x - u_offset, v_texcoord.y - u_offset));
26 |
27 | gl_FragColor = vec4(originColor.r, offsetColor1.g, offsetColor0.b, originColor.a);
28 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_15.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 | precision highp float;
3 | varying vec2 v_texcoord;
4 | uniform lowp sampler2D s_textureY;
5 | uniform lowp sampler2D s_textureU;
6 | uniform lowp sampler2D s_textureV;
7 | uniform float u_offset;
8 | vec4 YuvToRgb(vec2 uv) {
9 | float y, u, v, r, g, b;
10 | y = texture2D(s_textureY, uv).r;
11 | u = texture2D(s_textureU, uv).r;
12 | v = texture2D(s_textureV, uv).r;
13 | u = u - 0.5;
14 | v = v - 0.5;
15 | r = y + 1.403 * v;
16 | g = y - 0.344 * u - 0.714 * v;
17 | b = y + 1.770 * u;
18 | return vec4(r, g, b, 1.0);
19 | }
20 | void main()
21 | {
22 | vec4 originColor = YuvToRgb(v_texcoord);
23 | gl_FragColor = vec4(originColor.r, originColor.g + u_offset, originColor.b, originColor.a);
24 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_16.glsl:
--------------------------------------------------------------------------------
1 | //scale circle 缩放的圆
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform float u_offset;
9 | uniform vec2 texSize;
10 | vec4 YuvToRgb(vec2 uv) {
11 | float y, u, v, r, g, b;
12 | y = texture2D(s_textureY, uv).r;
13 | u = texture2D(s_textureU, uv).r;
14 | v = texture2D(s_textureV, uv).r;
15 | u = u - 0.5;
16 | v = v - 0.5;
17 | r = y + 1.403 * v;
18 | g = y - 0.344 * u - 0.714 * v;
19 | b = y + 1.770 * u;
20 | return vec4(r, g, b, 1.0);
21 | }
22 | void main()
23 | {
24 | vec2 imgTex = v_texcoord * texSize;
25 | float r = (u_offset + 0.208 ) * texSize.x;
26 | if(distance(imgTex, vec2(texSize.x / 2.0, texSize.y / 2.0)) < r)
27 | {
28 | gl_FragColor = YuvToRgb(v_texcoord);
29 | }
30 | else
31 | {
32 | gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
33 | }
34 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_17.glsl:
--------------------------------------------------------------------------------
1 | //旋转的圆
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform float u_offset;
9 | uniform vec2 texSize;
10 | vec4 YuvToRgb(vec2 uv) {
11 | float y, u, v, r, g, b;
12 | y = texture2D(s_textureY, uv).r;
13 | u = texture2D(s_textureU, uv).r;
14 | v = texture2D(s_textureV, uv).r;
15 | u = u - 0.5;
16 | v = v - 0.5;
17 | r = y + 1.403 * v;
18 | g = y - 0.344 * u - 0.714 * v;
19 | b = y + 1.770 * u;
20 | return vec4(r, g, b, 1.0);
21 | }
22 | const float PI = 3.141592653;
23 | void main()
24 | {
25 | vec2 imgTex = v_texcoord * texSize;
26 | float r = 0.3 * texSize.x;
27 | if(distance(imgTex, vec2(texSize.x / 2.0, texSize.y / 2.0)) < r)
28 | {
29 | vec2 tranTex = v_texcoord - 0.5;
30 | vec2 imgTranTex = tranTex * texSize;
31 | float len = length(imgTranTex);
32 | float angle = 0.0;
33 |
34 | angle = acos(imgTranTex.x / len);
35 |
36 | if(tranTex.y < 0.0)
37 | {
38 | angle *= -1.0;
39 | }
40 |
41 | angle -= u_offset;
42 |
43 | imgTranTex.x = len * cos(angle);
44 | imgTranTex.y = len * sin(angle);
45 |
46 | vec2 newTexCoors = imgTranTex / texSize + 0.5;
47 |
48 | gl_FragColor = YuvToRgb(newTexCoors);
49 | }
50 | else
51 | {
52 | gl_FragColor = YuvToRgb(v_texcoord);
53 | }
54 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_18.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 | precision highp float;
3 | varying vec2 v_texcoord;
4 | //这是个二阶向量,x是横向偏移的值,y是阈值
5 | uniform vec2 u_ScanLineJitter;
6 | //颜色偏移的值
7 | uniform float u_ColorDrift;
8 | uniform lowp sampler2D s_textureY;
9 | uniform lowp sampler2D s_textureU;
10 | uniform lowp sampler2D s_textureV;
11 |
12 | vec4 YuvToRgb(vec2 uv) {
13 | float y, u, v, r, g, b;
14 | y = texture2D(s_textureY, uv).r;
15 | u = texture2D(s_textureU, uv).r;
16 | v = texture2D(s_textureV, uv).r;
17 | u = u - 0.5;
18 | v = v - 0.5;
19 | r = y + 1.403 * v;
20 | g = y - 0.344 * u - 0.714 * v;
21 | b = y + 1.770 * u;
22 | return vec4(r, g, b, 1.0);
23 | }
24 |
25 | float nrand(in float x,in float y){
26 | //fract(x) = x - floor(x);
27 | //dot是向量点乘,,sin就是正弦函数
28 | return fract(sin(dot(vec2(x,y) ,vec2(12.9898,78.233))) * 43758.5453);
29 | }
30 |
31 | void main()
32 | {
33 | float v = v_texcoord.x;
34 | float u = v_texcoord.y;
35 | //用y计算0~1的随机值,再取值-1~1的数
36 | float jitter = nrand(v ,0.0) * 2.0 - 1.0;
37 | float drift = u_ColorDrift;
38 | //计算向左或向右偏移
39 | //意思是,如果第一个参数大于第二个参数,那么返回0,否则返回1
40 | float offsetParam = step(u_ScanLineJitter.y,abs(jitter));
41 | //如果offset为0就不偏移,如果为1,就偏移jtter*u_ScanLineJitter.x的位置
42 | jitter = jitter * offsetParam * u_ScanLineJitter.x;
43 | //这里计算最终的像素值,纹理坐标是0到1之间的数,如果小于0,那么图像就捅到屏幕右边去,如果超过1,那么就捅到屏幕左边去,形成颜色偏移
44 | vec4 color1 = YuvToRgb(fract(vec2(v, u + jitter)));
45 | vec4 color2 = YuvToRgb(fract(vec2(v, u + jitter + v * drift)));
46 | gl_FragColor = vec4(color1.r ,color2.g ,color1.b ,1.0);
47 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_19.glsl:
--------------------------------------------------------------------------------
1 | // Lut 滤镜
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 |
6 | //Lut 纹理
7 | uniform sampler2D s_LutTexture;
8 | uniform lowp sampler2D s_textureY;
9 | uniform lowp sampler2D s_textureU;
10 | uniform lowp sampler2D s_textureV;
11 |
12 | vec4 YuvToRgb(vec2 uv) {
13 | float y, u, v, r, g, b;
14 | y = texture2D(s_textureY, uv).r;
15 | u = texture2D(s_textureU, uv).r;
16 | v = texture2D(s_textureV, uv).r;
17 | u = u - 0.5;
18 | v = v - 0.5;
19 | r = y + 1.403 * v;
20 | g = y - 0.344 * u - 0.714 * v;
21 | b = y + 1.770 * u;
22 | return vec4(r, g, b, 1.0);
23 | }
24 |
25 | vec4 LutFilter(vec2 texCoord)
26 | {
27 | //原始采样像素的 RGBA 值
28 | vec4 textureColor = YuvToRgb(texCoord);
29 |
30 | //获取 B 分量值,确定 LUT 小方格的 index, 取值范围转为 0~63
31 | float blueColor = textureColor.b * 63.0;
32 |
33 | //取与 B 分量值最接近的 2 个小方格的坐标
34 | vec2 quad1;
35 | quad1.y = floor(floor(blueColor) / 8.0);
36 | quad1.x = floor(blueColor) - (quad1.y * 8.0);
37 |
38 | vec2 quad2;
39 | quad2.y = floor(ceil(blueColor) / 7.9999);
40 | quad2.x = ceil(blueColor) - (quad2.y * 8.0);
41 |
42 | //通过 R 和 G 分量的值确定小方格内目标映射的 RGB 组合的坐标,然后归一化,转化为纹理坐标。
43 | vec2 texPos1;
44 | texPos1.x = (quad1.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);
45 | texPos1.y = (quad1.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g);
46 |
47 | vec2 texPos2;
48 | texPos2.x = (quad2.x * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.r);
49 | texPos2.y = (quad2.y * 0.125) + 0.5/512.0 + ((0.125 - 1.0/512.0) * textureColor.g);
50 |
51 | //取目标映射对应的像素值
52 | vec4 newColor1 = texture2D(s_LutTexture, texPos1);
53 | vec4 newColor2 = texture2D(s_LutTexture, texPos2);
54 |
55 | //使用 Mix 方法对 2 个边界像素值进行混合
56 | vec4 newColor = mix(newColor1, newColor2, fract(blueColor));
57 | return mix(textureColor, vec4(newColor.rgb, textureColor.w), 1.0);
58 | }
59 |
60 | void main()
61 | {
62 | if(v_texcoord.y > 0.5)
63 | {
64 | gl_FragColor = LutFilter(v_texcoord);
65 | }
66 | else
67 | {
68 | gl_FragColor = YuvToRgb(v_texcoord);
69 | }
70 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_2.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform vec2 texSize;
9 | vec4 YuvToRgb(vec2 uv) {
10 | float y, u, v, r, g, b;
11 | y = texture2D(s_textureY, uv).r;
12 | u = texture2D(s_textureU, uv).r;
13 | v = texture2D(s_textureV, uv).r;
14 | u = u - 0.5;
15 | v = v - 0.5;
16 | r = y + 1.403 * v;
17 | g = y - 0.344 * u - 0.714 * v;
18 | b = y + 1.770 * u;
19 | return vec4(r, g, b, 1.0);
20 | }
21 | void main() {
22 | vec2 pos = v_texcoord.xy;
23 | vec2 onePixel = vec2(1, 1) / texSize;
24 | vec4 color = vec4(0);
25 | mat3 edgeDetectionKernel = mat3(
26 | -1, -1, -1,
27 | -1, 8, -1,
28 | -1, -1, -1
29 | );
30 | for(int i = 0; i < 3; i++) {
31 | for(int j = 0; j < 3; j++) {
32 | vec2 samplePos = pos + vec2(i - 1 , j - 1) * onePixel;
33 | vec4 sampleColor = YuvToRgb(samplePos);
34 | sampleColor *= edgeDetectionKernel[i][j];
35 | color += sampleColor;
36 | }
37 | }
38 | gl_FragColor = vec4(color.rgb, 1.0);
39 | }
40 |
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_23.glsl:
--------------------------------------------------------------------------------
1 | //dynimic mesh 动态网格
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform float u_offset;
9 | uniform vec2 texSize;
10 | vec4 YuvToRgb(vec2 uv) {
11 | float y, u, v, r, g, b;
12 | y = texture2D(s_textureY, uv).r;
13 | u = texture2D(s_textureU, uv).r;
14 | v = texture2D(s_textureV, uv).r;
15 | u = u - 0.5;
16 | v = v - 0.5;
17 | r = y + 1.403 * v;
18 | g = y - 0.344 * u - 0.714 * v;
19 | b = y + 1.770 * u;
20 | return vec4(r, g, b, 1.0);
21 | }
22 | void main()
23 | {
24 | vec2 imgTexCoord = v_texcoord * texSize;
25 | float sideLength = texSize.y / 6.0;
26 | float maxOffset = 0.15 * sideLength;
27 | float x = mod(imgTexCoord.x, floor(sideLength));
28 | float y = mod(imgTexCoord.y, floor(sideLength));
29 |
30 | float offset = u_offset * maxOffset;
31 |
32 | if(offset <= x
33 | && x <= sideLength - offset
34 | && offset <= y
35 | && y <= sideLength - offset)
36 | {
37 | gl_FragColor = YuvToRgb(v_texcoord);
38 | }
39 | else
40 | {
41 | gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
42 | }
43 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_24.glsl:
--------------------------------------------------------------------------------
1 | //分屏
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | vec4 YuvToRgb(vec2 uv) {
9 | float y, u, v, r, g, b;
10 | y = texture2D(s_textureY, uv).r;
11 | u = texture2D(s_textureU, uv).r;
12 | v = texture2D(s_textureV, uv).r;
13 | u = u - 0.5;
14 | v = v - 0.5;
15 | r = y + 1.403 * v;
16 | g = y - 0.344 * u - 0.714 * v;
17 | b = y + 1.770 * u;
18 | return vec4(r, g, b, 1.0);
19 | }
20 | void main()
21 | {
22 | vec2 newTexCoord = v_texcoord;
23 | if(newTexCoord.x < 0.5)
24 | {
25 | newTexCoord.x = newTexCoord.x * 2.0;
26 | }
27 | else
28 | {
29 | newTexCoord.x = (newTexCoord.x - 0.5) * 2.0;
30 | }
31 |
32 | if(newTexCoord.y < 0.5)
33 | {
34 | newTexCoord.y = newTexCoord.y * 2.0;
35 | }
36 | else
37 | {
38 | newTexCoord.y = (newTexCoord.y - 0.5) * 2.0;
39 | }
40 |
41 | gl_FragColor = YuvToRgb(newTexCoord);
42 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_26.glsl:
--------------------------------------------------------------------------------
1 | //灵魂出窍
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform float u_offset;
9 | uniform vec2 texSize;
10 |
11 | vec4 YuvToRgb(vec2 uv) {
12 | float y, u, v, r, g, b;
13 | y = texture2D(s_textureY, uv).r;
14 | u = texture2D(s_textureU, uv).r;
15 | v = texture2D(s_textureV, uv).r;
16 | u = u - 0.5;
17 | v = v - 0.5;
18 | r = y + 1.403 * v;
19 | g = y - 0.344 * u - 0.714 * v;
20 | b = y + 1.770 * u;
21 | return vec4(r, g, b, 1.0);
22 | }
23 | const float MAX_ALPHA = 0.5;
24 | const float MAX_SCALE = 0.8;
25 | void main()
26 | {
27 | float alpha = MAX_ALPHA * (1.0 - u_offset);
28 | float scale = 1.0 + u_offset * MAX_SCALE;
29 |
30 | float scale_x = 0.5 + (v_texcoord.x - 0.5) / scale;
31 | float scale_y = 0.5 + (v_texcoord.y - 0.5) / scale;
32 |
33 | vec2 scaleCoord = vec2(scale_x, scale_y);
34 | vec4 maskColor = YuvToRgb(scaleCoord);
35 |
36 | vec4 originColor = YuvToRgb(v_texcoord);
37 |
38 | gl_FragColor = originColor * (1.0 - alpha) + maskColor * alpha;
39 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_27.glsl:
--------------------------------------------------------------------------------
1 | //随机马赛克
2 | #version 100
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform float u_time;
9 | uniform vec2 texSize;
10 |
11 | float rand(float n) {
12 | // fract(x) 返回x的小数部分数值
13 | return fract(sin(n) * 50000.0);
14 | }
15 |
16 | vec4 YuvToRgb(vec2 uv) {
17 | float y, u, v, r, g, b;
18 | y = texture2D(s_textureY, uv).r;
19 | u = texture2D(s_textureU, uv).r;
20 | v = texture2D(s_textureV, uv).r;
21 | u = u - 0.5;
22 | v = v - 0.5;
23 | r = y + 1.403 * v;
24 | g = y - 0.344 * u - 0.714 * v;
25 | b = y + 1.770 * u;
26 | return vec4(r, g, b, 1.0);
27 | }
28 |
29 | const int MAX_COUNT = 5;
30 | void main()
31 | {
32 | float MAX_LEN = (texSize.x < texSize.y ? texSize.y : texSize.x) / 10.0;
33 | vec2 points[MAX_COUNT];
34 | points[0].x = rand(u_time);
35 | points[0].y = rand(points[0].x);
36 | for(int i=1; i minX && uv.x < maxX && uv.y > minY && uv.y < maxY) {
36 | float relX = uv.x - realCenter.x;
37 | float relY = uv.y - realCenter.y;
38 | float ang = atan(relY, relX);
39 | float dist = sqrt(relX * relX + relY * relY);
40 | if (dist <= circleRadius) {
41 | float newRad = dist * ((maxZoom * dist / circleRadius) + minZoom);
42 | float newX = realCenter.x + cos(ang) * newRad;
43 | newX *= (texSize.y / texSize.x);
44 | float newY = realCenter.y + sin(ang) * newRad;
45 | gl_FragColor = YuvToRgb(vec2(newX, newY));
46 | } else {
47 | gl_FragColor = YuvToRgb(v_texcoord);
48 | }
49 | } else {
50 | gl_FragColor = YuvToRgb(v_texcoord);
51 | }
52 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_5.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | const float PI = 3.1415926535;
5 | varying vec2 v_texcoord;
6 | uniform lowp sampler2D s_textureY;
7 | uniform lowp sampler2D s_textureU;
8 | uniform lowp sampler2D s_textureV;
9 | void main() {
10 | float aperture = 158.0;
11 | float apertureHalf = 0.5 * aperture * (PI / 180.0);
12 | float maxFactor = sin(apertureHalf);
13 | vec2 uv;
14 | vec2 xy = 2.0 * v_texcoord.xy - 1.0;
15 | float d = length(xy);
16 | if (d < (2.0 - maxFactor)) {
17 | d = length(xy * maxFactor);
18 | float z = sqrt(1.0 - d * d);
19 | float r = atan(d, z) / PI;
20 | float phi = atan(xy.y, xy.x);
21 | uv.x = r * cos(phi) + 0.5;
22 | uv.y = r * sin(phi) + 0.5;
23 | } else {
24 | uv = v_texcoord.xy;
25 | }
26 | float y, u, v, r, g, b;
27 | y = texture2D(s_textureY, uv).r;
28 | u = texture2D(s_textureU, uv).r;
29 | v = texture2D(s_textureV, uv).r;
30 | u = u - 0.5;
31 | v = v - 0.5;
32 | r = y + 1.403 * v;
33 | g = y - 0.344 * u - 0.714 * v;
34 | b = y + 1.770 * u;
35 | gl_FragColor = vec4(r, g, b, 1.0);
36 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_6.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform vec2 texSize;
9 | void main() {
10 | float size = texSize.x / 75.0;
11 | float radius = size * 0.5;
12 | vec2 fragCoord = v_texcoord * texSize.xy;
13 | vec2 quadPos = floor(fragCoord.xy / size) * size;
14 | vec2 quad = quadPos/texSize.xy;
15 | vec2 quadCenter = (quadPos + size/2.0);
16 | float dist = length(quadCenter - fragCoord.xy);
17 | float y, u, v, r, g, b;
18 | y = texture2D(s_textureY, quad).r;
19 | u = texture2D(s_textureU, quad).r;
20 | v = texture2D(s_textureV, quad).r;
21 | u = u - 0.5;
22 | v = v - 0.5;
23 | r = y + 1.403 * v;
24 | g = y - 0.344 * u - 0.714 * v;
25 | b = y + 1.770 * u;
26 | if (dist > radius) {
27 | gl_FragColor = vec4(0.25);
28 | } else {
29 | gl_FragColor = vec4(r, g, b, 1.0);
30 | }
31 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_7.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform vec2 texSize;
9 | vec4 YuvToRgb(vec2 uv) {
10 | float y, u, v, r, g, b;
11 | y = texture2D(s_textureY, uv).r;
12 | u = texture2D(s_textureU, uv).r;
13 | v = texture2D(s_textureV, uv).r;
14 | u = u - 0.5;
15 | v = v - 0.5;
16 | r = y + 1.403 * v;
17 | g = y - 0.344 * u - 0.714 * v;
18 | b = y + 1.770 * u;
19 | return vec4(r, g, b, 1.0);
20 | }
21 | void main() {
22 | vec2 tileNum = vec2(40.0, 20.0);
23 | vec2 uv = v_texcoord;
24 | vec2 uv2 = floor(uv * tileNum) / tileNum;
25 | uv -= uv2;
26 | uv *= tileNum;
27 | vec3 color = YuvToRgb(uv2 + vec2(step(1.0 - uv.y, uv.x) / (2.0 * tileNum.x),
28 | step(uv.x, uv.y) / (2.0 * tileNum.y))).rgb;
29 | gl_FragColor = vec4(color, 1.0);
30 | }
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_8.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform vec2 texSize;
9 | void main() {
10 | vec2 pixelSize = vec2(texSize.x/100.0, texSize.y/100.0);
11 | vec2 uv = v_texcoord.xy;
12 | float dx = pixelSize.x*(1./texSize.x);
13 | float dy = pixelSize.y*(1./texSize.y);
14 | vec2 coord = vec2(dx*floor(uv.x/dx),
15 | dy*floor(uv.y/dy));
16 | float y, u, v, r, g, b;
17 | y = texture2D(s_textureY, coord).r;
18 | u = texture2D(s_textureU, coord).r;
19 | v = texture2D(s_textureV, coord).r;
20 | u = u - 0.5;
21 | v = v - 0.5;
22 | r = y + 1.403 * v;
23 | g = y - 0.344 * u - 0.714 * v;
24 | b = y + 1.770 * u;
25 | gl_FragColor = vec4(r, g, b, 1.0);
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/glcamera/src/main/assets/shaders/fshader_9.glsl:
--------------------------------------------------------------------------------
1 | #version 100
2 |
3 | precision highp float;
4 | varying vec2 v_texcoord;
5 | uniform lowp sampler2D s_textureY;
6 | uniform lowp sampler2D s_textureU;
7 | uniform lowp sampler2D s_textureV;
8 | uniform vec2 texSize;
9 | vec4 YuvToRgb(vec2 uv) {
10 | float y, u, v, r, g, b;
11 | y = texture2D(s_textureY, uv).r;
12 | u = texture2D(s_textureU, uv).r;
13 | v = texture2D(s_textureV, uv).r;
14 | u = u - 0.5;
15 | v = v - 0.5;
16 | r = y + 1.403 * v;
17 | g = y - 0.344 * u - 0.714 * v;
18 | b = y + 1.770 * u;
19 | return vec4(r, g, b, 1.0);
20 | }
21 | vec4 CrossStitching(vec2 uv) {
22 | float stitchSize = texSize.x / 35.0;
23 | int invert = 0;
24 | vec4 color = vec4(0.0);
25 | float size = stitchSize;
26 | vec2 cPos = uv * texSize.xy;
27 | vec2 tlPos = floor(cPos / vec2(size, size));
28 | tlPos *= size;
29 | int remX = int(mod(cPos.x, size));
30 | int remY = int(mod(cPos.y, size));
31 | if (remX == 0 && remY == 0)
32 | tlPos = cPos;
33 | vec2 blPos = tlPos;
34 | blPos.y += (size - 1.0);
35 | if ((remX == remY) || (((int(cPos.x) - int(blPos.x)) == (int(blPos.y) - int(cPos.y))))) {
36 | if (invert == 1)
37 | color = vec4(0.2, 0.15, 0.05, 1.0);
38 | else
39 | color = YuvToRgb(tlPos * vec2(1.0 / texSize.x, 1.0 / texSize.y)) * 1.4;
40 | } else {
41 | if (invert == 1)
42 | color = YuvToRgb(tlPos * vec2(1.0 / texSize.x, 1.0 / texSize.y)) * 1.4;
43 | else
44 | color = vec4(0.0, 0.0, 0.0, 1.0);
45 | }
46 | return color;
47 | }
48 | void main() {
49 | gl_FragColor = CrossStitching(v_texcoord);
50 | }
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | cmake_minimum_required(VERSION 3.4.1)
2 |
3 |
4 |
5 | include_directories(
6 | ${CMAKE_SOURCE_DIR}/util
7 | ${CMAKE_SOURCE_DIR}/render
8 | ${CMAKE_SOURCE_DIR}/glm
9 | ${CMAKE_SOURCE_DIR}/context
10 | ${CMAKE_SOURCE_DIR}/filter
11 | )
12 |
13 | file(GLOB src-files
14 | ${CMAKE_SOURCE_DIR}/JniImpl.cpp
15 | ${CMAKE_SOURCE_DIR}/render/*.cpp
16 | ${CMAKE_SOURCE_DIR}/context/RenderContext.cpp
17 | # ${CMAKE_SOURCE_DIR}/filter/*.cpp
18 | ${CMAKE_SOURCE_DIR}/util/*.cpp
19 | )
20 |
21 | add_library(
22 |
23 | opencamera-android
24 | # Sets the library as a shared library.
25 | SHARED
26 |
27 | # Provides a relative path to your source file(s).
28 | ${src-files}
29 | )
30 |
31 |
32 | find_library( # Sets the name of the path variable.
33 | log-lib
34 |
35 | # Specifies the name of the NDK library that
36 | # you want CMake to locate.
37 | log)
38 |
39 |
40 | target_link_libraries( # Specifies the target library.
41 | opencamera-android
42 |
43 | # Links the target library to the log library
44 | # included in the NDK.
45 | ${log-lib}
46 | EGL
47 | GLESv3
48 | android)
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/context/RenderContext.h:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Created by 公众号:字节流动 on 2021/3/16.
4 | * https://github.com/githubhaohao/OpenGLCamera2
5 | * 最新文章首发于公众号:字节流动,有疑问或者技术交流可以添加微信 Byte-Flow ,领取视频教程, 拉你进技术交流群
6 | *
7 | * */
8 |
9 | #ifndef OPENGLCAMERA2_BYTEFLOWRENDERCONTEXT_H
10 | #define OPENGLCAMERA2_BYTEFLOWRENDERCONTEXT_H
11 |
12 |
13 | #include
14 | #include
15 | #include
16 | #include
17 | //#include "GLExampleBase.h"
18 |
19 | #define GL_RENDER_TYPE 0
20 | #define CL_RENDER_TYPE 1
21 |
22 | #define PARAM_TYPE_SET_SHADER_INDEX 201
23 | #define PARAM_TYPE_SET_EXAMPLE 202
24 |
25 | using namespace glm;
26 |
27 | class ByteFlowRenderContext
28 | {
29 | public:
30 | ByteFlowRenderContext(int renderType);
31 |
32 | ~ByteFlowRenderContext();
33 |
34 | static void CreateRenderContext(JNIEnv *env, jobject instance, jint renderType);
35 |
36 | static void StoreRenderContext(JNIEnv *env, jobject instance, ByteFlowRenderContext *pContext);
37 |
38 | static void DeleteRenderContext(JNIEnv *env, jobject instance);
39 |
40 | static ByteFlowRenderContext* GetRenderContext(JNIEnv *env, jobject instance);
41 |
42 | int Init(int initType);
43 |
44 | int UnInit();
45 |
46 | void UpdateFrame(int format, uint8_t *pBuffer, int width, int height);
47 |
48 | void LoadLutImageData(int index, int format, int width, int height, uint8_t *pData);
49 |
50 | void LoadFragShaderScript(int shaderIndex, char *pShaderStr, int strLen);
51 |
52 | void SetTransformMatrix(float translateX, float translateY, float scaleX, float scaleY, int degree, int mirror);
53 |
54 | void SetParamsInt(int paramType, int param);
55 |
56 | int GetParamsInt(int paramType);
57 |
58 | void OnSurfaceCreated();
59 |
60 | void OnSurfaceChanged(int width, int height);
61 |
62 | void OnDrawFrame();
63 |
64 | private:
65 | void CreateExample(int exampleIndex);
66 |
67 | static jfieldID s_ContextHandle;
68 |
69 | ByteFlowRender *m_pByteFlowRender;
70 |
71 | // GLExampleBase *m_pCurGlFilter;
72 | // GLExampleBase *m_pBeforeGlFilter;
73 | volatile bool m_bIsExampleMode;
74 |
75 | vec2 m_ViewPort;
76 | TransformMatrix m_TransformMatrix;
77 | };
78 |
79 |
80 | #endif //OPENGLCAMERA2_BYTEFLOWRENDERCONTEXT_H
81 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | set(NAME glm_dummy)
2 |
3 | file(GLOB ROOT_SOURCE *.cpp)
4 | file(GLOB ROOT_INLINE *.inl)
5 | file(GLOB ROOT_HEADER *.hpp)
6 | file(GLOB ROOT_TEXT ../*.txt)
7 | file(GLOB ROOT_NAT ../util/glm.natvis)
8 |
9 | file(GLOB_RECURSE CORE_SOURCE ./detail/*.cpp)
10 | file(GLOB_RECURSE CORE_INLINE ./detail/*.inl)
11 | file(GLOB_RECURSE CORE_HEADER ./detail/*.hpp)
12 |
13 | file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp)
14 | file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl)
15 | file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp)
16 |
17 | file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp)
18 | file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl)
19 | file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp)
20 |
21 | source_group("Text Files" FILES ${ROOT_TEXT})
22 | source_group("Core Files" FILES ${CORE_SOURCE})
23 | source_group("Core Files" FILES ${CORE_INLINE})
24 | source_group("Core Files" FILES ${CORE_HEADER})
25 | source_group("GTC Files" FILES ${GTC_SOURCE})
26 | source_group("GTC Files" FILES ${GTC_INLINE})
27 | source_group("GTC Files" FILES ${GTC_HEADER})
28 | source_group("GTX Files" FILES ${GTX_SOURCE})
29 | source_group("GTX Files" FILES ${GTX_INLINE})
30 | source_group("GTX Files" FILES ${GTX_HEADER})
31 |
32 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..)
33 |
34 | if(GLM_TEST_ENABLE)
35 | add_executable(${NAME} ${ROOT_TEXT} ${ROOT_NAT}
36 | ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER}
37 | ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER}
38 | ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER}
39 | ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER})
40 | endif(GLM_TEST_ENABLE)
41 |
42 | #add_library(glm STATIC glm.cpp)
43 | #add_library(glm_shared SHARED glm.cpp)
44 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/common.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/common.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_common.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/_fixes.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/_fixes.hpp
29 | /// @date 2011-02-21 / 2011-11-22
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #include
34 |
35 | //! Workaround for compatibility with other libraries
36 | #ifdef max
37 | #undef max
38 | #endif
39 |
40 | //! Workaround for compatibility with other libraries
41 | #ifdef min
42 | #undef min
43 | #endif
44 |
45 | //! Workaround for Android
46 | #ifdef isnan
47 | #undef isnan
48 | #endif
49 |
50 | //! Workaround for Android
51 | #ifdef isinf
52 | #undef isinf
53 | #endif
54 |
55 | //! Workaround for Chrone Native Client
56 | #ifdef log2
57 | #undef log2
58 | #endif
59 |
60 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_exponential.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_exponential.inl
25 | /// @date 2011-06-15 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_geometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_geometric.hpp
25 | /// @date 2009-05-08 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #pragma once
30 |
31 | #include "setup.hpp"
32 |
33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
34 | # error "SSE2 instructions not supported or enabled"
35 | #else
36 |
37 | #include "intrinsic_common.hpp"
38 |
39 | namespace glm{
40 | namespace detail
41 | {
42 | //length
43 | __m128 sse_len_ps(__m128 x);
44 |
45 | //distance
46 | __m128 sse_dst_ps(__m128 p0, __m128 p1);
47 |
48 | //dot
49 | __m128 sse_dot_ps(__m128 v1, __m128 v2);
50 |
51 | // SSE1
52 | __m128 sse_dot_ss(__m128 v1, __m128 v2);
53 |
54 | //cross
55 | __m128 sse_xpd_ps(__m128 v1, __m128 v2);
56 |
57 | //normalize
58 | __m128 sse_nrm_ps(__m128 v);
59 |
60 | //faceforward
61 | __m128 sse_ffd_ps(__m128 N, __m128 I, __m128 Nref);
62 |
63 | //reflect
64 | __m128 sse_rfe_ps(__m128 I, __m128 N);
65 |
66 | //refract
67 | __m128 sse_rfa_ps(__m128 I, __m128 N, __m128 eta);
68 |
69 | }//namespace detail
70 | }//namespace glm
71 |
72 | #include "intrinsic_geometric.inl"
73 |
74 | #endif//GLM_ARCH
75 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_integer.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_integer.hpp
25 | /// @date 2009-05-11 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #pragma once
30 |
31 | #include "glm/glm.hpp"
32 |
33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
34 | # error "SSE2 instructions not supported or enabled"
35 | #else
36 |
37 | namespace glm{
38 | namespace detail
39 | {
40 | __m128i _mm_bit_interleave_si128(__m128i x);
41 | __m128i _mm_bit_interleave_si128(__m128i x, __m128i y);
42 |
43 | }//namespace detail
44 | }//namespace glm
45 |
46 | #include "intrinsic_integer.inl"
47 |
48 | #endif//GLM_ARCH
49 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_matrix.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_common.hpp
25 | /// @date 2009-06-05 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #pragma once
30 |
31 | #include "setup.hpp"
32 |
33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
34 | # error "SSE2 instructions not supported or enabled"
35 | #else
36 |
37 | #include "intrinsic_geometric.hpp"
38 |
39 | namespace glm{
40 | namespace detail
41 | {
42 | void sse_add_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);
43 |
44 | void sse_sub_ps(__m128 in1[4], __m128 in2[4], __m128 out[4]);
45 |
46 | __m128 sse_mul_ps(__m128 m[4], __m128 v);
47 |
48 | __m128 sse_mul_ps(__m128 v, __m128 m[4]);
49 |
50 | void sse_mul_ps(__m128 const in1[4], __m128 const in2[4], __m128 out[4]);
51 |
52 | void sse_transpose_ps(__m128 const in[4], __m128 out[4]);
53 |
54 | void sse_inverse_ps(__m128 const in[4], __m128 out[4]);
55 |
56 | void sse_rotate_ps(__m128 const in[4], float Angle, float const v[3], __m128 out[4]);
57 |
58 | __m128 sse_det_ps(__m128 const m[4]);
59 |
60 | __m128 sse_slow_det_ps(__m128 const m[4]);
61 |
62 | }//namespace detail
63 | }//namespace glm
64 |
65 | #include "intrinsic_matrix.inl"
66 |
67 | #endif//GLM_ARCH
68 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_trigonometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_trigonometric.hpp
25 | /// @date 2009-06-09 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #pragma once
30 |
31 | #include "setup.hpp"
32 |
33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
34 | # error "SSE2 instructions not supported or enabled"
35 | #else
36 |
37 | namespace glm{
38 | namespace detail
39 | {
40 |
41 | }//namespace detail
42 | }//namespace glm
43 |
44 | #include "intrinsic_trigonometric.inl"
45 |
46 | #endif//GLM_ARCH
47 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_trigonometric.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_trigonometric.inl
25 | /// @date 2011-06-15 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/intrinsic_vector_relational.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21 | /// THE SOFTWARE.
22 | ///
23 | /// @ref core
24 | /// @file glm/detail/intrinsic_vector_relational.hpp
25 | /// @date 2009-06-09 / 2011-06-15
26 | /// @author Christophe Riccio
27 | ///////////////////////////////////////////////////////////////////////////////////
28 |
29 | #pragma once
30 |
31 | #include "setup.hpp"
32 |
33 | #if(!(GLM_ARCH & GLM_ARCH_SSE2))
34 | # error "SSE2 instructions not supported or enabled"
35 | #else
36 |
37 | namespace glm{
38 | namespace detail
39 | {
40 |
41 | }//namespace detail
42 | }//namespace glm
43 |
44 | #include "intrinsic_vector_relational.inl"
45 |
46 | #endif//GLM_ARCH
47 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/precision.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/precision.hpp
29 | /// @date 2013-04-01 / 2013-04-01
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | namespace glm
36 | {
37 | enum precision
38 | {
39 | highp,
40 | mediump,
41 | lowp,
42 | defaultp = highp
43 | };
44 | }//namespace glm
45 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/type_half.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/type_half.hpp
29 | /// @date 2008-08-17 / 2011-09-20
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "setup.hpp"
36 |
37 | namespace glm{
38 | namespace detail
39 | {
40 | typedef short hdata;
41 |
42 | GLM_FUNC_DECL float toFloat32(hdata value);
43 | GLM_FUNC_DECL hdata toFloat16(float const & value);
44 |
45 | }//namespace detail
46 | }//namespace glm
47 |
48 | #include "type_half.inl"
49 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/type_mat.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/type_mat.inl
29 | /// @date 2011-06-15 / 2011-06-15
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/type_vec.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/type_vec.inl
29 | /// @date 2011-06-15 / 2011-06-15
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/type_vec4_avx.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/type_tvec4_avx.inl
29 | /// @date 2014-12-01 / 2014-12-01
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm{
34 | namespace detail
35 | {
36 |
37 | }//namespace detail
38 |
39 |
40 |
41 | }//namespace glm
42 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/detail/type_vec4_avx2.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/detail/type_tvec4_avx2.inl
29 | /// @date 2014-12-01 / 2014-12-01
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm{
34 | namespace detail
35 | {
36 |
37 | }//namespace detail
38 |
39 |
40 |
41 | }//namespace glm
42 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/exponential.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/exponential.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_exponential.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/geometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/geometric.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_geometric.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtc/type_precision.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtc_swizzle
28 | /// @file glm/gtc/swizzle.inl
29 | /// @date 2009-06-14 / 2011-06-15
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtc/vec1.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtc_vec1
28 | /// @file glm/gtc/vec1.inl
29 | /// @date 2013-03-16 / 2013-03-16
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/extend.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_extend
28 | /// @file glm/gtx/extend.hpp
29 | /// @date 2006-01-07 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | ///
34 | /// @defgroup gtx_extend GLM_GTX_extend
35 | /// @ingroup gtx
36 | ///
37 | /// @brief Extend a position from a source to a position at a defined length.
38 | ///
39 | /// need to be included to use these functionalities.
40 | ///////////////////////////////////////////////////////////////////////////////////
41 |
42 | #pragma once
43 |
44 | // Dependency:
45 | #include "../glm.hpp"
46 |
47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
48 | # pragma message("GLM: GLM_GTX_extend extension included")
49 | #endif
50 |
51 | namespace glm
52 | {
53 | /// @addtogroup gtx_extend
54 | /// @{
55 |
56 | /// Extends of Length the Origin position using the (Source - Origin) direction.
57 | /// @see gtx_extend
58 | template
59 | GLM_FUNC_DECL genType extend(
60 | genType const & Origin,
61 | genType const & Source,
62 | typename genType::value_type const Length);
63 |
64 | /// @}
65 | }//namespace glm
66 |
67 | #include "extend.inl"
68 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/extend.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_extend
28 | /// @file glm/gtx/extend.inl
29 | /// @date 2006-01-07 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER genType extend
37 | (
38 | genType const & Origin,
39 | genType const & Source,
40 | genType const & Distance
41 | )
42 | {
43 | return Origin + (Source - Origin) * Distance;
44 | }
45 |
46 | template
47 | GLM_FUNC_QUALIFIER tvec2 extend
48 | (
49 | tvec2 const & Origin,
50 | tvec2 const & Source,
51 | T const & Distance
52 | )
53 | {
54 | return Origin + (Source - Origin) * Distance;
55 | }
56 |
57 | template
58 | GLM_FUNC_QUALIFIER tvec3 extend
59 | (
60 | tvec3 const & Origin,
61 | tvec3 const & Source,
62 | T const & Distance
63 | )
64 | {
65 | return Origin + (Source - Origin) * Distance;
66 | }
67 |
68 | template
69 | GLM_FUNC_QUALIFIER tvec4 extend
70 | (
71 | tvec4 const & Origin,
72 | tvec4 const & Source,
73 | T const & Distance
74 | )
75 | {
76 | return Origin + (Source - Origin) * Distance;
77 | }
78 | }//namespace glm
79 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/gradient_paint.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_gradient_paint
28 | /// @file glm/gtx/gradient_paint.inl
29 | /// @date 2009-03-06 / 2013-04-09
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER T radialGradient
37 | (
38 | tvec2 const & Center,
39 | T const & Radius,
40 | tvec2 const & Focal,
41 | tvec2 const & Position
42 | )
43 | {
44 | tvec2 F = Focal - Center;
45 | tvec2 D = Position - Focal;
46 | T Radius2 = pow2(Radius);
47 | T Fx2 = pow2(F.x);
48 | T Fy2 = pow2(F.y);
49 |
50 | T Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x));
51 | T Denominator = Radius2 - (Fx2 + Fy2);
52 | return Numerator / Denominator;
53 | }
54 |
55 | template
56 | GLM_FUNC_QUALIFIER T linearGradient
57 | (
58 | tvec2 const & Point0,
59 | tvec2 const & Point1,
60 | tvec2 const & Position
61 | )
62 | {
63 | tvec2 Dist = Point1 - Point0;
64 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist);
65 | }
66 | }//namespace glm
67 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/handed_coordinate_space.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_handed_coordinate_space
28 | /// @file glm/gtx/handed_coordinate_space.inl
29 | /// @date 2005-12-21 / 2009-02-19
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER bool rightHanded
37 | (
38 | tvec3 const & tangent,
39 | tvec3 const & binormal,
40 | tvec3 const & normal
41 | )
42 | {
43 | return dot(cross(normal, tangent), binormal) > T(0);
44 | }
45 |
46 | template
47 | GLM_FUNC_QUALIFIER bool leftHanded
48 | (
49 | tvec3 const & tangent,
50 | tvec3 const & binormal,
51 | tvec3 const & normal
52 | )
53 | {
54 | return dot(cross(normal, tangent), binormal) < T(0);
55 | }
56 | }//namespace glm
57 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/log_base.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_log_base
28 | /// @file glm/gtx/log_base.hpp
29 | /// @date 2008-10-24 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | ///
34 | /// @defgroup gtx_log_base GLM_GTX_log_base
35 | /// @ingroup gtx
36 | ///
37 | /// @brief Logarithm for any base. base can be a vector or a scalar.
38 | ///
39 | /// need to be included to use these functionalities.
40 | ///////////////////////////////////////////////////////////////////////////////////
41 |
42 | #pragma once
43 |
44 | // Dependency:
45 | #include "../glm.hpp"
46 |
47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
48 | # pragma message("GLM: GLM_GTX_log_base extension included")
49 | #endif
50 |
51 | namespace glm
52 | {
53 | /// @addtogroup gtx_log_base
54 | /// @{
55 |
56 | //! Logarithm for any base.
57 | //! From GLM_GTX_log_base.
58 | template
59 | GLM_FUNC_DECL genType log(
60 | genType x,
61 | genType base);
62 |
63 | //! Logarithm for any base.
64 | //! From GLM_GTX_log_base.
65 | template class vecType>
66 | GLM_FUNC_DECL vecType sign(
67 | vecType const & x,
68 | vecType const & base);
69 |
70 | /// @}
71 | }//namespace glm
72 |
73 | #include "log_base.inl"
74 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/log_base.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_log_base
28 | /// @file glm/gtx/log_base.inl
29 | /// @date 2008-10-24 / 2014-11-25
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER genType log(genType const & x, genType const & base)
37 | {
38 | assert(x != genType(0));
39 | return glm::log(x) / glm::log(base);
40 | }
41 |
42 | template class vecType>
43 | GLM_FUNC_QUALIFIER vecType log(vecType const & x, vecType const & base)
44 | {
45 | return glm::log(x) / glm::log(base);
46 | }
47 | }//namespace glm
48 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/matrix_cross_product.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_matrix_cross_product
28 | /// @file glm/gtx/matrix_cross_product.inl
29 | /// @date 2005-12-21 / 2005-12-21
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER tmat3x3 matrixCross3
37 | (
38 | tvec3 const & x
39 | )
40 | {
41 | tmat3x3 Result(T(0));
42 | Result[0][1] = x.z;
43 | Result[1][0] = -x.z;
44 | Result[0][2] = -x.y;
45 | Result[2][0] = x.y;
46 | Result[1][2] = x.x;
47 | Result[2][1] = -x.x;
48 | return Result;
49 | }
50 |
51 | template
52 | GLM_FUNC_QUALIFIER tmat4x4 matrixCross4
53 | (
54 | tvec3 const & x
55 | )
56 | {
57 | tmat4x4 Result(T(0));
58 | Result[0][1] = x.z;
59 | Result[1][0] = -x.z;
60 | Result[0][2] = -x.y;
61 | Result[2][0] = x.y;
62 | Result[1][2] = x.x;
63 | Result[2][1] = -x.x;
64 | return Result;
65 | }
66 |
67 | }//namespace glm
68 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/mixed_product.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_mixed_product
28 | /// @file glm/gtx/mixed_product.hpp
29 | /// @date 2007-04-03 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | ///
34 | /// @defgroup gtx_mixed_product GLM_GTX_mixed_producte
35 | /// @ingroup gtx
36 | ///
37 | /// @brief Mixed product of 3 vectors.
38 | ///
39 | /// need to be included to use these functionalities.
40 | ///////////////////////////////////////////////////////////////////////////////////
41 |
42 | #pragma once
43 |
44 | // Dependency:
45 | #include "../glm.hpp"
46 |
47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
48 | # pragma message("GLM: GLM_GTX_mixed_product extension included")
49 | #endif
50 |
51 | namespace glm
52 | {
53 | /// @addtogroup gtx_mixed_product
54 | /// @{
55 |
56 | /// @brief Mixed product of 3 vectors (from GLM_GTX_mixed_product extension)
57 | template
58 | GLM_FUNC_DECL T mixedProduct(
59 | tvec3 const & v1,
60 | tvec3 const & v2,
61 | tvec3 const & v3);
62 |
63 | /// @}
64 | }// namespace glm
65 |
66 | #include "mixed_product.inl"
67 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/mixed_product.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_mixed_product
28 | /// @file glm/gtx/mixed_product.inl
29 | /// @date 2007-04-03 / 2008-09-17
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER T mixedProduct
37 | (
38 | tvec3 const & v1,
39 | tvec3 const & v2,
40 | tvec3 const & v3
41 | )
42 | {
43 | return dot(cross(v1, v2), v3);
44 | }
45 | }//namespace glm
46 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/normal.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_normal
28 | /// @file glm/gtx/normal.hpp
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | /// @see gtx_extented_min_max (dependence)
34 | ///
35 | /// @defgroup gtx_normal GLM_GTX_normal
36 | /// @ingroup gtx
37 | ///
38 | /// @brief Compute the normal of a triangle.
39 | ///
40 | /// need to be included to use these functionalities.
41 | ///////////////////////////////////////////////////////////////////////////////////
42 |
43 | #pragma once
44 |
45 | // Dependency:
46 | #include "../glm.hpp"
47 |
48 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
49 | # pragma message("GLM: GLM_GTX_normal extension included")
50 | #endif
51 |
52 | namespace glm
53 | {
54 | /// @addtogroup gtx_normal
55 | /// @{
56 |
57 | //! Computes triangle normal from triangle points.
58 | //! From GLM_GTX_normal extension.
59 | template
60 | GLM_FUNC_DECL tvec3 triangleNormal(
61 | tvec3 const & p1,
62 | tvec3 const & p2,
63 | tvec3 const & p3);
64 |
65 | /// @}
66 | }//namespace glm
67 |
68 | #include "normal.inl"
69 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/normal.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_normal
28 | /// @file glm/gtx/normal.inl
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER tvec3 triangleNormal
37 | (
38 | tvec3 const & p1,
39 | tvec3 const & p2,
40 | tvec3 const & p3
41 | )
42 | {
43 | return normalize(cross(p1 - p2, p1 - p3));
44 | }
45 | }//namespace glm
46 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/normalize_dot.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_normalize_dot
28 | /// @file glm/gtx/normalize_dot.inl
29 | /// @date 2007-09-28 / 2008-10-07
30 | /// @author Christophe Riccio
31 | //////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template class vecType>
36 | GLM_FUNC_QUALIFIER T normalizeDot(vecType const & x, vecType const & y)
37 | {
38 | return glm::dot(x, y) * glm::inversesqrt(glm::dot(x, x) * glm::dot(y, y));
39 | }
40 |
41 | template class vecType>
42 | GLM_FUNC_QUALIFIER T fastNormalizeDot(vecType const & x, vecType const & y)
43 | {
44 | return glm::dot(x, y) * glm::fastInverseSqrt(glm::dot(x, x) * glm::dot(y, y));
45 | }
46 | }//namespace glm
47 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/number_precision.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_number_precision
28 | /// @file glm/gtx/number_precision.inl
29 | /// @date 2007-05-10 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/optimum_pow.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_optimum_pow
28 | /// @file glm/gtx/optimum_pow.inl
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER genType pow2(genType const & x)
37 | {
38 | return x * x;
39 | }
40 |
41 | template
42 | GLM_FUNC_QUALIFIER genType pow3(genType const & x)
43 | {
44 | return x * x * x;
45 | }
46 |
47 | template
48 | GLM_FUNC_QUALIFIER genType pow4(genType const & x)
49 | {
50 | return (x * x) * (x * x);
51 | }
52 | }//namespace glm
53 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/orthonormalize.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_orthonormalize
28 | /// @file glm/gtx/orthonormalize.inl
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER tmat3x3 orthonormalize(tmat3x3 const & m)
37 | {
38 | tmat3x3 r = m;
39 |
40 | r[0] = normalize(r[0]);
41 |
42 | T d0 = dot(r[0], r[1]);
43 | r[1] -= r[0] * d0;
44 | r[1] = normalize(r[1]);
45 |
46 | T d1 = dot(r[1], r[2]);
47 | d0 = dot(r[0], r[2]);
48 | r[2] -= r[0] * d0 + r[1] * d1;
49 | r[2] = normalize(r[2]);
50 |
51 | return r;
52 | }
53 |
54 | template
55 | GLM_FUNC_QUALIFIER tvec3 orthonormalize(tvec3 const & x, tvec3 const & y)
56 | {
57 | return normalize(x - y * dot(y, x));
58 | }
59 | }//namespace glm
60 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/perpendicular.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_perpendicular
28 | /// @file glm/gtx/perpendicular.hpp
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | /// @see gtx_projection (dependence)
34 | ///
35 | /// @defgroup gtx_perpendicular GLM_GTX_perpendicular
36 | /// @ingroup gtx
37 | ///
38 | /// @brief Perpendicular of a vector from other one
39 | ///
40 | /// need to be included to use these functionalities.
41 | ///////////////////////////////////////////////////////////////////////////////////
42 |
43 | #pragma once
44 |
45 | // Dependency:
46 | #include "../glm.hpp"
47 | #include "../gtx/projection.hpp"
48 |
49 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
50 | # pragma message("GLM: GLM_GTX_perpendicular extension included")
51 | #endif
52 |
53 | namespace glm
54 | {
55 | /// @addtogroup gtx_perpendicular
56 | /// @{
57 |
58 | //! Projects x a perpendicular axis of Normal.
59 | //! From GLM_GTX_perpendicular extension.
60 | template
61 | GLM_FUNC_DECL vecType perp(
62 | vecType const & x,
63 | vecType const & Normal);
64 |
65 | /// @}
66 | }//namespace glm
67 |
68 | #include "perpendicular.inl"
69 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/perpendicular.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_perpendicular
28 | /// @file glm/gtx/perpendicular.inl
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER vecType perp
37 | (
38 | vecType const & x,
39 | vecType const & Normal
40 | )
41 | {
42 | return x - proj(x, Normal);
43 | }
44 | }//namespace glm
45 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/polar_coordinates.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_polar_coordinates
28 | /// @file glm/gtx/polar_coordinates.inl
29 | /// @date 2007-03-06 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER tvec3 polar
37 | (
38 | tvec3 const & euclidean
39 | )
40 | {
41 | T const Length(length(euclidean));
42 | tvec3 const tmp(euclidean / Length);
43 | T const xz_dist(sqrt(tmp.x * tmp.x + tmp.z * tmp.z));
44 |
45 | return tvec3(
46 | atan(xz_dist, tmp.y), // latitude
47 | atan(tmp.x, tmp.z), // longitude
48 | xz_dist); // xz distance
49 | }
50 |
51 | template
52 | GLM_FUNC_QUALIFIER tvec3 euclidean
53 | (
54 | tvec2 const & polar
55 | )
56 | {
57 | T const latitude(polar.x);
58 | T const longitude(polar.y);
59 |
60 | return tvec3(
61 | cos(latitude) * sin(longitude),
62 | sin(latitude),
63 | cos(latitude) * cos(longitude));
64 | }
65 |
66 | }//namespace glm
67 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/projection.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_projection
28 | /// @file glm/gtx/projection.hpp
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | ///
34 | /// @defgroup gtx_projection GLM_GTX_projection
35 | /// @ingroup gtx
36 | ///
37 | /// @brief Projection of a vector to other one
38 | ///
39 | /// need to be included to use these functionalities.
40 | ///////////////////////////////////////////////////////////////////////////////////
41 |
42 | #pragma once
43 |
44 | // Dependency:
45 | #include "../geometric.hpp"
46 |
47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
48 | # pragma message("GLM: GLM_GTX_projection extension included")
49 | #endif
50 |
51 | namespace glm
52 | {
53 | /// @addtogroup gtx_projection
54 | /// @{
55 |
56 | /// Projects x on Normal.
57 | ///
58 | /// @see gtx_projection
59 | template
60 | GLM_FUNC_DECL vecType proj(vecType const & x, vecType const & Normal);
61 |
62 | /// @}
63 | }//namespace glm
64 |
65 | #include "projection.inl"
66 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/projection.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_projection
28 | /// @file glm/gtx/projection.inl
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER vecType proj(vecType const & x, vecType const & Normal)
37 | {
38 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal;
39 | }
40 | }//namespace glm
41 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/raw_data.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_raw_data
28 | /// @file glm/gtx/raw_data.inl
29 | /// @date 2008-11-19 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/scalar_relational.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_scalar_relational
28 | /// @file glm/gtx/scalar_relational.hpp
29 | /// @date 2013-02-04 / 2013-02-04
30 | /// @author Christophe Riccio
31 | ///
32 | /// @see core (dependence)
33 | ///
34 | /// @defgroup gtx_scalar_relational GLM_GTX_scalar_relational
35 | /// @ingroup gtx
36 | ///
37 | /// @brief Extend a position from a source to a position at a defined length.
38 | ///
39 | /// need to be included to use these functionalities.
40 | ///////////////////////////////////////////////////////////////////////////////////
41 |
42 | #pragma once
43 |
44 | // Dependency:
45 | #include "../glm.hpp"
46 |
47 | #if(defined(GLM_MESSAGES) && !defined(GLM_EXT_INCLUDED))
48 | # pragma message("GLM: GLM_GTX_extend extension included")
49 | #endif
50 |
51 | namespace glm
52 | {
53 | /// @addtogroup gtx_scalar_relational
54 | /// @{
55 |
56 |
57 |
58 | /// @}
59 | }//namespace glm
60 |
61 | #include "scalar_relational.inl"
62 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/std_based_type.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_std_based_type
28 | /// @file glm/gtx/std_based_type.inl
29 | /// @date 2008-06-08 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/transform.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtx_transform
28 | /// @file glm/gtx/transform.inl
29 | /// @date 2005-12-21 / 2011-06-07
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 | template
36 | GLM_FUNC_QUALIFIER tmat4x4 translate(
37 | tvec3 const & v)
38 | {
39 | return translate(
40 | tmat4x4(1.0f), v);
41 | }
42 |
43 | template
44 | GLM_FUNC_QUALIFIER tmat4x4 rotate(
45 | T angle,
46 | tvec3 const & v)
47 | {
48 | return rotate(
49 | tmat4x4(1), angle, v);
50 | }
51 |
52 | template
53 | GLM_FUNC_QUALIFIER tmat4x4 scale(
54 | tvec3 const & v)
55 | {
56 | return scale(
57 | tmat4x4(1.0f), v);
58 | }
59 |
60 | }//namespace glm
61 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/gtx/type_aligned.inl:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref gtc_type_aligned
28 | /// @file glm/gtc/type_aligned.inl
29 | /// @date 2014-11-23 / 2014-11-23
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | namespace glm
34 | {
35 |
36 | }
37 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/integer.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/integer.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_integer.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/matrix.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/matrix.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_matrix.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/packing.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/packing.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_packing.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/trigonometric.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/trigonometric.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_trigonometric.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/vec2.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/vec2.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/type_vec2.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/vec3.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/vec3.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/type_vec3.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/vec4.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/vec4.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/type_vec4.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/glm/vector_relational.hpp:
--------------------------------------------------------------------------------
1 | ///////////////////////////////////////////////////////////////////////////////////
2 | /// OpenGL Mathematics (glm.g-truc.net)
3 | ///
4 | /// Copyright (c) 2005 - 2015 G-Truc Creation (www.g-truc.net)
5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy
6 | /// of this software and associated documentation files (the "Software"), to deal
7 | /// in the Software without restriction, including without limitation the rights
8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | /// copies of the Software, and to permit persons to whom the Software is
10 | /// furnished to do so, subject to the following conditions:
11 | ///
12 | /// The above copyright notice and this permission notice shall be included in
13 | /// all copies or substantial portions of the Software.
14 | ///
15 | /// Restrictions:
16 | /// By making use of the Software for military purposes, you choose to make
17 | /// a Bunny unhappy.
18 | ///
19 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25 | /// THE SOFTWARE.
26 | ///
27 | /// @ref core
28 | /// @file glm/vector_relational.hpp
29 | /// @date 2013-12-24 / 2013-12-24
30 | /// @author Christophe Riccio
31 | ///////////////////////////////////////////////////////////////////////////////////
32 |
33 | #pragma once
34 |
35 | #include "detail/func_vector_relational.hpp"
36 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/render/ByteFlowRender.h:
--------------------------------------------------------------------------------
1 | /**
2 | *
3 | * Created by 公众号:字节流动 on 2021/3/16.
4 | * https://github.com/githubhaohao/OpenGLCamera2
5 | * 最新文章首发于公众号:字节流动,有疑问或者技术交流可以添加微信 Byte-Flow ,领取视频教程, 拉你进技术交流群
6 | *
7 | * */
8 |
9 | #ifndef OPENGLCAMERA2_BYTEFLOWRENDER_H
10 | #define OPENGLCAMERA2_BYTEFLOWRENDER_H
11 |
12 | #include
13 | #include "ByteFlowDef.h"
14 | #include "ImageDef.h"
15 |
16 | class ByteFlowRender
17 | {
18 | public:
19 | ByteFlowRender():
20 | m_ViewportHeight(0),
21 | m_ViewportWidth(0),
22 | m_IsProgramChanged(false),
23 | m_IsTextureDirty(false)
24 | {
25 | memset(&m_RenderFrame, 0, sizeof(NativeImage));
26 | }
27 |
28 | virtual ~ByteFlowRender()
29 | {
30 |
31 | }
32 |
33 | virtual int Init(int initType) = 0;
34 | virtual int UnInit() = 0;
35 |
36 | virtual void UpdateFrame(NativeImage *pImage) = 0;
37 |
38 | virtual void LoadFilterImageData(int index, NativeImage *pImage) = 0;
39 |
40 | virtual void LoadFragShaderScript(int shaderIndex, char *pShaderStr, int strLen) = 0;
41 |
42 | virtual void SetTransformMatrix(float translateX, float translateY, float scaleX, float scaleY, int degree, int mirror) = 0;
43 |
44 | virtual void SetShaderIndex(int shaderIndex) = 0;
45 |
46 | virtual int GetShaderIndex() = 0;
47 |
48 | virtual bool CreateTextures() = 0;
49 |
50 | virtual bool UpdateTextures() = 0;
51 |
52 | virtual bool DeleteTextures() = 0;
53 |
54 | virtual void OnSurfaceCreated() = 0;
55 |
56 | virtual void OnSurfaceChanged(int width, int height) = 0;
57 |
58 | virtual void OnDrawFrame() = 0;
59 |
60 |
61 | protected:
62 | volatile bool m_IsProgramChanged;
63 | size_t m_ViewportWidth;
64 | size_t m_ViewportHeight;
65 | NativeImage m_RenderFrame;
66 | TransformMatrix m_TransformMatrix;
67 |
68 | volatile bool m_IsTextureDirty;
69 | };
70 |
71 | #endif //OPENGLCAMERA2_BYTEFLOWRENDER_H
72 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/util/LogUtil.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteFlow on 2019/1/14.
3 | //
4 |
5 | #ifndef BYTEFLOW_LOGUTIL_H
6 | #define BYTEFLOW_LOGUTIL_H
7 |
8 | #include
9 | #include
10 |
11 | #define LOG_TAG "ByteFlow"
12 |
13 | #define LOGCATE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)
14 | #define LOGCATV(...) __android_log_print(ANDROID_LOG_VERBOSE,LOG_TAG,__VA_ARGS__)
15 | #define LOGCATD(...) __android_log_print(ANDROID_LOG_DEBUG,LOG_TAG,__VA_ARGS__)
16 | #define LOGCATI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
17 |
18 | #define FUN_BEGIN_TIME(FUN) {\
19 | LOGCATE("%s:%s func start", __FILE__, FUN); \
20 | long long t0 = GetSysCurrentTime();
21 |
22 | #define FUN_END_TIME(FUN) \
23 | long long t1 = GetSysCurrentTime(); \
24 | LOGCATE("%s:%s func cost time %ldms", __FILE__, FUN, (long)(t1-t0));}
25 |
26 | #define BEGIN_TIME(FUN) {\
27 | LOGCATE("%s func start", FUN); \
28 | long long t0 = GetSysCurrentTime();
29 |
30 | #define END_TIME(FUN) \
31 | long long t1 = GetSysCurrentTime(); \
32 | LOGCATE("%s func cost time %ldms", FUN, (long)(t1-t0));}
33 |
34 | static long long GetSysCurrentTime()
35 | {
36 | struct timeval time;
37 | gettimeofday(&time, NULL);
38 | long long curTime = ((long long)(time.tv_sec))*1000+time.tv_usec/1000;
39 | return curTime;
40 | }
41 |
42 | #define GO_CHECK_GL_ERROR(...) LOGCATE("CHECK_GL_ERROR %s glGetError = %d, line = %d, ", __FUNCTION__, glGetError(), __LINE__)
43 |
44 | #define DEBUG_LOGCATE(...) LOGCATE("DEBUG_LOGCATE %s line = %d", __FUNCTION__, __LINE__)
45 |
46 | #endif //BYTEFLOW_LOGUTIL_H
47 |
--------------------------------------------------------------------------------
/glcamera/src/main/cpp/util/SyncLock.h:
--------------------------------------------------------------------------------
1 | //
2 | // Created by ByteFlow on 2019/1/23.
3 | //
4 |
5 | #ifndef BYTEFLOW_MYLOCK_H
6 | #define BYTEFLOW_MYLOCK_H
7 |
8 | #include
9 |
10 | class SyncLock
11 | {
12 | public:
13 | SyncLock(bool bRecursive = true)
14 | {
15 |
16 | pthread_mutexattr_init(&m_attr);
17 | if (bRecursive)
18 | {
19 | pthread_mutexattr_settype(&m_attr, PTHREAD_MUTEX_RECURSIVE);
20 | }
21 | else
22 | {
23 | pthread_mutexattr_settype(&m_attr, PTHREAD_MUTEX_DEFAULT);
24 | }
25 | pthread_mutex_init(&m_mutex, &m_attr);
26 |
27 | }
28 |
29 | ~SyncLock(void)
30 | {
31 |
32 | pthread_mutex_destroy(&m_mutex);
33 | pthread_mutexattr_destroy(&m_attr);
34 | }
35 |
36 | int Lock()
37 | {
38 |
39 | return pthread_mutex_lock(&m_mutex);
40 |
41 | }
42 |
43 | int UnLock()
44 | {
45 |
46 | return pthread_mutex_unlock(&m_mutex);
47 |
48 |
49 | }
50 |
51 | int TryLock()
52 | {
53 |
54 | return pthread_mutex_trylock(&m_mutex);
55 | }
56 |
57 | private:
58 | pthread_mutex_t m_mutex;
59 | pthread_mutexattr_t m_attr;
60 |
61 | };
62 |
63 | class ByteFlowLock
64 | {
65 | public:
66 | ByteFlowLock(SyncLock *pLock) :
67 | m_pLock(pLock)
68 | {
69 | if (pLock != NULL)
70 | {
71 | m_pLock->Lock();
72 | }
73 | }
74 |
75 | ~ByteFlowLock()
76 | {
77 | if (m_pLock != NULL)
78 | {
79 | m_pLock->UnLock();
80 | }
81 |
82 | }
83 |
84 | private:
85 | SyncLock *m_pLock;
86 | };
87 |
88 | #endif //BYTEFLOW_MYLOCK_H
89 |
--------------------------------------------------------------------------------
/glcamera/src/main/java/com/atech/glcamera/camera/Camera2FrameCallback.java:
--------------------------------------------------------------------------------
1 | package com.atech.glcamera.camera;
2 |
3 | public interface Camera2FrameCallback {
4 | void onPreviewFrame(byte[] data, int width, int height);
5 | void onCaptureFrame(byte[] data, int width, int height);
6 | }
7 |
--------------------------------------------------------------------------------
/glcamera/src/main/java/com/atech/glcamera/frame/ByteFlowFrame.java:
--------------------------------------------------------------------------------
1 | package com.atech.glcamera.frame;
2 |
3 | public class ByteFlowFrame {
4 | byte[] mData;
5 | int mWidth;
6 | int mHeight;
7 |
8 | public ByteFlowFrame(byte[] mData, int mWidth, int mHeight) {
9 | this.mData = mData;
10 | this.mWidth = mWidth;
11 | this.mHeight = mHeight;
12 | }
13 |
14 | public byte[] getData() {
15 | return mData;
16 | }
17 |
18 | public int getWidth() {
19 | return mWidth;
20 | }
21 |
22 | public int getHeight() {
23 | return mHeight;
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/glcamera/src/main/java/com/atech/glcamera/render/ByteFlowRender.java:
--------------------------------------------------------------------------------
1 | package com.atech.glcamera.render;
2 |
3 | public abstract class ByteFlowRender {
4 | public static final int GL_RENDER_TYPE = 0;
5 | public static final int CL_RENDER_TYPE = 1;
6 |
7 | public static final int IMAGE_FORMAT_RGBA = 0x01;
8 | public static final int IMAGE_FORMAT_NV21 = 0x02;
9 | public static final int IMAGE_FORMAT_NV12 = 0x03;
10 | public static final int IMAGE_FORMAT_I420 = 0x04;
11 |
12 | public static final int PARAM_TYPE_SET_SHADER_INDEX = 201;
13 | public static final int PARAM_TYPE_SET_EXAMPLE = 202;
14 |
15 | public static final int EXAMPLE_TYPE = 300;
16 | public static final int EXAMPLE_TYPE_KEY_CONVEYOR_BELT = EXAMPLE_TYPE;
17 | public static final int EXAMPLE_TYPE_KEY_BLUELINE_CHALLENGE = EXAMPLE_TYPE + 1;
18 |
19 | static {
20 | System.loadLibrary("opencamera-android");
21 | }
22 |
23 | private long mNativeContextHandle;
24 |
25 | protected native void native_CreateContext(int renderType);
26 |
27 | protected native void native_DestroyContext();
28 |
29 | protected native int native_Init(int initType);
30 |
31 | protected native int native_UnInit();
32 |
33 | protected native void native_UpdateFrame(int format, byte[] data, int width, int height);
34 |
35 | protected native void native_LoadFilterData(int index, int format, int width, int height, byte[] bytes);
36 |
37 | protected native void native_LoadShaderScript(int shaderIndex, String scriptStr);
38 |
39 | protected native void native_SetTransformMatrix(float translateX, float translateY, float scaleX, float scaleY, int degree, int mirror);
40 |
41 | protected native void native_SetParamsInt(int paramType, int value);
42 |
43 | protected native int native_GetParamsInt(int paramType);
44 |
45 | protected native void native_OnSurfaceCreated();
46 |
47 | protected native void native_OnSurfaceChanged(int width, int height);
48 |
49 | protected native void native_OnDrawFrame();
50 | }
51 |
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/ascii_mapping.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/ascii_mapping.png
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/bg_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/camera.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/camera.png
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/dzzz.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/dzzz.jpg
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/lut_a.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/lut_a.png
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/lut_b.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/lut_b.png
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/lut_c.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/lut_c.png
--------------------------------------------------------------------------------
/glcamera/src/main/res/drawable/lut_d.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/glcamera/src/main/res/drawable/lut_d.png
--------------------------------------------------------------------------------
/glcamera/src/main/res/layout/activity_camera.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
7 |
8 |
13 |
14 |
15 |
16 |
17 |
18 |
32 |
33 |
40 |
41 |
47 |
48 |
49 |
--------------------------------------------------------------------------------
/glcamera/src/main/res/layout/sample_item_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
9 |
15 |
22 |
23 |
--------------------------------------------------------------------------------
/glcamera/src/main/res/layout/sample_selected_layout.xml:
--------------------------------------------------------------------------------
1 |
2 |
6 |
11 |
22 |
23 |
27 |
31 |
32 |
36 |
42 |
--------------------------------------------------------------------------------
/glcamera/src/main/res/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #008577
4 | #00574B
5 | #D81B60
6 | #666
7 |
--------------------------------------------------------------------------------
/glcamera/src/main/res/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
8 |
9 |
--------------------------------------------------------------------------------
/glcamera/src/test/java/com/atech/glcamera/ExampleUnitTest.java:
--------------------------------------------------------------------------------
1 | package com.atech.glcamera;
2 |
3 | import org.junit.Test;
4 |
5 | import static org.junit.Assert.*;
6 |
7 | /**
8 | * Example local unit test, which will execute on the development machine (host).
9 | *
10 | * @see Testing documentation
11 | */
12 | public class ExampleUnitTest {
13 | @Test
14 | public void addition_isCorrect() {
15 | assertEquals(4, 2 + 2);
16 | }
17 | }
--------------------------------------------------------------------------------
/gradle.properties:
--------------------------------------------------------------------------------
1 | # Project-wide Gradle settings.
2 | # IDE (e.g. Android Studio) users:
3 | # Gradle settings configured through the IDE *will override*
4 | # any settings specified in this file.
5 | # For more details on how to configure your build environment visit
6 | # http://www.gradle.org/docs/current/userguide/build_environment.html
7 | # Specifies the JVM arguments used for the daemon process.
8 | # The setting is particularly useful for tweaking memory settings.
9 | android.enableJetifier=true
10 | android.useAndroidX=true
11 | org.gradle.jvmargs=-Xmx1536m
12 | # When configured, Gradle will run in incubating parallel mode.
13 | # This option should only be used with decoupled projects. More details, visit
14 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
15 | # org.gradle.parallel=true
16 |
17 |
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.jar:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/gradle/wrapper/gradle-wrapper.jar
--------------------------------------------------------------------------------
/gradle/wrapper/gradle-wrapper.properties:
--------------------------------------------------------------------------------
1 | distributionBase=GRADLE_USER_HOME
2 | distributionPath=wrapper/dists
3 | distributionUrl=file:///Users/macos/.gradle/wrapper/dists/gradle-6.8-bin.zip
4 | zipStoreBase=GRADLE_USER_HOME
5 | zipStorePath=wrapper/dists
6 |
--------------------------------------------------------------------------------
/gradlew.bat:
--------------------------------------------------------------------------------
1 | @if "%DEBUG%" == "" @echo off
2 | @rem ##########################################################################
3 | @rem
4 | @rem Gradle startup script for Windows
5 | @rem
6 | @rem ##########################################################################
7 |
8 | @rem Set local scope for the variables with windows NT shell
9 | if "%OS%"=="Windows_NT" setlocal
10 |
11 | set DIRNAME=%~dp0
12 | if "%DIRNAME%" == "" set DIRNAME=.
13 | set APP_BASE_NAME=%~n0
14 | set APP_HOME=%DIRNAME%
15 |
16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
17 | set DEFAULT_JVM_OPTS=
18 |
19 | @rem Find java.exe
20 | if defined JAVA_HOME goto findJavaFromJavaHome
21 |
22 | set JAVA_EXE=java.exe
23 | %JAVA_EXE% -version >NUL 2>&1
24 | if "%ERRORLEVEL%" == "0" goto init
25 |
26 | echo.
27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
28 | echo.
29 | echo Please set the JAVA_HOME variable in your environment to match the
30 | echo location of your Java installation.
31 |
32 | goto fail
33 |
34 | :findJavaFromJavaHome
35 | set JAVA_HOME=%JAVA_HOME:"=%
36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe
37 |
38 | if exist "%JAVA_EXE%" goto init
39 |
40 | echo.
41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
42 | echo.
43 | echo Please set the JAVA_HOME variable in your environment to match the
44 | echo location of your Java installation.
45 |
46 | goto fail
47 |
48 | :init
49 | @rem Get command-line arguments, handling Windows variants
50 |
51 | if not "%OS%" == "Windows_NT" goto win9xME_args
52 |
53 | :win9xME_args
54 | @rem Slurp the command line arguments.
55 | set CMD_LINE_ARGS=
56 | set _SKIP=2
57 |
58 | :win9xME_args_slurp
59 | if "x%~1" == "x" goto execute
60 |
61 | set CMD_LINE_ARGS=%*
62 |
63 | :execute
64 | @rem Setup the command line
65 |
66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
67 |
68 | @rem Execute Gradle
69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
70 |
71 | :end
72 | @rem End local scope for the variables with windows NT shell
73 | if "%ERRORLEVEL%"=="0" goto mainEnd
74 |
75 | :fail
76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
77 | rem the _cmd.exe /c_ return code!
78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
79 | exit /b 1
80 |
81 | :mainEnd
82 | if "%OS%"=="Windows_NT" endlocal
83 |
84 | :omega
85 |
--------------------------------------------------------------------------------
/images/tu1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/images/tu1.jpg
--------------------------------------------------------------------------------
/images/tu2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/images/tu2.jpg
--------------------------------------------------------------------------------
/images/tu3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/moo611/opencamera-for-android/a1aa989e60cccd976b4b055104f881230ca5aac7/images/tu3.gif
--------------------------------------------------------------------------------
/settings.gradle:
--------------------------------------------------------------------------------
1 | include ':demo', ':glcamera'
2 |
--------------------------------------------------------------------------------