code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
#pragma once #include <zGraphicsConfig.hpp> #include <Math/Vector3.hpp> namespace zzz{ ZGRAPHICS_FUNC float Ft_in(float costheta1,float eta); ZGRAPHICS_FUNC float Ft_out(float costheta2,float eta); ZGRAPHICS_FUNC float Ft_out2(float costheta1,float eta); ZGRAPHICS_FUNC bool RefractTo(Vector3f inray,Vector3f &...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/RayTransform.hpp
C++
gpl3
496
#pragma once #include <common.hpp> #include <Math/Vector.hpp> namespace zzz{ template <unsigned int N, typename T > class AABB { public: #undef max #undef min AABB():min_(numeric_limits<T>::max()),max_(-numeric_limits<T>::max()){} AABB(const Vector<N,T> &min,const Vector<N,T> &max):min_(min),max_(max){...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/AABB.hpp
C++
gpl3
4,568
#pragma once #include <zGraphicsConfig.hpp> #include "Graphics.hpp" #include "Quaternion.hpp" #include "Rotation.hpp" #include "Transformation.hpp" #include "Translation.hpp" #include "Coordinate.hpp" #include <Utility/Uncopyable.hpp> //stupid MFC define... #undef near #undef far namespace zzz { class ...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/Camera.hpp
C++
gpl3
1,557
#pragma once #include <zGraphicsConfig.hpp> namespace zzz{ #define MAP_SIZE 128 class ZGRAPHICS_CLASS HeightMap { public: int ToIndex(int x, int y) const; void Generate(); void GetVertexColor(int x, int y, float *col); bool SetVertexColor(int x, int y); float GetHeight(int x, int y); void Set...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/HeightMap.hpp
C++
gpl3
558
#pragma once #include <Math/Vector3.hpp> #include <Math/Matrix4x4.hpp> #include <Math/Matrix3x3.hpp> #include <Graphics/Translation.hpp> #include <Graphics/Rotation.hpp> namespace zzz{ template <typename T> class Transformation : public Matrix<4,4,T> { public: Transformation(){Matrix<4,4,T>::Identical(...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/Transformation.hpp
C++
gpl3
4,644
#include <Math/Vector2.hpp> #include <Math/Vector3.hpp> #include <Math/Vector4.hpp> #include <Graphics/aabb.hpp> namespace zzz { template<typename T> class BoundingBox3 { public: BoundingBox3() : ori_boundary_good_(false) { rot_.Identical(); rot_back_.Identical(); } BoundingBox3(con...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/BoundingBox3.hpp
C++
gpl3
9,053
#pragma once #include <zGraphicsConfig.hpp> #include <Utility/Singleton.hpp> #include <Math/Vector2.hpp> namespace zzz { class ZGRAPHICS_CLASS BMPFont : public Singleton<BMPFont> { public: BMPFont(); Vector2i Size(const string &msg); void Draw(const string &msg); void DrawFont(); zuint FontHeight...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/BMPFont.hpp
C++
gpl3
364
#include "Coordinate.hpp" namespace zzz{ CubeCoord::CubeCoord() { cubeface=POSX; x=0; y=0; size=0; } CubeCoord::CubeCoord(const CUBEFACE _face,const zuint _x,const zuint _y, const zuint _size) { cubeface=_face; x=_x; y=_y; size=_size; } CubeCoord::CubeCoord(const CubeCoord& c) { ...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/Coordinate.cpp
C++
gpl3
2,739
#include <common.hpp> #include "OpenGLTools.hpp" #include "../Resource/Shader/ShaderSpecify.hpp" #include <Utility/Log.hpp> namespace zzz{ GLfloat GLPointSize::old=1; GLfloat GLLineWidth::old=1; Vector<2, GLint> GLPolygonMode::old(GL_FILL,GL_FILL); Color<GLfloat> GLClearColor::old(1,1,1,1); GLfloat GLClearDe...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/OpenGLTools.cpp
C++
gpl3
4,610
// SHRotationMatrix Class Definition // --------------------------------- // // Takes a rotation matrix of the form: // (r[0], r[3], r[6]) // (r[1], r[4], r[7]) // (r[2], r[5], r[8]) // and an order. Computes an order^2 x order^2 matrix. // #pragma once //#include "../../common.hpp" #include "SHCoeff.hpp" na...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/SH/SHRotationMatrix.hpp
C++
gpl3
5,126
#ifdef ZZZ_SSE #include "SHCoeff4f_SSE.hpp" namespace zzz{ SHCoeff4f_SSE::SHCoeff4f_SSE(void) { } SHCoeff4f_SSE::SHCoeff4f_SSE(float *data) { *this=data; } SHCoeff4f_SSE::SHCoeff4f_SSE(const SHCoeff4f_SSE &coef) { *this=coef; } SHCoeff4f_SSE::~SHCoeff4f_SSE(void) {...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/SH/SHCoeff4f_SSE.cpp
C++
gpl3
8,623
#pragma once #include "SHCoeff.hpp" #include <xmmintrin.h> namespace zzz{ class SHCoeff4f_SSE{ public: union{ float __declspec(align(16)) v[16]; struct {__m128 v0,v1,v2,v3;}; }; public: //inline functions inline const SHCoeff4f_SSE& operator=(const float *data) { v[0]=data[0]; ...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/SH/SHCoeff4f_SSE.hpp
C++
gpl3
12,482
#pragma once #include <Math/Matrix3x3.hpp> #include <Math/Vector3.hpp> namespace zzz{ template <std::size_t N,typename T=float> struct SHCoeff { T v[N*N]; const int order_; SHCoeff():order_(N) { } const SHCoeff& operator=(float *data) { for (int i=0; i<N*N; i++) v[i]=data[i]; return...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/SH/SHCoeff.hpp
C++
gpl3
29,588
#include "GraphicsHelper.hpp" #include "GeometryHelper.hpp" #include "../Resource/Mesh/SimpleMesh.hpp" #include "../Resource/Shader/Shader.hpp" #include "OpenGLTools.hpp" #include "ColorDefine.hpp" namespace zzz{ void GraphicsHelper::DrawPlane(const Vector3d &point, const Vector3d &normal, double size) const ...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/GraphicsHelper.cpp
C++
gpl3
4,458
#pragma once #include <Math/Vector3.hpp> #include <Math/Vector4.hpp> #include <Math/Vector.hpp> #include <Math/Matrix.hpp> namespace zzz{ template<typename T> class Rotation; template<typename T> class Quaternion : public Vector<4,T> { public: using Vector<4,T>::v; Quaternion():Vector<4,T>(0){} Qua...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/Quaternion.hpp
C++
gpl3
5,183
#pragma once namespace zzz{ template <typename T> class GraphicsElement3 { public: virtual T DistanceTo(const GraphicsElement3<T> &other) const=0; typedef enum {ELEMENT_POINT,ELEMENT_LINE,ELEMENT_PLANE,ELEMENT_BOX} ELEMENT_TYPE; GraphicsElement3(const ELEMENT_TYPE t):type(t){} const ELEMENT_TYPE type...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/GraphicsElement.hpp
C++
gpl3
611
#pragma once #include <zGraphicsConfig.hpp> #include "../Resource/Mesh/SimpleMesh.hpp" #include <Math/Vector3.hpp> #include <Math/Statistics.hpp> #include <Math/Matrix3x3.hpp> #include <Math/Array2.hpp> namespace zzz{ template<zuint PN> class Mesh; class GeometryHelper { public: template <typename T> stat...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/GeometryHelper.hpp
C++
gpl3
11,916
#pragma once #include <zGraphicsConfig.hpp> #include "Graphics.hpp" #include "Color.hpp" #include <Math/Vector2.hpp> #include "../Context/Context.hpp" #include <Utility/Thread.hpp> namespace zzz{ ZGRAPHICS_FUNC bool InitGLEW(); ZGRAPHICS_FUNC void CheckGLVersion(); ZGRAPHICS_FUNC bool CheckGLSL(); ZGRAPHIC...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/OpenGLTools.hpp
C++
gpl3
8,473
#pragma once #include <zGraphicsConfig.hpp> #include "Quaternion.hpp" #include "Rotation.hpp" #include "Translation.hpp" #include "Transformation.hpp" namespace zzz{ class ZGRAPHICS_CLASS ArcBall{ public: double win_w; /// the windows double win_h; /// the windows double old_x; /// stores the x...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/ArcBall.hpp
C++
gpl3
1,720
#include "Camera.hpp" namespace zzz{ void Camera::SetPerspective(const int cw, const int ch, const double near, const double far, const double angle) { if (near != -1) zNear_=near; if (far != -1) zFar_=far; if (angle != -1) fovy_=angle; if (ch==0) return; width_=cw; height_=ch; aspect_=(doub...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/Camera.cpp
C++
gpl3
6,786
#include "GeometryHelper.hpp" #include <Resource\Mesh\Mesh.hpp> namespace zzz{ void SphereSubDivide(SimpleMesh &mesh) { unsigned int origSize = mesh.faces_.size(); for (unsigned int i = 0 ; i < origSize ; ++i) { Vector3i &t = mesh.faces_[i]; const Vector3f &a = mesh.vertices_[t[0]], &b = mesh.v...
zzz-engine
zzzEngine/zGraphics/zGraphics/Graphics/GeometryHelper.cpp
C++
gpl3
7,613
#pragma once #include <zGraphicsConfig.hpp> #include <common.hpp> #include "../Graphics/Graphics.hpp" #include "../Resource/Texture/Texture.hpp" namespace zzz { class ZGRAPHICS_CLASS FBO { public: FBO(); virtual ~FBO(); GLuint GetID(); void Bind(); void Unbind(); void AttachTexture(Textur...
zzz-engine
zzzEngine/zGraphics/zGraphics/FBO/FBO.hpp
C++
gpl3
2,188
#include "RenderBuffer.hpp" namespace zzz{ Renderbuffer::Renderbuffer(GLenum internalFormat) :buf_(0), width_(0), height_(0), internal_format_(internalFormat) { } Renderbuffer::Renderbuffer(GLenum internalFormat, int width, int height) :buf_(0) { Create(internalFormat, width, height); } Renderbuffer...
zzz-engine
zzzEngine/zGraphics/zGraphics/FBO/RenderBuffer.cpp
C++
gpl3
1,330
#pragma once #include <zGraphicsConfig.hpp> #include "FBO.hpp" #include <Image\Image.hpp> #include <Graphics\OpenGLTools.hpp> namespace zzz{ class ZGRAPHICS_CLASS Renderbuffer { public: Renderbuffer(GLenum internalFormat); Renderbuffer(GLenum internalFormat, int width, int height); ~Renderbuffer(); ...
zzz-engine
zzzEngine/zGraphics/zGraphics/FBO/RenderBuffer.hpp
C++
gpl3
2,177
#include "FBO.hpp" #include <Graphics\OpenGLTools.hpp> namespace zzz { FBO::FBO() :fbo_(0) { } FBO::~FBO() { glDeleteFramebuffers(1, &fbo_); } void FBO::Bind() { GLBindFrameBuffer::Set(GetID()); } void FBO::Unbind() { GLBindFrameBuffer::Restore(); } void FBO::Disable() { GLBindFra...
zzz-engine
zzzEngine/zGraphics/zGraphics/FBO/FBO.cpp
C++
gpl3
5,991
#pragma once #include <zGraphicsConfig.hpp> #include "Context.hpp" #ifdef ZZZ_CONTEXT_MFC #include <common.hpp> #include "../Renderer/Renderer.hpp" #include <Windows.h> namespace zzz{ class ZGRAPHICS_CLASS SingleViewContext : public Context { public: virtual ~SingleViewContext(); public: bool Init...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/SingleViewContext.hpp
C++
gpl3
9,762
#pragma once #include <Utility/Tools.hpp> namespace zzz { //for OnMouse... #define ZZZFLAG_LMOUSE (0x00000001) #define ZZZFLAG_RMOUSE (0x00000002) #define ZZZFLAG_MMOUSE (0x00000004) #define ZZZFLAG_X1MOUSE (0x00000008) #define ZZZFLAG_X2MOUSE (0x00000010) #define ZZZFLAG_SHIFT (0x00010000) #define Z...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/KeyDefine.hpp
C++
gpl3
5,921
#pragma once #include <zGraphicsConfig.hpp> #include "KeyDefine.hpp" #include "../GraphicsGUI/GraphicsGUI.hpp" #include "../Resource/ResourceManager.hpp" #include <Utility/Thread.hpp> namespace zzz{ class Renderer; class ZGRAPHICS_CLASS Context { public: Context(); virtual ~Context(); public: // ...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/Context.hpp
C++
gpl3
2,893
#define ZGRAPHICS_SOURCE #include "Qt4Context.hpp" #ifdef ZZZ_CONTEXT_QT4 #include <QtGui/QApplication> #include "../Resource/Shader/ShaderSpecify.hpp" #include "../Graphics/OpenGLTools.hpp" namespace zzz{ ////////////////////////////////////////////////////////////////////////// //QTWidget zQt4GLWidget::zQt...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/Qt4Context.cpp
C++
gpl3
8,010
#pragma once #include <zGraphicsConfig.hpp> #include "../zGraphicsConfig.hpp" #include "Context.hpp" #ifdef ZZZ_CONTEXT_QT4 #include "../Renderer/Renderer.hpp" #pragma warning(disable:4311) //reinterpret_cast #pragma warning(disable:4312) //reinterpret_cast #include <QtOpenGL/QGLWidget> #include <QtGui/QMo...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/Qt4Context.hpp
C++
gpl3
1,371
#pragma once #include "../../common.hpp" #include "../../Graphics/Box2.hpp" #include "../../Renderer/Renderer.hpp" namespace zzz{ struct MultiContextDescriptorBase { float m_ratio; //width / height Box2<int> m_box; }; struct MultiContextDescriptor : public MultiContextDescriptorBase { Renderer *m_ren...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/MultiContext/MultiContextDescriptor.hpp
C++
gpl3
824
#define ZGRAPHICS_SOURCE #include "SFMLContext.hpp" #ifdef ZZZ_CONTEXT_SFML #include "../Renderer/Renderer.hpp" #include "../Graphics/OpenGLTools.hpp" namespace zzz{ SFMLContext::SFMLContext(void) :App_(NULL) { } SFMLContext::~SFMLContext(void) { if (App_) delete App_; } void SFMLContext::Initiali...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/SFMLContext.cpp
C++
gpl3
9,649
#pragma once #include <zGraphicsConfig.hpp> #include "../zGraphicsConfig.hpp" #include "Context.hpp" #include "../Graphics/Graphics.hpp" #include "../GraphicsGUI/GraphicsGUI.hpp" #include "../Renderer/Renderer.hpp" //GLUT #define FREEGLUT_STATIC #define FREEGLUT_LIB_PRAGMAS 0 #include <GL/freeglut.h> //G...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/GLUTContext.hpp
C++
gpl3
3,777
#define ZGRAPHICS_SOURCE #include "GLUTContext.hpp" #include "../Graphics/OpenGLTools.hpp" #include "../Resource/Shader/ShaderSpecify.hpp" namespace zzz{ GLUTContext * GLUTContext::s_context; int GLUTContext::window_id; #ifdef ZZZ_CONTEXT_GLUI GLUI *GLUTContext::glui; #endif GLUTContext::GluiMode GLUTContex...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/GLUTContext.cpp
C++
gpl3
3,767
#pragma once #include <zGraphicsConfig.hpp> #include "Context.hpp" #ifdef ZZZ_CONTEXT_SFML #include <SFML/Graphics.hpp> #ifdef ZZZ_DEBUG #pragma comment(lib,"sfml-window-s-d.lib") #pragma comment(lib,"sfml-graphics-s-d.lib") #pragma comment(lib,"sfml-system-s-d.lib") #else #pragma comment(lib,"sfml-window-s...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/SFMLContext.hpp
C++
gpl3
943
#define ZGRAPHICS_SOURCE #include "../Graphics/OpenGLTools.hpp" #include "../Graphics/Graphics.hpp" #include "../Renderer/Renderer.hpp" #include "Context.hpp" namespace zzz{ Context *Context::current_context_=NULL; #ifdef ZZZ_OPENGL_MX Mutex Context::OpenGLMutex; #endif // ZZZ_OPENGL_MX Context::Context()...
zzz-engine
zzzEngine/zGraphics/zGraphics/Context/Context.cpp
C++
gpl3
4,352
#pragma once #include <zGraphicsConfig.hpp> #include "RT_Ray.hpp" #include "../Graphics/AABB.hpp" namespace zzz { // interior node of a k-d tree struct ZGRAPHICS_CLASS RT_KdNode { enum SAxis{AXIS_X = 0, AXIS_Y, AXIS_Z}; SAxis splitFlag; // decide split axis float split; //decide split plane position int...
zzz-engine
zzzEngine/zGraphics/zGraphics/RayTracer/RT_KdTree.hpp
C++
gpl3
3,102
#define ZGRAPHICS_SOURCE #include "RT_Ray.hpp" namespace zzz { const float RT_Ray::MAX_RAY_RANGE=4096.0f; const float RT_Ray::RAY_EPSILON=0.00003f; }
zzz-engine
zzzEngine/zGraphics/zGraphics/RayTracer/RT_Ray.cpp
C++
gpl3
156
#pragma once #include <zGraphicsConfig.hpp> #include <Math/Vector3.hpp> #include "../Graphics/AABB.hpp" namespace zzz { class ZGRAPHICS_CLASS RT_Ray { public: static const float MAX_RAY_RANGE; static const float RAY_EPSILON; RT_Ray() :mint_(RAY_EPSILON), maxt_(MAX_RAY_RANGE) { } RT_Ray(const Vect...
zzz-engine
zzzEngine/zGraphics/zGraphics/RayTracer/RT_Ray.hpp
C++
gpl3
1,176
#include <zGraphicsConfig.hpp> #ifdef ZZZ_DYNAMIC #include <zCoreAutoLink.hpp> #include <zImageAutoLink.hpp> #include <zGraphicsAutoLink3rdParty.hpp> #endif
zzz-engine
zzzEngine/zGraphics/zGraphics/zGraphicsAutoLink.cpp
C++
gpl3
163
SET(THISLIB zVision) FILE(GLOB_RECURSE LibSrc *.cpp) #MESSAGE(STATUS "files ${LibSrc}") IF( "${DEBUG_MODE}" EQUAL "1") SET(THISLIB ${THISLIB}D) ENDIF() IF( "${BIT_MODE}" EQUAL "64" ) SET(THISLIB ${THISLIB}_X64) ENDIF() ADD_LIBRARY(${THISLIB} STATIC ${LibSrc})
zzz-engine
zzzEngine/zVision/CMakeLists.txt
CMake
gpl3
272
#pragma once #include <Math/Matrix3x3.hpp> #include <Math/Random.hpp> #include <Math/Vector.hpp> namespace zzz{ template<typename T, zuint N> Vector<N+1,T> ToHomogeneous(const Vector<N,T> &v) { Vector<N+1,T> res; for (zuint i=0; i<N; i++) res[i]=v[i]; res[N]=1; return res; } template<typename T...
zzz-engine
zzzEngine/zVision/zVision/VisionTools.hpp
C++
gpl3
1,432
#pragma once #include <EnvDetect.hpp> #include <LibraryConfig.hpp> #ifdef ZZZ_OS_WIN32 #include "zVisionConfig.hpp.win32" #endif
zzz-engine
zzzEngine/zVision/zVision/zVisionConfig.hpp
C++
gpl3
137
#pragma once #include <common.hpp> #include <Math/Vector3.hpp> #include <Math/Matrix3x3.hpp> #include "../VisionTools.hpp" namespace zzz{ class Homography { public: static const int MIN_POINT_NUMBER = 4; Homography(){Hab_.Identical(); Hba_.Identical();} bool Create(const vector<Vector2d> &pa, const...
zzz-engine
zzzEngine/zVision/zVision/SfM/Homography.hpp
C++
gpl3
948
#include "Triangulator.hpp" #include "../VisionTools.hpp" #include <zMat.hpp> namespace zzz{ Vector3d Triangulator::LinearTriangulate(const vector<ProjectionMat<double> > &P, const vector<Vector2d> &pos2ds) { zuint n=P.size(); zMatrix<double> A(n*2,4),U,S,VT; for (zuint i=0; i<n; i++) { A(i*...
zzz-engine
zzzEngine/zVision/zVision/SfM/Triangulator.cpp
C++
gpl3
2,332
#pragma once #include <common.hpp> #include <Math/Vector3.hpp> #include <Math/Matrix3x3.hpp> #include <Math/IterExitCond.hpp> #include "ProjectionMat.hpp" #include "SceneData.hpp" //implementation of 11.1.1 namespace zzz{ class FundamentalMat : public Matrix3x3d { public: FundamentalMat(const MatrixBa...
zzz-engine
zzzEngine/zVision/zVision/SfM/FundamentalMat.hpp
C++
gpl3
1,178
#pragma once #include <Math/Statistics.hpp> #include <Math/Matrix3x3.hpp> //to normalize coordination in an image //based on "In Defense of Eight-Point Algorithm" //set ori to the center of image and scale to make (average distance of all points from the origin is equal to \sqrt{2}) //will make the eight-point ...
zzz-engine
zzzEngine/zVision/zVision/SfM/CoordNormalizer.hpp
C++
gpl3
2,340
#include "Affine.hpp" #include <zMat.hpp> #include <Utility/Log.hpp> #include "../VisionTools.hpp" namespace zzz{ bool Affine::Create(const vector<Vector2d> &pa, const vector<Vector2d> &pb) { ZCHECK_EQ(pa.size(), pb.size()); zuint n=pa.size(); zMatrix<double> A(Zerosd(n*2,6)); zVector<do...
zzz-engine
zzzEngine/zVision/zVision/SfM/Affine.cpp
C++
gpl3
937
#pragma once #include "FundamentalMat.hpp" #include <Math/Vector2.hpp> #include <Math/IterExitCond.hpp> //Calculate relative pose given intrinsic calibration, fundamental matrix and corresponding point pairs namespace zzz{ int FivePointAlgo(EssentialMat &E, const Matrix3x3d &K, const vector<Vector2d> &ls, const...
zzz-engine
zzzEngine/zVision/zVision/SfM/FivePointAlgo.hpp
C++
gpl3
410
#pragma once #include <common.hpp> #include <Math/Vector3.hpp> #include <Math/Matrix3x3.hpp> #include "../VisionTools.hpp" namespace zzz{ class SmallRigid { public: static const int MIN_POINT_NUMBER = 2; SmallRigid(){Hab_.Identical(); Hba_.Identical();} bool Create(const vector<Vector2d> &pa, const...
zzz-engine
zzzEngine/zVision/zVision/SfM/SmallRigid.hpp
C++
gpl3
652
#include "Homography.hpp" #include <zMat.hpp> #include <Utility/Log.hpp> #include "../VisionTools.hpp" namespace zzz{ bool Homography::Create(const vector<Vector2d> &pa, const vector<Vector2d> &pb) { ZCHECK_EQ(pa.size(), pb.size()); zuint n=pa.size(); zMatrix<double> A(Zeros<double>(n*2,9)),U,S,VT; z...
zzz-engine
zzzEngine/zVision/zVision/SfM/Homography.cpp
C++
gpl3
1,484
#pragma once #include "ProjectionMat.hpp" #include <Math/Vector2.hpp> #include <Math/Vector3.hpp> #include <Math/Vector.hpp> #include "SceneData.hpp" namespace zzz{ class Triangulator { public: static Vector3d LinearTriangulate(const vector<ProjectionMat<double> > &P, const vector<Vector2d> &pos2ds); s...
zzz-engine
zzzEngine/zVision/zVision/SfM/Triangulator.hpp
C++
gpl3
644
#pragma once #include <common.hpp> #include <Math/Vector3.hpp> #include <Math/Matrix3x3.hpp> #include "../VisionTools.hpp" namespace zzz{ class Affine { public: static const int MIN_POINT_NUMBER = 3; Affine(){Hab_.Identical(); Hba_.Identical();} bool Create(const vector<Vector2d> &pa, const vector<...
zzz-engine
zzzEngine/zVision/zVision/SfM/Affine.hpp
C++
gpl3
644
#pragma once #include "SceneData.hpp" #include <Utility/IOObject.hpp> namespace zzz { typedef SceneDataf64::Point2D SceneDataf32Point2D; SIMPLE_IOOBJECT(SceneDataf32Point2D); typedef SceneDataf64::Point SceneDataf32Point; template<> class IOObject<SceneDataf32Point> { public: typedef SceneDataf32Point D...
zzz-engine
zzzEngine/zVision/zVision/SfM/SceneDataIOObject.hpp
C++
gpl3
3,569
#include "FivePointAlgo.hpp" //#include "5point/5point.h" #include <zMat.hpp> #include "../VisionTools.hpp" #include "Homography.hpp" #include <Math/Poly3.hpp> #include <Math/Matrix.hpp> namespace zzz{ void computeNullspaceBasis(const vector<Vector2d> &ls, const vector<Vector2d> &rs, Matrix<4,9,double> &bas...
zzz-engine
zzzEngine/zVision/zVision/SfM/FivePointAlgo.cpp
C++
gpl3
18,984
#pragma once #include <Math/Matrix3x3.hpp> #include <Math/Vector3.hpp> #include <Math/Vector4.hpp> #include "../VisionTools.hpp" #include <Graphics/Rotation.hpp> #include <Graphics/Translation.hpp> namespace zzz{ template<typename DataType=double> class ProjectionMat { public: ProjectionMat() :K_(1,0...
zzz-engine
zzzEngine/zVision/zVision/SfM/ProjectionMat.hpp
C++
gpl3
3,333
#include "FundamentalMat.hpp" #include "../VisionTools.hpp" #include "CoordNormalizer.hpp" #include "Triangulator.hpp" #include <zMat.hpp> namespace zzz{ bool FundamentalMat::Create8(const vector<Vector2d> &ls, const vector<Vector2d> &rs) { //implementation of 11.1 assert(ls.size()==rs.size()); //1....
zzz-engine
zzzEngine/zVision/zVision/SfM/FundamentalMat.cpp
C++
gpl3
6,368
#pragma once #include <zMat.hpp> #include <Math/Vector.hpp> #include <Utility/IOInterface.hpp> #include <Utility/HasFlag.hpp> #include <Utility/STLVector.hpp> #include "../Feature/SIFTKeys.hpp" #include <Xml/RapidXMLNode.hpp> #include "ProjectionMat.hpp" namespace zzz{ template<typename DataType> class Pro...
zzz-engine
zzzEngine/zVision/zVision/SfM/SceneData.hpp
C++
gpl3
24,016
#pragma once #include <Image/Image.hpp> //to generate textures according to a homography transformation //input original point on the original image and corresponding projection point on a new image //it will fill the new image by a homography transformation namespace zzz{ template<typename T> class TextureG...
zzz-engine
zzzEngine/zVision/zVision/SfM/TextureGenerator.hpp
C++
gpl3
889
#include "SceneDataIOObject.hpp"
zzz-engine
zzzEngine/zVision/zVision/SfM/SceneDataIOObject.cpp
C++
gpl3
34
#include "SmallRigid.hpp" #include <zMat.hpp> #include <Utility/Log.hpp> #include "../VisionTools.hpp" namespace zzz{ bool SmallRigid::Create(const vector<Vector2d> &pa, const vector<Vector2d> &pb) { ZCHECK_EQ(pa.size(), pb.size()); zuint n=pa.size(); zMatrix<double> A(Zerosd(n*2,3)); zVector<double...
zzz-engine
zzzEngine/zVision/zVision/SfM/SmallRigid.cpp
C++
gpl3
866
#pragma once #include "Renderer/CutRenderer.hpp" #include "Renderer/ImageListRenderer.hpp" #include "Renderer/MatchRenderer.hpp" #include "TensorVoting/TensorVoting.hpp" #include "Feature/SIFT.hpp" #include "Feature/SIFTKeys.hpp" //#include "Feature/SIFTMatcher.hpp" //used ANN_char, will have some redefini...
zzz-engine
zzzEngine/zVision/zVision/zVision.hpp
C++
gpl3
784
#pragma once #include <3rdparty/MaxFlow.hpp> #include <Math/Random.hpp> #include <boost/function.hpp> #include <Math/IterExitCond.hpp> namespace zzz{ #ifdef ZZZ_LIB_GCO template<typename IMGT, typename GRHT=IMGT> class ImageMultiCut { public: typedef boost::function<GRHT (const IMGT &t, const IMGT &p, ...
zzz-engine
zzzEngine/zVision/zVision/VisionAlgo/ImageMultiCut.hpp
C++
gpl3
7,923
#pragma once #include <Image/Image.hpp> #include <Algorithm/FibonacciHeap.hpp> //find a path between two points in a image //the path will track along the edges in the image //before track, call Prepare() to prepare //use SetStart() to set the startpoint //Repetitively call FindPath() to track, used DP so will...
zzz-engine
zzzEngine/zVision/zVision/VisionAlgo/EdgeTracer.hpp
C++
gpl3
1,881
#include "EdgeTracer.hpp" namespace zzz{ EdgeTracer::EdgeTracer(void) { start_=-1; optrange_=5; } EdgeTracer::~EdgeTracer(void) { } //link direction //3 2 1 //7 p 0 //6 5 4 //only calculate 1 2 3 7 and set 6 5 4 0 accordingly void EdgeTracer::Prepare(const Imagef &ori) { const float S...
zzz-engine
zzzEngine/zVision/zVision/VisionAlgo/EdgeTracer.cpp
C++
gpl3
11,055
#pragma once #include <Graphics/AABB.hpp> #include <Renderer/Renderer.hpp> #include <Resource/Shader/ShaderSpecify.hpp> #include <Math/Math.hpp> #include <Utility/CacheSet.hpp> #include <3rdParty/boostsignal2.hpp> namespace zzz{ template<typename T> class ImageListRenderer : public Renderer , public Graphics...
zzz-engine
zzzEngine/zVision/zVision/Renderer/ImageListRenderer.hpp
C++
gpl3
12,862
#pragma once #include <GraphicsGUI/GraphicsGUI.hpp> #include <Renderer/Vis2DRenderer.hpp> namespace zzz { class BrushGUI : public GraphicsGUI<Vis2DRenderer> { public: BrushGUI(); bool OnLButtonDown(unsigned int nFlags,int x,int y); bool OnLButtonUp(unsigned int nFlags,int x,int y); bool OnRButtonDow...
zzz-engine
zzzEngine/zVision/zVision/Renderer/BrushGUI.hpp
C++
gpl3
795
#pragma once #include <Renderer/Vis2DRenderer.hpp> #include <GraphicsGUI/GraphicsGUI.hpp> #include <Math/Vector2.hpp> #include <VisionAlgo/EdgeTracer.hpp> namespace zzz { class CutGUI : public GraphicsGUI<Vis2DRenderer> { public: CutGUI(); bool OnLButtonDown(unsigned int nFlags,int x,int y); bool OnL...
zzz-engine
zzzEngine/zVision/zVision/Renderer/CutGUI.hpp
C++
gpl3
1,691
#include "CutGUI.hpp" #include <Renderer\Vis2DRenderer.hpp> #include <Image\ImageDrawer.hpp> #include <Graphics\ColorDefine.hpp> namespace zzz { CutGUI::CutGUI() :left_(false), right_(false), inputstatus_(FIRST_CLICK), optmode_(true), usemask_(false), masksize_(10), boxsize_(5), curseg_(1) { } bool C...
zzz-engine
zzzEngine/zVision/zVision/Renderer/CutGUI.cpp
C++
gpl3
9,629
#pragma once #include <Renderer/Vis2DRenderer.hpp> namespace zzz{ template<typename T> class MatchRenderer : public Vis2DRenderer, public GraphicsHelper { public: typedef pair<Vector2i,Vector2i> MatchPair; MatchRenderer():shows_(10){} void DrawObj() { if (shows_>match_.size()) shows_=match_.s...
zzz-engine
zzzEngine/zVision/zVision/Renderer/MatchRenderer.hpp
C++
gpl3
2,494
#include "BrushGUI.hpp" #include <Graphics\ColorDefine.hpp> #include <zImage.hpp> namespace zzz { BrushGUI::BrushGUI() :sel_id_(1), brushsize_(5), left_(false), right_(false) { } void BrushGUI::Prepare(const Image4f &img) { ori_=img; mask_.SetSize(ori_.Size()); mask_.Zero(); show_=ori_; } ...
zzz-engine
zzzEngine/zVision/zVision/Renderer/BrushGUI.cpp
C++
gpl3
2,341
#pragma once //#include <sigslot.h> #include <3rdParty/boostsignal2.hpp> #include "../VisionAlgo/EdgeTracer.hpp" #include <Renderer/OneImageRenderer.hpp> #include "CutGUI.hpp" #include "BrushGUI.hpp" // USAGE: to cut out a piece from a image with Intelligent Scissor // call Prepare to init // click will opti...
zzz-engine
zzzEngine/zVision/zVision/Renderer/CutRenderer.hpp
C++
gpl3
3,805
#include "SIFTKeys.hpp" #include <Image/ImageDrawer.hpp> namespace zzz{ SIFTKeys::SIFTKeys(){} SIFTKeys::SIFTKeys(const string &filename) { LoadKeyFile(filename); } SIFTKeys::SIFTKeys(const SIFTKeys& other) { *this=other; } void SIFTKeys::LoadKeyFile(const string &filename) { ifstream fi(f...
zzz-engine
zzzEngine/zVision/zVision/Feature/SIFTKeys.cpp
C++
gpl3
1,506
#include "SIFT.hpp" #include <Math/Matrix3x3.hpp> #include <Image/ImageFilter.hpp> #include <common.hpp> using namespace std; namespace zzz { void SIFT::RefineKeypoint() { Matrix3x3f A; //Hessian Vector3f B,X; for (size_t o=0; o<keypoint_.size(); o++) { int octave_scale=Pow(2,o); int nrow=nro...
zzz-engine
zzzEngine/zVision/zVision/Feature/SIFT.cpp
C++
gpl3
7,497
#pragma once #include <Image/Image.hpp> #include <Math/Math.hpp> #include <3rdParty/boostsignal2.hpp> #include <Utility/Log.hpp> namespace zzz{ class SIFT { public: SIFT(){} ~SIFT() { ClearOctave(gauss_); ClearOctave(dog_); } void FindKeypoint(Image<float> *img) { ori_=img; ncol...
zzz-engine
zzzEngine/zVision/zVision/Feature/SIFT.hpp
C++
gpl3
2,083
#pragma once #include <common.hpp> #include <Image/Image.hpp> #include <Image/ImageCoord.hpp> #include <Graphics/ColorDefine.hpp> #include <Utility/STLVector.hpp> namespace zzz{ struct SIFTKey { CoordX_Yf32 pos; zfloat32 scale; zfloat32 dir; }; class SIFTKeys { public: static const int KEY_L...
zzz-engine
zzzEngine/zVision/zVision/Feature/SIFTKeys.hpp
C++
gpl3
1,184
#pragma once #include <3rdParty/ANNChar4Vector.hpp> #include <common.hpp> #include "SIFTKeys.hpp" namespace zzz{ #ifdef ZZZ_LIB_ANN_CHAR class SIFTMatcher { public: SIFTMatcher(); SIFTMatcher(const SIFTKeys &keys); void Prepair(const SIFTKeys &keys); void Match(const SIFTKeys &keys); void Sort(...
zzz-engine
zzzEngine/zVision/zVision/Feature/SIFTMatcher.hpp
C++
gpl3
467
#include "SIFTMatcher.hpp" #ifdef ZZZ_LIB_ANN_CHAR #include <boost/lambda/lambda.hpp> #include <Utility/CheckPoint.hpp> #include <Utility/CmdParser.hpp> using namespace boost::lambda; namespace zzz{ ZFLAGS_INT(ann_max_visit_pt, 200, "Maximum visit point number for each ann search"); SIFTMatcher::SIFTMatcher...
zzz-engine
zzzEngine/zVision/zVision/Feature/SIFTMatcher.cpp
C++
gpl3
2,138
#pragma once #include "TensorVoter.hpp" #include <3rdparty/ANN4Vector.hpp> #include <GraphicsAlgo/RotationMatrix.hpp> #include <Utility/TextProgress.hpp> #include <Xml/XML.hpp> #include <Math/Random.hpp> namespace zzz{ template<int D> class TensorVoting : public IOData { public: TensorVoting():sigma_(...
zzz-engine
zzzEngine/zVision/zVision/TensorVoting/TensorVoting.hpp
C++
gpl3
15,139
#pragma once #include <zMat.hpp> namespace zzz{ template<int D> struct TensorVoter { TensorVoter():Position(0),Lambda(0),Directions(0),T(0){} //init from position //and init as a uniform ball tensor TensorVoter(const Vector<D, double> &pos) :Position(pos),Lambda(1),Directions(0),T(0) { ...
zzz-engine
zzzEngine/zVision/zVision/TensorVoting/TensorVoter.hpp
C++
gpl3
2,936
#pragma once // Separate link so when change a lib, only link needs redo. #include "zImageConfig.hpp" #ifndef ZZZ_NO_PRAGMA_LIB #ifdef ZZZ_COMPILER_MSVC #ifdef ZZZ_DEBUG #ifndef ZZZ_OS_WIN64 #pragma comment(lib,"zVisionD.lib") #else #pragma comment(lib,"zVisionD_x64.lib") #endif // ZZZ_OS_WIN64 #else...
zzz-engine
zzzEngine/zVision/zVision/zVisionAutoLink.hpp
C++
gpl3
679
SET(THISLIB zCore) FILE(GLOB_RECURSE LibSrc *.cpp *.c) IF( "${DEBUG_MODE}" EQUAL "1") SET(THISLIB ${THISLIB}D) ENDIF() IF( "${BIT_MODE}" EQUAL "64" ) SET(THISLIB ${THISLIB}_X64) ENDIF() ADD_LIBRARY(${THISLIB} STATIC ${LibSrc}) #MESSAGE("zCore Lib Path: ${BASENAME}")
zzz-engine
zzzEngine/zCore/CMakeLists.txt
CMake
gpl3
279
#pragma once // Separate link so when change a lib, only link needs redo. #include "zCoreConfig.hpp" #ifndef ZZZ_NO_PRAGMA_LIB #ifdef ZZZ_COMPILER_MSVC #ifdef ZZZ_LIB_ZLIB #ifdef ZZZ_OS_WIN64 #pragma comment(lib, "zlib_x64.lib") #else #pragma comment(lib, "zlib.lib") #endif #endif #ifdef ZZZ_LIB_A...
zzz-engine
zzzEngine/zCore/zCore/zCoreAutoLink3rdParty.hpp
C++
gpl3
5,632
#define ZCORE_SOURCE #include "BraceFile.hpp" #include "StringTools.hpp" #include "Log.hpp" namespace zzz{ BraceItem::~BraceItem() { Clear(); } void BraceItem::Clear() { for (vector<BraceItem*>::iterator vi=children_.begin();vi!=children_.end();vi++) delete *vi; children_.clear(); } Bra...
zzz-engine
zzzEngine/zCore/zCore/Utility/BraceFile.cpp
C++
gpl3
5,787
#pragma once #include <zCoreConfig.hpp> #include <Define.hpp> #include <common.hpp> namespace zzz { typedef pair<int, zint64> TableItem; class ZCORE_CLASS RecordItem { public: RecordItem(FILE *fp, zint64 itebegin_pos_, RecordItem *parent); void ReadTable(); RecordItem* ReadChild(const zint32 label...
zzz-engine
zzzEngine/zCore/zCore/Utility/RecordFile.hpp
C++
gpl3
3,521
#pragma once #include <zCoreConfig.hpp> #include "../common.hpp" #include "Log.hpp" //%b = progress bar //%s = spin //%p = percentage //%n = number namespace zzz { class ZCORE_CLASS TextProgress { public: TextProgress(const string &_content="%s", int endvalue=0, int startvalue=0); void SetValue(int...
zzz-engine
zzzEngine/zCore/zCore/Utility/TextProgress.hpp
C++
gpl3
977
#pragma once #include "../common.hpp" #include "../Xml/RapidXMLNode.hpp" namespace zzz{ class IOData { public: virtual bool LoadFile(const string &)=0; virtual bool SaveFile(const string &)=0; }; class IODataA : public IOData { public: bool SaveFile(const string &filename) { ofstream fo(file...
zzz-engine
zzzEngine/zCore/zCore/Utility/IOInterface.hpp
C++
gpl3
1,251
#pragma once #include "AnyHolder.hpp" // Options is a AnyHolder that holds porperties. // These properties should be simple variables and string. namespace zzz { class Options : public AnyHolder { public: bool Parse(const string &str); }; } // namespace zzz
zzz-engine
zzzEngine/zCore/zCore/Utility/Options.hpp
C++
gpl3
270
#pragma once #include "FileTools.hpp" #include <3rdParty/SmallObj.hpp> #include "BraceNode.hpp" namespace zzz{ class BraceItem { public: BraceItem():head_(0),tail_(0){} virtual ~BraceItem(); void Clear(); BraceItem* AddNode(const string &str, const char h=0, const char t=0); string text_; c...
zzz-engine
zzzEngine/zCore/zCore/Utility/BraceFile.hpp
C++
gpl3
807
#pragma once #include <zCoreConfig.hpp> #include <vector> #include "Log.hpp" #include "IOObject.hpp" // This class wrapped std::vector // It implements all vector's interface, so simply replace std::vector to zzz::STLVector will make it. // It will print out error instead of crush when allocation fails. names...
zzz-engine
zzzEngine/zCore/zCore/Utility/STLVector.hpp
C++
gpl3
10,731
#define ZCORE_SOURCE #include "BraceNode.hpp" #include "BraceFile.hpp" #include "Log.hpp" namespace zzz{ BraceNode::BraceNode(const BraceNode &node) :item(node.item),parent(node.parent),idx(node.idx) {} BraceNode::BraceNode(BraceItem *_item,BraceItem *_parent,int i) :item(_item),parent(_parent),idx(i) {...
zzz-engine
zzzEngine/zCore/zCore/Utility/BraceNode.cpp
C++
gpl3
5,574
#ifdef WIN32 #include <stdarg.h> inline void va_copy(va_list &a, va_list &b) { a = b; } typedef int uid_t; #endif
zzz-engine
zzzEngine/zCore/zCore/Utility/Port.hpp
C++
gpl3
124
#pragma once #include "../common.hpp" #include "IndexSet.hpp" namespace zzz{ class StringGenerator : public IndexSet<string> { public: StringGenerator(){} StringGenerator(const vector<string> &strs){strings_=strs;} StringGenerator(const StringGenerator &other){strings_=other.strings_;} const StringG...
zzz-engine
zzzEngine/zCore/zCore/Utility/StringGenerator.hpp
C++
gpl3
1,657
#pragma once #include <zCoreConfig.hpp> #include "../common.hpp" #include "Timer.hpp" // Mimic Google progress bar behavior namespace zzz { #define ZVERBOSE_PROGRESS_BAR (ZINFO) class ZCORE_CLASS TextProgressBar { public: typedef enum {STYLE_NORMAL, STYLE_Z} Style; TextProgressBar(const string &msg, b...
zzz-engine
zzzEngine/zCore/zCore/Utility/TextProgressBar.hpp
C++
gpl3
1,830
#define ZCORE_SOURCE #include "TextProgress.hpp" namespace zzz { TextProgress::TextProgress(const string &_content, int endvalue, int startvalue) { SetContent(_content); SetValue(endvalue,startvalue); SetAppearance('[', ']', '-', '+',30); } void TextProgress::SetValue(int _endvalue, int _startvalue) ...
zzz-engine
zzzEngine/zCore/zCore/Utility/TextProgress.cpp
C++
gpl3
2,633
#pragma once #include <zCoreConfig.hpp> #ifdef ZZZ_LIB_PTHREAD #include <pthread.h> namespace zzz{ class ZCORE_CLASS Thread { public: Thread(); void Start(); void Wait(); bool IsRunning(); virtual void Main()=0; pthread_t thread; bool running; }; class ZCORE_CLASS Mutex { public:...
zzz-engine
zzzEngine/zCore/zCore/Utility/Thread.hpp
C++
gpl3
658
#define ZCORE_SOURCE #include <EnvDetect.hpp> #include "FileTools.hpp" #include "Log.hpp" #include <sys/stat.h> #ifdef ZZZ_OS_WIN #include <3rdParty/dirent.h> #include <direct.h> #define _GetCurrentDir _getcwd #define _MkDir _mkdir #define SPLITOR "\\" #else #include <dirent.h> #include <unis...
zzz-engine
zzzEngine/zCore/zCore/Utility/FileTools.cpp
C++
gpl3
14,069
#define ZCORE_SOURCE #include "TextProgressBar.hpp" #include "Log.hpp" #include "StringPrintf.hpp" #include "../Math/Math.hpp" // Mimic Google progress bar behavior namespace zzz { TextProgressBar::TextProgressBar(const string &msg, bool active_mode, Style style) :msg_(msg), active_mode_(active_mode), max_(...
zzz-engine
zzzEngine/zCore/zCore/Utility/TextProgressBar.cpp
C++
gpl3
8,360
#pragma once #include <common.hpp> //it is the base class of a kind of set //it will take a integer and return a value //for example, filename set can return filename //and image set can return an image namespace zzz{ template<typename T, typename IDX=zuint> class IndexSet { public: virtual T Get(const...
zzz-engine
zzzEngine/zCore/zCore/Utility/IndexSet.hpp
C++
gpl3
338
#pragma once //a generalized tree //every node connect to father, siblings and sons namespace zzz{ template<typename T> struct TreeNode { public: T v; TreeNode<T> *father; vector<TreeNode<T> *> sons; int height; TreeNode(); ~TreeNode(); void AddSon(TreeNode<T> *son); bool DeleteSon(...
zzz-engine
zzzEngine/zCore/zCore/Utility/Tree.hpp
C++
gpl3
3,562