This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.graphics.Matrix; | |
import android.media.ExifInterface; | |
// Some reference: https://msdn.microsoft.com/library/windows/apps/windows.storage.fileproperties.photoorientation | |
public class ExifToMat { | |
public static Matrix fromOrientation(final int pExifOrientation) { | |
Matrix matrix = new Matrix(); | |
switch (pExifOrientation) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// don't forget to include related head files | |
void BindCVMat2GLTexture(cv::Mat& image, GLuint& imageTexture) | |
{ | |
if(image.empty()){ | |
std::cout << "image empty" << std::endl; | |
}else{ | |
//glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); | |
glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); | |
glGenTextures(1, &imageTexture1); | |
glBindTexture(GL_TEXTURE_2D, imageTexture1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package mdesl.line2dx.test; | |
import com.badlogic.gdx.ApplicationListener; | |
import com.badlogic.gdx.Gdx; | |
import com.badlogic.gdx.graphics.GL10; | |
import com.badlogic.gdx.graphics.OrthographicCamera; | |
import com.badlogic.gdx.graphics.Texture; | |
import com.badlogic.gdx.graphics.g2d.SpriteBatch; | |
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; | |
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JAVA REFERENCE IMPLEMENTATION OF IMPROVED NOISE - COPYRIGHT 2002 KEN PERLIN. | |
public final class ImprovedNoise { | |
static public double noise(double x, double y, double z) { | |
int X = (int)Math.floor(x) & 255, // FIND UNIT CUBE THAT | |
Y = (int)Math.floor(y) & 255, // CONTAINS POINT. | |
Z = (int)Math.floor(z) & 255; | |
x -= Math.floor(x); // FIND RELATIVE X,Y,Z | |
y -= Math.floor(y); // OF POINT IN CUBE. | |
z -= Math.floor(z); |