hexsha
stringlengths
40
40
size
int64
7
1.05M
ext
stringclasses
13 values
lang
stringclasses
1 value
max_stars_repo_path
stringlengths
4
269
max_stars_repo_name
stringlengths
5
109
max_stars_repo_head_hexsha
stringlengths
40
40
max_stars_repo_licenses
listlengths
1
9
max_stars_count
int64
1
191k
max_stars_repo_stars_event_min_datetime
stringlengths
24
24
max_stars_repo_stars_event_max_datetime
stringlengths
24
24
max_issues_repo_path
stringlengths
4
269
max_issues_repo_name
stringlengths
5
116
max_issues_repo_head_hexsha
stringlengths
40
40
max_issues_repo_licenses
listlengths
1
9
max_issues_count
int64
1
48.5k
max_issues_repo_issues_event_min_datetime
stringlengths
24
24
max_issues_repo_issues_event_max_datetime
stringlengths
24
24
max_forks_repo_path
stringlengths
4
269
max_forks_repo_name
stringlengths
5
116
max_forks_repo_head_hexsha
stringlengths
40
40
max_forks_repo_licenses
listlengths
1
9
max_forks_count
int64
1
105k
max_forks_repo_forks_event_min_datetime
stringlengths
24
24
max_forks_repo_forks_event_max_datetime
stringlengths
24
24
content
stringlengths
7
1.05M
avg_line_length
float64
1.21
330k
max_line_length
int64
6
990k
alphanum_fraction
float64
0.01
0.99
author_id
stringlengths
2
40
dc659e1bd88a8f1726a38f6c3fefda7acb1a3843
1,984
cpp
C++
graph/course_schedule.cpp
zm66260/Data_Structure_and_Algorithms
f3e6d60a9f0ddf1a8fe943dedc089172bc8c833e
[ "MIT" ]
null
null
null
graph/course_schedule.cpp
zm66260/Data_Structure_and_Algorithms
f3e6d60a9f0ddf1a8fe943dedc089172bc8c833e
[ "MIT" ]
null
null
null
graph/course_schedule.cpp
zm66260/Data_Structure_and_Algorithms
f3e6d60a9f0ddf1a8fe943dedc089172bc8c833e
[ "MIT" ]
null
null
null
// 207 course schedule // There are a total of n courses you have to take, labeled from 0 to n-1. // Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1] // Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses? // Example 1: // Input: 2, [[1,0]] // Output: true // Explanation: There are a total of 2 courses to take. //   To take course 1 you should have finished course 0. So it is possible. // Example 2: // Input: 2, [[1,0],[0,1]] // Output: false // Explanation: There are a total of 2 courses to take. //   To take course 1 you should have finished course 0, and to take course 0 you should //   also have finished course 1. So it is impossible. // DAG directed acycle graph store as edge #include<vector> #include<queue> using namespace std; class Solution { public: bool canFinish(int numCourses, vector<vector<int>>& prerequisites) { vector<int> inDegree(numCourses, 0); vector<vector<int>> adjacentList(numCourses, vector<int>()); if(prerequisites.size() == 0){return true;} for(int i = 0; i < prerequisites.size(); i++){ inDegree[prerequisites[i][0]]++; adjacentList[prerequisites[i][1]].push_back(prerequisites[i][0]); } queue<int> q; for(int i = 0; i < inDegree.size(); i++){ if(inDegree[i] == 0 ){ q.push(i);} } vector<int> rest; while(!q.empty()){ int course = q.front(); q.pop(); rest.push_back(course); for(int adj : adjacentList[course]){ inDegree[adj]--; if(inDegree[adj]==0){q.push(adj);} } } if(rest.size() == numCourses){return true;} return false; } };
32
138
0.568044
zm66260
dc6b6d8e1e212cc59a4fde3d5e89cdb5e0a0aba9
22,038
cxx
C++
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.cxx
kagarner/AliRoot
4648616e4ecc903ad132252dd94f9eacf1c5ad16
[ "BSD-3-Clause" ]
null
null
null
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.cxx
kagarner/AliRoot
4648616e4ecc903ad132252dd94f9eacf1c5ad16
[ "BSD-3-Clause" ]
null
null
null
HLT/TPCLib/tracking-ca/AliHLTTPCCATrackParam.cxx
kagarner/AliRoot
4648616e4ecc903ad132252dd94f9eacf1c5ad16
[ "BSD-3-Clause" ]
null
null
null
// $Id$ // ************************************************************************** // This file is property of and copyright by the ALICE HLT Project * // ALICE Experiment at CERN, All rights reserved. * // * // Primary Authors: Sergey Gorbunov <sergey.gorbunov@kip.uni-heidelberg.de> * // Ivan Kisel <kisel@kip.uni-heidelberg.de> * // for The ALICE HLT Project. * // * // Permission to use, copy, modify and distribute this software and its * // documentation strictly for non-commercial purposes is hereby granted * // without fee, provided that the above copyright notice appears in all * // copies and that both the copyright notice and this permission notice * // appear in the supporting documentation. The authors make no claims * // about the suitability of this software for any purpose. It is * // provided "as is" without express or implied warranty. * // * //*************************************************************************** #include "AliHLTTPCCATrackParam.h" #include "AliHLTTPCCAMath.h" #include "AliHLTTPCCATrackLinearisation.h" #if !defined(__OPENCL__) | defined(HLTCA_HOSTCODE) #include <iostream> #endif // // Circle in XY: // // kCLight = 0.000299792458; // Kappa = -Bz*kCLight*QPt; // R = 1/TMath::Abs(Kappa); // Xc = X - sin(Phi)/Kappa; // Yc = Y + cos(Phi)/Kappa; // MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::GetDist2( const MEM_LG(AliHLTTPCCATrackParam) &t ) const { // get squared distance between tracks float dx = GetX() - t.GetX(); float dy = GetY() - t.GetY(); float dz = GetZ() - t.GetZ(); return dx*dx + dy*dy + dz*dz; } MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::GetDistXZ2( const MEM_LG(AliHLTTPCCATrackParam) &t ) const { // get squared distance between tracks in X&Z float dx = GetX() - t.GetX(); float dz = GetZ() - t.GetZ(); return dx*dx + dz*dz; } MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::GetS( float x, float y, float Bz ) const { //* Get XY path length to the given point float k = GetKappa( Bz ); float ex = GetCosPhi(); float ey = GetSinPhi(); x -= GetX(); y -= GetY(); float dS = x * ex + y * ey; if ( CAMath::Abs( k ) > 1.e-4 ) dS = CAMath::ATan2( k * dS, 1 + k * ( x * ey - y * ex ) ) / k; return dS; } MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCATrackParam)::GetDCAPoint( float x, float y, float z, float &xp, float &yp, float &zp, float Bz ) const { //* Get the track point closest to the (x,y,z) float x0 = GetX(); float y0 = GetY(); float k = GetKappa( Bz ); float ex = GetCosPhi(); float ey = GetSinPhi(); float dx = x - x0; float dy = y - y0; float ax = dx * k + ey; float ay = dy * k - ex; float a = sqrt( ax * ax + ay * ay ); xp = x0 + ( dx - ey * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a; yp = y0 + ( dy + ex * ( ( dx * dx + dy * dy ) * k - 2 * ( -dx * ey + dy * ex ) ) / ( a + 1 ) ) / a; float s = GetS( x, y, Bz ); zp = GetZ() + GetDzDs() * s; if ( CAMath::Abs( k ) > 1.e-2 ) { float dZ = CAMath::Abs( GetDzDs() * CAMath::TwoPi() / k ); if ( dZ > .1 ) { zp += CAMath::Nint( ( z - zp ) / dZ ) * dZ; } } } //* //* Transport routines //* MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::TransportToX( float x, AliHLTTPCCATrackLinearisation &t0, float Bz, float maxSinPhi, float *DL ) { //* Transport the track parameters to X=x, using linearization at t0, and the field value Bz //* maxSinPhi is the max. allowed value for |t0.SinPhi()| //* linearisation of trajectory t0 is also transported to X=x, //* returns 1 if OK //* float ex = t0.CosPhi(); float ey = t0.SinPhi(); float k =-t0.QPt() * Bz; float dx = x - X(); float ey1 = k * dx + ey; float ex1; // check for intersection with X=x if ( CAMath::Abs( ey1 ) > maxSinPhi ) return 0; ex1 = CAMath::Sqrt( 1 - ey1 * ey1 ); if ( ex < 0 ) ex1 = -ex1; float dx2 = dx * dx; float ss = ey + ey1; float cc = ex + ex1; if ( CAMath::Abs( cc ) < 1.e-4 || CAMath::Abs( ex ) < 1.e-4 || CAMath::Abs( ex1 ) < 1.e-4 ) return 0; float tg = ss / cc; // tan((phi1+phi)/2) float dy = dx * tg; float dl = dx * CAMath::Sqrt( 1 + tg * tg ); if ( cc < 0 ) dl = -dl; float dSin = dl * k / 2; if ( dSin > 1 ) dSin = 1; if ( dSin < -1 ) dSin = -1; float dS = ( CAMath::Abs( k ) > 1.e-4 ) ? ( 2 * CAMath::ASin( dSin ) / k ) : dl; float dz = dS * t0.DzDs(); if ( DL ) *DL = -dS * CAMath::Sqrt( 1 + t0.DzDs() * t0.DzDs() ); float cci = 1. / cc; float exi = 1. / ex; float ex1i = 1. / ex1; float d[5] = { 0, 0, GetPar(2) - t0.SinPhi(), GetPar(3) - t0.DzDs(), GetPar(4) - t0.QPt() }; //float H0[5] = { 1,0, h2, 0, h4 }; //float H1[5] = { 0, 1, 0, dS, 0 }; //float H2[5] = { 0, 0, 1, 0, dxBz }; //float H3[5] = { 0, 0, 0, 1, 0 }; //float H4[5] = { 0, 0, 0, 0, 1 }; float h2 = dx * ( 1 + ey * ey1 + ex * ex1 ) * exi * ex1i * cci; float h4 = dx2 * ( cc + ss * ey1 * ex1i ) * cci * cci * (-Bz); float dxBz = dx * (-Bz); t0.SetCosPhi( ex1 ); t0.SetSinPhi( ey1 ); SetX(X() + dx); SetPar(0, Y() + dy + h2 * d[2] + h4 * d[4]); SetPar(1, Z() + dz + dS * d[3]); SetPar(2, t0.SinPhi() + d[2] + dxBz * d[4]); float c00 = fC[0]; float c10 = fC[1]; float c11 = fC[2]; float c20 = fC[3]; float c21 = fC[4]; float c22 = fC[5]; float c30 = fC[6]; float c31 = fC[7]; float c32 = fC[8]; float c33 = fC[9]; float c40 = fC[10]; float c41 = fC[11]; float c42 = fC[12]; float c43 = fC[13]; float c44 = fC[14]; //This is not the correct propagation!!! The max ensures the positional error does not decrease during track finding. //A different propagation method is used for the fit. fC[0] = c00 + h2 * h2 * c22 + h4 * h4 * c44 + 2 * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 ); fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 ); fC[2] = c11 + 2 * dS * c31 + dS * dS * c33; fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 ); fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 ); fC[5] = c22 + 2 * dxBz * c42 + dxBz * dxBz * c44; fC[6] = c30 + h2 * c32 + h4 * c43; fC[7] = c31 + dS * c33; fC[8] = c32 + dxBz * c43; fC[9] = c33; fC[10] = c40 + h2 * c42 + h4 * c44; fC[11] = c41 + dS * c43; fC[12] = c42 + dxBz * c44; fC[13] = c43; fC[14] = c44; return 1; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::TransportToX( float x, float sinPhi0, float cosPhi0, float Bz, float maxSinPhi ) { //* Transport the track parameters to X=x, using linearization at phi0 with 0 curvature, //* and the field value Bz //* maxSinPhi is the max. allowed value for |t0.SinPhi()| //* linearisation of trajectory t0 is also transported to X=x, //* returns 1 if OK //* float ex = cosPhi0; float ey = sinPhi0; float dx = x - X(); if ( CAMath::Abs( ex ) < 1.e-4 ) return 0; float exi = 1. / ex; float dxBz = dx * (-Bz); float dS = dx * exi; float h2 = dS * exi * exi; float h4 = .5 * h2 * dxBz; //float H0[5] = { 1,0, h2, 0, h4 }; //float H1[5] = { 0, 1, 0, dS, 0 }; //float H2[5] = { 0, 0, 1, 0, dxBz }; //float H3[5] = { 0, 0, 0, 1, 0 }; //float H4[5] = { 0, 0, 0, 0, 1 }; float sinPhi = SinPhi() + dxBz * QPt(); if ( maxSinPhi > 0 && CAMath::Abs( sinPhi ) > maxSinPhi ) return 0; SetX(X() + dx); SetPar(0, GetPar(0) + dS * ey + h2 * ( SinPhi() - ey ) + h4 * QPt()); SetPar(1, GetPar(1) + dS * DzDs()); SetPar(2, sinPhi); float c00 = fC[0]; float c10 = fC[1]; float c11 = fC[2]; float c20 = fC[3]; float c21 = fC[4]; float c22 = fC[5]; float c30 = fC[6]; float c31 = fC[7]; float c32 = fC[8]; float c33 = fC[9]; float c40 = fC[10]; float c41 = fC[11]; float c42 = fC[12]; float c43 = fC[13]; float c44 = fC[14]; //This is not the correct propagation!!! The max ensures the positional error does not decrease during track finding. //A different propagation method is used for the fit. fC[0] = CAMath::Max(c00, c00 + h2 * h2 * c22 + h4 * h4 * c44 + 2 * ( h2 * c20 + h4 * c40 + h2 * h4 * c42 )); fC[1] = c10 + h2 * c21 + h4 * c41 + dS * ( c30 + h2 * c32 + h4 * c43 ); fC[2] = CAMath::Max(c11, c11 + 2 * dS * c31 + dS * dS * c33); fC[3] = c20 + h2 * c22 + h4 * c42 + dxBz * ( c40 + h2 * c42 + h4 * c44 ); fC[4] = c21 + dS * c32 + dxBz * ( c41 + dS * c43 ); fC[5] = c22 + 2 * dxBz * c42 + dxBz * dxBz * c44; fC[6] = c30 + h2 * c32 + h4 * c43; fC[7] = c31 + dS * c33; fC[8] = c32 + dxBz * c43; fC[9] = c33; fC[10] = c40 + h2 * c42 + h4 * c44; fC[11] = c41 + dS * c43; fC[12] = c42 + dxBz * c44; fC[13] = c43; fC[14] = c44; return 1; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::TransportToX( float x, float Bz, float maxSinPhi ) { //* Transport the track parameters to X=x AliHLTTPCCATrackLinearisation t0( *this ); return TransportToX( x, t0, Bz, maxSinPhi ); } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::TransportToXWithMaterial( float x, AliHLTTPCCATrackLinearisation &t0, AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi ) { //* Transport the track parameters to X=x taking into account material budget const float kRho = 1.025e-3;//0.9e-3; const float kRadLen = 29.532;//28.94; const float kRhoOverRadLen = kRho / kRadLen; float dl; if ( !TransportToX( x, t0, Bz, maxSinPhi, &dl ) ) return 0; CorrectForMeanMaterial( dl*kRhoOverRadLen, dl*kRho, par ); return 1; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::TransportToXWithMaterial( float x, AliHLTTPCCATrackFitParam &par, float Bz, float maxSinPhi ) { //* Transport the track parameters to X=x taking into account material budget AliHLTTPCCATrackLinearisation t0( *this ); return TransportToXWithMaterial( x, t0, par, Bz, maxSinPhi ); } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::TransportToXWithMaterial( float x, float Bz, float maxSinPhi ) { //* Transport the track parameters to X=x taking into account material budget AliHLTTPCCATrackFitParam par; CalculateFitParameters( par ); return TransportToXWithMaterial( x, par, Bz, maxSinPhi ); } //* //* Multiple scattering and energy losses //* MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::BetheBlochGeant( float bg2, float kp0, float kp1, float kp2, float kp3, float kp4 ) { // // This is the parameterization of the Bethe-Bloch formula inspired by Geant. // // bg2 - (beta*gamma)^2 // kp0 - density [g/cm^3] // kp1 - density effect first junction point // kp2 - density effect second junction point // kp3 - mean excitation energy [GeV] // kp4 - mean Z/A // // The default values for the kp* parameters are for silicon. // The returned value is in [GeV/(g/cm^2)]. // const float mK = 0.307075e-3; // [GeV*cm^2/g] const float me = 0.511e-3; // [GeV/c^2] const float rho = kp0; const float x0 = kp1 * 2.303; const float x1 = kp2 * 2.303; const float mI = kp3; const float mZA = kp4; const float maxT = 2 * me * bg2; // neglecting the electron mass //*** Density effect float d2 = 0.; const float x = 0.5 * AliHLTTPCCAMath::Log( bg2 ); const float lhwI = AliHLTTPCCAMath::Log( 28.816 * 1e-9 * AliHLTTPCCAMath::Sqrt( rho * mZA ) / mI ); if ( x > x1 ) { d2 = lhwI + x - 0.5; } else if ( x > x0 ) { const float r = ( x1 - x ) / ( x1 - x0 ); d2 = lhwI + x - 0.5 + ( 0.5 - lhwI - x0 ) * r * r * r; } return mK*mZA*( 1 + bg2 ) / bg2*( 0.5*AliHLTTPCCAMath::Log( 2*me*bg2*maxT / ( mI*mI ) ) - bg2 / ( 1 + bg2 ) - d2 ); } MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::BetheBlochSolid( float bg ) { //------------------------------------------------------------------ // This is an approximation of the Bethe-Bloch formula, // reasonable for solid materials. // All the parameters are, in fact, for Si. // The returned value is in [GeV] //------------------------------------------------------------------ return BetheBlochGeant( bg ); } MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::BetheBlochGas( float bg ) { //------------------------------------------------------------------ // This is an approximation of the Bethe-Bloch formula, // reasonable for gas materials. // All the parameters are, in fact, for Ne. // The returned value is in [GeV] //------------------------------------------------------------------ const float rho = 0.9e-3; const float x0 = 2.; const float x1 = 4.; const float mI = 140.e-9; const float mZA = 0.49555; return BetheBlochGeant( bg, rho, x0, x1, mI, mZA ); } MEM_CLASS_PRE() GPUdi() float MEM_LG(AliHLTTPCCATrackParam)::ApproximateBetheBloch( float beta2 ) { //------------------------------------------------------------------ // This is an approximation of the Bethe-Bloch formula with // the density effect taken into account at beta*gamma > 3.5 // (the approximation is reasonable only for solid materials) //------------------------------------------------------------------ if ( beta2 >= 1 ) return 0; if ( beta2 / ( 1 - beta2 ) > 3.5*3.5 ) return 0.153e-3 / beta2*( log( 3.5*5940 ) + 0.5*log( beta2 / ( 1 - beta2 ) ) - beta2 ); return 0.153e-3 / beta2*( log( 5940*beta2 / ( 1 - beta2 ) ) - beta2 ); } MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCATrackParam)::CalculateFitParameters( AliHLTTPCCATrackFitParam &par, float mass ) { //*! float qpt = GetPar(4); if( fC[14]>=1. ) qpt = 1./0.35; float p2 = ( 1. + GetPar(3) * GetPar(3) ); float k2 = qpt * qpt; float mass2 = mass * mass; float beta2 = p2 / ( p2 + mass2 * k2 ); float pp2 = ( k2 > 1.e-8 ) ? p2 / k2 : 10000; // impuls 2 //par.fBethe = BetheBlochGas( pp2/mass2); par.fBethe = ApproximateBetheBloch( pp2 / mass2 ); par.fE = CAMath::Sqrt( pp2 + mass2 ); par.fTheta2 = 14.1 * 14.1 / ( beta2 * pp2 * 1e6 ); par.fEP2 = par.fE / pp2; // Approximate energy loss fluctuation (M.Ivanov) const float knst = 0.07; // To be tuned. par.fSigmadE2 = knst * par.fEP2 * qpt; par.fSigmadE2 = par.fSigmadE2 * par.fSigmadE2; par.fK22 = ( 1. + GetPar(3) * GetPar(3) ); par.fK33 = par.fK22 * par.fK22; par.fK43 = 0; par.fK44 = GetPar(3) * GetPar(3) * k2; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::CorrectForMeanMaterial( float xOverX0, float xTimesRho, const AliHLTTPCCATrackFitParam &par ) { //------------------------------------------------------------------ // This function corrects the track parameters for the crossed material. // "xOverX0" - X/X0, the thickness in units of the radiation length. // "xTimesRho" - is the product length*density (g/cm^2). //------------------------------------------------------------------ float &fC22 = fC[5]; float &fC33 = fC[9]; float &fC40 = fC[10]; float &fC41 = fC[11]; float &fC42 = fC[12]; float &fC43 = fC[13]; float &fC44 = fC[14]; //Energy losses************************ float dE = par.fBethe * xTimesRho; if ( CAMath::Abs( dE ) > 0.3*par.fE ) return 0; //30% energy loss is too much! float corr = ( 1. - par.fEP2 * dE ); if ( corr < 0.3 || corr > 1.3 ) return 0; SetPar(4, GetPar(4) * corr); fC40 *= corr; fC41 *= corr; fC42 *= corr; fC43 *= corr; fC44 *= corr * corr; fC44 += par.fSigmadE2 * CAMath::Abs( dE ); //Multiple scattering****************** float theta2 = par.fTheta2 * CAMath::Abs( xOverX0 ); fC22 += theta2 * par.fK22 * (1.-GetPar(2))*(1.+GetPar(2)); fC33 += theta2 * par.fK33; fC43 += theta2 * par.fK43; fC44 += theta2 * par.fK44; return 1; } //* //* Rotation //* MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::Rotate( float alpha, float maxSinPhi ) { //* Rotate the coordinate system in XY on the angle alpha float cA = CAMath::Cos( alpha ); float sA = CAMath::Sin( alpha ); float x = X(), y = Y(), sP = SinPhi(), cP = GetCosPhi(); float cosPhi = cP * cA + sP * sA; float sinPhi = -cP * sA + sP * cA; if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2 ) return 0; float j0 = cP / cosPhi; float j2 = cosPhi / cP; SetX( x*cA + y*sA ); SetY( -x*sA + y*cA ); SetSignCosPhi( cosPhi ); SetSinPhi( sinPhi ); //float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y // { 0, 1, 0, 0, 0 }, // Z // { 0, 0, j2, 0, 0 }, // SinPhi // { 0, 0, 0, 1, 0 }, // DzDs // { 0, 0, 0, 0, 1 } }; // Kappa //cout<<"alpha="<<alpha<<" "<<x<<" "<<y<<" "<<sP<<" "<<cP<<" "<<j0<<" "<<j2<<endl; //cout<<" "<<fC[0]<<" "<<fC[1]<<" "<<fC[6]<<" "<<fC[10]<<" "<<fC[4]<<" "<<fC[5]<<" "<<fC[8]<<" "<<fC[12]<<endl; fC[0] *= j0 * j0; fC[1] *= j0; fC[3] *= j0; fC[6] *= j0; fC[10] *= j0; fC[3] *= j2; fC[4] *= j2; fC[5] *= j2 * j2; fC[8] *= j2; fC[12] *= j2; if (cosPhi < 0) { SetSinPhi(-SinPhi()); SetDzDs(-DzDs()); SetQPt(-QPt()); fC[3] = - fC[3]; fC[4] = - fC[4]; fC[6] = - fC[6]; fC[7] = - fC[7]; fC[10] = -fC[10]; fC[11] = -fC[11]; } //cout<<" "<<fC[0]<<" "<<fC[1]<<" "<<fC[6]<<" "<<fC[10]<<" "<<fC[4]<<" "<<fC[5]<<" "<<fC[8]<<" "<<fC[12]<<endl; return 1; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::Rotate( float alpha, AliHLTTPCCATrackLinearisation &t0, float maxSinPhi ) { //* Rotate the coordinate system in XY on the angle alpha float cA = CAMath::Cos( alpha ); float sA = CAMath::Sin( alpha ); float x0 = X(), y0 = Y(), sP = t0.SinPhi(), cP = t0.CosPhi(); float cosPhi = cP * cA + sP * sA; float sinPhi = -cP * sA + sP * cA; if ( CAMath::Abs( sinPhi ) > maxSinPhi || CAMath::Abs( cosPhi ) < 1.e-2 || CAMath::Abs( cP ) < 1.e-2 ) return 0; //float J[5][5] = { { j0, 0, 0, 0, 0 }, // Y // { 0, 1, 0, 0, 0 }, // Z // { 0, 0, j2, 0, 0 }, // SinPhi // { 0, 0, 0, 1, 0 }, // DzDs // { 0, 0, 0, 0, 1 } }; // Kappa float j0 = cP / cosPhi; float j2 = cosPhi / cP; float d[2] = {Y() - y0, SinPhi() - sP}; SetX( x0*cA + y0*sA ); SetY( -x0*sA + y0*cA + j0*d[0] ); t0.SetCosPhi( cosPhi ); t0.SetSinPhi( sinPhi ); SetSinPhi( sinPhi + j2*d[1] ); fC[0] *= j0 * j0; fC[1] *= j0; fC[3] *= j0; fC[6] *= j0; fC[10] *= j0; fC[3] *= j2; fC[4] *= j2; fC[5] *= j2 * j2; fC[8] *= j2; fC[12] *= j2; return 1; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::Filter( float y, float z, float err2Y, float err2Z, float maxSinPhi, bool paramOnly ) { //* Add the y,z measurement with the Kalman filter float c00 = fC[ 0], c11 = fC[ 2], c20 = fC[ 3], c31 = fC[ 7], c40 = fC[10]; err2Y += c00; err2Z += c11; float z0 = y - GetPar(0), z1 = z - GetPar(1); if ( err2Y < 1.e-8 || err2Z < 1.e-8 ) return 0; float mS0 = 1. / err2Y; float mS2 = 1. / err2Z; // K = CHtS float k00, k11, k20, k31, k40; k00 = c00 * mS0; k20 = c20 * mS0; k40 = c40 * mS0; k11 = c11 * mS2; k31 = c31 * mS2; float sinPhi = GetPar(2) + k20 * z0 ; if ( maxSinPhi > 0 && CAMath::Abs( sinPhi ) >= maxSinPhi ) return 0; SetPar(0, GetPar(0) + k00 * z0); SetPar(1, GetPar(1) + k11 * z1); SetPar(2, sinPhi); SetPar(3, GetPar(3) + k31 * z1); SetPar(4, GetPar(4) + k40 * z0); if (paramOnly) return true; fNDF += 2; fChi2 += mS0 * z0 * z0 + mS2 * z1 * z1 ; fC[ 0] -= k00 * c00 ; fC[ 3] -= k20 * c00 ; fC[ 5] -= k20 * c20 ; fC[10] -= k40 * c00 ; fC[12] -= k40 * c20 ; fC[14] -= k40 * c40 ; fC[ 2] -= k11 * c11 ; fC[ 7] -= k31 * c11 ; fC[ 9] -= k31 * c31 ; return 1; } MEM_CLASS_PRE() GPUdi() bool MEM_LG(AliHLTTPCCATrackParam)::CheckNumericalQuality() const { //* Check that the track parameters and covariance matrix are reasonable bool ok = AliHLTTPCCAMath::Finite( GetX() ) && AliHLTTPCCAMath::Finite( fSignCosPhi ) && AliHLTTPCCAMath::Finite( fChi2 ); const float *c = Cov(); for ( int i = 0; i < 15; i++ ) ok = ok && AliHLTTPCCAMath::Finite( c[i] ); for ( int i = 0; i < 5; i++ ) ok = ok && AliHLTTPCCAMath::Finite( Par()[i] ); if ( c[0] <= 0 || c[2] <= 0 || c[5] <= 0 || c[9] <= 0 || c[14] <= 0 ) ok = 0; if ( c[0] > 5. || c[2] > 5. || c[5] > 2. || c[9] > 2 //|| ( CAMath::Abs( QPt() ) > 1.e-2 && c[14] > 2. ) ) ok = 0; if ( CAMath::Abs( SinPhi() ) > HLTCA_MAX_SIN_PHI ) ok = 0; if ( CAMath::Abs( QPt() ) > 1. / 0.05 ) ok = 0; if( ok ){ ok = ok && ( c[1]*c[1]<=c[2]*c[0] ) && ( c[3]*c[3]<=c[5]*c[0] ) && ( c[4]*c[4]<=c[5]*c[2] ) && ( c[6]*c[6]<=c[9]*c[0] ) && ( c[7]*c[7]<=c[9]*c[2] ) && ( c[8]*c[8]<=c[9]*c[5] ) && ( c[10]*c[10]<=c[14]*c[0] ) && ( c[11]*c[11]<=c[14]*c[2] ) && ( c[12]*c[12]<=c[14]*c[5] ) && ( c[13]*c[13]<=c[14]*c[9] ); } return ok; } #if !defined(HLTCA_GPUCODE) #include <iostream> #endif MEM_CLASS_PRE() GPUdi() void MEM_LG(AliHLTTPCCATrackParam)::Print() const { //* print parameters #if !defined(HLTCA_GPUCODE) std::cout << "track: x=" << GetX() << " c=" << GetSignCosPhi() << ", P= " << GetY() << " " << GetZ() << " " << GetSinPhi() << " " << GetDzDs() << " " << GetQPt() << std::endl; std::cout << "errs2: " << GetErr2Y() << " " << GetErr2Z() << " " << GetErr2SinPhi() << " " << GetErr2DzDs() << " " << GetErr2QPt() << std::endl; #endif }
29.902307
189
0.52591
kagarner
dc6c6f51a3f40e6a75d64f09955c7d156e1fbb1b
2,631
cpp
C++
src/error.cpp
CorvusPrudens/Cp
e5019e4faee705dadc2ddfb8530a518730276e96
[ "MIT" ]
null
null
null
src/error.cpp
CorvusPrudens/Cp
e5019e4faee705dadc2ddfb8530a518730276e96
[ "MIT" ]
null
null
null
src/error.cpp
CorvusPrudens/Cp
e5019e4faee705dadc2ddfb8530a518730276e96
[ "MIT" ]
null
null
null
#include <iostream> #include <fstream> #include <string> #include "error.h" #include "colors.h" using std::string; string get_line(string filename, int line) { std::ifstream file(filename); int i = 0; char c; while (i < line) { file.read(&c, 1); if (file.eof()) { return "???"; } if (c == '\n') i++; } string out; std::getline(file, out); return out; } void Error::AddError(string message, int line, string file, int code, bool fatal) { item e {message, line, file, code}; errors.push_back(e); if (fatal || errors.size() > max_errors) Report(); } void Error::AddWarning(string message, int line, string file, int code) { item w {message, line, file, code}; warnings.push_back(w); } void Error::Report() { int num_errors = errors.size(); int num_warnings = warnings.size(); if (num_errors > 0) PrintErrors(); if (num_warnings > 0) PrintWarnings(); string ess = num_errors == 1 ? "s, " : ", "; std::cout << num_errors << Colors::Red << " error" << ess << Colors::Stop; ess = num_warnings == 1 ? "s" : ""; std::cout << num_warnings << Colors::Blue << " warning" << ess << Colors::Stop; if (num_errors > 0) { std::cout << ", exiting...\n"; exit(1); } std::cout << "\n"; } void Error::PrintErrors() { for (auto& e : errors) { if (e.file != "-1" && e.line != -1) { std::cout << Colors::Red << "Error " << Colors::Stop; std::cout << "in file " << Colors::Green << "\"" << e.file << "\" " << Colors::Stop; std::cout << "at line " << e.line << ":\n"; string line = get_line(e.file, e.line); std::cout << Colors::Purple << line << Colors::Stop; std::cout << Colors::Green << " -> " << Colors::Stop << e.message << "\n"; } else { std::cout << Colors::Red << "Error: \n" << Colors::Stop; std::cout << Colors::Green << " -> " << Colors::Stop << e.message << "\n"; } } } void Error::PrintWarnings() { for (auto& w : warnings) { if (w.file != "-1" && w.line != -1) { std::cout << Colors::Yellow << "Warning " << Colors::Stop; std::cout << "in file " << Colors::Green << "\"" << w.file << "\" " << Colors::Stop; std::cout << "at line " << w.line << ":\n"; string line = get_line(w.file, w.line); std::cout << Colors::Purple << line << Colors::Stop; std::cout << Colors::Green << " -> " << Colors::Stop << w.message << "\n"; } else { std::cout << Colors::Red << "Error: \n" << Colors::Stop; std::cout << Colors::Green << " -> " << Colors::Stop << w.message << "\n"; } } }
23.702703
90
0.522235
CorvusPrudens
dc6fe0903328ba85281e9d7496a6560e85c85ae9
129,426
cpp
C++
code/addons/dynui/scripting/deargui.cpp
Nechrito/nebula
6c7ef27ab1374d3f751d866500729524f72a0c87
[ "BSD-2-Clause" ]
null
null
null
code/addons/dynui/scripting/deargui.cpp
Nechrito/nebula
6c7ef27ab1374d3f751d866500729524f72a0c87
[ "BSD-2-Clause" ]
null
null
null
code/addons/dynui/scripting/deargui.cpp
Nechrito/nebula
6c7ef27ab1374d3f751d866500729524f72a0c87
[ "BSD-2-Clause" ]
null
null
null
#include <pybind11/pybind11.h> #include <pybind11/functional.h> #include <pybind11/embed.h> #include <pybind11/stl.h> #include <limits> #include "imgui.h" #include "imgui_internal.h" namespace py = pybind11; template<typename T> void template_ImVector(py::module &module, const char* name) { py::class_< ImVector<T> >(module, name) .def_property_readonly_static("stride", [](py::object) { return sizeof(T); }) .def_property_readonly("data", [](const ImVector<T>& self) { return size_t((void*)self.Data); }) .def("__len__", [](const ImVector<T>& self) { return self.size(); }) .def("__iter__", [](const ImVector<T>& self) { return py::make_iterator(self.begin(), self.end()); }) .def("__getitem__", [](const ImVector<T>& self, size_t i) { if ((int)i >= self.size()) throw py::index_error(); return self[i]; }) ; } PYBIND11_EMBEDDED_MODULE(deargui, deargui) { py::class_<ImGuiContext>(deargui, "Context"); template_ImVector<char>(deargui, "Vector_char"); template_ImVector<float>(deargui, "Vector_float"); template_ImVector<unsigned char>(deargui, "Vector_unsignedchar"); template_ImVector<unsigned short>(deargui, "Vector_unsignedshort"); template_ImVector<ImDrawCmd>(deargui, "Vector_DrawCmd"); template_ImVector<ImDrawVert>(deargui, "Vector_DrawVert"); template_ImVector<ImFontGlyph>(deargui, "Vector_FontGlyph"); py::class_<ImVec2> Vec2(deargui, "Vec2"); Vec2.def_readwrite("x", &ImVec2::x); Vec2.def_readwrite("y", &ImVec2::y); Vec2.def(py::init<>()); Vec2.def(py::init<float, float>() , py::arg("_x") , py::arg("_y") ); py::class_<ImVec4> Vec4(deargui, "Vec4"); Vec4.def_readwrite("x", &ImVec4::x); Vec4.def_readwrite("y", &ImVec4::y); Vec4.def_readwrite("z", &ImVec4::z); Vec4.def_readwrite("w", &ImVec4::w); Vec4.def(py::init<>()); Vec4.def(py::init<float, float, float, float>() , py::arg("_x") , py::arg("_y") , py::arg("_z") , py::arg("_w") ); deargui.def("create_context", &ImGui::CreateContext , py::arg("shared_font_atlas") = nullptr , py::return_value_policy::automatic_reference); deargui.def("destroy_context", &ImGui::DestroyContext , py::arg("ctx") = nullptr , py::return_value_policy::automatic_reference); deargui.def("get_current_context", &ImGui::GetCurrentContext , py::return_value_policy::automatic_reference); deargui.def("set_current_context", &ImGui::SetCurrentContext , py::arg("ctx") , py::return_value_policy::automatic_reference); deargui.def("debug_check_version_and_data_layout", &ImGui::DebugCheckVersionAndDataLayout , py::arg("version_str") , py::arg("sz_io") , py::arg("sz_style") , py::arg("sz_vec2") , py::arg("sz_vec4") , py::arg("sz_drawvert") , py::return_value_policy::automatic_reference); deargui.def("get_io", &ImGui::GetIO , py::return_value_policy::reference); deargui.def("get_style", &ImGui::GetStyle , py::return_value_policy::reference); deargui.def("new_frame", &ImGui::NewFrame , py::return_value_policy::automatic_reference); deargui.def("end_frame", &ImGui::EndFrame , py::return_value_policy::automatic_reference); deargui.def("render", &ImGui::Render , py::return_value_policy::automatic_reference); deargui.def("get_draw_data", &ImGui::GetDrawData , py::return_value_policy::automatic_reference); deargui.def("show_demo_window", [](bool * p_open) { ImGui::ShowDemoWindow(p_open); return p_open; } , py::arg("p_open") = nullptr , py::return_value_policy::automatic_reference); deargui.def("show_metrics_window", [](bool * p_open) { ImGui::ShowMetricsWindow(p_open); return p_open; } , py::arg("p_open") = nullptr , py::return_value_policy::automatic_reference); deargui.def("show_style_editor", &ImGui::ShowStyleEditor , py::arg("ref") = nullptr , py::return_value_policy::automatic_reference); deargui.def("show_style_selector", &ImGui::ShowStyleSelector , py::arg("label") , py::return_value_policy::automatic_reference); deargui.def("show_font_selector", &ImGui::ShowFontSelector , py::arg("label") , py::return_value_policy::automatic_reference); deargui.def("show_user_guide", &ImGui::ShowUserGuide , py::return_value_policy::automatic_reference); deargui.def("get_version", &ImGui::GetVersion , py::return_value_policy::automatic_reference); deargui.def("style_colors_dark", &ImGui::StyleColorsDark , py::arg("dst") = nullptr , py::return_value_policy::automatic_reference); deargui.def("style_colors_classic", &ImGui::StyleColorsClassic , py::arg("dst") = nullptr , py::return_value_policy::automatic_reference); deargui.def("style_colors_light", &ImGui::StyleColorsLight , py::arg("dst") = nullptr , py::return_value_policy::automatic_reference); deargui.def("begin", [](const char * name, bool * p_open, ImGuiWindowFlags flags) { auto ret = ImGui::Begin(name, p_open, flags); return std::make_tuple(ret, p_open); } , py::arg("name") , py::arg("p_open") = nullptr , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("end", &ImGui::End , py::return_value_policy::automatic_reference); deargui.def("begin_child", py::overload_cast<const char *, const ImVec2 &, bool, ImGuiWindowFlags>(&ImGui::BeginChild) , py::arg("str_id") , py::arg("size") = ImVec2(0,0) , py::arg("border") = false , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("begin_child", py::overload_cast<ImGuiID, const ImVec2 &, bool, ImGuiWindowFlags>(&ImGui::BeginChild) , py::arg("id") , py::arg("size") = ImVec2(0,0) , py::arg("border") = false , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("end_child", &ImGui::EndChild , py::return_value_policy::automatic_reference); deargui.def("is_window_appearing", &ImGui::IsWindowAppearing , py::return_value_policy::automatic_reference); deargui.def("is_window_collapsed", &ImGui::IsWindowCollapsed , py::return_value_policy::automatic_reference); deargui.def("is_window_focused", &ImGui::IsWindowFocused , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("is_window_hovered", &ImGui::IsWindowHovered , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("get_window_draw_list", &ImGui::GetWindowDrawList , py::return_value_policy::automatic_reference); deargui.def("get_window_pos", &ImGui::GetWindowPos , py::return_value_policy::automatic_reference); deargui.def("get_window_size", &ImGui::GetWindowSize , py::return_value_policy::automatic_reference); deargui.def("get_window_width", &ImGui::GetWindowWidth , py::return_value_policy::automatic_reference); deargui.def("get_window_height", &ImGui::GetWindowHeight , py::return_value_policy::automatic_reference); deargui.def("get_content_region_max", &ImGui::GetContentRegionMax , py::return_value_policy::automatic_reference); deargui.def("get_content_region_avail", &ImGui::GetContentRegionAvail , py::return_value_policy::automatic_reference); deargui.def("get_content_region_avail_width", &ImGui::GetContentRegionAvailWidth , py::return_value_policy::automatic_reference); deargui.def("get_window_content_region_min", &ImGui::GetWindowContentRegionMin , py::return_value_policy::automatic_reference); deargui.def("get_window_content_region_max", &ImGui::GetWindowContentRegionMax , py::return_value_policy::automatic_reference); deargui.def("get_window_content_region_width", &ImGui::GetWindowContentRegionWidth , py::return_value_policy::automatic_reference); deargui.def("set_next_window_pos", &ImGui::SetNextWindowPos , py::arg("pos") , py::arg("cond") = 0 , py::arg("pivot") = ImVec2(0,0) , py::return_value_policy::automatic_reference); deargui.def("set_next_window_size", &ImGui::SetNextWindowSize , py::arg("size") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_next_window_content_size", &ImGui::SetNextWindowContentSize , py::arg("size") , py::return_value_policy::automatic_reference); deargui.def("set_next_window_collapsed", &ImGui::SetNextWindowCollapsed , py::arg("collapsed") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_next_window_focus", &ImGui::SetNextWindowFocus , py::return_value_policy::automatic_reference); deargui.def("set_next_window_bg_alpha", &ImGui::SetNextWindowBgAlpha , py::arg("alpha") , py::return_value_policy::automatic_reference); deargui.def("set_window_pos", py::overload_cast<const ImVec2 &, ImGuiCond>(&ImGui::SetWindowPos) , py::arg("pos") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_window_size", py::overload_cast<const ImVec2 &, ImGuiCond>(&ImGui::SetWindowSize) , py::arg("size") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_window_collapsed", py::overload_cast<bool, ImGuiCond>(&ImGui::SetWindowCollapsed) , py::arg("collapsed") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_window_focus", py::overload_cast<>(&ImGui::SetWindowFocus) , py::return_value_policy::automatic_reference); deargui.def("set_window_font_scale", &ImGui::SetWindowFontScale , py::arg("scale") , py::return_value_policy::automatic_reference); deargui.def("set_window_pos", py::overload_cast<const char *, const ImVec2 &, ImGuiCond>(&ImGui::SetWindowPos) , py::arg("name") , py::arg("pos") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_window_size", py::overload_cast<const char *, const ImVec2 &, ImGuiCond>(&ImGui::SetWindowSize) , py::arg("name") , py::arg("size") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_window_collapsed", py::overload_cast<const char *, bool, ImGuiCond>(&ImGui::SetWindowCollapsed) , py::arg("name") , py::arg("collapsed") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_window_focus", py::overload_cast<const char *>(&ImGui::SetWindowFocus) , py::arg("name") , py::return_value_policy::automatic_reference); deargui.def("get_scroll_x", &ImGui::GetScrollX , py::return_value_policy::automatic_reference); deargui.def("get_scroll_y", &ImGui::GetScrollY , py::return_value_policy::automatic_reference); deargui.def("get_scroll_max_x", &ImGui::GetScrollMaxX , py::return_value_policy::automatic_reference); deargui.def("get_scroll_max_y", &ImGui::GetScrollMaxY , py::return_value_policy::automatic_reference); deargui.def("set_scroll_x", &ImGui::SetScrollX , py::arg("scroll_x") , py::return_value_policy::automatic_reference); deargui.def("set_scroll_y", &ImGui::SetScrollY , py::arg("scroll_y") , py::return_value_policy::automatic_reference); deargui.def("set_scroll_here", &ImGui::SetScrollHereY , py::arg("center_y_ratio") = 0.5f , py::return_value_policy::automatic_reference); deargui.def("set_scroll_from_pos_y", &ImGui::SetScrollFromPosY , py::arg("pos_y") , py::arg("center_y_ratio") = 0.5f , py::return_value_policy::automatic_reference); deargui.def("push_font", &ImGui::PushFont , py::arg("font") , py::return_value_policy::automatic_reference); deargui.def("pop_font", &ImGui::PopFont , py::return_value_policy::automatic_reference); deargui.def("push_style_color", py::overload_cast<ImGuiCol, ImU32>(&ImGui::PushStyleColor) , py::arg("idx") , py::arg("col") , py::return_value_policy::automatic_reference); deargui.def("push_style_color", py::overload_cast<ImGuiCol, const ImVec4 &>(&ImGui::PushStyleColor) , py::arg("idx") , py::arg("col") , py::return_value_policy::automatic_reference); deargui.def("pop_style_color", &ImGui::PopStyleColor , py::arg("count") = 1 , py::return_value_policy::automatic_reference); deargui.def("push_style_var", py::overload_cast<ImGuiStyleVar, float>(&ImGui::PushStyleVar) , py::arg("idx") , py::arg("val") , py::return_value_policy::automatic_reference); deargui.def("push_style_var", py::overload_cast<ImGuiStyleVar, const ImVec2 &>(&ImGui::PushStyleVar) , py::arg("idx") , py::arg("val") , py::return_value_policy::automatic_reference); deargui.def("pop_style_var", &ImGui::PopStyleVar , py::arg("count") = 1 , py::return_value_policy::automatic_reference); deargui.def("get_style_color_vec4", &ImGui::GetStyleColorVec4 , py::arg("idx") , py::return_value_policy::reference); deargui.def("get_font", &ImGui::GetFont , py::return_value_policy::automatic_reference); deargui.def("get_font_size", &ImGui::GetFontSize , py::return_value_policy::automatic_reference); deargui.def("get_font_tex_uv_white_pixel", &ImGui::GetFontTexUvWhitePixel , py::return_value_policy::automatic_reference); deargui.def("get_color_u32", py::overload_cast<ImGuiCol, float>(&ImGui::GetColorU32) , py::arg("idx") , py::arg("alpha_mul") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("get_color_u32", py::overload_cast<const ImVec4 &>(&ImGui::GetColorU32) , py::arg("col") , py::return_value_policy::automatic_reference); deargui.def("get_color_u32", py::overload_cast<ImU32>(&ImGui::GetColorU32) , py::arg("col") , py::return_value_policy::automatic_reference); deargui.def("push_item_width", &ImGui::PushItemWidth , py::arg("item_width") , py::return_value_policy::automatic_reference); deargui.def("pop_item_width", &ImGui::PopItemWidth , py::return_value_policy::automatic_reference); deargui.def("calc_item_width", &ImGui::CalcItemWidth , py::return_value_policy::automatic_reference); deargui.def("push_text_wrap_pos", &ImGui::PushTextWrapPos , py::arg("wrap_pos_x") = 0.0f , py::return_value_policy::automatic_reference); deargui.def("pop_text_wrap_pos", &ImGui::PopTextWrapPos , py::return_value_policy::automatic_reference); deargui.def("push_allow_keyboard_focus", &ImGui::PushAllowKeyboardFocus , py::arg("allow_keyboard_focus") , py::return_value_policy::automatic_reference); deargui.def("pop_allow_keyboard_focus", &ImGui::PopAllowKeyboardFocus , py::return_value_policy::automatic_reference); deargui.def("push_button_repeat", &ImGui::PushButtonRepeat , py::arg("repeat") , py::return_value_policy::automatic_reference); deargui.def("pop_button_repeat", &ImGui::PopButtonRepeat , py::return_value_policy::automatic_reference); deargui.def("separator", &ImGui::Separator , py::return_value_policy::automatic_reference); deargui.def("same_line", &ImGui::SameLine , py::arg("pos_x") = 0.0f , py::arg("spacing_w") = -1.0f , py::return_value_policy::automatic_reference); deargui.def("new_line", &ImGui::NewLine , py::return_value_policy::automatic_reference); deargui.def("spacing", &ImGui::Spacing , py::return_value_policy::automatic_reference); deargui.def("dummy", &ImGui::Dummy , py::arg("size") , py::return_value_policy::automatic_reference); deargui.def("indent", &ImGui::Indent , py::arg("indent_w") = 0.0f , py::return_value_policy::automatic_reference); deargui.def("unindent", &ImGui::Unindent , py::arg("indent_w") = 0.0f , py::return_value_policy::automatic_reference); deargui.def("begin_group", &ImGui::BeginGroup , py::return_value_policy::automatic_reference); deargui.def("end_group", &ImGui::EndGroup , py::return_value_policy::automatic_reference); deargui.def("get_cursor_pos", &ImGui::GetCursorPos , py::return_value_policy::automatic_reference); deargui.def("get_cursor_pos_x", &ImGui::GetCursorPosX , py::return_value_policy::automatic_reference); deargui.def("get_cursor_pos_y", &ImGui::GetCursorPosY , py::return_value_policy::automatic_reference); deargui.def("set_cursor_pos", &ImGui::SetCursorPos , py::arg("local_pos") , py::return_value_policy::automatic_reference); deargui.def("set_cursor_pos_x", &ImGui::SetCursorPosX , py::arg("x") , py::return_value_policy::automatic_reference); deargui.def("set_cursor_pos_y", &ImGui::SetCursorPosY , py::arg("y") , py::return_value_policy::automatic_reference); deargui.def("get_cursor_start_pos", &ImGui::GetCursorStartPos , py::return_value_policy::automatic_reference); deargui.def("get_cursor_screen_pos", &ImGui::GetCursorScreenPos , py::return_value_policy::automatic_reference); deargui.def("set_cursor_screen_pos", &ImGui::SetCursorScreenPos , py::arg("screen_pos") , py::return_value_policy::automatic_reference); deargui.def("align_text_to_frame_padding", &ImGui::AlignTextToFramePadding , py::return_value_policy::automatic_reference); deargui.def("get_text_line_height", &ImGui::GetTextLineHeight , py::return_value_policy::automatic_reference); deargui.def("get_text_line_height_with_spacing", &ImGui::GetTextLineHeightWithSpacing , py::return_value_policy::automatic_reference); deargui.def("get_frame_height", &ImGui::GetFrameHeight , py::return_value_policy::automatic_reference); deargui.def("get_frame_height_with_spacing", &ImGui::GetFrameHeightWithSpacing , py::return_value_policy::automatic_reference); deargui.def("push_id", py::overload_cast<const char *>(&ImGui::PushID) , py::arg("str_id") , py::return_value_policy::automatic_reference); deargui.def("push_id", py::overload_cast<const char *, const char *>(&ImGui::PushID) , py::arg("str_id_begin") , py::arg("str_id_end") , py::return_value_policy::automatic_reference); deargui.def("push_id", py::overload_cast<const void *>(&ImGui::PushID) , py::arg("ptr_id") , py::return_value_policy::automatic_reference); deargui.def("push_id", py::overload_cast<int>(&ImGui::PushID) , py::arg("int_id") , py::return_value_policy::automatic_reference); deargui.def("pop_id", &ImGui::PopID , py::return_value_policy::automatic_reference); deargui.def("get_id", py::overload_cast<const char *>(&ImGui::GetID) , py::arg("str_id") , py::return_value_policy::automatic_reference); deargui.def("get_id", py::overload_cast<const char *, const char *>(&ImGui::GetID) , py::arg("str_id_begin") , py::arg("str_id_end") , py::return_value_policy::automatic_reference); deargui.def("get_id", py::overload_cast<const void *>(&ImGui::GetID) , py::arg("ptr_id") , py::return_value_policy::automatic_reference); deargui.def("text_unformatted", &ImGui::TextUnformatted , py::arg("text") , py::arg("text_end") = nullptr , py::return_value_policy::automatic_reference); deargui.def("text", [](const char * fmt) { ImGui::Text(fmt); return ; } , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("text_colored", [](const ImVec4 & col, const char * fmt) { ImGui::TextColored(col, fmt); return ; } , py::arg("col") , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("text_disabled", [](const char * fmt) { ImGui::TextDisabled(fmt); return ; } , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("text_wrapped", [](const char * fmt) { ImGui::TextWrapped(fmt); return ; } , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("label_text", [](const char * label, const char * fmt) { ImGui::LabelText(label, fmt); return ; } , py::arg("label") , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("bullet_text", [](const char * fmt) { ImGui::BulletText(fmt); return ; } , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("button", &ImGui::Button , py::arg("label") , py::arg("size") = ImVec2(0,0) , py::return_value_policy::automatic_reference); deargui.def("small_button", &ImGui::SmallButton , py::arg("label") , py::return_value_policy::automatic_reference); deargui.def("invisible_button", &ImGui::InvisibleButton , py::arg("str_id") , py::arg("size") , py::return_value_policy::automatic_reference); deargui.def("arrow_button", &ImGui::ArrowButton , py::arg("str_id") , py::arg("dir") , py::return_value_policy::automatic_reference); deargui.def("image", &ImGui::Image , py::arg("user_texture_id") , py::arg("size") , py::arg("uv0") = ImVec2(0,0) , py::arg("uv1") = ImVec2(1,1) , py::arg("tint_col") = ImVec4(1,1,1,1) , py::arg("border_col") = ImVec4(0,0,0,0) , py::return_value_policy::automatic_reference); deargui.def("image_button", &ImGui::ImageButton , py::arg("user_texture_id") , py::arg("size") , py::arg("uv0") = ImVec2(0,0) , py::arg("uv1") = ImVec2(1,1) , py::arg("frame_padding") = -1 , py::arg("bg_col") = ImVec4(0,0,0,0) , py::arg("tint_col") = ImVec4(1,1,1,1) , py::return_value_policy::automatic_reference); deargui.def("checkbox", [](const char * label, bool * v) { auto ret = ImGui::Checkbox(label, v); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::return_value_policy::automatic_reference); deargui.def("checkbox_flags", [](const char * label, unsigned int * flags, unsigned int flags_value) { auto ret = ImGui::CheckboxFlags(label, flags, flags_value); return std::make_tuple(ret, flags); } , py::arg("label") , py::arg("flags") , py::arg("flags_value") , py::return_value_policy::automatic_reference); deargui.def("radio_button", py::overload_cast<const char *, bool>(&ImGui::RadioButton) , py::arg("label") , py::arg("active") , py::return_value_policy::automatic_reference); deargui.def("radio_button", [](const char * label, int * v, int v_button) { auto ret = ImGui::RadioButton(label, v, v_button); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_button") , py::return_value_policy::automatic_reference); deargui.def("progress_bar", &ImGui::ProgressBar , py::arg("fraction") , py::arg("size_arg") = ImVec2(-1,0) , py::arg("overlay") = nullptr , py::return_value_policy::automatic_reference); deargui.def("bullet", &ImGui::Bullet , py::return_value_policy::automatic_reference); deargui.def("begin_combo", &ImGui::BeginCombo , py::arg("label") , py::arg("preview_value") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("end_combo", &ImGui::EndCombo , py::return_value_policy::automatic_reference); deargui.def("drag_float", [](const char * label, float * v, float v_speed, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::DragFloat(label, v, v_speed, v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0.0f , py::arg("v_max") = 0.0f , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("drag_float2", [](const char * label, std::array<float, 2>& v, float v_speed, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::DragFloat2(label, &v[0], v_speed, v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0.0f , py::arg("v_max") = 0.0f , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("drag_float3", [](const char * label, std::array<float, 3>& v, float v_speed, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::DragFloat3(label, &v[0], v_speed, v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0.0f , py::arg("v_max") = 0.0f , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("drag_float4", [](const char * label, std::array<float, 4>& v, float v_speed, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::DragFloat4(label, &v[0], v_speed, v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0.0f , py::arg("v_max") = 0.0f , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("drag_float_range2", [](const char * label, float * v_current_min, float * v_current_max, float v_speed, float v_min, float v_max, const char * format, const char * format_max, float power) { auto ret = ImGui::DragFloatRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max, power); return std::make_tuple(ret, v_current_min, v_current_max); } , py::arg("label") , py::arg("v_current_min") , py::arg("v_current_max") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0.0f , py::arg("v_max") = 0.0f , py::arg("format") = nullptr , py::arg("format_max") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("drag_int", [](const char * label, int * v, float v_speed, int v_min, int v_max, const char * format) { auto ret = ImGui::DragInt(label, v, v_speed, v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0 , py::arg("v_max") = 0 , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("drag_int2", [](const char * label, std::array<int, 2>& v, float v_speed, int v_min, int v_max, const char * format) { auto ret = ImGui::DragInt2(label, &v[0], v_speed, v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0 , py::arg("v_max") = 0 , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("drag_int3", [](const char * label, std::array<int, 3>& v, float v_speed, int v_min, int v_max, const char * format) { auto ret = ImGui::DragInt3(label, &v[0], v_speed, v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0 , py::arg("v_max") = 0 , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("drag_int4", [](const char * label, std::array<int, 4>& v, float v_speed, int v_min, int v_max, const char * format) { auto ret = ImGui::DragInt4(label, &v[0], v_speed, v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0 , py::arg("v_max") = 0 , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("drag_int_range2", [](const char * label, int * v_current_min, int * v_current_max, float v_speed, int v_min, int v_max, const char * format, const char * format_max) { auto ret = ImGui::DragIntRange2(label, v_current_min, v_current_max, v_speed, v_min, v_max, format, format_max); return std::make_tuple(ret, v_current_min, v_current_max); } , py::arg("label") , py::arg("v_current_min") , py::arg("v_current_max") , py::arg("v_speed") = 1.0f , py::arg("v_min") = 0 , py::arg("v_max") = 0 , py::arg("format") = nullptr , py::arg("format_max") = nullptr , py::return_value_policy::automatic_reference); deargui.def("drag_scalar", &ImGui::DragScalar , py::arg("label") , py::arg("data_type") , py::arg("v") , py::arg("v_speed") , py::arg("v_min") = nullptr , py::arg("v_max") = nullptr , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("drag_scalar_n", &ImGui::DragScalarN , py::arg("label") , py::arg("data_type") , py::arg("v") , py::arg("components") , py::arg("v_speed") , py::arg("v_min") = nullptr , py::arg("v_max") = nullptr , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("slider_float", [](const char * label, float * v, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::SliderFloat(label, v, v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("slider_float2", [](const char * label, std::array<float, 2>& v, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::SliderFloat2(label, &v[0], v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("slider_float3", [](const char * label, std::array<float, 3>& v, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::SliderFloat3(label, &v[0], v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("slider_float4", [](const char * label, std::array<float, 4>& v, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::SliderFloat4(label, &v[0], v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("slider_angle", [](const char * label, float * v_rad, float v_degrees_min, float v_degrees_max) { auto ret = ImGui::SliderAngle(label, v_rad, v_degrees_min, v_degrees_max); return std::make_tuple(ret, v_rad); } , py::arg("label") , py::arg("v_rad") , py::arg("v_degrees_min") = -360.0f , py::arg("v_degrees_max") = +360.0f , py::return_value_policy::automatic_reference); deargui.def("slider_int", [](const char * label, int * v, int v_min, int v_max, const char * format) { auto ret = ImGui::SliderInt(label, v, v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("slider_int2", [](const char * label, std::array<int, 2>& v, int v_min, int v_max, const char * format) { auto ret = ImGui::SliderInt2(label, &v[0], v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("slider_int3", [](const char * label, std::array<int, 3>& v, int v_min, int v_max, const char * format) { auto ret = ImGui::SliderInt3(label, &v[0], v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("slider_int4", [](const char * label, std::array<int, 4>& v, int v_min, int v_max, const char * format) { auto ret = ImGui::SliderInt4(label, &v[0], v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("slider_scalar", &ImGui::SliderScalar , py::arg("label") , py::arg("data_type") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("slider_scalar_n", &ImGui::SliderScalarN , py::arg("label") , py::arg("data_type") , py::arg("v") , py::arg("components") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("v_slider_float", [](const char * label, const ImVec2 & size, float * v, float v_min, float v_max, const char * format, float power) { auto ret = ImGui::VSliderFloat(label, size, v, v_min, v_max, format, power); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("size") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("v_slider_int", [](const char * label, const ImVec2 & size, int * v, int v_min, int v_max, const char * format) { auto ret = ImGui::VSliderInt(label, size, v, v_min, v_max, format); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("size") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("v_slider_scalar", &ImGui::VSliderScalar , py::arg("label") , py::arg("size") , py::arg("data_type") , py::arg("v") , py::arg("v_min") , py::arg("v_max") , py::arg("format") = nullptr , py::arg("power") = 1.0f , py::return_value_policy::automatic_reference); deargui.def("input_float", [](const char * label, float * v, float step, float step_fast, const char * format, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputFloat(label, v, step, step_fast, format, extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("step") = 0.0f , py::arg("step_fast") = 0.0f , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_float2", [](const char * label, std::array<float, 2>& v, const char * format, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputFloat2(label, &v[0], format, extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_float3", [](const char * label, std::array<float, 3>& v, const char * format, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputFloat3(label, &v[0], format, extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_float4", [](const char * label, std::array<float, 4>& v, const char * format, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputFloat4(label, &v[0], format, extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_int", [](const char * label, int * v, int step, int step_fast, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputInt(label, v, step, step_fast, extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("step") = 1 , py::arg("step_fast") = 100 , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_int2", [](const char * label, std::array<int, 2>& v, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputInt2(label, &v[0], extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_int3", [](const char * label, std::array<int, 3>& v, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputInt3(label, &v[0], extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_int4", [](const char * label, std::array<int, 4>& v, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputInt4(label, &v[0], extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_double", [](const char * label, double * v, double step, double step_fast, const char * format, ImGuiInputTextFlags extra_flags) { auto ret = ImGui::InputDouble(label, v, step, step_fast, format, extra_flags); return std::make_tuple(ret, v); } , py::arg("label") , py::arg("v") , py::arg("step") = 0.0f , py::arg("step_fast") = 0.0f , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_scalar", &ImGui::InputScalar , py::arg("label") , py::arg("data_type") , py::arg("v") , py::arg("step") = nullptr , py::arg("step_fast") = nullptr , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_scalar_n", &ImGui::InputScalarN , py::arg("label") , py::arg("data_type") , py::arg("v") , py::arg("components") , py::arg("step") = nullptr , py::arg("step_fast") = nullptr , py::arg("format") = nullptr , py::arg("extra_flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("color_edit3", [](const char * label, std::array<float, 3>& col, ImGuiColorEditFlags flags) { auto ret = ImGui::ColorEdit3(label, &col[0], flags); return std::make_tuple(ret, col); } , py::arg("label") , py::arg("col") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("color_edit4", [](const char * label, std::array<float, 4>& col, ImGuiColorEditFlags flags) { auto ret = ImGui::ColorEdit4(label, &col[0], flags); return std::make_tuple(ret, col); } , py::arg("label") , py::arg("col") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("color_picker3", [](const char * label, std::array<float, 3>& col, ImGuiColorEditFlags flags) { auto ret = ImGui::ColorPicker3(label, &col[0], flags); return std::make_tuple(ret, col); } , py::arg("label") , py::arg("col") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("color_picker4", [](const char * label, std::array<float, 4>& col, ImGuiColorEditFlags flags, const float * ref_col) { auto ret = ImGui::ColorPicker4(label, &col[0], flags, ref_col); return std::make_tuple(ret, col); } , py::arg("label") , py::arg("col") , py::arg("flags") = 0 , py::arg("ref_col") = nullptr , py::return_value_policy::automatic_reference); deargui.def("color_button", &ImGui::ColorButton , py::arg("desc_id") , py::arg("col") , py::arg("flags") = 0 , py::arg("size") = ImVec2(0,0) , py::return_value_policy::automatic_reference); deargui.def("set_color_edit_options", &ImGui::SetColorEditOptions , py::arg("flags") , py::return_value_policy::automatic_reference); deargui.def("tree_node", py::overload_cast<const char *>(&ImGui::TreeNode) , py::arg("label") , py::return_value_policy::automatic_reference); deargui.def("tree_node", [](const char * str_id, const char * fmt) { auto ret = ImGui::TreeNode(str_id, fmt); return ret; } , py::arg("str_id") , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("tree_node", [](const void * ptr_id, const char * fmt) { auto ret = ImGui::TreeNode(ptr_id, fmt); return ret; } , py::arg("ptr_id") , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("tree_node_ex", py::overload_cast<const char *, ImGuiTreeNodeFlags>(&ImGui::TreeNodeEx) , py::arg("label") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("tree_node_ex", [](const char * str_id, ImGuiTreeNodeFlags flags, const char * fmt) { auto ret = ImGui::TreeNodeEx(str_id, flags, fmt); return ret; } , py::arg("str_id") , py::arg("flags") , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("tree_node_ex", [](const void * ptr_id, ImGuiTreeNodeFlags flags, const char * fmt) { auto ret = ImGui::TreeNodeEx(ptr_id, flags, fmt); return ret; } , py::arg("ptr_id") , py::arg("flags") , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("tree_push", py::overload_cast<const char *>(&ImGui::TreePush) , py::arg("str_id") , py::return_value_policy::automatic_reference); deargui.def("tree_push", py::overload_cast<const void *>(&ImGui::TreePush) , py::arg("ptr_id") = nullptr , py::return_value_policy::automatic_reference); deargui.def("tree_pop", &ImGui::TreePop , py::return_value_policy::automatic_reference); deargui.def("tree_advance_to_label_pos", &ImGui::TreeAdvanceToLabelPos , py::return_value_policy::automatic_reference); deargui.def("get_tree_node_to_label_spacing", &ImGui::GetTreeNodeToLabelSpacing , py::return_value_policy::automatic_reference); deargui.def("set_next_tree_node_open", &ImGui::SetNextTreeNodeOpen , py::arg("is_open") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("collapsing_header", py::overload_cast<const char *, ImGuiTreeNodeFlags>(&ImGui::CollapsingHeader) , py::arg("label") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("collapsing_header", [](const char * label, bool * p_open, ImGuiTreeNodeFlags flags) { auto ret = ImGui::CollapsingHeader(label, p_open, flags); return std::make_tuple(ret, p_open); } , py::arg("label") , py::arg("p_open") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("selectable", py::overload_cast<const char *, bool, ImGuiSelectableFlags, const ImVec2 &>(&ImGui::Selectable) , py::arg("label") , py::arg("selected") = false , py::arg("flags") = 0 , py::arg("size") = ImVec2(0,0) , py::return_value_policy::automatic_reference); deargui.def("selectable", [](const char * label, bool * p_selected, ImGuiSelectableFlags flags, const ImVec2 & size) { auto ret = ImGui::Selectable(label, p_selected, flags, size); return std::make_tuple(ret, p_selected); } , py::arg("label") , py::arg("p_selected") , py::arg("flags") = 0 , py::arg("size") = ImVec2(0,0) , py::return_value_policy::automatic_reference); deargui.def("list_box_header", py::overload_cast<const char *, const ImVec2 &>(&ImGui::ListBoxHeader) , py::arg("label") , py::arg("size") = ImVec2(0,0) , py::return_value_policy::automatic_reference); deargui.def("list_box_header", py::overload_cast<const char *, int, int>(&ImGui::ListBoxHeader) , py::arg("label") , py::arg("items_count") , py::arg("height_in_items") = -1 , py::return_value_policy::automatic_reference); deargui.def("list_box_footer", &ImGui::ListBoxFooter , py::return_value_policy::automatic_reference); deargui.def("value", py::overload_cast<const char *, bool>(&ImGui::Value) , py::arg("prefix") , py::arg("b") , py::return_value_policy::automatic_reference); deargui.def("value", py::overload_cast<const char *, int>(&ImGui::Value) , py::arg("prefix") , py::arg("v") , py::return_value_policy::automatic_reference); deargui.def("value", py::overload_cast<const char *, unsigned int>(&ImGui::Value) , py::arg("prefix") , py::arg("v") , py::return_value_policy::automatic_reference); deargui.def("value", py::overload_cast<const char *, float, const char *>(&ImGui::Value) , py::arg("prefix") , py::arg("v") , py::arg("float_format") = nullptr , py::return_value_policy::automatic_reference); deargui.def("begin_main_menu_bar", &ImGui::BeginMainMenuBar , py::return_value_policy::automatic_reference); deargui.def("end_main_menu_bar", &ImGui::EndMainMenuBar , py::return_value_policy::automatic_reference); deargui.def("begin_menu_bar", &ImGui::BeginMenuBar , py::return_value_policy::automatic_reference); deargui.def("end_menu_bar", &ImGui::EndMenuBar , py::return_value_policy::automatic_reference); deargui.def("begin_menu", &ImGui::BeginMenu , py::arg("label") , py::arg("enabled") = true , py::return_value_policy::automatic_reference); deargui.def("end_menu", &ImGui::EndMenu , py::return_value_policy::automatic_reference); deargui.def("menu_item", py::overload_cast<const char *, const char *, bool, bool>(&ImGui::MenuItem) , py::arg("label") , py::arg("shortcut") = nullptr , py::arg("selected") = false , py::arg("enabled") = true , py::return_value_policy::automatic_reference); deargui.def("menu_item", [](const char * label, const char * shortcut, bool * p_selected, bool enabled) { auto ret = ImGui::MenuItem(label, shortcut, p_selected, enabled); return std::make_tuple(ret, p_selected); } , py::arg("label") , py::arg("shortcut") , py::arg("p_selected") , py::arg("enabled") = true , py::return_value_policy::automatic_reference); deargui.def("begin_tooltip", &ImGui::BeginTooltip , py::return_value_policy::automatic_reference); deargui.def("end_tooltip", &ImGui::EndTooltip , py::return_value_policy::automatic_reference); deargui.def("set_tooltip", [](const char * fmt) { ImGui::SetTooltip(fmt); return ; } , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("open_popup", &ImGui::OpenPopup , py::arg("str_id") , py::return_value_policy::automatic_reference); deargui.def("begin_popup", &ImGui::BeginPopup , py::arg("str_id") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("begin_popup_context_item", &ImGui::BeginPopupContextItem , py::arg("str_id") = nullptr , py::arg("mouse_button") = 1 , py::return_value_policy::automatic_reference); deargui.def("begin_popup_context_window", &ImGui::BeginPopupContextWindow , py::arg("str_id") = nullptr , py::arg("mouse_button") = 1 , py::arg("also_over_items") = true , py::return_value_policy::automatic_reference); deargui.def("begin_popup_context_void", &ImGui::BeginPopupContextVoid , py::arg("str_id") = nullptr , py::arg("mouse_button") = 1 , py::return_value_policy::automatic_reference); deargui.def("begin_popup_modal", [](const char * name, bool * p_open, ImGuiWindowFlags flags) { auto ret = ImGui::BeginPopupModal(name, p_open, flags); return std::make_tuple(ret, p_open); } , py::arg("name") , py::arg("p_open") = nullptr , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("end_popup", &ImGui::EndPopup , py::return_value_policy::automatic_reference); deargui.def("open_popup_on_item_click", &ImGui::OpenPopupOnItemClick , py::arg("str_id") = nullptr , py::arg("mouse_button") = 1 , py::return_value_policy::automatic_reference); deargui.def("is_popup_open", py::overload_cast<const char *>(&ImGui::IsPopupOpen) , py::arg("str_id") , py::return_value_policy::automatic_reference); deargui.def("close_current_popup", &ImGui::CloseCurrentPopup , py::return_value_policy::automatic_reference); deargui.def("columns", &ImGui::Columns , py::arg("count") = 1 , py::arg("id") = nullptr , py::arg("border") = true , py::return_value_policy::automatic_reference); deargui.def("next_column", &ImGui::NextColumn , py::return_value_policy::automatic_reference); deargui.def("get_column_index", &ImGui::GetColumnIndex , py::return_value_policy::automatic_reference); deargui.def("get_column_width", &ImGui::GetColumnWidth , py::arg("column_index") = -1 , py::return_value_policy::automatic_reference); deargui.def("set_column_width", &ImGui::SetColumnWidth , py::arg("column_index") , py::arg("width") , py::return_value_policy::automatic_reference); deargui.def("get_column_offset", &ImGui::GetColumnOffset , py::arg("column_index") = -1 , py::return_value_policy::automatic_reference); deargui.def("set_column_offset", &ImGui::SetColumnOffset , py::arg("column_index") , py::arg("offset_x") , py::return_value_policy::automatic_reference); deargui.def("get_columns_count", &ImGui::GetColumnsCount , py::return_value_policy::automatic_reference); deargui.def("log_to_tty", &ImGui::LogToTTY , py::arg("max_depth") = -1 , py::return_value_policy::automatic_reference); deargui.def("log_to_file", &ImGui::LogToFile , py::arg("max_depth") = -1 , py::arg("filename") = nullptr , py::return_value_policy::automatic_reference); deargui.def("log_to_clipboard", &ImGui::LogToClipboard , py::arg("max_depth") = -1 , py::return_value_policy::automatic_reference); deargui.def("log_finish", &ImGui::LogFinish , py::return_value_policy::automatic_reference); deargui.def("log_buttons", &ImGui::LogButtons , py::return_value_policy::automatic_reference); deargui.def("log_text", [](const char * fmt) { ImGui::LogText(fmt); return ; } , py::arg("fmt") , py::return_value_policy::automatic_reference); deargui.def("begin_drag_drop_source", &ImGui::BeginDragDropSource , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("set_drag_drop_payload", &ImGui::SetDragDropPayload , py::arg("type") , py::arg("data") , py::arg("size") , py::arg("cond") = 0 , py::return_value_policy::automatic_reference); deargui.def("end_drag_drop_source", &ImGui::EndDragDropSource , py::return_value_policy::automatic_reference); deargui.def("begin_drag_drop_target", &ImGui::BeginDragDropTarget , py::return_value_policy::automatic_reference); deargui.def("accept_drag_drop_payload", &ImGui::AcceptDragDropPayload , py::arg("type") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("end_drag_drop_target", &ImGui::EndDragDropTarget , py::return_value_policy::automatic_reference); deargui.def("push_clip_rect", &ImGui::PushClipRect , py::arg("clip_rect_min") , py::arg("clip_rect_max") , py::arg("intersect_with_current_clip_rect") , py::return_value_policy::automatic_reference); deargui.def("pop_clip_rect", &ImGui::PopClipRect , py::return_value_policy::automatic_reference); deargui.def("set_item_default_focus", &ImGui::SetItemDefaultFocus , py::return_value_policy::automatic_reference); deargui.def("set_keyboard_focus_here", &ImGui::SetKeyboardFocusHere , py::arg("offset") = 0 , py::return_value_policy::automatic_reference); deargui.def("is_item_hovered", &ImGui::IsItemHovered , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("is_item_active", &ImGui::IsItemActive , py::return_value_policy::automatic_reference); deargui.def("is_item_focused", &ImGui::IsItemFocused , py::return_value_policy::automatic_reference); deargui.def("is_item_clicked", &ImGui::IsItemClicked , py::arg("mouse_button") = 0 , py::return_value_policy::automatic_reference); deargui.def("is_item_visible", &ImGui::IsItemVisible , py::return_value_policy::automatic_reference); deargui.def("is_item_edited", &ImGui::IsItemEdited , py::return_value_policy::automatic_reference); deargui.def("is_item_deactivated", &ImGui::IsItemDeactivated , py::return_value_policy::automatic_reference); deargui.def("is_item_deactivated_after_edit", &ImGui::IsItemDeactivatedAfterEdit , py::return_value_policy::automatic_reference); deargui.def("is_any_item_hovered", &ImGui::IsAnyItemHovered , py::return_value_policy::automatic_reference); deargui.def("is_any_item_active", &ImGui::IsAnyItemActive , py::return_value_policy::automatic_reference); deargui.def("is_any_item_focused", &ImGui::IsAnyItemFocused , py::return_value_policy::automatic_reference); deargui.def("get_item_rect_min", &ImGui::GetItemRectMin , py::return_value_policy::automatic_reference); deargui.def("get_item_rect_max", &ImGui::GetItemRectMax , py::return_value_policy::automatic_reference); deargui.def("get_item_rect_size", &ImGui::GetItemRectSize , py::return_value_policy::automatic_reference); deargui.def("set_item_allow_overlap", &ImGui::SetItemAllowOverlap , py::return_value_policy::automatic_reference); deargui.def("is_rect_visible", py::overload_cast<const ImVec2 &>(&ImGui::IsRectVisible) , py::arg("size") , py::return_value_policy::automatic_reference); deargui.def("is_rect_visible", py::overload_cast<const ImVec2 &, const ImVec2 &>(&ImGui::IsRectVisible) , py::arg("rect_min") , py::arg("rect_max") , py::return_value_policy::automatic_reference); deargui.def("get_time", &ImGui::GetTime , py::return_value_policy::automatic_reference); deargui.def("get_frame_count", &ImGui::GetFrameCount , py::return_value_policy::automatic_reference); deargui.def("get_overlay_draw_list", &ImGui::GetOverlayDrawList , py::return_value_policy::automatic_reference); deargui.def("get_draw_list_shared_data", &ImGui::GetDrawListSharedData , py::return_value_policy::automatic_reference); deargui.def("get_style_color_name", &ImGui::GetStyleColorName , py::arg("idx") , py::return_value_policy::automatic_reference); deargui.def("set_state_storage", &ImGui::SetStateStorage , py::arg("storage") , py::return_value_policy::automatic_reference); deargui.def("get_state_storage", &ImGui::GetStateStorage , py::return_value_policy::automatic_reference); deargui.def("calc_text_size", &ImGui::CalcTextSize , py::arg("text") , py::arg("text_end") = nullptr , py::arg("hide_text_after_double_hash") = false , py::arg("wrap_width") = -1.0f , py::return_value_policy::automatic_reference); deargui.def("calc_list_clipping", [](int items_count, float items_height, int * out_items_display_start, int * out_items_display_end) { ImGui::CalcListClipping(items_count, items_height, out_items_display_start, out_items_display_end); return std::make_tuple(out_items_display_start, out_items_display_end); } , py::arg("items_count") , py::arg("items_height") , py::arg("out_items_display_start") , py::arg("out_items_display_end") , py::return_value_policy::automatic_reference); deargui.def("begin_child_frame", &ImGui::BeginChildFrame , py::arg("id") , py::arg("size") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("end_child_frame", &ImGui::EndChildFrame , py::return_value_policy::automatic_reference); deargui.def("color_convert_u32_to_float4", &ImGui::ColorConvertU32ToFloat4 , py::arg("in") , py::return_value_policy::automatic_reference); deargui.def("color_convert_float4_to_u32", &ImGui::ColorConvertFloat4ToU32 , py::arg("in") , py::return_value_policy::automatic_reference); deargui.def("color_convert_rg_bto_hsv", [](float r, float g, float b, float & out_h, float & out_s, float & out_v) { ImGui::ColorConvertRGBtoHSV(r, g, b, out_h, out_s, out_v); return std::make_tuple(out_h, out_s, out_v); } , py::arg("r") , py::arg("g") , py::arg("b") , py::arg("out_h") = 0 , py::arg("out_s") = 0 , py::arg("out_v") = 0 , py::return_value_policy::automatic_reference); deargui.def("color_convert_hs_vto_rgb", [](float h, float s, float v, float & out_r, float & out_g, float & out_b) { ImGui::ColorConvertHSVtoRGB(h, s, v, out_r, out_g, out_b); return std::make_tuple(out_r, out_g, out_b); } , py::arg("h") , py::arg("s") , py::arg("v") , py::arg("out_r") = 0 , py::arg("out_g") = 0 , py::arg("out_b") , py::return_value_policy::automatic_reference); deargui.def("get_key_index", &ImGui::GetKeyIndex , py::arg("imgui_key") , py::return_value_policy::automatic_reference); deargui.def("is_key_down", &ImGui::IsKeyDown , py::arg("user_key_index") , py::return_value_policy::automatic_reference); deargui.def("is_key_pressed", &ImGui::IsKeyPressed , py::arg("user_key_index") , py::arg("repeat") = true , py::return_value_policy::automatic_reference); deargui.def("is_key_released", &ImGui::IsKeyReleased , py::arg("user_key_index") , py::return_value_policy::automatic_reference); deargui.def("get_key_pressed_amount", &ImGui::GetKeyPressedAmount , py::arg("key_index") , py::arg("repeat_delay") , py::arg("rate") , py::return_value_policy::automatic_reference); deargui.def("is_mouse_down", &ImGui::IsMouseDown , py::arg("button") , py::return_value_policy::automatic_reference); deargui.def("is_any_mouse_down", &ImGui::IsAnyMouseDown , py::return_value_policy::automatic_reference); deargui.def("is_mouse_clicked", &ImGui::IsMouseClicked , py::arg("button") , py::arg("repeat") = false , py::return_value_policy::automatic_reference); deargui.def("is_mouse_double_clicked", &ImGui::IsMouseDoubleClicked , py::arg("button") , py::return_value_policy::automatic_reference); deargui.def("is_mouse_released", &ImGui::IsMouseReleased , py::arg("button") , py::return_value_policy::automatic_reference); deargui.def("is_mouse_dragging", &ImGui::IsMouseDragging , py::arg("button") = 0 , py::arg("lock_threshold") = -1.0f , py::return_value_policy::automatic_reference); deargui.def("is_mouse_hovering_rect", &ImGui::IsMouseHoveringRect , py::arg("r_min") , py::arg("r_max") , py::arg("clip") = true , py::return_value_policy::automatic_reference); deargui.def("is_mouse_pos_valid", &ImGui::IsMousePosValid , py::arg("mouse_pos") = nullptr , py::return_value_policy::automatic_reference); deargui.def("get_mouse_pos", &ImGui::GetMousePos , py::return_value_policy::automatic_reference); deargui.def("get_mouse_pos_on_opening_current_popup", &ImGui::GetMousePosOnOpeningCurrentPopup , py::return_value_policy::automatic_reference); deargui.def("get_mouse_drag_delta", &ImGui::GetMouseDragDelta , py::arg("button") = 0 , py::arg("lock_threshold") = -1.0f , py::return_value_policy::automatic_reference); deargui.def("reset_mouse_drag_delta", &ImGui::ResetMouseDragDelta , py::arg("button") = 0 , py::return_value_policy::automatic_reference); deargui.def("get_mouse_cursor", &ImGui::GetMouseCursor , py::return_value_policy::automatic_reference); deargui.def("set_mouse_cursor", &ImGui::SetMouseCursor , py::arg("type") , py::return_value_policy::automatic_reference); deargui.def("capture_keyboard_from_app", &ImGui::CaptureKeyboardFromApp , py::arg("capture") = true , py::return_value_policy::automatic_reference); deargui.def("capture_mouse_from_app", &ImGui::CaptureMouseFromApp , py::arg("capture") = true , py::return_value_policy::automatic_reference); deargui.def("get_clipboard_text", &ImGui::GetClipboardText , py::return_value_policy::automatic_reference); deargui.def("set_clipboard_text", &ImGui::SetClipboardText , py::arg("text") , py::return_value_policy::automatic_reference); deargui.def("load_ini_settings_from_disk", &ImGui::LoadIniSettingsFromDisk , py::arg("ini_filename") , py::return_value_policy::automatic_reference); deargui.def("load_ini_settings_from_memory", &ImGui::LoadIniSettingsFromMemory , py::arg("ini_data") , py::arg("ini_size") = 0 , py::return_value_policy::automatic_reference); deargui.def("save_ini_settings_to_disk", &ImGui::SaveIniSettingsToDisk , py::arg("ini_filename") , py::return_value_policy::automatic_reference); deargui.def("save_ini_settings_to_memory", [](size_t * out_ini_size) { auto ret = ImGui::SaveIniSettingsToMemory(out_ini_size); return std::make_tuple(ret, out_ini_size); } , py::arg("out_ini_size") = 0 , py::return_value_policy::automatic_reference); py::enum_<ImGuiWindowFlags_>(deargui, "WindowFlags", py::arithmetic()) .value("WINDOW_FLAGS_NONE", ImGuiWindowFlags_None) .value("WINDOW_FLAGS_NO_TITLE_BAR", ImGuiWindowFlags_NoTitleBar) .value("WINDOW_FLAGS_NO_RESIZE", ImGuiWindowFlags_NoResize) .value("WINDOW_FLAGS_NO_MOVE", ImGuiWindowFlags_NoMove) .value("WINDOW_FLAGS_NO_SCROLLBAR", ImGuiWindowFlags_NoScrollbar) .value("WINDOW_FLAGS_NO_SCROLL_WITH_MOUSE", ImGuiWindowFlags_NoScrollWithMouse) .value("WINDOW_FLAGS_NO_COLLAPSE", ImGuiWindowFlags_NoCollapse) .value("WINDOW_FLAGS_ALWAYS_AUTO_RESIZE", ImGuiWindowFlags_AlwaysAutoResize) .value("WINDOW_FLAGS_NO_SAVED_SETTINGS", ImGuiWindowFlags_NoSavedSettings) .value("WINDOW_FLAGS_NO_INPUTS", ImGuiWindowFlags_NoInputs) .value("WINDOW_FLAGS_MENU_BAR", ImGuiWindowFlags_MenuBar) .value("WINDOW_FLAGS_HORIZONTAL_SCROLLBAR", ImGuiWindowFlags_HorizontalScrollbar) .value("WINDOW_FLAGS_NO_FOCUS_ON_APPEARING", ImGuiWindowFlags_NoFocusOnAppearing) .value("WINDOW_FLAGS_NO_BRING_TO_FRONT_ON_FOCUS", ImGuiWindowFlags_NoBringToFrontOnFocus) .value("WINDOW_FLAGS_ALWAYS_VERTICAL_SCROLLBAR", ImGuiWindowFlags_AlwaysVerticalScrollbar) .value("WINDOW_FLAGS_ALWAYS_HORIZONTAL_SCROLLBAR", ImGuiWindowFlags_AlwaysHorizontalScrollbar) .value("WINDOW_FLAGS_ALWAYS_USE_WINDOW_PADDING", ImGuiWindowFlags_AlwaysUseWindowPadding) .value("WINDOW_FLAGS_NO_NAV_INPUTS", ImGuiWindowFlags_NoNavInputs) .value("WINDOW_FLAGS_NO_NAV_FOCUS", ImGuiWindowFlags_NoNavFocus) .value("WINDOW_FLAGS_NO_NAV", ImGuiWindowFlags_NoNav) .value("WINDOW_FLAGS_NAV_FLATTENED", ImGuiWindowFlags_NavFlattened) .value("WINDOW_FLAGS_CHILD_WINDOW", ImGuiWindowFlags_ChildWindow) .value("WINDOW_FLAGS_TOOLTIP", ImGuiWindowFlags_Tooltip) .value("WINDOW_FLAGS_POPUP", ImGuiWindowFlags_Popup) .value("WINDOW_FLAGS_MODAL", ImGuiWindowFlags_Modal) .value("WINDOW_FLAGS_CHILD_MENU", ImGuiWindowFlags_ChildMenu) .export_values(); py::enum_<ImGuiInputTextFlags_>(deargui, "InputTextFlags", py::arithmetic()) .value("INPUT_TEXT_FLAGS_NONE", ImGuiInputTextFlags_None) .value("INPUT_TEXT_FLAGS_CHARS_DECIMAL", ImGuiInputTextFlags_CharsDecimal) .value("INPUT_TEXT_FLAGS_CHARS_HEXADECIMAL", ImGuiInputTextFlags_CharsHexadecimal) .value("INPUT_TEXT_FLAGS_CHARS_UPPERCASE", ImGuiInputTextFlags_CharsUppercase) .value("INPUT_TEXT_FLAGS_CHARS_NO_BLANK", ImGuiInputTextFlags_CharsNoBlank) .value("INPUT_TEXT_FLAGS_AUTO_SELECT_ALL", ImGuiInputTextFlags_AutoSelectAll) .value("INPUT_TEXT_FLAGS_ENTER_RETURNS_TRUE", ImGuiInputTextFlags_EnterReturnsTrue) .value("INPUT_TEXT_FLAGS_CALLBACK_COMPLETION", ImGuiInputTextFlags_CallbackCompletion) .value("INPUT_TEXT_FLAGS_CALLBACK_HISTORY", ImGuiInputTextFlags_CallbackHistory) .value("INPUT_TEXT_FLAGS_CALLBACK_ALWAYS", ImGuiInputTextFlags_CallbackAlways) .value("INPUT_TEXT_FLAGS_CALLBACK_CHAR_FILTER", ImGuiInputTextFlags_CallbackCharFilter) .value("INPUT_TEXT_FLAGS_ALLOW_TAB_INPUT", ImGuiInputTextFlags_AllowTabInput) .value("INPUT_TEXT_FLAGS_CTRL_ENTER_FOR_NEW_LINE", ImGuiInputTextFlags_CtrlEnterForNewLine) .value("INPUT_TEXT_FLAGS_NO_HORIZONTAL_SCROLL", ImGuiInputTextFlags_NoHorizontalScroll) .value("INPUT_TEXT_FLAGS_ALWAYS_INSERT_MODE", ImGuiInputTextFlags_AlwaysInsertMode) .value("INPUT_TEXT_FLAGS_READ_ONLY", ImGuiInputTextFlags_ReadOnly) .value("INPUT_TEXT_FLAGS_PASSWORD", ImGuiInputTextFlags_Password) .value("INPUT_TEXT_FLAGS_NO_UNDO_REDO", ImGuiInputTextFlags_NoUndoRedo) .value("INPUT_TEXT_FLAGS_CHARS_SCIENTIFIC", ImGuiInputTextFlags_CharsScientific) .value("INPUT_TEXT_FLAGS_CALLBACK_RESIZE", ImGuiInputTextFlags_CallbackResize) .value("INPUT_TEXT_FLAGS_MULTILINE", ImGuiInputTextFlags_Multiline) .export_values(); py::enum_<ImGuiTreeNodeFlags_>(deargui, "TreeNodeFlags", py::arithmetic()) .value("TREE_NODE_FLAGS_NONE", ImGuiTreeNodeFlags_None) .value("TREE_NODE_FLAGS_SELECTED", ImGuiTreeNodeFlags_Selected) .value("TREE_NODE_FLAGS_FRAMED", ImGuiTreeNodeFlags_Framed) .value("TREE_NODE_FLAGS_ALLOW_ITEM_OVERLAP", ImGuiTreeNodeFlags_AllowItemOverlap) .value("TREE_NODE_FLAGS_NO_TREE_PUSH_ON_OPEN", ImGuiTreeNodeFlags_NoTreePushOnOpen) .value("TREE_NODE_FLAGS_NO_AUTO_OPEN_ON_LOG", ImGuiTreeNodeFlags_NoAutoOpenOnLog) .value("TREE_NODE_FLAGS_DEFAULT_OPEN", ImGuiTreeNodeFlags_DefaultOpen) .value("TREE_NODE_FLAGS_OPEN_ON_DOUBLE_CLICK", ImGuiTreeNodeFlags_OpenOnDoubleClick) .value("TREE_NODE_FLAGS_OPEN_ON_ARROW", ImGuiTreeNodeFlags_OpenOnArrow) .value("TREE_NODE_FLAGS_LEAF", ImGuiTreeNodeFlags_Leaf) .value("TREE_NODE_FLAGS_BULLET", ImGuiTreeNodeFlags_Bullet) .value("TREE_NODE_FLAGS_FRAME_PADDING", ImGuiTreeNodeFlags_FramePadding) .value("TREE_NODE_FLAGS_NAV_LEFT_JUMPS_BACK_HERE", ImGuiTreeNodeFlags_NavLeftJumpsBackHere) .value("TREE_NODE_FLAGS_COLLAPSING_HEADER", ImGuiTreeNodeFlags_CollapsingHeader) .export_values(); py::enum_<ImGuiSelectableFlags_>(deargui, "SelectableFlags", py::arithmetic()) .value("SELECTABLE_FLAGS_NONE", ImGuiSelectableFlags_None) .value("SELECTABLE_FLAGS_DONT_CLOSE_POPUPS", ImGuiSelectableFlags_DontClosePopups) .value("SELECTABLE_FLAGS_SPAN_ALL_COLUMNS", ImGuiSelectableFlags_SpanAllColumns) .value("SELECTABLE_FLAGS_ALLOW_DOUBLE_CLICK", ImGuiSelectableFlags_AllowDoubleClick) .value("SELECTABLE_FLAGS_DISABLED", ImGuiSelectableFlags_Disabled) .export_values(); py::enum_<ImGuiComboFlags_>(deargui, "ComboFlags", py::arithmetic()) .value("COMBO_FLAGS_NONE", ImGuiComboFlags_None) .value("COMBO_FLAGS_POPUP_ALIGN_LEFT", ImGuiComboFlags_PopupAlignLeft) .value("COMBO_FLAGS_HEIGHT_SMALL", ImGuiComboFlags_HeightSmall) .value("COMBO_FLAGS_HEIGHT_REGULAR", ImGuiComboFlags_HeightRegular) .value("COMBO_FLAGS_HEIGHT_LARGE", ImGuiComboFlags_HeightLarge) .value("COMBO_FLAGS_HEIGHT_LARGEST", ImGuiComboFlags_HeightLargest) .value("COMBO_FLAGS_NO_ARROW_BUTTON", ImGuiComboFlags_NoArrowButton) .value("COMBO_FLAGS_NO_PREVIEW", ImGuiComboFlags_NoPreview) .value("COMBO_FLAGS_HEIGHT_MASK", ImGuiComboFlags_HeightMask_) .export_values(); py::enum_<ImGuiFocusedFlags_>(deargui, "FocusedFlags", py::arithmetic()) .value("FOCUSED_FLAGS_NONE", ImGuiFocusedFlags_None) .value("FOCUSED_FLAGS_CHILD_WINDOWS", ImGuiFocusedFlags_ChildWindows) .value("FOCUSED_FLAGS_ROOT_WINDOW", ImGuiFocusedFlags_RootWindow) .value("FOCUSED_FLAGS_ANY_WINDOW", ImGuiFocusedFlags_AnyWindow) .value("FOCUSED_FLAGS_ROOT_AND_CHILD_WINDOWS", ImGuiFocusedFlags_RootAndChildWindows) .export_values(); py::enum_<ImGuiHoveredFlags_>(deargui, "HoveredFlags", py::arithmetic()) .value("HOVERED_FLAGS_NONE", ImGuiHoveredFlags_None) .value("HOVERED_FLAGS_CHILD_WINDOWS", ImGuiHoveredFlags_ChildWindows) .value("HOVERED_FLAGS_ROOT_WINDOW", ImGuiHoveredFlags_RootWindow) .value("HOVERED_FLAGS_ANY_WINDOW", ImGuiHoveredFlags_AnyWindow) .value("HOVERED_FLAGS_ALLOW_WHEN_BLOCKED_BY_POPUP", ImGuiHoveredFlags_AllowWhenBlockedByPopup) .value("HOVERED_FLAGS_ALLOW_WHEN_BLOCKED_BY_ACTIVE_ITEM", ImGuiHoveredFlags_AllowWhenBlockedByActiveItem) .value("HOVERED_FLAGS_ALLOW_WHEN_OVERLAPPED", ImGuiHoveredFlags_AllowWhenOverlapped) .value("HOVERED_FLAGS_ALLOW_WHEN_DISABLED", ImGuiHoveredFlags_AllowWhenDisabled) .value("HOVERED_FLAGS_RECT_ONLY", ImGuiHoveredFlags_RectOnly) .value("HOVERED_FLAGS_ROOT_AND_CHILD_WINDOWS", ImGuiHoveredFlags_RootAndChildWindows) .export_values(); py::enum_<ImGuiDragDropFlags_>(deargui, "DragDropFlags", py::arithmetic()) .value("DRAG_DROP_FLAGS_NONE", ImGuiDragDropFlags_None) .value("DRAG_DROP_FLAGS_SOURCE_NO_PREVIEW_TOOLTIP", ImGuiDragDropFlags_SourceNoPreviewTooltip) .value("DRAG_DROP_FLAGS_SOURCE_NO_DISABLE_HOVER", ImGuiDragDropFlags_SourceNoDisableHover) .value("DRAG_DROP_FLAGS_SOURCE_NO_HOLD_TO_OPEN_OTHERS", ImGuiDragDropFlags_SourceNoHoldToOpenOthers) .value("DRAG_DROP_FLAGS_SOURCE_ALLOW_NULL_ID", ImGuiDragDropFlags_SourceAllowNullID) .value("DRAG_DROP_FLAGS_SOURCE_EXTERN", ImGuiDragDropFlags_SourceExtern) .value("DRAG_DROP_FLAGS_SOURCE_AUTO_EXPIRE_PAYLOAD", ImGuiDragDropFlags_SourceAutoExpirePayload) .value("DRAG_DROP_FLAGS_ACCEPT_BEFORE_DELIVERY", ImGuiDragDropFlags_AcceptBeforeDelivery) .value("DRAG_DROP_FLAGS_ACCEPT_NO_DRAW_DEFAULT_RECT", ImGuiDragDropFlags_AcceptNoDrawDefaultRect) .value("DRAG_DROP_FLAGS_ACCEPT_NO_PREVIEW_TOOLTIP", ImGuiDragDropFlags_AcceptNoPreviewTooltip) .value("DRAG_DROP_FLAGS_ACCEPT_PEEK_ONLY", ImGuiDragDropFlags_AcceptPeekOnly) .export_values(); py::enum_<ImGuiDataType_>(deargui, "DataType", py::arithmetic()) .value("DATA_TYPE_S32", ImGuiDataType_S32) .value("DATA_TYPE_U32", ImGuiDataType_U32) .value("DATA_TYPE_S64", ImGuiDataType_S64) .value("DATA_TYPE_U64", ImGuiDataType_U64) .value("DATA_TYPE_FLOAT", ImGuiDataType_Float) .value("DATA_TYPE_DOUBLE", ImGuiDataType_Double) .value("DATA_TYPE_COUNT", ImGuiDataType_COUNT) .export_values(); py::enum_<ImGuiDir_>(deargui, "Dir", py::arithmetic()) .value("DIR_NONE", ImGuiDir_None) .value("DIR_LEFT", ImGuiDir_Left) .value("DIR_RIGHT", ImGuiDir_Right) .value("DIR_UP", ImGuiDir_Up) .value("DIR_DOWN", ImGuiDir_Down) .value("DIR_COUNT", ImGuiDir_COUNT) .export_values(); py::enum_<ImGuiKey_>(deargui, "Key", py::arithmetic()) .value("KEY_TAB", ImGuiKey_Tab) .value("KEY_LEFT_ARROW", ImGuiKey_LeftArrow) .value("KEY_RIGHT_ARROW", ImGuiKey_RightArrow) .value("KEY_UP_ARROW", ImGuiKey_UpArrow) .value("KEY_DOWN_ARROW", ImGuiKey_DownArrow) .value("KEY_PAGE_UP", ImGuiKey_PageUp) .value("KEY_PAGE_DOWN", ImGuiKey_PageDown) .value("KEY_HOME", ImGuiKey_Home) .value("KEY_END", ImGuiKey_End) .value("KEY_INSERT", ImGuiKey_Insert) .value("KEY_DELETE", ImGuiKey_Delete) .value("KEY_BACKSPACE", ImGuiKey_Backspace) .value("KEY_SPACE", ImGuiKey_Space) .value("KEY_ENTER", ImGuiKey_Enter) .value("KEY_ESCAPE", ImGuiKey_Escape) .value("KEY_A", ImGuiKey_A) .value("KEY_C", ImGuiKey_C) .value("KEY_V", ImGuiKey_V) .value("KEY_X", ImGuiKey_X) .value("KEY_Y", ImGuiKey_Y) .value("KEY_Z", ImGuiKey_Z) .value("KEY_COUNT", ImGuiKey_COUNT) .export_values(); py::enum_<ImGuiNavInput_>(deargui, "NavInput", py::arithmetic()) .value("NAV_INPUT_ACTIVATE", ImGuiNavInput_Activate) .value("NAV_INPUT_CANCEL", ImGuiNavInput_Cancel) .value("NAV_INPUT_INPUT", ImGuiNavInput_Input) .value("NAV_INPUT_MENU", ImGuiNavInput_Menu) .value("NAV_INPUT_DPAD_LEFT", ImGuiNavInput_DpadLeft) .value("NAV_INPUT_DPAD_RIGHT", ImGuiNavInput_DpadRight) .value("NAV_INPUT_DPAD_UP", ImGuiNavInput_DpadUp) .value("NAV_INPUT_DPAD_DOWN", ImGuiNavInput_DpadDown) .value("NAV_INPUT_L_STICK_LEFT", ImGuiNavInput_LStickLeft) .value("NAV_INPUT_L_STICK_RIGHT", ImGuiNavInput_LStickRight) .value("NAV_INPUT_L_STICK_UP", ImGuiNavInput_LStickUp) .value("NAV_INPUT_L_STICK_DOWN", ImGuiNavInput_LStickDown) .value("NAV_INPUT_FOCUS_PREV", ImGuiNavInput_FocusPrev) .value("NAV_INPUT_FOCUS_NEXT", ImGuiNavInput_FocusNext) .value("NAV_INPUT_TWEAK_SLOW", ImGuiNavInput_TweakSlow) .value("NAV_INPUT_TWEAK_FAST", ImGuiNavInput_TweakFast) .value("NAV_INPUT_KEY_MENU", ImGuiNavInput_KeyMenu_) .value("NAV_INPUT_KEY_LEFT", ImGuiNavInput_KeyLeft_) .value("NAV_INPUT_KEY_RIGHT", ImGuiNavInput_KeyRight_) .value("NAV_INPUT_KEY_UP", ImGuiNavInput_KeyUp_) .value("NAV_INPUT_KEY_DOWN", ImGuiNavInput_KeyDown_) .value("NAV_INPUT_COUNT", ImGuiNavInput_COUNT) .value("NAV_INPUT_INTERNAL_START", ImGuiNavInput_InternalStart_) .export_values(); py::enum_<ImGuiConfigFlags_>(deargui, "ConfigFlags", py::arithmetic()) .value("CONFIG_FLAGS_NAV_ENABLE_KEYBOARD", ImGuiConfigFlags_NavEnableKeyboard) .value("CONFIG_FLAGS_NAV_ENABLE_GAMEPAD", ImGuiConfigFlags_NavEnableGamepad) .value("CONFIG_FLAGS_NAV_ENABLE_SET_MOUSE_POS", ImGuiConfigFlags_NavEnableSetMousePos) .value("CONFIG_FLAGS_NAV_NO_CAPTURE_KEYBOARD", ImGuiConfigFlags_NavNoCaptureKeyboard) .value("CONFIG_FLAGS_NO_MOUSE", ImGuiConfigFlags_NoMouse) .value("CONFIG_FLAGS_NO_MOUSE_CURSOR_CHANGE", ImGuiConfigFlags_NoMouseCursorChange) .value("CONFIG_FLAGS_IS_SRGB", ImGuiConfigFlags_IsSRGB) .value("CONFIG_FLAGS_IS_TOUCH_SCREEN", ImGuiConfigFlags_IsTouchScreen) .export_values(); py::enum_<ImGuiBackendFlags_>(deargui, "BackendFlags", py::arithmetic()) .value("BACKEND_FLAGS_HAS_GAMEPAD", ImGuiBackendFlags_HasGamepad) .value("BACKEND_FLAGS_HAS_MOUSE_CURSORS", ImGuiBackendFlags_HasMouseCursors) .value("BACKEND_FLAGS_HAS_SET_MOUSE_POS", ImGuiBackendFlags_HasSetMousePos) .export_values(); py::enum_<ImGuiCol_>(deargui, "Col", py::arithmetic()) .value("COL_TEXT", ImGuiCol_Text) .value("COL_TEXT_DISABLED", ImGuiCol_TextDisabled) .value("COL_WINDOW_BG", ImGuiCol_WindowBg) .value("COL_CHILD_BG", ImGuiCol_ChildBg) .value("COL_POPUP_BG", ImGuiCol_PopupBg) .value("COL_BORDER", ImGuiCol_Border) .value("COL_BORDER_SHADOW", ImGuiCol_BorderShadow) .value("COL_FRAME_BG", ImGuiCol_FrameBg) .value("COL_FRAME_BG_HOVERED", ImGuiCol_FrameBgHovered) .value("COL_FRAME_BG_ACTIVE", ImGuiCol_FrameBgActive) .value("COL_TITLE_BG", ImGuiCol_TitleBg) .value("COL_TITLE_BG_ACTIVE", ImGuiCol_TitleBgActive) .value("COL_TITLE_BG_COLLAPSED", ImGuiCol_TitleBgCollapsed) .value("COL_MENU_BAR_BG", ImGuiCol_MenuBarBg) .value("COL_SCROLLBAR_BG", ImGuiCol_ScrollbarBg) .value("COL_SCROLLBAR_GRAB", ImGuiCol_ScrollbarGrab) .value("COL_SCROLLBAR_GRAB_HOVERED", ImGuiCol_ScrollbarGrabHovered) .value("COL_SCROLLBAR_GRAB_ACTIVE", ImGuiCol_ScrollbarGrabActive) .value("COL_CHECK_MARK", ImGuiCol_CheckMark) .value("COL_SLIDER_GRAB", ImGuiCol_SliderGrab) .value("COL_SLIDER_GRAB_ACTIVE", ImGuiCol_SliderGrabActive) .value("COL_BUTTON", ImGuiCol_Button) .value("COL_BUTTON_HOVERED", ImGuiCol_ButtonHovered) .value("COL_BUTTON_ACTIVE", ImGuiCol_ButtonActive) .value("COL_HEADER", ImGuiCol_Header) .value("COL_HEADER_HOVERED", ImGuiCol_HeaderHovered) .value("COL_HEADER_ACTIVE", ImGuiCol_HeaderActive) .value("COL_SEPARATOR", ImGuiCol_Separator) .value("COL_SEPARATOR_HOVERED", ImGuiCol_SeparatorHovered) .value("COL_SEPARATOR_ACTIVE", ImGuiCol_SeparatorActive) .value("COL_RESIZE_GRIP", ImGuiCol_ResizeGrip) .value("COL_RESIZE_GRIP_HOVERED", ImGuiCol_ResizeGripHovered) .value("COL_RESIZE_GRIP_ACTIVE", ImGuiCol_ResizeGripActive) .value("COL_PLOT_LINES", ImGuiCol_PlotLines) .value("COL_PLOT_LINES_HOVERED", ImGuiCol_PlotLinesHovered) .value("COL_PLOT_HISTOGRAM", ImGuiCol_PlotHistogram) .value("COL_PLOT_HISTOGRAM_HOVERED", ImGuiCol_PlotHistogramHovered) .value("COL_TEXT_SELECTED_BG", ImGuiCol_TextSelectedBg) .value("COL_DRAG_DROP_TARGET", ImGuiCol_DragDropTarget) .value("COL_NAV_HIGHLIGHT", ImGuiCol_NavHighlight) .value("COL_NAV_WINDOWING_HIGHLIGHT", ImGuiCol_NavWindowingHighlight) .value("COL_NAV_WINDOWING_DIM_BG", ImGuiCol_NavWindowingDimBg) .value("COL_MODAL_WINDOW_DIM_BG", ImGuiCol_ModalWindowDimBg) .value("COL_COUNT", ImGuiCol_COUNT) .export_values(); py::enum_<ImGuiStyleVar_>(deargui, "StyleVar", py::arithmetic()) .value("STYLE_VAR_ALPHA", ImGuiStyleVar_Alpha) .value("STYLE_VAR_WINDOW_PADDING", ImGuiStyleVar_WindowPadding) .value("STYLE_VAR_WINDOW_ROUNDING", ImGuiStyleVar_WindowRounding) .value("STYLE_VAR_WINDOW_BORDER_SIZE", ImGuiStyleVar_WindowBorderSize) .value("STYLE_VAR_WINDOW_MIN_SIZE", ImGuiStyleVar_WindowMinSize) .value("STYLE_VAR_WINDOW_TITLE_ALIGN", ImGuiStyleVar_WindowTitleAlign) .value("STYLE_VAR_CHILD_ROUNDING", ImGuiStyleVar_ChildRounding) .value("STYLE_VAR_CHILD_BORDER_SIZE", ImGuiStyleVar_ChildBorderSize) .value("STYLE_VAR_POPUP_ROUNDING", ImGuiStyleVar_PopupRounding) .value("STYLE_VAR_POPUP_BORDER_SIZE", ImGuiStyleVar_PopupBorderSize) .value("STYLE_VAR_FRAME_PADDING", ImGuiStyleVar_FramePadding) .value("STYLE_VAR_FRAME_ROUNDING", ImGuiStyleVar_FrameRounding) .value("STYLE_VAR_FRAME_BORDER_SIZE", ImGuiStyleVar_FrameBorderSize) .value("STYLE_VAR_ITEM_SPACING", ImGuiStyleVar_ItemSpacing) .value("STYLE_VAR_ITEM_INNER_SPACING", ImGuiStyleVar_ItemInnerSpacing) .value("STYLE_VAR_INDENT_SPACING", ImGuiStyleVar_IndentSpacing) .value("STYLE_VAR_SCROLLBAR_SIZE", ImGuiStyleVar_ScrollbarSize) .value("STYLE_VAR_SCROLLBAR_ROUNDING", ImGuiStyleVar_ScrollbarRounding) .value("STYLE_VAR_GRAB_MIN_SIZE", ImGuiStyleVar_GrabMinSize) .value("STYLE_VAR_GRAB_ROUNDING", ImGuiStyleVar_GrabRounding) .value("STYLE_VAR_BUTTON_TEXT_ALIGN", ImGuiStyleVar_ButtonTextAlign) .value("STYLE_VAR_COUNT", ImGuiStyleVar_COUNT) .export_values(); py::enum_<ImGuiColorEditFlags_>(deargui, "ColorEditFlags", py::arithmetic()) .value("COLOR_EDIT_FLAGS_NONE", ImGuiColorEditFlags_None) .value("COLOR_EDIT_FLAGS_NO_ALPHA", ImGuiColorEditFlags_NoAlpha) .value("COLOR_EDIT_FLAGS_NO_PICKER", ImGuiColorEditFlags_NoPicker) .value("COLOR_EDIT_FLAGS_NO_OPTIONS", ImGuiColorEditFlags_NoOptions) .value("COLOR_EDIT_FLAGS_NO_SMALL_PREVIEW", ImGuiColorEditFlags_NoSmallPreview) .value("COLOR_EDIT_FLAGS_NO_INPUTS", ImGuiColorEditFlags_NoInputs) .value("COLOR_EDIT_FLAGS_NO_TOOLTIP", ImGuiColorEditFlags_NoTooltip) .value("COLOR_EDIT_FLAGS_NO_LABEL", ImGuiColorEditFlags_NoLabel) .value("COLOR_EDIT_FLAGS_NO_SIDE_PREVIEW", ImGuiColorEditFlags_NoSidePreview) .value("COLOR_EDIT_FLAGS_NO_DRAG_DROP", ImGuiColorEditFlags_NoDragDrop) .value("COLOR_EDIT_FLAGS_ALPHA_BAR", ImGuiColorEditFlags_AlphaBar) .value("COLOR_EDIT_FLAGS_ALPHA_PREVIEW", ImGuiColorEditFlags_AlphaPreview) .value("COLOR_EDIT_FLAGS_ALPHA_PREVIEW_HALF", ImGuiColorEditFlags_AlphaPreviewHalf) .value("COLOR_EDIT_FLAGS_HDR", ImGuiColorEditFlags_HDR) .value("COLOR_EDIT_FLAGS_RGB", ImGuiColorEditFlags_RGB) .value("COLOR_EDIT_FLAGS_HSV", ImGuiColorEditFlags_HSV) .value("COLOR_EDIT_FLAGS_HEX", ImGuiColorEditFlags_HEX) .value("COLOR_EDIT_FLAGS_UINT8", ImGuiColorEditFlags_Uint8) .value("COLOR_EDIT_FLAGS_FLOAT", ImGuiColorEditFlags_Float) .value("COLOR_EDIT_FLAGS_PICKER_HUE_BAR", ImGuiColorEditFlags_PickerHueBar) .value("COLOR_EDIT_FLAGS_PICKER_HUE_WHEEL", ImGuiColorEditFlags_PickerHueWheel) .value("COLOR_EDIT_FLAGS__INPUTS_MASK", ImGuiColorEditFlags__InputsMask) .value("COLOR_EDIT_FLAGS__DATA_TYPE_MASK", ImGuiColorEditFlags__DataTypeMask) .value("COLOR_EDIT_FLAGS__PICKER_MASK", ImGuiColorEditFlags__PickerMask) .value("COLOR_EDIT_FLAGS__OPTIONS_DEFAULT", ImGuiColorEditFlags__OptionsDefault) .export_values(); py::enum_<ImGuiMouseCursor_>(deargui, "MouseCursor", py::arithmetic()) .value("MOUSE_CURSOR_NONE", ImGuiMouseCursor_None) .value("MOUSE_CURSOR_ARROW", ImGuiMouseCursor_Arrow) .value("MOUSE_CURSOR_TEXT_INPUT", ImGuiMouseCursor_TextInput) .value("MOUSE_CURSOR_RESIZE_ALL", ImGuiMouseCursor_ResizeAll) .value("MOUSE_CURSOR_RESIZE_NS", ImGuiMouseCursor_ResizeNS) .value("MOUSE_CURSOR_RESIZE_EW", ImGuiMouseCursor_ResizeEW) .value("MOUSE_CURSOR_RESIZE_NESW", ImGuiMouseCursor_ResizeNESW) .value("MOUSE_CURSOR_RESIZE_NWSE", ImGuiMouseCursor_ResizeNWSE) .value("MOUSE_CURSOR_HAND", ImGuiMouseCursor_Hand) .value("MOUSE_CURSOR_COUNT", ImGuiMouseCursor_COUNT) .export_values(); py::enum_<ImGuiCond_>(deargui, "Cond", py::arithmetic()) .value("COND_ALWAYS", ImGuiCond_Always) .value("COND_ONCE", ImGuiCond_Once) .value("COND_FIRST_USE_EVER", ImGuiCond_FirstUseEver) .value("COND_APPEARING", ImGuiCond_Appearing) .export_values(); py::class_<ImGuiStyle> Style(deargui, "Style"); Style.def_readwrite("alpha", &ImGuiStyle::Alpha); Style.def_readwrite("window_padding", &ImGuiStyle::WindowPadding); Style.def_readwrite("window_rounding", &ImGuiStyle::WindowRounding); Style.def_readwrite("window_border_size", &ImGuiStyle::WindowBorderSize); Style.def_readwrite("window_min_size", &ImGuiStyle::WindowMinSize); Style.def_readwrite("window_title_align", &ImGuiStyle::WindowTitleAlign); Style.def_readwrite("child_rounding", &ImGuiStyle::ChildRounding); Style.def_readwrite("child_border_size", &ImGuiStyle::ChildBorderSize); Style.def_readwrite("popup_rounding", &ImGuiStyle::PopupRounding); Style.def_readwrite("popup_border_size", &ImGuiStyle::PopupBorderSize); Style.def_readwrite("frame_padding", &ImGuiStyle::FramePadding); Style.def_readwrite("frame_rounding", &ImGuiStyle::FrameRounding); Style.def_readwrite("frame_border_size", &ImGuiStyle::FrameBorderSize); Style.def_readwrite("item_spacing", &ImGuiStyle::ItemSpacing); Style.def_readwrite("item_inner_spacing", &ImGuiStyle::ItemInnerSpacing); Style.def_readwrite("touch_extra_padding", &ImGuiStyle::TouchExtraPadding); Style.def_readwrite("indent_spacing", &ImGuiStyle::IndentSpacing); Style.def_readwrite("columns_min_spacing", &ImGuiStyle::ColumnsMinSpacing); Style.def_readwrite("scrollbar_size", &ImGuiStyle::ScrollbarSize); Style.def_readwrite("scrollbar_rounding", &ImGuiStyle::ScrollbarRounding); Style.def_readwrite("grab_min_size", &ImGuiStyle::GrabMinSize); Style.def_readwrite("grab_rounding", &ImGuiStyle::GrabRounding); Style.def_readwrite("button_text_align", &ImGuiStyle::ButtonTextAlign); Style.def_readwrite("display_window_padding", &ImGuiStyle::DisplayWindowPadding); Style.def_readwrite("display_safe_area_padding", &ImGuiStyle::DisplaySafeAreaPadding); Style.def_readwrite("mouse_cursor_scale", &ImGuiStyle::MouseCursorScale); Style.def_readwrite("anti_aliased_lines", &ImGuiStyle::AntiAliasedLines); Style.def_readwrite("anti_aliased_fill", &ImGuiStyle::AntiAliasedFill); Style.def_readwrite("curve_tessellation_tol", &ImGuiStyle::CurveTessellationTol); Style.def_readonly("colors", &ImGuiStyle::Colors); Style.def(py::init<>()); Style.def("scale_all_sizes", &ImGuiStyle::ScaleAllSizes , py::arg("scale_factor") , py::return_value_policy::automatic_reference); py::class_<ImGuiIO> IO(deargui, "IO"); IO.def_readwrite("config_flags", &ImGuiIO::ConfigFlags); IO.def_readwrite("backend_flags", &ImGuiIO::BackendFlags); IO.def_readwrite("display_size", &ImGuiIO::DisplaySize); IO.def_readwrite("delta_time", &ImGuiIO::DeltaTime); IO.def_readwrite("ini_saving_rate", &ImGuiIO::IniSavingRate); IO.def_readwrite("ini_filename", &ImGuiIO::IniFilename); IO.def_readwrite("log_filename", &ImGuiIO::LogFilename); IO.def_readwrite("mouse_double_click_time", &ImGuiIO::MouseDoubleClickTime); IO.def_readwrite("mouse_double_click_max_dist", &ImGuiIO::MouseDoubleClickMaxDist); IO.def_readwrite("mouse_drag_threshold", &ImGuiIO::MouseDragThreshold); IO.def_readonly("key_map", &ImGuiIO::KeyMap); IO.def_readwrite("key_repeat_delay", &ImGuiIO::KeyRepeatDelay); IO.def_readwrite("key_repeat_rate", &ImGuiIO::KeyRepeatRate); IO.def_readwrite("user_data", &ImGuiIO::UserData); IO.def_readwrite("fonts", &ImGuiIO::Fonts); IO.def_readwrite("font_global_scale", &ImGuiIO::FontGlobalScale); IO.def_readwrite("font_allow_user_scaling", &ImGuiIO::FontAllowUserScaling); IO.def_readwrite("font_default", &ImGuiIO::FontDefault); IO.def_readwrite("display_framebuffer_scale", &ImGuiIO::DisplayFramebufferScale); IO.def_readwrite("display_visible_min", &ImGuiIO::DisplayVisibleMin); IO.def_readwrite("display_visible_max", &ImGuiIO::DisplayVisibleMax); IO.def_readwrite("mouse_draw_cursor", &ImGuiIO::MouseDrawCursor); IO.def_readwrite("config_mac_osx_behaviors", &ImGuiIO::ConfigMacOSXBehaviors); IO.def_readwrite("config_input_text_cursor_blink", &ImGuiIO::ConfigInputTextCursorBlink); IO.def_readwrite("config_resize_windows_from_edges", &ImGuiIO::ConfigResizeWindowsFromEdges); IO.def_readwrite("clipboard_user_data", &ImGuiIO::ClipboardUserData); IO.def_readwrite("ime_window_handle", &ImGuiIO::ImeWindowHandle); //IO.def_readwrite("render_draw_lists_fn_unused", &ImGuiIO::RenderDrawListsFnUnused); IO.def_readwrite("mouse_pos", &ImGuiIO::MousePos); IO.def_readwrite("mouse_wheel", &ImGuiIO::MouseWheel); IO.def_readwrite("mouse_wheel_h", &ImGuiIO::MouseWheelH); IO.def_readwrite("key_ctrl", &ImGuiIO::KeyCtrl); IO.def_readwrite("key_shift", &ImGuiIO::KeyShift); IO.def_readwrite("key_alt", &ImGuiIO::KeyAlt); IO.def_readwrite("key_super", &ImGuiIO::KeySuper); IO.def("add_input_character", &ImGuiIO::AddInputCharacter , py::arg("c") , py::return_value_policy::automatic_reference); IO.def("add_input_characters_utf8", &ImGuiIO::AddInputCharactersUTF8 , py::arg("utf8_chars") , py::return_value_policy::automatic_reference); IO.def("clear_input_characters", &ImGuiIO::ClearInputCharacters , py::return_value_policy::automatic_reference); IO.def_readwrite("want_capture_mouse", &ImGuiIO::WantCaptureMouse); IO.def_readwrite("want_capture_keyboard", &ImGuiIO::WantCaptureKeyboard); IO.def_readwrite("want_text_input", &ImGuiIO::WantTextInput); IO.def_readwrite("want_set_mouse_pos", &ImGuiIO::WantSetMousePos); IO.def_readwrite("want_save_ini_settings", &ImGuiIO::WantSaveIniSettings); IO.def_readwrite("nav_active", &ImGuiIO::NavActive); IO.def_readwrite("nav_visible", &ImGuiIO::NavVisible); IO.def_readwrite("framerate", &ImGuiIO::Framerate); IO.def_readwrite("metrics_render_vertices", &ImGuiIO::MetricsRenderVertices); IO.def_readwrite("metrics_render_indices", &ImGuiIO::MetricsRenderIndices); IO.def_readwrite("metrics_render_windows", &ImGuiIO::MetricsRenderWindows); IO.def_readwrite("metrics_active_windows", &ImGuiIO::MetricsActiveWindows); IO.def_readwrite("metrics_active_allocations", &ImGuiIO::MetricsActiveAllocations); IO.def_readwrite("mouse_delta", &ImGuiIO::MouseDelta); IO.def_readwrite("mouse_pos_prev", &ImGuiIO::MousePosPrev); IO.def_readonly("mouse_clicked_pos", &ImGuiIO::MouseClickedPos); IO.def_readonly("mouse_clicked_time", &ImGuiIO::MouseClickedTime); IO.def_readonly("mouse_clicked", &ImGuiIO::MouseClicked); IO.def_readonly("mouse_double_clicked", &ImGuiIO::MouseDoubleClicked); IO.def_readonly("mouse_released", &ImGuiIO::MouseReleased); IO.def_readonly("mouse_down_owned", &ImGuiIO::MouseDownOwned); IO.def_readonly("mouse_down_duration", &ImGuiIO::MouseDownDuration); IO.def_readonly("mouse_down_duration_prev", &ImGuiIO::MouseDownDurationPrev); IO.def_readonly("mouse_drag_max_distance_abs", &ImGuiIO::MouseDragMaxDistanceAbs); IO.def_readonly("mouse_drag_max_distance_sqr", &ImGuiIO::MouseDragMaxDistanceSqr); IO.def_readonly("keys_down_duration", &ImGuiIO::KeysDownDuration); IO.def_readonly("keys_down_duration_prev", &ImGuiIO::KeysDownDurationPrev); IO.def_readonly("nav_inputs_down_duration", &ImGuiIO::NavInputsDownDuration); IO.def_readonly("nav_inputs_down_duration_prev", &ImGuiIO::NavInputsDownDurationPrev); IO.def(py::init<>()); py::class_<ImGuiOnceUponAFrame> OnceUponAFrame(deargui, "OnceUponAFrame"); OnceUponAFrame.def(py::init<>()); OnceUponAFrame.def_readwrite("ref_frame", &ImGuiOnceUponAFrame::RefFrame); py::class_<ImGuiTextFilter> TextFilter(deargui, "TextFilter"); TextFilter.def(py::init<const char *>() , py::arg("default_filter") = nullptr ); TextFilter.def("draw", &ImGuiTextFilter::Draw , py::arg("label") = nullptr , py::arg("width") = 0.0f , py::return_value_policy::automatic_reference); TextFilter.def("pass_filter", &ImGuiTextFilter::PassFilter , py::arg("text") , py::arg("text_end") = nullptr , py::return_value_policy::automatic_reference); TextFilter.def("build", &ImGuiTextFilter::Build , py::return_value_policy::automatic_reference); TextFilter.def("clear", &ImGuiTextFilter::Clear , py::return_value_policy::automatic_reference); TextFilter.def("is_active", &ImGuiTextFilter::IsActive , py::return_value_policy::automatic_reference); TextFilter.def_readonly("input_buf", &ImGuiTextFilter::InputBuf); TextFilter.def_readwrite("count_grep", &ImGuiTextFilter::CountGrep); py::class_<ImGuiStorage> Storage(deargui, "Storage"); Storage.def("clear", &ImGuiStorage::Clear , py::return_value_policy::automatic_reference); Storage.def("get_int", &ImGuiStorage::GetInt , py::arg("key") , py::arg("default_val") = 0 , py::return_value_policy::automatic_reference); Storage.def("set_int", &ImGuiStorage::SetInt , py::arg("key") , py::arg("val") , py::return_value_policy::automatic_reference); Storage.def("get_bool", &ImGuiStorage::GetBool , py::arg("key") , py::arg("default_val") = false , py::return_value_policy::automatic_reference); Storage.def("set_bool", &ImGuiStorage::SetBool , py::arg("key") , py::arg("val") , py::return_value_policy::automatic_reference); Storage.def("get_float", &ImGuiStorage::GetFloat , py::arg("key") , py::arg("default_val") = 0.0f , py::return_value_policy::automatic_reference); Storage.def("set_float", &ImGuiStorage::SetFloat , py::arg("key") , py::arg("val") , py::return_value_policy::automatic_reference); Storage.def("get_void_ptr", &ImGuiStorage::GetVoidPtr , py::arg("key") , py::return_value_policy::automatic_reference); Storage.def("set_void_ptr", &ImGuiStorage::SetVoidPtr , py::arg("key") , py::arg("val") , py::return_value_policy::automatic_reference); Storage.def("get_int_ref", &ImGuiStorage::GetIntRef , py::arg("key") , py::arg("default_val") = 0 , py::return_value_policy::automatic_reference); Storage.def("get_bool_ref", &ImGuiStorage::GetBoolRef , py::arg("key") , py::arg("default_val") = false , py::return_value_policy::automatic_reference); Storage.def("get_float_ref", &ImGuiStorage::GetFloatRef , py::arg("key") , py::arg("default_val") = 0.0f , py::return_value_policy::automatic_reference); Storage.def("get_void_ptr_ref", &ImGuiStorage::GetVoidPtrRef , py::arg("key") , py::arg("default_val") = nullptr , py::return_value_policy::automatic_reference); Storage.def("set_all_int", &ImGuiStorage::SetAllInt , py::arg("val") , py::return_value_policy::automatic_reference); Storage.def("build_sort_by_key", &ImGuiStorage::BuildSortByKey , py::return_value_policy::automatic_reference); py::class_<ImGuiInputTextCallbackData> InputTextCallbackData(deargui, "InputTextCallbackData"); InputTextCallbackData.def_readwrite("event_flag", &ImGuiInputTextCallbackData::EventFlag); InputTextCallbackData.def_readwrite("flags", &ImGuiInputTextCallbackData::Flags); InputTextCallbackData.def_readwrite("user_data", &ImGuiInputTextCallbackData::UserData); InputTextCallbackData.def_readwrite("event_char", &ImGuiInputTextCallbackData::EventChar); InputTextCallbackData.def_readwrite("event_key", &ImGuiInputTextCallbackData::EventKey); InputTextCallbackData.def_readwrite("buf", &ImGuiInputTextCallbackData::Buf); InputTextCallbackData.def_readwrite("buf_text_len", &ImGuiInputTextCallbackData::BufTextLen); InputTextCallbackData.def_readwrite("buf_size", &ImGuiInputTextCallbackData::BufSize); InputTextCallbackData.def_readwrite("buf_dirty", &ImGuiInputTextCallbackData::BufDirty); InputTextCallbackData.def_readwrite("cursor_pos", &ImGuiInputTextCallbackData::CursorPos); InputTextCallbackData.def_readwrite("selection_start", &ImGuiInputTextCallbackData::SelectionStart); InputTextCallbackData.def_readwrite("selection_end", &ImGuiInputTextCallbackData::SelectionEnd); InputTextCallbackData.def(py::init<>()); InputTextCallbackData.def("delete_chars", &ImGuiInputTextCallbackData::DeleteChars , py::arg("pos") , py::arg("bytes_count") , py::return_value_policy::automatic_reference); InputTextCallbackData.def("insert_chars", &ImGuiInputTextCallbackData::InsertChars , py::arg("pos") , py::arg("text") , py::arg("text_end") = nullptr , py::return_value_policy::automatic_reference); InputTextCallbackData.def("has_selection", &ImGuiInputTextCallbackData::HasSelection , py::return_value_policy::automatic_reference); py::class_<ImGuiSizeCallbackData> SizeCallbackData(deargui, "SizeCallbackData"); SizeCallbackData.def_readwrite("user_data", &ImGuiSizeCallbackData::UserData); SizeCallbackData.def_readwrite("pos", &ImGuiSizeCallbackData::Pos); SizeCallbackData.def_readwrite("current_size", &ImGuiSizeCallbackData::CurrentSize); SizeCallbackData.def_readwrite("desired_size", &ImGuiSizeCallbackData::DesiredSize); py::class_<ImGuiPayload> Payload(deargui, "Payload"); Payload.def_readwrite("data", &ImGuiPayload::Data); Payload.def_readwrite("data_size", &ImGuiPayload::DataSize); Payload.def_readwrite("source_id", &ImGuiPayload::SourceId); Payload.def_readwrite("source_parent_id", &ImGuiPayload::SourceParentId); Payload.def_readwrite("data_frame_count", &ImGuiPayload::DataFrameCount); Payload.def_readonly("data_type", &ImGuiPayload::DataType); Payload.def_readwrite("preview", &ImGuiPayload::Preview); Payload.def_readwrite("delivery", &ImGuiPayload::Delivery); Payload.def(py::init<>()); Payload.def("clear", &ImGuiPayload::Clear , py::return_value_policy::automatic_reference); Payload.def("is_data_type", &ImGuiPayload::IsDataType , py::arg("type") , py::return_value_policy::automatic_reference); Payload.def("is_preview", &ImGuiPayload::IsPreview , py::return_value_policy::automatic_reference); Payload.def("is_delivery", &ImGuiPayload::IsDelivery , py::return_value_policy::automatic_reference); py::class_<ImColor> Color(deargui, "Color"); Color.def_readwrite("value", &ImColor::Value); Color.def(py::init<>()); Color.def(py::init<int, int, int, int>() , py::arg("r") , py::arg("g") , py::arg("b") , py::arg("a") = 255 ); Color.def(py::init<ImU32>() , py::arg("rgba") ); Color.def(py::init<float, float, float, float>() , py::arg("r") , py::arg("g") , py::arg("b") , py::arg("a") = 1.0f ); Color.def(py::init<const ImVec4 &>() , py::arg("col") ); Color.def("set_hsv", &ImColor::SetHSV , py::arg("h") , py::arg("s") , py::arg("v") , py::arg("a") = 1.0f , py::return_value_policy::automatic_reference); py::class_<ImGuiListClipper> ListClipper(deargui, "ListClipper"); ListClipper.def_readwrite("start_pos_y", &ImGuiListClipper::StartPosY); ListClipper.def_readwrite("items_height", &ImGuiListClipper::ItemsHeight); ListClipper.def_readwrite("items_count", &ImGuiListClipper::ItemsCount); ListClipper.def_readwrite("step_no", &ImGuiListClipper::StepNo); ListClipper.def_readwrite("display_start", &ImGuiListClipper::DisplayStart); ListClipper.def_readwrite("display_end", &ImGuiListClipper::DisplayEnd); ListClipper.def(py::init<int, float>() , py::arg("items_count") = -1 , py::arg("items_height") = -1.0f ); ListClipper.def("step", &ImGuiListClipper::Step , py::return_value_policy::automatic_reference); ListClipper.def("begin", &ImGuiListClipper::Begin , py::arg("items_count") , py::arg("items_height") = -1.0f , py::return_value_policy::automatic_reference); ListClipper.def("end", &ImGuiListClipper::End , py::return_value_policy::automatic_reference); py::class_<ImDrawCmd> DrawCmd(deargui, "DrawCmd"); DrawCmd.def_readwrite("elem_count", &ImDrawCmd::ElemCount); DrawCmd.def_readwrite("clip_rect", &ImDrawCmd::ClipRect); DrawCmd.def_readwrite("texture_id", &ImDrawCmd::TextureId); DrawCmd.def_readwrite("user_callback_data", &ImDrawCmd::UserCallbackData); DrawCmd.def(py::init<>()); py::class_<ImDrawVert> DrawVert(deargui, "DrawVert"); DrawVert.def_readwrite("pos", &ImDrawVert::pos); DrawVert.def_readwrite("uv", &ImDrawVert::uv); DrawVert.def_readwrite("col", &ImDrawVert::col); py::class_<ImDrawChannel> DrawChannel(deargui, "DrawChannel"); DrawChannel.def_readwrite("cmd_buffer", &ImDrawChannel::CmdBuffer); DrawChannel.def_readwrite("idx_buffer", &ImDrawChannel::IdxBuffer); py::enum_<ImDrawCornerFlags_>(deargui, "DrawCornerFlags", py::arithmetic()) .value("DRAW_CORNER_FLAGS_TOP_LEFT", ImDrawCornerFlags_TopLeft) .value("DRAW_CORNER_FLAGS_TOP_RIGHT", ImDrawCornerFlags_TopRight) .value("DRAW_CORNER_FLAGS_BOT_LEFT", ImDrawCornerFlags_BotLeft) .value("DRAW_CORNER_FLAGS_BOT_RIGHT", ImDrawCornerFlags_BotRight) .value("DRAW_CORNER_FLAGS_TOP", ImDrawCornerFlags_Top) .value("DRAW_CORNER_FLAGS_BOT", ImDrawCornerFlags_Bot) .value("DRAW_CORNER_FLAGS_LEFT", ImDrawCornerFlags_Left) .value("DRAW_CORNER_FLAGS_RIGHT", ImDrawCornerFlags_Right) .value("DRAW_CORNER_FLAGS_ALL", ImDrawCornerFlags_All) .export_values(); py::enum_<ImDrawListFlags_>(deargui, "DrawListFlags", py::arithmetic()) .value("DRAW_LIST_FLAGS_ANTI_ALIASED_LINES", ImDrawListFlags_AntiAliasedLines) .value("DRAW_LIST_FLAGS_ANTI_ALIASED_FILL", ImDrawListFlags_AntiAliasedFill) .export_values(); py::class_<ImDrawList> DrawList(deargui, "DrawList"); DrawList.def_readwrite("cmd_buffer", &ImDrawList::CmdBuffer); DrawList.def_readwrite("idx_buffer", &ImDrawList::IdxBuffer); DrawList.def_readwrite("vtx_buffer", &ImDrawList::VtxBuffer); DrawList.def_readwrite("flags", &ImDrawList::Flags); DrawList.def(py::init<const ImDrawListSharedData *>() , py::arg("shared_data") ); DrawList.def("push_clip_rect", &ImDrawList::PushClipRect , py::arg("clip_rect_min") , py::arg("clip_rect_max") , py::arg("intersect_with_current_clip_rect") = false , py::return_value_policy::automatic_reference); DrawList.def("push_clip_rect_full_screen", &ImDrawList::PushClipRectFullScreen , py::return_value_policy::automatic_reference); DrawList.def("pop_clip_rect", &ImDrawList::PopClipRect , py::return_value_policy::automatic_reference); DrawList.def("push_texture_id", &ImDrawList::PushTextureID , py::arg("texture_id") , py::return_value_policy::automatic_reference); DrawList.def("pop_texture_id", &ImDrawList::PopTextureID , py::return_value_policy::automatic_reference); DrawList.def("get_clip_rect_min", &ImDrawList::GetClipRectMin , py::return_value_policy::automatic_reference); DrawList.def("get_clip_rect_max", &ImDrawList::GetClipRectMax , py::return_value_policy::automatic_reference); DrawList.def("add_line", &ImDrawList::AddLine , py::arg("a") , py::arg("b") , py::arg("col") , py::arg("thickness") = 1.0f , py::return_value_policy::automatic_reference); DrawList.def("add_rect", &ImDrawList::AddRect , py::arg("a") , py::arg("b") , py::arg("col") , py::arg("rounding") = 0.0f , py::arg("rounding_corners_flags") = ImDrawCornerFlags_All , py::arg("thickness") = 1.0f , py::return_value_policy::automatic_reference); DrawList.def("add_rect_filled", &ImDrawList::AddRectFilled , py::arg("a") , py::arg("b") , py::arg("col") , py::arg("rounding") = 0.0f , py::arg("rounding_corners_flags") = ImDrawCornerFlags_All , py::return_value_policy::automatic_reference); DrawList.def("add_rect_filled_multi_color", &ImDrawList::AddRectFilledMultiColor , py::arg("a") , py::arg("b") , py::arg("col_upr_left") , py::arg("col_upr_right") , py::arg("col_bot_right") , py::arg("col_bot_left") , py::return_value_policy::automatic_reference); DrawList.def("add_quad", &ImDrawList::AddQuad , py::arg("a") , py::arg("b") , py::arg("c") , py::arg("d") , py::arg("col") , py::arg("thickness") = 1.0f , py::return_value_policy::automatic_reference); DrawList.def("add_quad_filled", &ImDrawList::AddQuadFilled , py::arg("a") , py::arg("b") , py::arg("c") , py::arg("d") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("add_triangle", &ImDrawList::AddTriangle , py::arg("a") , py::arg("b") , py::arg("c") , py::arg("col") , py::arg("thickness") = 1.0f , py::return_value_policy::automatic_reference); DrawList.def("add_triangle_filled", &ImDrawList::AddTriangleFilled , py::arg("a") , py::arg("b") , py::arg("c") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("add_circle", &ImDrawList::AddCircle , py::arg("centre") , py::arg("radius") , py::arg("col") , py::arg("num_segments") = 12 , py::arg("thickness") = 1.0f , py::return_value_policy::automatic_reference); DrawList.def("add_circle_filled", &ImDrawList::AddCircleFilled , py::arg("centre") , py::arg("radius") , py::arg("col") , py::arg("num_segments") = 12 , py::return_value_policy::automatic_reference); DrawList.def("add_text", py::overload_cast<const ImVec2 &, ImU32, const char *, const char *>(&ImDrawList::AddText) , py::arg("pos") , py::arg("col") , py::arg("text_begin") , py::arg("text_end") = nullptr , py::return_value_policy::automatic_reference); DrawList.def("add_text", py::overload_cast<const ImFont *, float, const ImVec2 &, ImU32, const char *, const char *, float, const ImVec4 *>(&ImDrawList::AddText) , py::arg("font") , py::arg("font_size") , py::arg("pos") , py::arg("col") , py::arg("text_begin") , py::arg("text_end") = nullptr , py::arg("wrap_width") = 0.0f , py::arg("cpu_fine_clip_rect") = nullptr , py::return_value_policy::automatic_reference); DrawList.def("add_image", &ImDrawList::AddImage , py::arg("user_texture_id") , py::arg("a") , py::arg("b") , py::arg("uv_a") = ImVec2(0,0) , py::arg("uv_b") = ImVec2(1,1) , py::arg("col") = 0xFFFFFFFF , py::return_value_policy::automatic_reference); DrawList.def("add_image_quad", &ImDrawList::AddImageQuad , py::arg("user_texture_id") , py::arg("a") , py::arg("b") , py::arg("c") , py::arg("d") , py::arg("uv_a") = ImVec2(0,0) , py::arg("uv_b") = ImVec2(1,0) , py::arg("uv_c") = ImVec2(1,1) , py::arg("uv_d") = ImVec2(0,1) , py::arg("col") = 0xFFFFFFFF , py::return_value_policy::automatic_reference); DrawList.def("add_image_rounded", &ImDrawList::AddImageRounded , py::arg("user_texture_id") , py::arg("a") , py::arg("b") , py::arg("uv_a") , py::arg("uv_b") , py::arg("col") , py::arg("rounding") , py::arg("rounding_corners") = ImDrawCornerFlags_All , py::return_value_policy::automatic_reference); DrawList.def("add_polyline", &ImDrawList::AddPolyline , py::arg("points") , py::arg("num_points") , py::arg("col") , py::arg("closed") , py::arg("thickness") , py::return_value_policy::automatic_reference); DrawList.def("add_convex_poly_filled", &ImDrawList::AddConvexPolyFilled , py::arg("points") , py::arg("num_points") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("add_bezier_curve", &ImDrawList::AddBezierCurve , py::arg("pos0") , py::arg("cp0") , py::arg("cp1") , py::arg("pos1") , py::arg("col") , py::arg("thickness") , py::arg("num_segments") = 0 , py::return_value_policy::automatic_reference); DrawList.def("path_clear", &ImDrawList::PathClear , py::return_value_policy::automatic_reference); DrawList.def("path_line_to", &ImDrawList::PathLineTo , py::arg("pos") , py::return_value_policy::automatic_reference); DrawList.def("path_line_to_merge_duplicate", &ImDrawList::PathLineToMergeDuplicate , py::arg("pos") , py::return_value_policy::automatic_reference); DrawList.def("path_fill_convex", &ImDrawList::PathFillConvex , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("path_stroke", &ImDrawList::PathStroke , py::arg("col") , py::arg("closed") , py::arg("thickness") = 1.0f , py::return_value_policy::automatic_reference); DrawList.def("path_arc_to", &ImDrawList::PathArcTo , py::arg("centre") , py::arg("radius") , py::arg("a_min") , py::arg("a_max") , py::arg("num_segments") = 10 , py::return_value_policy::automatic_reference); DrawList.def("path_arc_to_fast", &ImDrawList::PathArcToFast , py::arg("centre") , py::arg("radius") , py::arg("a_min_of_12") , py::arg("a_max_of_12") , py::return_value_policy::automatic_reference); DrawList.def("path_bezier_curve_to", &ImDrawList::PathBezierCurveTo , py::arg("p1") , py::arg("p2") , py::arg("p3") , py::arg("num_segments") = 0 , py::return_value_policy::automatic_reference); DrawList.def("path_rect", &ImDrawList::PathRect , py::arg("rect_min") , py::arg("rect_max") , py::arg("rounding") = 0.0f , py::arg("rounding_corners_flags") = ImDrawCornerFlags_All , py::return_value_policy::automatic_reference); DrawList.def("channels_split", &ImDrawList::ChannelsSplit , py::arg("channels_count") , py::return_value_policy::automatic_reference); DrawList.def("channels_merge", &ImDrawList::ChannelsMerge , py::return_value_policy::automatic_reference); DrawList.def("channels_set_current", &ImDrawList::ChannelsSetCurrent , py::arg("channel_index") , py::return_value_policy::automatic_reference); DrawList.def("add_draw_cmd", &ImDrawList::AddDrawCmd , py::return_value_policy::automatic_reference); DrawList.def("clone_output", &ImDrawList::CloneOutput , py::return_value_policy::automatic_reference); DrawList.def("clear", &ImDrawList::Clear , py::return_value_policy::automatic_reference); DrawList.def("clear_free_memory", &ImDrawList::ClearFreeMemory , py::return_value_policy::automatic_reference); DrawList.def("prim_reserve", &ImDrawList::PrimReserve , py::arg("idx_count") , py::arg("vtx_count") , py::return_value_policy::automatic_reference); DrawList.def("prim_rect", &ImDrawList::PrimRect , py::arg("a") , py::arg("b") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("prim_rect_uv", &ImDrawList::PrimRectUV , py::arg("a") , py::arg("b") , py::arg("uv_a") , py::arg("uv_b") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("prim_quad_uv", &ImDrawList::PrimQuadUV , py::arg("a") , py::arg("b") , py::arg("c") , py::arg("d") , py::arg("uv_a") , py::arg("uv_b") , py::arg("uv_c") , py::arg("uv_d") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("prim_write_vtx", &ImDrawList::PrimWriteVtx , py::arg("pos") , py::arg("uv") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("prim_write_idx", &ImDrawList::PrimWriteIdx , py::arg("idx") , py::return_value_policy::automatic_reference); DrawList.def("prim_vtx", &ImDrawList::PrimVtx , py::arg("pos") , py::arg("uv") , py::arg("col") , py::return_value_policy::automatic_reference); DrawList.def("update_clip_rect", &ImDrawList::UpdateClipRect , py::return_value_policy::automatic_reference); DrawList.def("update_texture_id", &ImDrawList::UpdateTextureID , py::return_value_policy::automatic_reference); py::class_<ImDrawData> DrawData(deargui, "DrawData"); DrawData.def_readwrite("valid", &ImDrawData::Valid); DrawData.def_readwrite("cmd_lists_count", &ImDrawData::CmdListsCount); DrawData.def_readwrite("total_idx_count", &ImDrawData::TotalIdxCount); DrawData.def_readwrite("total_vtx_count", &ImDrawData::TotalVtxCount); DrawData.def_readwrite("display_pos", &ImDrawData::DisplayPos); DrawData.def_readwrite("display_size", &ImDrawData::DisplaySize); DrawData.def(py::init<>()); DrawData.def("clear", &ImDrawData::Clear , py::return_value_policy::automatic_reference); DrawData.def("de_index_all_buffers", &ImDrawData::DeIndexAllBuffers , py::return_value_policy::automatic_reference); DrawData.def("scale_clip_rects", &ImDrawData::ScaleClipRects , py::arg("sc") , py::return_value_policy::automatic_reference); py::class_<ImFontConfig> FontConfig(deargui, "FontConfig"); FontConfig.def_readwrite("font_data", &ImFontConfig::FontData); FontConfig.def_readwrite("font_data_size", &ImFontConfig::FontDataSize); FontConfig.def_readwrite("font_data_owned_by_atlas", &ImFontConfig::FontDataOwnedByAtlas); FontConfig.def_readwrite("font_no", &ImFontConfig::FontNo); FontConfig.def_readwrite("size_pixels", &ImFontConfig::SizePixels); FontConfig.def_readwrite("oversample_h", &ImFontConfig::OversampleH); FontConfig.def_readwrite("oversample_v", &ImFontConfig::OversampleV); FontConfig.def_readwrite("pixel_snap_h", &ImFontConfig::PixelSnapH); FontConfig.def_readwrite("glyph_extra_spacing", &ImFontConfig::GlyphExtraSpacing); FontConfig.def_readwrite("glyph_offset", &ImFontConfig::GlyphOffset); FontConfig.def_readwrite("glyph_ranges", &ImFontConfig::GlyphRanges); FontConfig.def_readwrite("glyph_min_advance_x", &ImFontConfig::GlyphMinAdvanceX); FontConfig.def_readwrite("glyph_max_advance_x", &ImFontConfig::GlyphMaxAdvanceX); FontConfig.def_readwrite("merge_mode", &ImFontConfig::MergeMode); FontConfig.def_readwrite("rasterizer_flags", &ImFontConfig::RasterizerFlags); FontConfig.def_readwrite("rasterizer_multiply", &ImFontConfig::RasterizerMultiply); FontConfig.def_readonly("name", &ImFontConfig::Name); FontConfig.def_readwrite("dst_font", &ImFontConfig::DstFont); FontConfig.def(py::init<>()); py::class_<ImFontGlyph> FontGlyph(deargui, "FontGlyph"); FontGlyph.def_readwrite("codepoint", &ImFontGlyph::Codepoint); FontGlyph.def_readwrite("advance_x", &ImFontGlyph::AdvanceX); FontGlyph.def_readwrite("x0", &ImFontGlyph::X0); FontGlyph.def_readwrite("y0", &ImFontGlyph::Y0); FontGlyph.def_readwrite("x1", &ImFontGlyph::X1); FontGlyph.def_readwrite("y1", &ImFontGlyph::Y1); FontGlyph.def_readwrite("u0", &ImFontGlyph::U0); FontGlyph.def_readwrite("v0", &ImFontGlyph::V0); FontGlyph.def_readwrite("u1", &ImFontGlyph::U1); FontGlyph.def_readwrite("v1", &ImFontGlyph::V1); py::enum_<ImFontAtlasFlags_>(deargui, "FontAtlasFlags", py::arithmetic()) .value("FONT_ATLAS_FLAGS_NONE", ImFontAtlasFlags_None) .value("FONT_ATLAS_FLAGS_NO_POWER_OF_TWO_HEIGHT", ImFontAtlasFlags_NoPowerOfTwoHeight) .value("FONT_ATLAS_FLAGS_NO_MOUSE_CURSORS", ImFontAtlasFlags_NoMouseCursors) .export_values(); py::class_<ImFontAtlas> FontAtlas(deargui, "FontAtlas"); FontAtlas.def(py::init<>()); FontAtlas.def("add_font", &ImFontAtlas::AddFont , py::arg("font_cfg") , py::return_value_policy::automatic_reference); FontAtlas.def("add_font_default", &ImFontAtlas::AddFontDefault , py::arg("font_cfg") = nullptr , py::return_value_policy::automatic_reference); FontAtlas.def("add_font_from_file_ttf", &ImFontAtlas::AddFontFromFileTTF , py::arg("filename") , py::arg("size_pixels") , py::arg("font_cfg") = nullptr , py::arg("glyph_ranges") = nullptr , py::return_value_policy::automatic_reference); FontAtlas.def("add_font_from_memory_ttf", &ImFontAtlas::AddFontFromMemoryTTF , py::arg("font_data") , py::arg("font_size") , py::arg("size_pixels") , py::arg("font_cfg") = nullptr , py::arg("glyph_ranges") = nullptr , py::return_value_policy::automatic_reference); FontAtlas.def("add_font_from_memory_compressed_ttf", &ImFontAtlas::AddFontFromMemoryCompressedTTF , py::arg("compressed_font_data") , py::arg("compressed_font_size") , py::arg("size_pixels") , py::arg("font_cfg") = nullptr , py::arg("glyph_ranges") = nullptr , py::return_value_policy::automatic_reference); FontAtlas.def("add_font_from_memory_compressed_base85_ttf", &ImFontAtlas::AddFontFromMemoryCompressedBase85TTF , py::arg("compressed_font_data_base85") , py::arg("size_pixels") , py::arg("font_cfg") = nullptr , py::arg("glyph_ranges") = nullptr , py::return_value_policy::automatic_reference); FontAtlas.def("clear_input_data", &ImFontAtlas::ClearInputData , py::return_value_policy::automatic_reference); FontAtlas.def("clear_tex_data", &ImFontAtlas::ClearTexData , py::return_value_policy::automatic_reference); FontAtlas.def("clear_fonts", &ImFontAtlas::ClearFonts , py::return_value_policy::automatic_reference); FontAtlas.def("clear", &ImFontAtlas::Clear , py::return_value_policy::automatic_reference); FontAtlas.def("build", &ImFontAtlas::Build , py::return_value_policy::automatic_reference); FontAtlas.def("is_built", &ImFontAtlas::IsBuilt , py::return_value_policy::automatic_reference); FontAtlas.def("set_tex_id", &ImFontAtlas::SetTexID , py::arg("id") , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_default", &ImFontAtlas::GetGlyphRangesDefault , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_korean", &ImFontAtlas::GetGlyphRangesKorean , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_japanese", &ImFontAtlas::GetGlyphRangesJapanese , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_chinese_full", &ImFontAtlas::GetGlyphRangesChineseFull , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_chinese_simplified_common", &ImFontAtlas::GetGlyphRangesChineseSimplifiedCommon , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_cyrillic", &ImFontAtlas::GetGlyphRangesCyrillic , py::return_value_policy::automatic_reference); FontAtlas.def("get_glyph_ranges_thai", &ImFontAtlas::GetGlyphRangesThai , py::return_value_policy::automatic_reference); FontAtlas.def_readwrite("locked", &ImFontAtlas::Locked); FontAtlas.def_readwrite("flags", &ImFontAtlas::Flags); FontAtlas.def_readwrite("tex_id", &ImFontAtlas::TexID); FontAtlas.def_readwrite("tex_desired_width", &ImFontAtlas::TexDesiredWidth); FontAtlas.def_readwrite("tex_glyph_padding", &ImFontAtlas::TexGlyphPadding); py::class_<ImFont> Font(deargui, "Font"); Font.def_readwrite("font_size", &ImFont::FontSize); Font.def_readwrite("scale", &ImFont::Scale); Font.def_readwrite("display_offset", &ImFont::DisplayOffset); Font.def_readwrite("glyphs", &ImFont::Glyphs); Font.def_readwrite("index_advance_x", &ImFont::IndexAdvanceX); Font.def_readwrite("index_lookup", &ImFont::IndexLookup); Font.def_readwrite("fallback_glyph", &ImFont::FallbackGlyph); Font.def_readwrite("fallback_advance_x", &ImFont::FallbackAdvanceX); Font.def_readwrite("fallback_char", &ImFont::FallbackChar); Font.def_readwrite("config_data_count", &ImFont::ConfigDataCount); Font.def_readwrite("config_data", &ImFont::ConfigData); Font.def_readwrite("container_atlas", &ImFont::ContainerAtlas); Font.def_readwrite("ascent", &ImFont::Ascent); Font.def_readwrite("descent", &ImFont::Descent); Font.def_readwrite("dirty_lookup_tables", &ImFont::DirtyLookupTables); Font.def_readwrite("metrics_total_surface", &ImFont::MetricsTotalSurface); Font.def(py::init<>()); Font.def("clear_output_data", &ImFont::ClearOutputData , py::return_value_policy::automatic_reference); Font.def("build_lookup_table", &ImFont::BuildLookupTable , py::return_value_policy::automatic_reference); Font.def("find_glyph", &ImFont::FindGlyph , py::arg("c") , py::return_value_policy::automatic_reference); Font.def("find_glyph_no_fallback", &ImFont::FindGlyphNoFallback , py::arg("c") , py::return_value_policy::automatic_reference); Font.def("set_fallback_char", &ImFont::SetFallbackChar , py::arg("c") , py::return_value_policy::automatic_reference); Font.def("get_char_advance", &ImFont::GetCharAdvance , py::arg("c") , py::return_value_policy::automatic_reference); Font.def("is_loaded", &ImFont::IsLoaded , py::return_value_policy::automatic_reference); Font.def("get_debug_name", &ImFont::GetDebugName , py::return_value_policy::automatic_reference); Font.def("calc_word_wrap_position_a", &ImFont::CalcWordWrapPositionA , py::arg("scale") , py::arg("text") , py::arg("text_end") , py::arg("wrap_width") , py::return_value_policy::automatic_reference); Font.def("render_char", &ImFont::RenderChar , py::arg("draw_list") , py::arg("size") , py::arg("pos") , py::arg("col") , py::arg("c") , py::return_value_policy::automatic_reference); Font.def("render_text", &ImFont::RenderText , py::arg("draw_list") , py::arg("size") , py::arg("pos") , py::arg("col") , py::arg("clip_rect") , py::arg("text_begin") , py::arg("text_end") , py::arg("wrap_width") = 0.0f , py::arg("cpu_fine_clip") = false , py::return_value_policy::automatic_reference); Font.def("grow_index", &ImFont::GrowIndex , py::arg("new_size") , py::return_value_policy::automatic_reference); Font.def("add_glyph", &ImFont::AddGlyph , py::arg("c") , py::arg("x0") , py::arg("y0") , py::arg("x1") , py::arg("y1") , py::arg("u0") , py::arg("v0") , py::arg("u1") , py::arg("v1") , py::arg("advance_x") , py::return_value_policy::automatic_reference); Font.def("add_remap_char", &ImFont::AddRemapChar , py::arg("dst") , py::arg("src") , py::arg("overwrite_dst") = true , py::return_value_policy::automatic_reference); Style.def("set_color", [](ImGuiStyle& self, int item, ImVec4 color) { if (item < 0) throw py::index_error(); if (item >= IM_ARRAYSIZE(self.Colors)) throw py::index_error(); self.Colors[item] = color; }, py::arg("item"), py::arg("color")); IO.def("set_mouse_down", [](ImGuiIO& self, int button, bool down) { if (button < 0) throw py::index_error(); if (button >= IM_ARRAYSIZE(self.MouseDown)) throw py::index_error(); self.MouseDown[button] = down; }, py::arg("button"), py::arg("down")); IO.def("set_key_down", [](ImGuiIO& self, int key, bool down) { if (key < 0) throw py::index_error(); if (key >= IM_ARRAYSIZE(self.KeysDown)) throw py::index_error(); self.KeysDown[key] = down; }, py::arg("key"), py::arg("down")); IO.def("set_key_map", [](ImGuiIO& self, int key, int value) { if (key < 0) throw py::index_error(); if (key >= IM_ARRAYSIZE(self.KeyMap)) throw py::index_error(); self.KeyMap[key] = value; }, py::arg("key"), py::arg("value")); DrawData.def_property_readonly("cmd_lists", [](const ImDrawData& self) { py::list ret; for(int i = 0; i < self.CmdListsCount; i++) { ret.append(self.CmdLists[i]); } return ret; }); DrawVert.def_property_readonly_static("pos_offset", [](py::object) { return IM_OFFSETOF(ImDrawVert, pos); }); DrawVert.def_property_readonly_static("uv_offset", [](py::object) { return IM_OFFSETOF(ImDrawVert, uv); }); DrawVert.def_property_readonly_static("col_offset", [](py::object) { return IM_OFFSETOF(ImDrawVert, col); }); FontAtlas.def("get_tex_data_as_alpha8", [](ImFontAtlas& atlas) { unsigned char* pixels; int width, height, bytes_per_pixel; atlas.GetTexDataAsAlpha8(&pixels, &width, &height, &bytes_per_pixel); std::string data((char*)pixels, width * height * bytes_per_pixel); return std::make_tuple(width, height, py::bytes(data)); }); FontAtlas.def("get_tex_data_as_rgba32", [](ImFontAtlas& atlas) { unsigned char* pixels; int width, height, bytes_per_pixel; atlas.GetTexDataAsRGBA32(&pixels, &width, &height, &bytes_per_pixel); std::string data((char*)pixels, width * height * bytes_per_pixel); return std::make_tuple(width, height, py::bytes(data)); }); deargui.def("init", []() { ImGui::CreateContext(); ImGuiIO& io = ImGui::GetIO(); io.DisplaySize = ImVec2(100.0, 100.0); unsigned char* pixels; int w, h; io.Fonts->GetTexDataAsAlpha8(&pixels, &w, &h, nullptr); }); deargui.def("input_text", [](const char* label, char* data, size_t max_size, ImGuiInputTextFlags flags) { max_size++; char* text = (char*)malloc(max_size * sizeof(char)); strncpy(text, data, max_size); auto ret = ImGui::InputText(label, text, max_size, flags, nullptr, NULL); std::string output(text); free(text); return std::make_tuple(ret, output); } , py::arg("label") , py::arg("data") , py::arg("max_size") , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("input_text_multiline", [](const char* label, char* data, size_t max_size, const ImVec2& size, ImGuiInputTextFlags flags) { max_size++; char* text = (char*)malloc(max_size * sizeof(char)); strncpy(text, data, max_size); auto ret = ImGui::InputTextMultiline(label, text, max_size, size, flags, nullptr, NULL); std::string output(text); free(text); return std::make_tuple(ret, output); } , py::arg("label") , py::arg("data") , py::arg("max_size") , py::arg("size") = ImVec2(0,0) , py::arg("flags") = 0 , py::return_value_policy::automatic_reference); deargui.def("combo", [](const char* label, int * current_item, std::vector<std::string> items, int popup_max_height_in_items) { std::vector<const char*> ptrs; for (const std::string& s : items) { ptrs.push_back(s.c_str()); } auto ret = ImGui::Combo(label, current_item, ptrs.data(), ptrs.size(), popup_max_height_in_items); return std::make_tuple(ret, current_item); } , py::arg("label") , py::arg("current_item") , py::arg("items") , py::arg("popup_max_height_in_items") = -1 , py::return_value_policy::automatic_reference); deargui.def("list_box", [](const char* label, int * current_item, std::vector<std::string> items, int height_in_items) { std::vector<const char*> ptrs; for (const std::string& s : items) { ptrs.push_back(s.c_str()); } auto ret = ImGui::ListBox(label, current_item, ptrs.data(), ptrs.size(), height_in_items); return std::make_tuple(ret, current_item); } , py::arg("label") , py::arg("current_item") , py::arg("items") , py::arg("height_in_items") = -1 , py::return_value_policy::automatic_reference); deargui.def("plot_lines", [](const char* label, std::vector<float> values, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) { ImGui::PlotLines(label, values.data(), values.size(), values_offset, overlay_text, scale_min, scale_max, graph_size, sizeof(float)); } , py::arg("label") , py::arg("values") , py::arg("values_offset") = 0 , py::arg("overlay_text") = nullptr , py::arg("scale_min") = FLT_MAX , py::arg("scale_max") = FLT_MAX , py::arg("graph_size") = ImVec2(0,0) ); deargui.def("plot_histogram", [](const char* label, std::vector<float> values, int values_offset, const char* overlay_text, float scale_min, float scale_max, ImVec2 graph_size) { ImGui::PlotHistogram(label, values.data(), values.size(), values_offset, overlay_text, scale_min, scale_max, graph_size, sizeof(float)); } , py::arg("label") , py::arg("values") , py::arg("values_offset") = 0 , py::arg("overlay_text") = nullptr , py::arg("scale_min") = FLT_MAX , py::arg("scale_max") = FLT_MAX , py::arg("graph_size") = ImVec2(0,0) ); }
47.184105
205
0.685535
Nechrito
dc6fe7029108ad5e649c87a8c5d0b7be3d7d4962
1,660
hpp
C++
dsss/string_sorting/sequential/mergesort.hpp
kurpicz/dsss
ac50a22b1beec1d8613a6cd868798426352305c8
[ "BSD-2-Clause" ]
3
2018-10-24T22:15:17.000Z
2019-09-21T22:56:05.000Z
dsss/string_sorting/sequential/mergesort.hpp
kurpicz/dsss
ac50a22b1beec1d8613a6cd868798426352305c8
[ "BSD-2-Clause" ]
null
null
null
dsss/string_sorting/sequential/mergesort.hpp
kurpicz/dsss
ac50a22b1beec1d8613a6cd868798426352305c8
[ "BSD-2-Clause" ]
null
null
null
/******************************************************************************* * string_sorting/sequential/mergesort.hpp * * Copyright (C) 2018 Florian Kurpicz <florian.kurpicz@tu-dortmund.de> * * All rights reserved. Published under the BSD-2 license in the LICENSE file. ******************************************************************************/ #pragma once #include <cstdint> #include "util/string.hpp" namespace rantala { extern void mergesort_2way(dsss::string*, std::size_t); extern void mergesort_3way(dsss::string*, std::size_t); extern void mergesort_4way(dsss::string*, std::size_t); extern void mergesort_losertree_64way(dsss::string*, std::size_t); extern void mergesort_losertree_128way(dsss::string*, std::size_t); extern void mergesort_losertree_256way(dsss::string*, std::size_t); extern void mergesort_losertree_512way(dsss::string*, std::size_t); extern void mergesort_losertree_1024way(dsss::string*, std::size_t); extern void mergesort_2way_unstable(dsss::string*, std::size_t); extern void mergesort_3way_unstable(dsss::string*, std::size_t); extern void mergesort_4way_unstable(dsss::string*, std::size_t); } // namespace rantala namespace rantala_mergesort_lcp { extern void mergesort_lcp_2way(dsss::string*, std::size_t); extern void mergesort_cache1_lcp_2way(dsss::string*, std::size_t); extern void mergesort_cache2_lcp_2way(dsss::string*, std::size_t); extern void mergesort_cache4_lcp_2way(dsss::string*, std::size_t); extern void mergesort_lcp_2way_unstable(dsss::string*, std::size_t); } // namespace rantala_mergesort_lcp /******************************************************************************/
37.727273
80
0.66988
kurpicz
dc72c32ec5e28eed8c75f5ecd02d67bf6d52ecb5
4,342
cpp
C++
app/src/main/jni/nativeCode/common/texture.cpp
anandmuralidhar24/FloatTextureAndroid
53262deafc6e3a160134adce54c1e4e9c0385748
[ "Apache-2.0" ]
4
2018-01-16T09:50:32.000Z
2022-01-30T19:13:33.000Z
app/src/main/jni/nativeCode/common/texture.cpp
anandmuralidhar24/FloatTextureAndroid
53262deafc6e3a160134adce54c1e4e9c0385748
[ "Apache-2.0" ]
null
null
null
app/src/main/jni/nativeCode/common/texture.cpp
anandmuralidhar24/FloatTextureAndroid
53262deafc6e3a160134adce54c1e4e9c0385748
[ "Apache-2.0" ]
3
2017-11-05T00:28:54.000Z
2019-11-18T07:04:58.000Z
/* * Copyright 2016 Anand Muralidhar * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "texture.h" #include "myLogger.h" #include "misc.h" /** * Initializes a float texture: generate the texture name, bind it, etc. */ void InitializeFloatTexture(GLuint &textureName, int textureWidth, int textureHeight, int numberOfChannels) { GLenum internalFormat, textureFormat; if (numberOfChannels == 1) { internalFormat = GL_R32F; textureFormat = GL_RED; } else if (numberOfChannels == 2) { internalFormat = GL_RG32F; textureFormat = GL_RG; } else if (numberOfChannels == 3) { internalFormat = GL_RGB32F; textureFormat = GL_RGB; } else if (numberOfChannels == 4) { internalFormat = GL_RGBA32F; textureFormat = GL_RGBA; } // generate it glGenTextures(1, &textureName); // make active and bind glBindTexture(GL_TEXTURE_2D, textureName); // turn off filtering and wrap modes glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); // define texture with float format glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, textureWidth, textureHeight, 0, textureFormat, GL_FLOAT, 0); glBindTexture(GL_TEXTURE_2D, 0); // check if that worked CheckGLError("InitializeFloatTexture"); } /** * loads new data into float texture by replacing previous data */ void LoadFloatTexture(GLuint textureName, int textureWidth, int textureHeight, int numberOfChannels, cv::Mat inputData) { //!! assumes that inputData matches texture in number of channels!! if(numberOfChannels != inputData.channels()) { MyLOGE("Number of channels in input matrix does not match with texture!"); return; } GLenum textureFormat; if (numberOfChannels == 1) { textureFormat = GL_RED; } else if (numberOfChannels == 2) { textureFormat = GL_RG; } else if (numberOfChannels == 3) { textureFormat = GL_RGB; } else if (numberOfChannels == 4) { textureFormat = GL_RGBA; } // bind the texture and update its contents with the matrix's data glBindTexture(GL_TEXTURE_2D, textureName); glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, textureWidth, textureHeight, textureFormat, GL_FLOAT, inputData.data); CheckGLError("LoadFloatTexture"); } /** * Read data from float texture into opencv matrix */ cv::Mat ReadFloatTexture(GLuint textureName, int textureWidth, int textureHeight, int numberOfChannels) { glFramebufferTexture2D(GL_READ_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textureName, 0); // check if that worked CheckFramebufferStatus(); glReadBuffer(GL_COLOR_ATTACHMENT0); GLenum textureFormat; int matType; if (numberOfChannels == 1) { textureFormat = GL_RED; matType = CV_32F; } else if (numberOfChannels == 2) { textureFormat = GL_RG; matType = CV_32FC2; } else if (numberOfChannels == 3) { textureFormat = GL_RGB; matType = CV_32FC3; } else if (numberOfChannels == 4) { textureFormat = GL_RGBA; matType = CV_32FC4; } cv::Mat outputMat = cv::Mat::zeros(textureHeight, textureWidth, matType); // read data from texture into opencv Mat glReadPixels(0, 0, textureWidth, textureHeight, textureFormat, GL_FLOAT, outputMat.data); CheckGLError("ReadFloatTexture"); return outputMat; }
32.893939
97
0.669277
anandmuralidhar24
dc72cc28af2009cb084fb7a0b33c32b378053f81
4,733
cpp
C++
qxhexsignature.cpp
shield-endpoint/DIE-engine
ee556330ed953f042c06bb3c35e6af39dbf26e12
[ "MIT" ]
1
2021-10-15T02:21:37.000Z
2021-10-15T02:21:37.000Z
qxhexsignature.cpp
dzzie/DIE-engine
ca068f5ed55923b7e196d991016a6850355d6b72
[ "MIT" ]
null
null
null
qxhexsignature.cpp
dzzie/DIE-engine
ca068f5ed55923b7e196d991016a6850355d6b72
[ "MIT" ]
1
2020-01-10T12:27:40.000Z
2020-01-10T12:27:40.000Z
// Copyright (c) 2012-2020 hors<horsicq@gmail.com> // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. // #include "qxhexsignature.h" #include "ui_qxhexsignature.h" QXHexSignature::QXHexSignature(QWidget *parent) : QDialog(parent), ui(new Ui::QXHexSignature) { ui->setupUi(this); ui->textEditSignature->setWordWrapMode(QTextOption::WrapAnywhere); for(int i=0; i<128; i++) { pushButton[i]=new QPushButtonX; pushButton[i]->setMaximumWidth(30); pushButton[i]->setMaximumHeight(20); pushButton[i]->setCheckable(true); pushButton[i]->setEnabled(false); connect(pushButton[i],SIGNAL(toggled(bool)),this,SLOT(reload())); if((i>=0)&&(i<16)) { ui->horizontalLayout0->addWidget(pushButton[i]); } else if((i>=16)&&(i<32)) { ui->horizontalLayout1->addWidget(pushButton[i]); } else if((i>=32)&&(i<48)) { ui->horizontalLayout2->addWidget(pushButton[i]); } else if((i>=48)&&(i<64)) { ui->horizontalLayout3->addWidget(pushButton[i]); } else if((i>=64)&&(i<80)) { ui->horizontalLayout4->addWidget(pushButton[i]); } else if((i>=80)&&(i<96)) { ui->horizontalLayout5->addWidget(pushButton[i]); } else if((i>=96)&&(i<112)) { ui->horizontalLayout6->addWidget(pushButton[i]); } else if((i>=112)&&(i<128)) { ui->horizontalLayout7->addWidget(pushButton[i]); } } } void QXHexSignature::setData(QByteArray baData) { this->baData=baData; int nSize=qMin(128,baData.size()); for(int i=0; i<nSize; i++) { pushButton[i]->setText(QString("%1").arg((unsigned char)(baData.data()[i]),2,16,QChar('0')).toUpper()); pushButton[i]->setEnabled(true); } reload(); } QXHexSignature::~QXHexSignature() { delete ui; } void QXHexSignature::_showToolTips(bool bState) { if(bState) { ui->pushButtonClose->setToolTip("Quit"); ui->pushButtonCopy->setToolTip("Copy signature"); } else { ui->pushButtonClose->setToolTip(""); ui->pushButtonCopy->setToolTip(""); } } void QXHexSignature::reload() { int nSize=qMin(128,baData.size()); QString sSignature; QString sTemp; for(int i=0; i<nSize; i++) { if(pushButton[i]->isChecked()) { sTemp=ui->lineEditWildcard->text(); sTemp+=sTemp; } else { sTemp=QString("%1").arg((unsigned char)(baData.data()[i]),2,16,QChar('0')); } if(ui->checkBoxUpper->isChecked()) { sTemp=sTemp.toUpper(); } sSignature+=sTemp; if(ui->checkBoxSpaces->isChecked()) { sSignature+=" "; } } ui->textEditSignature->setText(sSignature); } void QXHexSignature::on_pushButtonClose_clicked() { this->close(); } void QXHexSignature::on_pushButtonCopy_clicked() { QClipboard *clipboard = QApplication::clipboard(); clipboard->setText(ui->textEditSignature->toPlainText()); } void QXHexSignature::on_checkBoxSpaces_toggled(bool checked) { Q_UNUSED(checked) reload(); } void QXHexSignature::on_checkBoxUpper_toggled(bool checked) { Q_UNUSED(checked) reload(); } void QXHexSignature::on_lineEditWildcard_textChanged(const QString &arg1) { Q_UNUSED(arg1) reload(); }
26.740113
112
0.594971
shield-endpoint
dc73a1b8cc1f5f55967c6c729c3101549e96279a
770
hpp
C++
include/RED4ext/Types/generated/vehicle/GridDestructionEvent.hpp
Cyberpunk-Extended-Development-Team/RED4ext.SDK
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
[ "MIT" ]
1
2021-02-01T23:07:50.000Z
2021-02-01T23:07:50.000Z
include/RED4ext/Types/generated/vehicle/GridDestructionEvent.hpp
Cyberpunk-Extended-Development-Team/RED4ext.SDK
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
[ "MIT" ]
null
null
null
include/RED4ext/Types/generated/vehicle/GridDestructionEvent.hpp
Cyberpunk-Extended-Development-Team/RED4ext.SDK
2dc828c761d87a1b4235ce9ca4fbdf9fb4312fae
[ "MIT" ]
null
null
null
#pragma once // This file is generated from the Game's Reflection data #include <cstdint> #include <RED4ext/Common.hpp> #include <RED4ext/REDhash.hpp> #include <RED4ext/Types/SimpleTypes.hpp> #include <RED4ext/Types/generated/red/Event.hpp> namespace RED4ext { namespace vehicle { struct GridDestructionEvent : red::Event { static constexpr const char* NAME = "vehicleGridDestructionEvent"; static constexpr const char* ALIAS = "VehicleGridDestructionEvent"; NativeArray<float, 16> state; // 40 NativeArray<float, 16> rawChange; // 80 NativeArray<float, 16> desiredChange; // C0 }; RED4EXT_ASSERT_SIZE(GridDestructionEvent, 0x100); } // namespace vehicle using VehicleGridDestructionEvent = vehicle::GridDestructionEvent; } // namespace RED4ext
28.518519
71
0.762338
Cyberpunk-Extended-Development-Team
dc73fd316b78c0b620b38fb7bf44bb5771a3a896
5,056
cpp
C++
ivld/src/v20210903/model/PersonImageInfo.cpp
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
null
null
null
ivld/src/v20210903/model/PersonImageInfo.cpp
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
null
null
null
ivld/src/v20210903/model/PersonImageInfo.cpp
suluner/tencentcloud-sdk-cpp
a56c73cc3f488c4d1e10755704107bb15c5e000d
[ "Apache-2.0" ]
null
null
null
/* * Copyright (c) 2017-2019 THL A29 Limited, a Tencent company. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <tencentcloud/ivld/v20210903/model/PersonImageInfo.h> using TencentCloud::CoreInternalOutcome; using namespace TencentCloud::Ivld::V20210903::Model; using namespace std; PersonImageInfo::PersonImageInfo() : m_imageIdHasBeenSet(false), m_imageURLHasBeenSet(false), m_errorCodeHasBeenSet(false), m_errorMsgHasBeenSet(false) { } CoreInternalOutcome PersonImageInfo::Deserialize(const rapidjson::Value &value) { string requestId = ""; if (value.HasMember("ImageId") && !value["ImageId"].IsNull()) { if (!value["ImageId"].IsString()) { return CoreInternalOutcome(Core::Error("response `PersonImageInfo.ImageId` IsString=false incorrectly").SetRequestId(requestId)); } m_imageId = string(value["ImageId"].GetString()); m_imageIdHasBeenSet = true; } if (value.HasMember("ImageURL") && !value["ImageURL"].IsNull()) { if (!value["ImageURL"].IsString()) { return CoreInternalOutcome(Core::Error("response `PersonImageInfo.ImageURL` IsString=false incorrectly").SetRequestId(requestId)); } m_imageURL = string(value["ImageURL"].GetString()); m_imageURLHasBeenSet = true; } if (value.HasMember("ErrorCode") && !value["ErrorCode"].IsNull()) { if (!value["ErrorCode"].IsString()) { return CoreInternalOutcome(Core::Error("response `PersonImageInfo.ErrorCode` IsString=false incorrectly").SetRequestId(requestId)); } m_errorCode = string(value["ErrorCode"].GetString()); m_errorCodeHasBeenSet = true; } if (value.HasMember("ErrorMsg") && !value["ErrorMsg"].IsNull()) { if (!value["ErrorMsg"].IsString()) { return CoreInternalOutcome(Core::Error("response `PersonImageInfo.ErrorMsg` IsString=false incorrectly").SetRequestId(requestId)); } m_errorMsg = string(value["ErrorMsg"].GetString()); m_errorMsgHasBeenSet = true; } return CoreInternalOutcome(true); } void PersonImageInfo::ToJsonObject(rapidjson::Value &value, rapidjson::Document::AllocatorType& allocator) const { if (m_imageIdHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ImageId"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_imageId.c_str(), allocator).Move(), allocator); } if (m_imageURLHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ImageURL"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_imageURL.c_str(), allocator).Move(), allocator); } if (m_errorCodeHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ErrorCode"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_errorCode.c_str(), allocator).Move(), allocator); } if (m_errorMsgHasBeenSet) { rapidjson::Value iKey(rapidjson::kStringType); string key = "ErrorMsg"; iKey.SetString(key.c_str(), allocator); value.AddMember(iKey, rapidjson::Value(m_errorMsg.c_str(), allocator).Move(), allocator); } } string PersonImageInfo::GetImageId() const { return m_imageId; } void PersonImageInfo::SetImageId(const string& _imageId) { m_imageId = _imageId; m_imageIdHasBeenSet = true; } bool PersonImageInfo::ImageIdHasBeenSet() const { return m_imageIdHasBeenSet; } string PersonImageInfo::GetImageURL() const { return m_imageURL; } void PersonImageInfo::SetImageURL(const string& _imageURL) { m_imageURL = _imageURL; m_imageURLHasBeenSet = true; } bool PersonImageInfo::ImageURLHasBeenSet() const { return m_imageURLHasBeenSet; } string PersonImageInfo::GetErrorCode() const { return m_errorCode; } void PersonImageInfo::SetErrorCode(const string& _errorCode) { m_errorCode = _errorCode; m_errorCodeHasBeenSet = true; } bool PersonImageInfo::ErrorCodeHasBeenSet() const { return m_errorCodeHasBeenSet; } string PersonImageInfo::GetErrorMsg() const { return m_errorMsg; } void PersonImageInfo::SetErrorMsg(const string& _errorMsg) { m_errorMsg = _errorMsg; m_errorMsgHasBeenSet = true; } bool PersonImageInfo::ErrorMsgHasBeenSet() const { return m_errorMsgHasBeenSet; }
27.78022
143
0.687896
suluner
dc75c43513f72450a0204906ce07ecd5c7badff3
85,035
cpp
C++
src/MeshData.cpp
yoshiya-usui/TetGen2Femtic
0faa9c2bd61e62cd89c2681d7c7899cd7b6267f6
[ "MIT" ]
1
2020-09-24T01:33:34.000Z
2020-09-24T01:33:34.000Z
src/MeshData.cpp
yoshiya-usui/TetGen2Femtic
0faa9c2bd61e62cd89c2681d7c7899cd7b6267f6
[ "MIT" ]
null
null
null
src/MeshData.cpp
yoshiya-usui/TetGen2Femtic
0faa9c2bd61e62cd89c2681d7c7899cd7b6267f6
[ "MIT" ]
null
null
null
//-------------------------------------------------------------------------- // MIT License // // Copyright (c) 2021 Yoshiya Usui // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal // in the Software without restriction, including without limitation the rights // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell // copies of the Software, and to permit persons to whom the Software is // furnished to do so, subject to the following conditions: // // The above copyright notice and this permission notice shall be included in all // copies or substantial portions of the Software. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. //-------------------------------------------------------------------------- #include <iostream> #include <algorithm> #include <iomanip> #include <math.h> #include "MeshData.h" #include <assert.h> const double MeshData::convkm2m = 1.0e3; const double MeshData::PI = 3.14159265359; const double MeshData::DEG2RAD = PI / 180.0; // Return the instance of the class MeshData* MeshData::getInstance() { static MeshData instance;// The only instance return &instance; } // Make mesh data for femtic void MeshData::makeMeshDataForFemtic( const std::string& rootName, const bool includeSediments, const bool rotateModel, const int numThread, const bool divAllElements ){ std::cout << "Total number of threas is " << numThread << std::endl; readNodeData( rootName, rotateModel); readElemData( rootName ); readNeighElements( rootName ); readFaceData( rootName ); #if 0 readBoundaryAttribute(); #endif m_doesUseBoundaryMaker = false; readResisitivity(); if( includeSediments ){ std::cout << "Sedimentary layer is included." << std::endl; includeSedimentaryLayers(); } if( rotateModel ){ std::cout << "Model is rotated at an angle of 90 degrees around the z axis." << std::endl; } if( m_doesUseBoundaryMaker ){ calcBoundaryFacesFromBoundaryMarker(); } else{ calcBoundaryFaces(); } #ifdef _ADDITIONAL_FIXED_AREA if( m_useAdditionalFixedRegion ){ // Write faces above the additional area in which resistivity values are fixed writeFacesAboveAdditionalFixedRegionToVTK(rootName); // Fix resistivity in the additional area in which resistivity values are fixed fixResistivityInAdditionalFixedRegion(); } #endif writeMeshData(); makeResistivityBlock(divAllElements); writeResisitivityData(); writeMeshDataToVTK( rootName ); } // Default constructer MeshData::MeshData(): m_doesUseBoundaryMaker(true), m_numNodes(0), m_nodeCoords(NULL), m_rotationAngle(0.0), m_elements(NULL), m_node2elem(NULL), m_faceTetGen(NULL), //m_faceFemtic(NULL), m_regionAttrAirLayer(0), m_elem2blk(NULL), m_numSphere(0), m_radius(NULL), m_maxBlockLength(NULL), m_oblatenessHorizontal(NULL), m_oblateness(NULL), m_numObsSite(0), m_obsSite(NULL), #ifdef _ADDITIONAL_FIXED_AREA m_numThreads(1), m_useAdditionalFixedRegion(false) #else m_numThreads(1) #endif { m_centerCoordSpheres.X = 0.0; m_centerCoordSpheres.Y = 0.0; m_centerCoordSpheres.Z = 0.0; } // Destructer MeshData::~MeshData() { if( m_nodeCoords != NULL ){ delete [] m_nodeCoords; m_nodeCoords = NULL; } if( m_elements != NULL ){ delete [] m_elements; m_elements = NULL; } if( m_node2elem != NULL ){ delete [] m_node2elem; m_node2elem = NULL; } if( m_faceTetGen != NULL ){ delete [] m_faceTetGen; m_faceTetGen = NULL; } if( m_elem2blk != NULL ){ delete [] m_elem2blk; m_elem2blk = NULL; } if( m_radius != NULL ){ delete [] m_radius; m_radius = NULL; } if( m_maxBlockLength != NULL ){ delete [] m_maxBlockLength; m_maxBlockLength = NULL; } if( m_oblatenessHorizontal != NULL ){ delete [] m_oblatenessHorizontal; m_oblatenessHorizontal = NULL; } if( m_oblateness != NULL ){ delete [] m_oblateness; m_oblateness = NULL; } if( m_obsSite != NULL ){ delete [] m_obsSite; m_obsSite = NULL; } } // Read node data void MeshData::readNodeData( const std::string& rootName, const bool rotateModel ){ std::string fileName = rootName; fileName += ".node"; std::ifstream ifs( fileName.c_str() ); if( !ifs.is_open() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Read node data from " << fileName.c_str() << std::endl; ifs >> m_numNodes; std::cout << "Total number of nodes : " << m_numNodes << std::endl; m_nodeCoords = new MeshData::XYZ[m_numNodes]; int ibuf(0); ifs >> ibuf; if( ibuf != 3 ){ std::cerr << "Dimension must be 3 !!" << std::endl; exit(1); } int iAttribute(0); ifs >> iAttribute; if( iAttribute != 0 ){ std::cerr << "Attributes of nodes are ignored in mesh of femtic." << std::endl; } int iBoundaryMarker(0); ifs >> iBoundaryMarker; if( iBoundaryMarker != 0 ){ std::cerr << "Boundary marker of nodes are ignored in mesh of femtic." << std::endl; } for( int iNode = 0; iNode < m_numNodes; ++iNode ){ int nodeID(0); ifs >> nodeID; if( iNode + 1 != nodeID ){ std::cerr << "Node ID must be sequence number from 1 !! nodeID = " << nodeID << std::endl; exit(1); } ifs >> m_nodeCoords[iNode].X >> m_nodeCoords[iNode].Y >> m_nodeCoords[iNode].Z; if( rotateModel ){ const double xOrg = m_nodeCoords[iNode].X; const double yOrg = m_nodeCoords[iNode].Y; m_nodeCoords[iNode].X = yOrg; m_nodeCoords[iNode].Y = -xOrg; } m_nodeCoords[iNode].X *= MeshData::convkm2m; m_nodeCoords[iNode].Y *= MeshData::convkm2m; m_nodeCoords[iNode].Z *= MeshData::convkm2m; if( iAttribute != 0 ){ ifs >> ibuf; } if( iBoundaryMarker != 0 ){ ifs >> ibuf; } } ifs.close(); } // Read element data void MeshData::readElemData( const std::string& rootName ){ std::string fileName = rootName; fileName += ".ele"; std::ifstream ifs( fileName.c_str() ); if( !ifs.is_open() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Read element data from " << fileName.c_str() << std::endl; ifs >> m_numElements; std::cout << "Total number of elements : " << m_numElements << std::endl; m_elements = new MeshData::Element[m_numElements]; int nodesPerTet(0); ifs >> nodesPerTet; if( nodesPerTet != 4 ){ std::cerr << "Nodes number of a tetrahedron must be 4 !!" << std::endl; exit(1); } int iAttribute(0); ifs >> iAttribute; if( iAttribute != 1 ){ std::cerr << "You must specify region attribute to elements." << std::endl; exit(1); } m_node2elem = new std::vector<int>[m_numNodes]; for( int iElem = 0; iElem < m_numElements; ++iElem ){ int elemID(0); ifs >> elemID; if( iElem + 1 != elemID ){ std::cerr << "Element ID must be sequence number from 1!!" << std::endl; exit(1); } for( int i = 0; i < 4; ++i ){ int nodeID(0); ifs >> nodeID; m_elements[iElem].nodeID[i] = nodeID; m_node2elem[nodeID-1].push_back( elemID ); } ifs >> m_elements[iElem].attribute; } ifs.close(); } // Read neighbor elements void MeshData::readNeighElements( const std::string& rootName ){ std::string fileName = rootName; fileName += ".neigh"; std::ifstream ifs( fileName.c_str() ); if( !ifs.is_open() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Read neighboors of elements from " << fileName.c_str() << std::endl; int nElem(0); ifs >> nElem; if( nElem != m_numElements ){ std::cerr << "Total element number written in .neigh file (" << nElem << " ) is different from the one written in .ele file ( " << m_numElements << " ) !!" << std::endl; exit(1); } if( m_elements == NULL ){ std::cerr << "m_elements is NULL !!" << std::endl; exit(1); } int nodesPerTet(0); ifs >> nodesPerTet; if( nodesPerTet != 4 ){ std::cerr << "Nodes number of a tetrahedron must be 4 !!" << std::endl; exit(1); } for( int iElem = 0; iElem < m_numElements; ++iElem ){ int elemID(0); ifs >> elemID; if( iElem + 1 != elemID ){ std::cerr << "Element ID must be sequence number from 1!!" << std::endl; exit(1); } for( int i = 0; i < 4; ++i ){ ifs >> m_elements[iElem].neigh[i]; } } ifs.close(); } // Read face data void MeshData::readFaceData( const std::string& rootName ){ std::string fileName = rootName; fileName += ".face"; std::ifstream ifs( fileName.c_str() ); if( !ifs.is_open() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Read face data from " << fileName.c_str() << std::endl; ifs >> m_numFaces; std::cout << "Total number of faces : " << m_numFaces << std::endl; m_faceTetGen = new MeshData::FaceTetGen[m_numFaces]; int iBoundaryMarker(0); ifs >> iBoundaryMarker; if( iBoundaryMarker != 1 ){ std::cerr << "Boundary marker of face must be one." << std::endl; exit(1); } for( int iFace = 0; iFace < m_numFaces; ++iFace ){ int faceID(0); ifs >> faceID; for( int i = 0; i < 3; ++i ){ ifs >> m_faceTetGen[iFace].nodeID[i]; } ifs >> m_faceTetGen[iFace].attribute; } ifs.close(); } // Read releationship between boundary of the model and attributes of faces void MeshData::readBoundaryAttribute(){ std::ifstream ifs( "bound_attr.dat" ); if( !ifs.is_open() ){ std::cerr << "Cannot open file bound_attr.dat !!" << std::endl; exit(1); } std::cout << "Read relationship between boundary and face from bound_attr.dat" << std::endl; int nBound(0); ifs >> nBound; if( nBound < 0 ){ m_doesUseBoundaryMaker= false; std::cout << "Calculate boundary faces without boundary maker because the number of boundary is negative in bound_attr.dat" << std::endl; return; } m_doesUseBoundaryMaker= true; if( nBound != NUM_BOUNDARY ){ std::cerr << "Number of boundary must be " << NUM_BOUNDARY << " !!" <<std::endl; exit(1); } for( int iBoun = 0; iBoun < NUM_BOUNDARY; ++iBoun ){ int numAttr(0); ifs >> numAttr; for( int iAttr = 0; iAttr < numAttr; ++iAttr ){ int attr(0); ifs >> attr; m_boundaryFaces[iBoun].attributes.push_back( attr ); } } ifs.close(); } // Read releationship between resistivity values and region attributes void MeshData::readResisitivity(){ std::ifstream ifs( "resistivity_attr.dat" ); if( !ifs.is_open() ){ std::cerr << "Cannot open file resistivity_attr.dat !!" << std::endl; exit(1); } std::cout << "Read relationship between resisitivity and region from resistivity_attr.dat." << std::endl; int numResistivity(0); ifs >> numResistivity; std::cout << "Number of different resisitivities : " << numResistivity << std::endl; if( numResistivity < 1 ){ std::cerr << "Number of different resisitivities must be greater than or equal to one !!" << std::endl; exit(1); } m_resistivityData.reserve(numResistivity); double resistivityAir(0.0); for( int iRes = 0; iRes < numResistivity; ++iRes ){ int attr(0); double resisitivity(0.0); ifs >> attr; m_regionAttr2ResistivityID.insert( std::make_pair( attr, iRes ) ); ResistivityData resistivityDataBuf; resistivityDataBuf.attr = attr; int ibuf; ifs >> resistivityDataBuf.resistivity >> resistivityDataBuf.ndiv >> ibuf; if( iRes == 0 ){ if( resistivityDataBuf.ndiv >= 0 ){ std::cerr << "Number of division must be negative for the first resistivity data ( the air layer ) !!" << std::endl; exit(1); } m_regionAttrAirLayer = resistivityDataBuf.attr; resistivityAir = resistivityDataBuf.resistivity; } resistivityDataBuf.fix = ( ibuf > 0 ? true : false ); if( resistivityDataBuf.ndiv < 0 ){ std::cout << "Resistivity data " << iRes << " is the air or the sea because its division number is negative." << std::endl; m_regionAttrAirOrSea.insert( resistivityDataBuf.attr ); } m_resistivityData.push_back(resistivityDataBuf); } std::cout << "First resistivity data must be the air layer." << std::endl; std::cout << "Therefore, the resisitivity of the air is set to be " << resistivityAir << " [Ohm-m]" << std::endl; //******************************************************************************* //***** Read data of spheres specifing maximum length of resistivity blocks ***** //******************************************************************************* ifs >> m_centerCoordSpheres.X >> m_centerCoordSpheres.Y >> m_centerCoordSpheres.Z; m_centerCoordSpheres.X *= MeshData::convkm2m; m_centerCoordSpheres.Y *= MeshData::convkm2m; m_centerCoordSpheres.Z *= MeshData::convkm2m; std::cout << "Center coorinate of the spheres [m] : (X,Y,Z) = (" << m_centerCoordSpheres.X << ", " << m_centerCoordSpheres.Y << ", " << m_centerCoordSpheres.Z << ")" << std::endl; ifs >> m_rotationAngle; std::cout << "Rotation angle of horizontal ellipsoid [deg] : " << m_rotationAngle << std::endl; m_rotationAngle *= DEG2RAD; ifs >> m_numSphere; std::cout << "Total number of spheres : " << m_numSphere << std::endl; if( m_numSphere > 0 ){ m_radius = new double[m_numSphere]; m_maxBlockLength = new double[m_numSphere]; m_oblatenessHorizontal = new double[m_numSphere]; m_oblateness = new double[m_numSphere]; std::cout << "<Radius[m]> <Edge Length[m]> <OblatenessHorizontal> <Oblateness>" << std::endl; } for( int i = 0; i < m_numSphere; ++i ){ ifs >> m_radius[i] >> m_maxBlockLength[i] >> m_oblatenessHorizontal[i] >> m_oblateness[i]; m_radius[i] *= MeshData::convkm2m; m_maxBlockLength[i] *= MeshData::convkm2m; std::cout << std::setw(15) << std::scientific << m_radius[i]; std::cout << std::setw(15) << std::scientific << m_maxBlockLength[i]; std::cout << std::setw(15) << std::scientific << m_oblatenessHorizontal[i]; std::cout << std::setw(15) << std::scientific << m_oblateness[i] << std::endl; } for( int i = 1; i < m_numSphere; ++i ){ if( m_radius[i] < m_radius[i-1] ){ std::cerr << "Radius of the region " << i << " is smaller than that of the previous region." << std::endl; exit(1); } if( m_maxBlockLength[i] < m_maxBlockLength[i-1] ){ std::cerr << "Edge length of the region " << i << " is smaller than that of the previous region." << std::endl; exit(1); } if( m_oblatenessHorizontal[i] < 0 || m_oblatenessHorizontal[i] > 1 ){ std::cerr << "Oblateness of horizontal ellipsoid must be smaller than 1 and larger than 0." << std::endl; exit(1); } if( m_oblateness[i] < 0 || m_oblateness[i] > 1 ){ std::cerr << "Oblateness must be smaller than 1 and larger than 0." << std::endl; exit(1); } if( m_radius[i]*(1.0-m_oblatenessHorizontal[i]) < m_radius[i-1]*(1.0-m_oblatenessHorizontal[i-1] ) ){ std::cerr << "Length of shorter axis of horizontal ellipsoid " << i << " is less than that of the previous ellipsoid." << std::endl; exit(1); } if( m_radius[i]*(1.0-m_oblateness[i]) < m_radius[i-1]*(1.0-m_oblateness[i-1] ) ){ std::cerr << "Depth of sphere " << i << " is shallower than that of the previous sphere in the earth." << std::endl; exit(1); } } //****************************************************************** //***** Read data of maximum length near the observation sites ***** //****************************************************************** ifs >> m_numObsSite; std::cout << "Total number of observed site : " << m_numObsSite << std::endl; m_obsSite = new ObservedSite[m_numObsSite]; for( int iObs = 0; iObs < m_numObsSite; ++iObs ){ ifs >> m_obsSite[iObs].X >> m_obsSite[iObs].Y >> m_obsSite[iObs].Z; m_obsSite[iObs].X *= MeshData::convkm2m; m_obsSite[iObs].Y *= MeshData::convkm2m; m_obsSite[iObs].Z *= MeshData::convkm2m; std::cout << "Locations of site [m] :" << std::endl; std::cout << std::setw(15) << std::scientific << m_obsSite[iObs].X << std::setw(15) << std::scientific << m_obsSite[iObs].Y << std::setw(15) << std::scientific << m_obsSite[iObs].Z << std::endl; ifs >> m_obsSite[iObs].numCircle; m_obsSite[iObs].radius.reserve(m_obsSite[iObs].numCircle); m_obsSite[iObs].length.reserve(m_obsSite[iObs].numCircle); std::cout << std::setw(15) << m_obsSite[iObs].numCircle << std::endl; for( int i = 0; i < m_obsSite[iObs].numCircle; ++i ){ double radius(-1.0); double length(-1.0); ifs >> radius; ifs >> length; radius *= MeshData::convkm2m; length *= MeshData::convkm2m; if( i > 0 && radius < m_obsSite[iObs].radius.back() ){ std::cerr << " Error : Radius must be specified in ascending order !! : " << radius << std::endl; exit(1); } if( i > 0 && length < m_obsSite[iObs].length.back() ){ std::cerr << " Error : Edge length must increase with radius !! : " << length << std::endl; exit(1); } m_obsSite[iObs].radius.push_back( radius ); m_obsSite[iObs].length.push_back( length ); std::cout << std::setw(15) << std::scientific << m_obsSite[iObs].radius[i] << std::setw(15) << std::scientific << m_obsSite[iObs].length[i] << std::endl; } } #ifdef _ADDITIONAL_FIXED_AREA //*************************************************************************** //***** Read data for the region where the resisitivity values are fixed ***** //*************************************************************************** int ibuf(0); ifs >> ibuf; if( ibuf != 0 ){ m_useAdditionalFixedRegion = true; ifs >> m_paramForAdditionalFixedRegion.centerCoord.X; ifs >> m_paramForAdditionalFixedRegion.centerCoord.Y; ifs >> m_paramForAdditionalFixedRegion.centerCoord.Z; ifs >> m_paramForAdditionalFixedRegion.xLength; ifs >> m_paramForAdditionalFixedRegion.yLength; ifs >> m_paramForAdditionalFixedRegion.zLength; ifs >> m_paramForAdditionalFixedRegion.rotationAngle; ifs >> m_paramForAdditionalFixedRegion.minDepthOfEarthSurface; ifs >> m_paramForAdditionalFixedRegion.maxDepthOfEarthSurface; ifs >> m_paramForAdditionalFixedRegion.resistivity; m_paramForAdditionalFixedRegion.centerCoord.X *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.centerCoord.Y *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.centerCoord.Z *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.xLength *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.yLength *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.zLength *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.minDepthOfEarthSurface *= MeshData::convkm2m; m_paramForAdditionalFixedRegion.maxDepthOfEarthSurface *= MeshData::convkm2m; std::cout << "Center coorinate of additional fixed region [m] : (X,Y,Z) = (" << m_paramForAdditionalFixedRegion.centerCoord.X << ", " << m_paramForAdditionalFixedRegion.centerCoord.Y << ", " << m_paramForAdditionalFixedRegion.centerCoord.Z << ")" << std::endl; std::cout << "Length along x direction [m] : " << m_paramForAdditionalFixedRegion.xLength << std::endl; std::cout << "Length along y direction [m] : " << m_paramForAdditionalFixedRegion.yLength << std::endl; std::cout << "Length along z direction [m] : " << m_paramForAdditionalFixedRegion.zLength << std::endl; std::cout << "Rotation angle [deg.] : " << m_paramForAdditionalFixedRegion.rotationAngle << std::endl; std::cout << "Minimum depth of the earth's surface [m] : " << m_paramForAdditionalFixedRegion.minDepthOfEarthSurface << std::endl; std::cout << "Maximum depth of the earth's surface [m] : " << m_paramForAdditionalFixedRegion.maxDepthOfEarthSurface << std::endl; std::cout << "Resistivity [Ohm-m] : " << m_paramForAdditionalFixedRegion.resistivity << std::endl; m_paramForAdditionalFixedRegion.rotationAngle *= DEG2RAD; int attrMax = 0; for( std::vector<ResistivityData>::const_iterator itr = m_resistivityData.begin(); itr != m_resistivityData.end(); ++itr ){ attrMax = std::max( itr->attr, attrMax ); } m_paramForAdditionalFixedRegion.attribute = attrMax + 1; std::cout << "Attribute of additional fixed region : " << m_paramForAdditionalFixedRegion.attribute << std::endl; ResistivityData resistivityDataBuf; resistivityDataBuf.attr = m_paramForAdditionalFixedRegion.attribute; resistivityDataBuf.fix = true; resistivityDataBuf.ndiv = -1; resistivityDataBuf.resistivity = m_paramForAdditionalFixedRegion.resistivity; m_resistivityData.push_back(resistivityDataBuf); m_regionAttr2ResistivityID.insert( std::make_pair( m_paramForAdditionalFixedRegion.attribute, numResistivity ) ); } #endif ifs.close(); } // Include sedimentary layers void MeshData::includeSedimentaryLayers(){ const std::string fileName = "sediment_layer.dat"; //// Center coordinate of the area including predifined sediments //XYZ centerCoordSedimentArea = { 0.0, 0.0, 0.0 }; //// Radius of the area including predifined sediments //double radiusSedimentArea(0.0); //// Depth of sedimentary layer //double depthSedimentLayer(0.0); //// Attribute of sediment //int attrSedimentLayer(-1); //// Resistivity of sediment //double resistivitySedimentLayer(0.0); SedimentParameter sedimentParam; // Number of the region attribute pair for specifing the area including predifined sediments std::vector< std::pair<int,int> > attrPair; readParametersOfSedimentArea( fileName, sedimentParam, attrPair ); std::vector<int> sedimentFaceSerials; findTrianglesAboveSediment( attrPair, sedimentParam.center, sedimentParam.radius, sedimentParam.oblateness, sedimentParam.rotation, sedimentFaceSerials ); std::vector<int> elemSerials; findElementsInSediment( sedimentFaceSerials, sedimentParam.center, sedimentParam.radius, sedimentParam.depth, sedimentParam.oblateness, sedimentParam.rotation, elemSerials ); changeAttributeOfSediment( elemSerials, sedimentParam.attr, sedimentParam.resistivity ); } // Read parameter file void MeshData::readParametersOfSedimentArea( const std::string& fileName, SedimentParameter& param, std::vector< std::pair<int,int> >& attrPair ) const{ std::ifstream ifs( fileName.c_str() ); if( ifs.fail() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Read parameters from " << fileName.c_str() << std::endl; ifs >> param.center.X; ifs >> param.center.Y; std::cout << "Center coordinate of the area including predifined sediments [km] : (X,Y) = ( " << param.center.X << ", " << param.center.Y << " )" << std::endl; param.center.X *= MeshData::convkm2m; param.center.Y *= MeshData::convkm2m; ifs >> param.radius; std::cout << "Radius of the area including predifined sediments [km] : " << param.radius << std::endl; param.radius *= MeshData::convkm2m; ifs >> param.depth; std::cout << "Depth of the sedimentary layer [km] : " << param.depth << std::endl; param.depth *= MeshData::convkm2m; ifs >> param.oblateness; std::cout << "Oblateness of the area including predifined sediments : " << param.oblateness << std::endl; ifs >> param.rotation; std::cout << "Rotation angle of the area including predifined sediments [deg.] : " << param.rotation << std::endl; param.rotation *= DEG2RAD; ifs >> param.attr; std::cout << "Region attribute of the sedimentary layer : " << param.attr << std::endl; ifs >> param.resistivity; std::cout << "Resistivity of the sedimentary layer [Ohm-m] : " << param.resistivity << std::endl; int numPair(0); ifs >> numPair; std::cout << "Number of the region attribute pair for specifing the area including predifined sediments : " << numPair << std::endl; for( int i = 0; i < numPair; ++i ){ std::pair<int,int> pair; ifs >> pair.first >> pair.second; attrPair.push_back(pair); } std::cout << "Region attribute pair for specifing the area including predifined sediments : " << std::endl; for( std::vector< std::pair<int,int> >::iterator itr = attrPair.begin(); itr != attrPair.end(); ++itr ){ std::cout << itr->first << " " << itr->second << std::endl; } ifs.close(); } // Find triangles above the sediment void MeshData::findTrianglesAboveSediment( const std::vector< std::pair<int,int> >& attrPair, const XY& centerCoord, const double radius, const double oblateness, const double rotation, std::vector<int>& sedimentFaceSerials ) const{ for( int iFace = 0; iFace < m_numFaces; ++iFace ){ int elemID(0); int faceID(0); calcElementFace( iFace, elemID, faceID ); const int elemIDFromZero = elemID - 1; const int elemIDNeighFromZero = m_elements[elemIDFromZero].neigh[faceID] - 1; const int regionAttr = m_elements[elemIDFromZero].attribute; const int regionAttrNeib = m_elements[elemIDNeighFromZero].attribute; if( elemIDNeighFromZero >= 0 && std::find( attrPair.begin(), attrPair.end(), std::make_pair(regionAttr,regionAttrNeib) ) != attrPair.end() || elemIDNeighFromZero >= 0 && std::find( attrPair.begin(), attrPair.end(), std::make_pair(regionAttrNeib,regionAttr) ) != attrPair.end() ){// Sediment if( locateInEllipse( centerCoord, radius, oblateness, rotation, calcGravityCenterOfTetGenFace(iFace) ) ){ sedimentFaceSerials.push_back(iFace); } } } } // Decide the specified point locates in the ellipse bool MeshData::locateInEllipse( const XY& centerCoord, const double radius, const double oblateness, const double rotation, const XY& coord ) const{ const double vecXOrg = coord.X - centerCoord.X; const double vecYOrg = coord.Y - centerCoord.Y; const double vecX = vecXOrg * cos( - rotation ) - vecYOrg * sin( - rotation ); const double vecY = vecXOrg * sin( - rotation ) + vecYOrg * cos( - rotation ); const double longAxisLength = radius; const double shortAxisLength = longAxisLength * ( 1.0 - oblateness ); double val = pow( vecX / longAxisLength, 2 ) + pow( vecY / shortAxisLength, 2 ); if( val <= 1.0 ){ return true; } return false; } // Decide the specified point locates in the ellipse bool MeshData::locateInEllipse( const XY& centerCoord, const double radius, const double oblateness, const double rotation, const XYZ& coord ) const{ const MeshData::XY coord2D = {coord.X, coord.Y}; return locateInEllipse( centerCoord, radius, oblateness, rotation, coord2D ); } // Find elements corresponding to sediment void MeshData::findElementsInSediment( const std::vector<int>& sedimentFaceSerials, const XY& centerCoord, const double radius, const double depth, const double oblateness, const double rotation, std::vector<int>& elemSerials ) const{ for( int iElem = 0; iElem < m_numElements; ++iElem ){ const MeshData::XYZ coord = calcGravityCenter(iElem); if( !locateInEllipse( centerCoord, radius, oblateness, rotation, coord ) ){// Out of the ellipse continue; } for( std::vector<int>::const_iterator itr = sedimentFaceSerials.begin(); itr != sedimentFaceSerials.end(); ++itr ){ double coordZOnFace(-1.0); if( calcZCoordOnTetGenFace(coord, *itr, coordZOnFace) ){ if( coord.Z - coordZOnFace > 0.0 && coord.Z - coordZOnFace < depth ){ elemSerials.push_back(iElem); } continue; } } } } // Change attributes of the elements corresponding to sediment layer void MeshData::changeAttributeOfSediment( const std::vector<int>& elemSerials, const int attrSediment, const double resistivitySediment ){ for( std::vector<int>::const_iterator itr = elemSerials.begin(); itr != elemSerials.end(); ++itr ){ m_elements[*itr].attribute = attrSediment; } ResistivityData resistivityDataBuf; resistivityDataBuf.attr = attrSediment; resistivityDataBuf.fix = 1; resistivityDataBuf.ndiv = 0; resistivityDataBuf.resistivity = resistivitySediment; m_resistivityData.push_back(resistivityDataBuf); m_regionAttr2ResistivityID.insert( std::make_pair( attrSediment, static_cast<int>(m_resistivityData.size()) - 1 ) ); } // Calculate gravity center of the specified face of Tetgen MeshData::XY MeshData::calcGravityCenterOfTetGenFace( const int iFace ) const{ if( iFace < 0 || iFace >= m_numFaces ){ std::cerr << "iFace ( " << iFace << " ) is wrong !!" << std::endl; exit(1); } MeshData::XY coord = { 0.0, 0.0 }; for( int i= 0; i < 3; ++i ){ const int iNode = m_faceTetGen[iFace].nodeID[i] - 1; coord.X += m_nodeCoords[iNode].X; coord.Y += m_nodeCoords[iNode].Y; } coord.X /= 3.0; coord.Y /= 3.0; return coord; } // Calculate Z coordinate of the point below the specified face of Tetgen //double MeshData::calcZCoordOnTetGenFace( const XYZ& point, const int iFace ) const{ // // assert( iFace < 0 || iFace >= m_numFaces ); // // const XYZ nodeCoords[3] = { // m_nodeCoords[ m_faceTetGen[iFace].nodeID[0] - 1 ], // m_nodeCoords[ m_faceTetGen[iFace].nodeID[1] - 1 ], // m_nodeCoords[ m_faceTetGen[iFace].nodeID[2] - 1 ] // }; // // const double areaTotal = calcAreaOnXYPlane( nodeCoords[0], nodeCoords[1], nodeCoords[2] ); // // const double areaCoords[3] = { // calcAreaOnXYPlane( point, nodeCoords[1], nodeCoords[2] ) / areaTotal, // calcAreaOnXYPlane( nodeCoords[0], point, nodeCoords[2] ) / areaTotal, // calcAreaOnXYPlane( nodeCoords[0], nodeCoords[1], point ) / areaTotal // }; // // const double EPS = 1.0e-12; // assert( areaCoords[0] < -EPS || areaCoords[0] < -EPS || areaCoords[0] < -EPS ); // // double val(0.0); // for( int i = 0; i < 3; ++i ){ // val += nodeCoords[i].Z * areaCoords[i]; // } // return val; // //} bool MeshData::calcZCoordOnTetGenFace( const XYZ& point, const int iFace, double& zCoord ) const{ assert( iFace >= 0 || iFace < m_numFaces ); const XYZ nodeCoords[3] = { m_nodeCoords[ m_faceTetGen[iFace].nodeID[0] - 1 ], m_nodeCoords[ m_faceTetGen[iFace].nodeID[1] - 1 ], m_nodeCoords[ m_faceTetGen[iFace].nodeID[2] - 1 ] }; const double areaTotal = calcAreaOnXYPlane( nodeCoords[0], nodeCoords[1], nodeCoords[2] ); const double areaCoords[3] = { calcAreaOnXYPlane( point, nodeCoords[1], nodeCoords[2] ) / areaTotal, calcAreaOnXYPlane( nodeCoords[0], point, nodeCoords[2] ) / areaTotal, calcAreaOnXYPlane( nodeCoords[0], nodeCoords[1], point ) / areaTotal }; const double EPS = 1.0e-12; if( fabs( 1.0 - areaCoords[0] - areaCoords[1] - areaCoords[2] ) > EPS ){// Out ot triangle return false; } zCoord = 0.0; for( int i = 0; i < 3; ++i ){ zCoord += nodeCoords[i].Z * areaCoords[i]; } return true; } // Calculate area of triangle on the XY plnae double MeshData::calcAreaOnXYPlane( const MeshData::XYZ& point1, const MeshData::XYZ& point2, const MeshData::XYZ& point3 ) const{ return 0.5 * fabs( ( point2.X - point1.X ) * ( point3.Y - point1.Y ) - ( point2.Y - point1.Y ) * ( point3.X - point1.X ) ); } //// Determine if the inputed point locate in the specified face of Tetgen //bool MeshData::locateInTriangleOfXYPlane( const XYZ& point, const int iFace ) const{ // // assert( iFace < 0 || iFace >= m_numFaces ); // // const XYZ nodeCoords[3] = { // m_nodeCoords[ m_faceTetGen[iFace].nodeID[0] - 1 ], // m_nodeCoords[ m_faceTetGen[iFace].nodeID[1] - 1 ], // m_nodeCoords[ m_faceTetGen[iFace].nodeID[2] - 1 ] // }; // // if( locateLeftOfSegmentOnXYPlane( point, nodeCoords[0], nodeCoords[1] ) && // locateLeftOfSegmentOnXYPlane( point, nodeCoords[1], nodeCoords[2] ) && // locateLeftOfSegmentOnXYPlane( point, nodeCoords[2], nodeCoords[0] ) ){ // return true; // } // // return false; //} // //// Determine if the inputed point locate at the left of the segment on the X-Y plane //bool MeshData::locateLeftOfSegmentOnXYPlane( const XYZ& point, const XYZ& startPointOfSegment, const XYZ& endPointOfSegment ) const{ // // if( ( endPointOfSegment.Y - startPointOfSegment.Y )*( point.X - startPointOfSegment.X ) >= ( endPointOfSegment.X - startPointOfSegment.X )*( point.Y - startPointOfSegment.Y ) ){ // return true; // } // // return false; //} // Calculate intersection point of a specified line and an X-Y plane void MeshData::calcIntersectionPoint( const XYZ& startCoord, const XYZ& endCoord, const double zCoordOfPlane, XYZ& intersectionPoint ) const{ assert( ( zCoordOfPlane >= startCoord.Z && zCoordOfPlane <= endCoord.Z ) || ( zCoordOfPlane >= endCoord.Z && zCoordOfPlane <= startCoord.Z ) ); const double factor = ( zCoordOfPlane - startCoord.Z ) / ( endCoord.Z - startCoord.Z ); //if( factor > 0.0 ){ // intersectionPoint.X = startCoord.X + factor * ( endCoord.X - startCoord.X ); // intersectionPoint.Y = startCoord.Y + factor * ( endCoord.Y - startCoord.Y ); // intersectionPoint.Z = startCoord.Z + factor * ( endCoord.Z - startCoord.Z ); //} //else{ // intersectionPoint.X = endCoord.X + factor * ( endCoord.X - startCoord.X ); // intersectionPoint.Y = endCoord.Y + factor * ( endCoord.Y - startCoord.Y ); // intersectionPoint.Z = endCoord.Z + factor * ( endCoord.Z - startCoord.Z ); //} intersectionPoint.X = startCoord.X + factor * ( endCoord.X - startCoord.X ); intersectionPoint.Y = startCoord.Y + factor * ( endCoord.Y - startCoord.Y ); intersectionPoint.Z = startCoord.Z + factor * ( endCoord.Z - startCoord.Z ); } // Calculate volume of an element double MeshData::calculateVolumeOfElement( const int iElem ) const{ return calculateVolumeOfTetrahedron( m_nodeCoords[m_elements[iElem].nodeID[0]-1], m_nodeCoords[m_elements[iElem].nodeID[1]-1], m_nodeCoords[m_elements[iElem].nodeID[2]-1], m_nodeCoords[m_elements[iElem].nodeID[3]-1] ); } // Calculate volume of tetrahedron double MeshData::calculateVolumeOfTetrahedron( const XYZ& point1, const XYZ& point2, const XYZ& point3, const XYZ& point4 ) const{ const double val = ( point2.X*point3.Y* point4.Z + point2.Y*point3.Z*point4.X + point2.Z*point3.X*point4.Y - point2.Z*point3.Y*point4.X - point2.X*point3.Z*point4.Y - point2.Y*point3.X*point4.Z ) - ( point1.X*point3.Y* point4.Z + point1.Y*point3.Z*point4.X + point1.Z*point3.X*point4.Y - point1.Z*point3.Y*point4.X - point1.X*point3.Z*point4.Y - point1.Y*point3.X*point4.Z ) + ( point1.X*point2.Y* point4.Z + point1.Y*point2.Z*point4.X + point1.Z*point2.X*point4.Y - point1.Z*point2.Y*point4.X - point1.X*point2.Z*point4.Y - point1.Y*point2.X*point4.Z ) - ( point1.X*point2.Y* point3.Z + point1.Y*point2.Z*point3.X + point1.Z*point2.X*point3.Y - point1.Z*point2.Y*point3.X - point1.X*point2.Z*point3.Y - point1.Y*point2.X*point3.Z ); return fabs(val / 6.0); } //// Calculate boundary faces //void MeshData::calcBoundaryFaces(){ // // for( int iFace = 0; iFace < m_numFaces; ++iFace ){ // // bool doesBoundary(false); // const int boundType = calcBoundTypeFromAttribute( m_faceFemtic[iFace].attribute, doesBoundary ); // // if( doesBoundary ){ // m_boundaryFaces[boundType].elemIDs.push_back( m_faceFemtic[iFace].elemID ); // m_boundaryFaces[boundType].faceIDs.push_back( m_faceFemtic[iFace].faceID ); // } // // } // //} // Calculate boundary faces from boundary marker void MeshData::calcBoundaryFacesFromBoundaryMarker(){ for( int iFace = 0; iFace < m_numFaces; ++iFace ){ bool doesBoundary(false); const int boundType = calcBoundTypeFromAttribute( m_faceTetGen[iFace].attribute, doesBoundary ); if( doesBoundary ){ int elemID(0); int faceID(0); calcElementFace( boundType, iFace, elemID, faceID ); m_boundaryFaces[boundType].elemIDs.push_back( elemID ); m_boundaryFaces[boundType].faceIDs.push_back( faceID ); } } } // Calculate boundary faces void MeshData::calcBoundaryFaces(){ for( int iFace = 0; iFace < m_numFaces; ++iFace ){ int elemID(0); int faceID(0); calcElementFace( iFace, elemID, faceID ); const int elemIDFromZero = elemID - 1; const int elemIDNeighFromZero = m_elements[elemIDFromZero].neigh[faceID] - 1; if( elemIDNeighFromZero >= 0 ){ if( m_regionAttrAirOrSea.find( m_elements[elemIDFromZero].attribute ) == m_regionAttrAirOrSea.end() && m_regionAttrAirOrSea.find( m_elements[elemIDNeighFromZero].attribute ) != m_regionAttrAirOrSea.end() ){// Earth surface m_boundaryFaces[EARTH_SURFACE].elemIDs.push_back( elemID ); m_boundaryFaces[EARTH_SURFACE].faceIDs.push_back( faceID ); #ifdef _ADDITIONAL_FIXED_AREA addIfFaceIndexAboveAdditionalFixedRegion(iFace); #endif } else if( m_regionAttrAirOrSea.find( m_elements[elemIDFromZero].attribute ) != m_regionAttrAirOrSea.end() && m_regionAttrAirOrSea.find( m_elements[elemIDNeighFromZero].attribute ) == m_regionAttrAirOrSea.end() ){// Earth surface int faceIDNeigh = -1; for( int i = 0; i < 4; ++i ){ if( m_elements[elemIDNeighFromZero].neigh[i] == elemID ){ faceIDNeigh = i; break; } } if( faceIDNeigh < 0 ){ std::cerr << "Face ID of neighboor element cannot be found." << std::endl; exit(1); } m_boundaryFaces[EARTH_SURFACE].elemIDs.push_back( elemIDNeighFromZero + 1 ); m_boundaryFaces[EARTH_SURFACE].faceIDs.push_back( faceIDNeigh ); #ifdef _ADDITIONAL_FIXED_AREA addIfFaceIndexAboveAdditionalFixedRegion(iFace); #endif } //else{ // std::cerr << "Face " << faceID << " of element " << elemID << " is not a boundary face." << std::endl; // exit(1); //} continue; } const int boundaryType = calcBoundTypeFromCoordinate( iFace ); m_boundaryFaces[boundaryType].elemIDs.push_back( elemID ); m_boundaryFaces[boundaryType].faceIDs.push_back( faceID ); } //for( int iElem = 0; iElem < m_numElements; ++iElem ){ // for( int i = 0; i < 4; ++i ){ // const int elemIDNeighFromZero = m_elements[iElem].neigh[i] - 1; // if( < 0 ; // } // //} } //// Change face data from TetGen to Femtic //void MeshData::changeFaceData(){ // // m_faceFemtic = new FaceFemtic[m_numFaces]; // // for( int iFace = 0; iFace < m_numFaces; ++iFace ){ // // int elemID(0); // int faceID(0); // calcElementFace( iFace, elemID, faceID ); // // m_faceFemtic[iFace].elemID = elemID; // m_faceFemtic[iFace].faceID = faceID; // m_faceFemtic[iFace].attribute = m_faceTetGen[iFace].attribute; // // } // // if( m_faceTetGen != NULL ){ // delete [] m_faceTetGen; // m_faceTetGen = NULL; // } // //} //// Calculate element ID and face ID for Femtic //void MeshData::calcElementFace( const int iFace, int& elemID, int& faceID ) const{ // // if( iFace < 0 || iFace >= m_numFaces ){ // std::cerr << "iFace ( " << iFace << " ) is wrong !!" << std::endl; // exit(1); // } // // const int nodeIDs[3] = { // m_faceTetGen[iFace].nodeID[0], // m_faceTetGen[iFace].nodeID[1], // m_faceTetGen[iFace].nodeID[2] // }; // //#ifdef _DEBUG_WRITE // std::cout << "iFace : " << iFace << std::endl; // std::cout << "nodeIDs : " << nodeIDs[0] << " " << nodeIDs[1] << " " << nodeIDs[2] << std::endl; //#endif // // for( std::vector<int>::const_iterator itr = m_node2elem[ nodeIDs[0] - 1 ].begin(); // itr != m_node2elem[ nodeIDs[0] - 1 ].end(); // ++itr ){ // // elemID = *itr; // //#ifdef _DEBUG_WRITE // std::cout << "elemID : " << elemID << std::endl; //#endif // // std::vector<int> localNodeID; // int icount(0); // for( int iFaceNode = 0; iFaceNode < 3; ++iFaceNode ){ // //#ifdef _DEBUG_WRITE // std::cout << "iFaceNode : " << iFaceNode << std::endl; // std::cout << "nodeIDs[iFaceNode] : " << nodeIDs[iFaceNode] << std::endl; //#endif // bool found(false); // for( int iNode = 0; iNode < 4; ++iNode ){ // //#ifdef _DEBUG_WRITE // //std::cout << "m_elements[elemID-1].attribute : " << m_elements[elemID-1].attribute << std::endl; // //std::cout << "m_elements[elemID-1].neigh[iNode] : " << m_elements[elemID-1].neigh[iNode] << std::endl; // std::cout << "iNode : " << iNode << std::endl; // std::cout << "m_elements[elemID-1].nodeID[iNode] : " << m_elements[elemID-1].nodeID[iNode] << std::endl; //#endif // if( m_elements[elemID-1].nodeID[iNode] == nodeIDs[iFaceNode] ){ // localNodeID.push_back( iNode ); // found = true; // ++icount; // break; // } // // } // if( icount >= 3 ){ // faceID = calcFaceIDOfFemtic( localNodeID ); // return; // } // if( !found ){ // break; // } // } // // } // // std::cerr << "Element face having node "; // std::cerr << nodeIDs[0] << " " << nodeIDs[1] << " " << nodeIDs[2] << " "; // std::cerr << "cannot be found !!" << std::endl; // exit(1); // //} // Calculate element ID and face ID for Femtic void MeshData::calcElementFace( const int boundaryType, const int iFace, int& elemID, int& faceID ) const{ if( iFace < 0 || iFace >= m_numFaces ){ std::cerr << "iFace ( " << iFace << " ) is wrong !!" << std::endl; exit(1); } const int nodeIDs[3] = { m_faceTetGen[iFace].nodeID[0], m_faceTetGen[iFace].nodeID[1], m_faceTetGen[iFace].nodeID[2] }; //#ifdef _DEBUG_WRITE // std::cout << "iFace : " << iFace << std::endl; // std::cout << "nodeIDs : " << nodeIDs[0] << " " << nodeIDs[1] << " " << nodeIDs[2] << std::endl; //#endif for( std::vector<int>::const_iterator itr = m_node2elem[ nodeIDs[0] - 1 ].begin(); itr != m_node2elem[ nodeIDs[0] - 1 ].end(); ++itr ){ elemID = *itr; //#ifdef _DEBUG_WRITE // std::cout << "elemID : " << elemID << std::endl; //#endif if( boundaryType == MeshData::EARTH_SURFACE ){ //#ifdef _DEBUG_WRITE // std::cout << "m_elements[elemID-1].attribute : " << m_elements[elemID-1].attribute << std::endl; // std::cout << "m_regionAttrAirLayer : " << m_regionAttrAirLayer << std::endl; //#endif //if( m_elements[elemID-1].attribute == m_regionAttrAirLayer ){ if( m_regionAttrAirOrSea.find( m_elements[elemID-1].attribute ) != m_regionAttrAirOrSea.end() ){// The air or the sea continue; } } std::vector<int> localNodeID; int icount(0); for( int iFaceNode = 0; iFaceNode < 3; ++iFaceNode ){ //#ifdef _DEBUG_WRITE // std::cout << "iFaceNode : " << iFaceNode << std::endl; // std::cout << "nodeIDs[iFaceNode] : " << nodeIDs[iFaceNode] << std::endl; //#endif bool found(false); for( int iNode = 0; iNode < 4; ++iNode ){ //#ifdef _DEBUG_WRITE // //std::cout << "m_elements[elemID-1].attribute : " << m_elements[elemID-1].attribute << std::endl; // //std::cout << "m_elements[elemID-1].neigh[iNode] : " << m_elements[elemID-1].neigh[iNode] << std::endl; // std::cout << "iNode : " << iNode << std::endl; // std::cout << "m_elements[elemID-1].nodeID[iNode] : " << m_elements[elemID-1].nodeID[iNode] << std::endl; //#endif if( m_elements[elemID-1].nodeID[iNode] == nodeIDs[iFaceNode] ){ localNodeID.push_back( iNode ); found = true; ++icount; break; } } if( icount >= 3 ){ faceID = calcFaceIDOfFemtic( localNodeID ); return; } if( !found ){ break; } } } std::cerr << "Element face having node "; std::cerr << nodeIDs[0] << " " << nodeIDs[1] << " " << nodeIDs[2] << " "; std::cerr << "cannot be found !!" << std::endl; exit(1); } // Calculate element ID and face ID for Femtic void MeshData::calcElementFace( const int iFace, int& elemID, int& faceID ) const{ if( iFace < 0 || iFace >= m_numFaces ){ std::cerr << "iFace ( " << iFace << " ) is wrong !!" << std::endl; exit(1); } const int nodeIDs[3] = { m_faceTetGen[iFace].nodeID[0], m_faceTetGen[iFace].nodeID[1], m_faceTetGen[iFace].nodeID[2] }; //#ifdef _DEBUG_WRITE // std::cout << "iFace : " << iFace << std::endl; // std::cout << "nodeIDs : " << nodeIDs[0] << " " << nodeIDs[1] << " " << nodeIDs[2] << std::endl; //#endif for( std::vector<int>::const_iterator itr = m_node2elem[ nodeIDs[0] - 1 ].begin(); itr != m_node2elem[ nodeIDs[0] - 1 ].end(); ++itr ){ elemID = *itr; //#ifdef _DEBUG_WRITE // std::cout << "elemID : " << elemID << std::endl; //#endif // if( boundaryType == MeshData::EARTH_SURFACE ){ //#ifdef _DEBUG_WRITE // std::cout << "m_elements[elemID-1].attribute : " << m_elements[elemID-1].attribute << std::endl; // std::cout << "m_regionAttrAirLayer : " << m_regionAttrAirLayer << std::endl; //#endif // if( m_elements[elemID-1].attribute == m_regionAttrAirLayer ){ // continue; // } // } std::vector<int> localNodeID; int icount(0); for( int iFaceNode = 0; iFaceNode < 3; ++iFaceNode ){ //#ifdef _DEBUG_WRITE // std::cout << "iFaceNode : " << iFaceNode << std::endl; // std::cout << "nodeIDs[iFaceNode] : " << nodeIDs[iFaceNode] << std::endl; //#endif bool found(false); for( int iNode = 0; iNode < 4; ++iNode ){ //#ifdef _DEBUG_WRITE // //std::cout << "m_elements[elemID-1].attribute : " << m_elements[elemID-1].attribute << std::endl; // //std::cout << "m_elements[elemID-1].neigh[iNode] : " << m_elements[elemID-1].neigh[iNode] << std::endl; // std::cout << "iNode : " << iNode << std::endl; // std::cout << "m_elements[elemID-1].nodeID[iNode] : " << m_elements[elemID-1].nodeID[iNode] << std::endl; //#endif if( m_elements[elemID-1].nodeID[iNode] == nodeIDs[iFaceNode] ){ localNodeID.push_back( iNode ); found = true; ++icount; break; } } if( icount >= 3 ){ faceID = calcFaceIDOfFemtic( localNodeID ); return; } if( !found ){ break; } } } std::cerr << "Element face having node "; std::cerr << nodeIDs[0] << " " << nodeIDs[1] << " " << nodeIDs[2] << " "; std::cerr << "cannot be found !!" << std::endl; exit(1); } // Calculate local face ID of Femtic int MeshData::calcFaceIDOfFemtic( std::vector<int>& localNodeIDs ) const{ if( static_cast<int>( localNodeIDs.size() ) != 3 ){ std::cerr << "Number of local node IDs must be 3 !!" << std::endl; exit(1); } //std::sort( localNodeIDs.begin(), localNodeIDs.end() ); //if( localNodeIDs[0] == 1 && // localNodeIDs[1] == 2 && // localNodeIDs[2] == 3 ){ // return 0; //} //else //if( localNodeIDs[0] == 0 && // localNodeIDs[1] == 2 && // localNodeIDs[2] == 3 ){ // return 1; //} //else //if( localNodeIDs[0] == 0 && // localNodeIDs[1] == 1 && // localNodeIDs[2] == 3 ){ // return 2; //} //else //if( localNodeIDs[0] == 0 && // localNodeIDs[1] == 1 && // localNodeIDs[2] == 2 ){ // return 3; //} const int sum = localNodeIDs[0] + localNodeIDs[1] + localNodeIDs[2]; switch(sum){ case 6: return 0; break; case 5: return 1; break; case 4: return 2; break; case 3: return 3; break; default: std::cerr << "Locall node IDs (" << localNodeIDs[0] << " " << localNodeIDs[1] << " " << localNodeIDs[2] << " ) are wrong." << std::endl; exit(1); return -1; break; } return -1; } // Calculate boundary type from attribute int MeshData::calcBoundTypeFromAttribute( const int iAttr, bool& isBoundary ) const{ for( int iBoun = 0; iBoun < NUM_BOUNDARY; ++iBoun ){ for( std::vector<int>::const_iterator itr = m_boundaryFaces[iBoun].attributes.begin(); itr != m_boundaryFaces[iBoun].attributes.end(); ++itr ){ if( iAttr == *itr ){ isBoundary = true; return iBoun; } } } isBoundary = false; #ifdef _DEBUG_WRITE std::cout << "Attribute ( " << iAttr << " ) is not assigned to a boundary !!" << std::endl; #endif return 0; } // Calculate boundary type from coordinate int MeshData::calcBoundTypeFromCoordinate( const int iFace ) const{ const double EPS = 1.0e-9; if( iFace < 0 || iFace >= m_numFaces ){ std::cerr << "iFace ( " << iFace << " ) is wrong !!" << std::endl; exit(1); } const int nodeIDFromZero[3] = { m_faceTetGen[iFace].nodeID[0] - 1, m_faceTetGen[iFace].nodeID[1] - 1, m_faceTetGen[iFace].nodeID[2] - 1 }; if( fabs( m_nodeCoords[nodeIDFromZero[0]].X - m_nodeCoords[nodeIDFromZero[1]].X ) < EPS && fabs( m_nodeCoords[nodeIDFromZero[0]].X - m_nodeCoords[nodeIDFromZero[2]].X ) < EPS ){ // On Y-Z plane if( m_nodeCoords[nodeIDFromZero[0]].X > 0 ){ return YZPlus; } else{ return YZMinus; } } else if( fabs( m_nodeCoords[nodeIDFromZero[0]].Y - m_nodeCoords[nodeIDFromZero[1]].Y ) < EPS && fabs( m_nodeCoords[nodeIDFromZero[0]].Y - m_nodeCoords[nodeIDFromZero[2]].Y ) < EPS ){ // On Z-X plane if( m_nodeCoords[nodeIDFromZero[0]].Y > 0 ){ return ZXPlus; } else{ return ZXMinus; } } else if( fabs( m_nodeCoords[nodeIDFromZero[0]].Z - m_nodeCoords[nodeIDFromZero[1]].Z ) < EPS && fabs( m_nodeCoords[nodeIDFromZero[0]].Z - m_nodeCoords[nodeIDFromZero[2]].Z ) < EPS ){ // On X-Y plane if( m_nodeCoords[nodeIDFromZero[0]].Z > 0 ){ return XYPlus; } else{ return XYMinus; } } std::cerr << "Face " << iFace << " is not on the boundary plane !!" << std::endl; exit(1); } // Write mesh data void MeshData::writeMeshData() const{ std::ofstream ofs( "mesh.dat" ); if( !ofs.is_open() ){ std::cerr << "Cannot open file mesh.dat !!" << std::endl; exit(1); } std::cout << "Output mesh data to mesh.dat ." << std::endl; ofs << "TETRA" << std::endl; ofs << std::setw(10) << m_numNodes << std::endl; ofs.precision(9); for( int iNode = 0; iNode < m_numNodes; ++iNode ){ ofs << std::setw(10) << iNode << std::setw(20) << std::scientific << m_nodeCoords[iNode].X << std::setw(20) << std::scientific << m_nodeCoords[iNode].Y << std::setw(20) << std::scientific << m_nodeCoords[iNode].Z << std::endl; } ofs << std::setw(10) << m_numElements << std::endl; for( int iElem = 0; iElem < m_numElements; ++iElem ){ ofs << std::setw(10) << iElem << std::setw(10) << ( m_elements[iElem].neigh[0] > 0 ? m_elements[iElem].neigh[0] - 1 : -1 ) << std::setw(10) << ( m_elements[iElem].neigh[1] > 0 ? m_elements[iElem].neigh[1] - 1 : -1 ) << std::setw(10) << ( m_elements[iElem].neigh[2] > 0 ? m_elements[iElem].neigh[2] - 1 : -1 ) << std::setw(10) << ( m_elements[iElem].neigh[3] > 0 ? m_elements[iElem].neigh[3] - 1 : -1 ) << std::setw(10) << m_elements[iElem].nodeID[0] - 1 << std::setw(10) << m_elements[iElem].nodeID[1] - 1 << std::setw(10) << m_elements[iElem].nodeID[2] - 1 << std::setw(10) << m_elements[iElem].nodeID[3] - 1 << std::endl; } for( int iBoun = 0; iBoun < NUM_BOUNDARY; ++iBoun ){ const int numFace = static_cast<int>( m_boundaryFaces[iBoun].elemIDs.size() ); ofs << std::setw(10) << numFace << std::endl; for( int iFace = 0; iFace < numFace; ++iFace ){ ofs << std::setw(10) << m_boundaryFaces[iBoun].elemIDs[iFace] - 1 << std::setw(10) << m_boundaryFaces[iBoun].faceIDs[iFace] << std::endl; } } ofs.close(); } // Write mesh data to vtk file void MeshData::writeMeshDataToVTK( const std::string& rootName ) const{ std::string fileName = rootName; fileName += ".femtic.vtk"; std::ofstream vtkFile( fileName.c_str() ); if( !vtkFile.is_open() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Output mesh data to " << fileName.c_str() << std::endl; vtkFile << "# vtk DataFile Version 2.0" << std::endl; vtkFile << "MeshData" << std::endl; vtkFile << "ASCII" << std::endl; vtkFile << "DATASET UNSTRUCTURED_GRID" << std::endl; vtkFile << "POINTS " << m_numNodes << " double" << std::endl; vtkFile.precision(9); for( int iNode = 0; iNode < m_numNodes; ++iNode ){ vtkFile << std::setw(20) << std::scientific << m_nodeCoords[iNode].X << std::setw(20) << std::scientific << m_nodeCoords[iNode].Y << std::setw(20) << std::scientific << m_nodeCoords[iNode].Z << std::endl; } vtkFile << "CELLS " << m_numElements << " " << m_numElements * 5 << std::endl; for( int iElem = 0; iElem < m_numElements; ++iElem ){ vtkFile << std::setw(5) << 4 << std::setw(10) << m_elements[iElem].nodeID[0] - 1 << std::setw(10) << m_elements[iElem].nodeID[1] - 1 << std::setw(10) << m_elements[iElem].nodeID[2] - 1 << std::setw(10) << m_elements[iElem].nodeID[3] - 1 << std::endl; } vtkFile << "CELL_TYPES " << m_numElements << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << std::setw(5) << 10 << std::endl; } vtkFile << "CELL_DATA " << m_numElements << std::endl; vtkFile << "SCALARS BlockSerial int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << std::setw(10) << m_elem2blk[iElem] << std::endl; } vtkFile << "SCALARS ElemPerBlock int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ const int iBlk = m_elem2blk[iElem]; vtkFile << std::setw(10) << static_cast<int>( m_blk2elem[iBlk].size() ) << std::endl; } vtkFile << "SCALARS Resistivity[Ohm-m] double" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; vtkFile.precision(9); for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << std::setw(20) << m_blk2resistivity[ m_elem2blk[iElem] ].first << std::endl; } vtkFile << "SCALARS ElemSerial int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << iElem << std::endl; } vtkFile << "SCALARS Fixed int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << std::setw(20) << static_cast<int>( m_blk2resistivity[ m_elem2blk[iElem] ].second ) << std::endl; } #ifdef _DEBUG_WRITE int* boundFlag = new int[m_numElements]; for( int iBoun = 0; iBoun < NUM_BOUNDARY; ++iBoun ){ for( int i = 0; i < m_numElements; ++i ){ boundFlag[i] = 0; } const int numFace = static_cast<int>( m_boundaryFaces[iBoun].elemIDs.size() ); for( int iFace = 0; iFace < numFace; ++iFace ){ boundFlag[ m_boundaryFaces[iBoun].elemIDs[iFace] - 1 ] = 1; } vtkFile << "SCALARS "; switch( iBoun ){ case MeshData::YZMinus: vtkFile << "YZMinus"; break; case MeshData::YZPlus: vtkFile << "YZPlus"; break; case MeshData::ZXMinus: vtkFile << "ZXMinus"; break; case MeshData::ZXPlus: vtkFile << "ZXPlus"; break; case MeshData::XYMinus: vtkFile << "XYMinus"; break; case MeshData::XYPlus: vtkFile << "XYPlus"; break; case MeshData::EARTH_SURFACE: vtkFile << "EARTH_SURFACE"; break; default: std::cerr << "Wrong boundary type !!" << std::endl; exit(1); break; } vtkFile << " int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << boundFlag[iElem] << std::endl; } } delete [] boundFlag; #endif vtkFile << "POINT_DATA " << m_numNodes << std::endl; vtkFile << "SCALARS NodeSerial int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( int iNode = 0 ; iNode < m_numNodes; ++iNode ){ vtkFile << iNode << std::endl; } vtkFile.close(); } //// Write resistivity data //void MeshData::writeResisitivityData() const{ // // std::ofstream ofs( "resistivity_model_iter0.dat" ); // // if( !ofs.is_open() ){ // std::cerr << "Cannot open file resistivity_model_iter0.dat !!" << std::endl; // exit(1); // } // // std::cout << "Output mesh data to resistivity_model_iter0.dat ." << std::endl; // // //const int numResisitivityBlk = static_cast<int>( m_regionAttr2Resistivity.size() ); // ofs << std::setw(10) << m_numElements // << std::setw(10) << m_numResistivity // << std::endl; // // for( int iElem = 0; iElem < m_numElements; ++iElem ){ // // ofs << std::setw(10) << iElem // << std::setw(10) << (m_regionAttr2Resistivity.find( m_elements[iElem].attribute )->second).first // << std::endl; // // } // // ofs.precision(9); // for( int iBlk = 0; iBlk < numResisitivityBlk; ++iBlk ){ // // double val(0.0); // bool found(false); // for( std::map< int, std::pair<int,double> >::const_iterator itr = m_regionAttr2Resistivity.begin(); // itr != m_regionAttr2Resistivity.end(); // ++itr ){ // // if( iBlk == (itr->second).first ){ // val = (itr->second).second; // found = true; // break; // } // // } // if( !found ){ // std::cerr << "Resistivity block ID " << iBlk << " cannot be found !!" << std::endl; // exit(1); // } // // ofs << std::setw(10) << iBlk // << std::setw(20) << std::scientific << val // << std::setw(10) << 0 // << std::endl; // // } // // ofs.close(); // //} // Write resistivity data void MeshData::writeResisitivityData() const{ std::ofstream ofs( "resistivity_block_iter0.dat" ); if( !ofs.is_open() ){ std::cerr << "Cannot open file resistivity_block_iter0.dat !!" << std::endl; exit(1); } std::cout << "Output mesh data to resistivity_block_iter0.dat ." << std::endl; //const int numResisitivityBlk = static_cast<int>( m_regionAttr2Resistivity.size() ); ofs << std::setw(10) << m_numElements << std::setw(10) << static_cast<int>( m_blk2resistivity.size() ) << std::endl; for( int iElem = 0; iElem < m_numElements; ++iElem ){ ofs << std::setw(10) << iElem << std::setw(10) << m_elem2blk[iElem] << std::endl; } ofs.precision(6); int icount(0); for( std::vector< std::pair<double,bool> >::const_iterator itr = m_blk2resistivity.begin(); itr != m_blk2resistivity.end(); ++itr, ++icount ){ ofs << std::setw(10) << icount << std::setw(15) << std::scientific << itr->first #ifdef _OLD #else << std::setw(15) << 1.0e-20 << std::setw(15) << 1.0e+20 << std::setw(15) << 1.0 #endif << std::setw(10) << ( itr->second ? 1 : 0 ) << std::endl; } ofs.close(); } // Make resistivity block by partitioning resistivity block by RCB void MeshData::makeResistivityBlock( const bool divAllElements ){ const int numResistivity = static_cast<int>( m_resistivityData.size() ); ElementVecs* elementVecsArray = new ElementVecs[numResistivity]; for( int iRes = 0; iRes < numResistivity; ++iRes ){ std::vector<int> dum; elementVecsArray[iRes].push_back( std::make_pair( dum, false ) ); } for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ std::map< int, int >::iterator itr = m_regionAttr2ResistivityID.find( m_elements[iElem].attribute ); if (itr == m_regionAttr2ResistivityID.end()){ std::cerr << "Error : Region attiribute << " << m_elements[iElem].attribute << " of element " << iElem << " cannot be found !!" << std::endl; exit(1); } const int iRes = itr->second; elementVecsArray[iRes][0].first.push_back( iElem ); } int numResistivityBlocks = 1;// For the air layer for( int iRes = 1; iRes < numResistivity; ++iRes ){// Skip iRes = 0 ( the air layer ) if( m_resistivityData[iRes].ndiv < 0 ){ ++numResistivityBlocks; continue; } if(divAllElements){ divideElementVecsAll( elementVecsArray[iRes] ); numResistivityBlocks += static_cast<int>( elementVecsArray[iRes].size() ); }else{ divideElementVecs( elementVecsArray[iRes], m_resistivityData[iRes].ndiv ); if( m_numSphere > 0 ){ divideBlockUntilRequiredLength( elementVecsArray[iRes] ); } numResistivityBlocks += static_cast<int>( elementVecsArray[iRes].size() ); } } m_elem2blk = new int[m_numElements]; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ m_elem2blk[iElem] = -1; } std::vector<int> tmpVec; m_blk2elem.resize(numResistivityBlocks, tmpVec); //m_blkID2resistivity.resize(m_numResistivityBlocks, std::make_pair(0.0,false)); m_blk2resistivity.reserve(numResistivityBlocks); //std::cout << "<blockID> <#elements> <resistivity> <fix>" << std::endl; int icount(0); for( int iRes = 0; iRes < numResistivity; ++iRes ){ for( ElementVecs::iterator itrVecs = elementVecsArray[iRes].begin(); itrVecs != elementVecsArray[iRes].end(); ++itrVecs ){ for( std::vector<int>::iterator itr = (itrVecs->first).begin(); itr != (itrVecs->first).end(); ++itr ){ m_elem2blk[*itr] = icount; m_blk2elem[icount].push_back(*itr); } m_blk2resistivity.push_back( std::make_pair(m_resistivityData[iRes].resistivity,m_resistivityData[iRes].fix) ); //std::cout << std::setw(10) << static_cast<int>( m_blk2resistivity.size() ) // << std::setw(10) << static_cast<int>( m_blk2elem[icount].size() ) // << std::setw(20) << std::scientific << m_blk2resistivity.back().first // << std::setw(5) << std::scientific << m_blk2resistivity.back().second // << std::endl; ++icount; } } delete [] elementVecsArray; } // Divide elements into sub-elements void MeshData::divideElementVecs( ElementVecs& elementVecs, const int ndiv ) const{ for( int idiv = 0; idiv < ndiv; ++idiv ){ const int num = static_cast<int>( elementVecs.size() ); bool everyElementHasDifferentResistivity(true); for( int i = 0; i < num; ++i ){ if( static_cast<int>( elementVecs[i].first.size() ) < 2 ){ continue; } elementVecs.push_back( std::make_pair( divide( elementVecs[i].first ), false ) ); everyElementHasDifferentResistivity = false; } if(everyElementHasDifferentResistivity){ return; } } } // Assign each element to different parameter cell void MeshData::divideElementVecsAll( ElementVecs& elementVecs ) const{ ElementVecs elementVecsNew; const int num = static_cast<int>( elementVecs.size() ); for( int i = 0; i < num; ++i ){ for( std::vector<int>::iterator itr = elementVecs[i].first.begin(); itr != elementVecs[i].first.end(); ++itr ){ std::vector<int> elemVec; elemVec.push_back(*itr); elementVecsNew.push_back( std::make_pair( elemVec, false ) ); } } elementVecs.swap(elementVecsNew); } // Divide resistivity blocks to the required length void MeshData::divideBlockUntilRequiredLength( ElementVecs& elementVecs ) const{ int icount = 0; for( ; icount < m_numElements; ++icount ){ bool satisfyAll = true; int numElemVec = static_cast<int>( elementVecs.size() ); for( int ivec = 0; ivec < numElemVec; ++ivec ){ if( elementVecs[ivec].second ){ // Length of resistivity blocks is shorter than the required length //std::cout << "Length of resistivity blocks is shorter than the required length" << std::endl; continue; } if( static_cast<int>( elementVecs[ivec].first.size() ) < 2 ){ elementVecs[ivec].second = true; //std::cout << "elementVecs[ivec].first.size() : " << elementVecs[ivec].first.size() << std::endl; continue; } std::vector< std::pair<double,int> > stack[3]; for( std::vector<int>::iterator itr = (elementVecs[ivec].first).begin(); itr != (elementVecs[ivec].first).end(); ++itr ){ stack[0].push_back( std::make_pair( calcGravityCenterX(*itr), *itr ) ); stack[1].push_back( std::make_pair( calcGravityCenterY(*itr), *itr ) ); stack[2].push_back( std::make_pair( calcGravityCenterZ(*itr), *itr ) ); } std::vector< std::pair<double,int> > stackDis; for( int i = 0; i < 3; ++i ){ sort( stack[i].begin(), stack[i].end() ); stackDis.push_back( std::make_pair( fabs( stack[i].back().first - stack[i].front().first ), i ) ); } sort( stackDis.begin(), stackDis.end() ); const int idirMax = stackDis.back().second; const double disMax = stackDis.back().first; if( disMax < calcShorterBlockLength( stack[idirMax].front().second, stack[idirMax].back().second ) ){ elementVecs[ivec].second = true; //std::cout << "disMax required : " << disMax << " " << calcShorterBlockLength( stack[idirMax].front().second, stack[idirMax].back().second ) << std::endl; continue; } satisfyAll = false; const int iEnd = static_cast<int>( stack[idirMax].size() ); const int iMid = iEnd / 2 + iEnd % 2; std::vector<int> newElements1; for( int i = 0; i < iMid; ++i ){ newElements1.push_back( stack[idirMax][i].second ); } (elementVecs[ivec].first).swap( newElements1 ); std::vector<int> newElements2; for( int i = iMid; i < iEnd; ++i ){ newElements2.push_back( stack[idirMax][i].second ); } elementVecs.push_back( std::make_pair( newElements2, false ) ); } if( satisfyAll ){ break; } } if( icount >= m_numElements ){ std::cerr << "Loop count reach maximum value : " << icount << std::endl; exit(1); } } // Divide specified elements for the longest direction std::vector<int> MeshData::divide( std::vector<int>& elements ) const{ if( static_cast<int>( elements.size() ) < 2 ){ std::cerr << "Error : Number of specified elements is less than 2" << std::endl; exit(1); } std::vector< std::pair<double,int> > stack[3]; for( std::vector<int>::iterator itr = elements.begin(); itr != elements.end(); ++itr ){ stack[0].push_back( std::make_pair( calcGravityCenterX(*itr), *itr ) ); stack[1].push_back( std::make_pair( calcGravityCenterY(*itr), *itr ) ); stack[2].push_back( std::make_pair( calcGravityCenterZ(*itr), *itr ) ); } std::vector< std::pair<double,int> > stackDis; for( int i = 0; i < 3; ++i ){ sort( stack[i].begin(), stack[i].end() ); stackDis.push_back( std::make_pair( fabs( stack[i].back().first - stack[i].front().first ), i ) ); } sort( stackDis.begin(), stackDis.end() ); const int idirMax = stackDis.back().second; const int iEnd = static_cast<int>( stack[idirMax].size() ); const int iMid = iEnd / 2 + iEnd % 2; std::vector<int> newElements1; for( int i = 0; i < iMid; ++i ){ newElements1.push_back( stack[idirMax][i].second ); } elements.swap( newElements1 ); std::vector<int> newElements2; for( int i = iMid; i < iEnd; ++i ){ newElements2.push_back( stack[idirMax][i].second ); } return newElements2; } // Calculate shorter block length of elements double MeshData::calcShorterBlockLength( const int elem1, const int elem2 ) const{ const XYZ coord1 = { calcGravityCenterX(elem1), calcGravityCenterY(elem1), calcGravityCenterZ(elem1) }; const XYZ coord2 = { calcGravityCenterX(elem2), calcGravityCenterY(elem2), calcGravityCenterZ(elem2) }; return std::min( calcBlockLength( coord1 ), calcBlockLength( coord2 ) ); } // Calculate maximum block length in the transition region double MeshData::calcBlockLength( const XYZ& coord ) const{ double length(1.0e20); if( locateInSphere( coord, 0 ) ){ length = m_maxBlockLength[0]; } else if( !locateInSphere( coord, m_numSphere-1 ) ){ length = m_maxBlockLength[m_numSphere-1]; } else{ for( int iSphere = 1; iSphere < m_numSphere; ++iSphere ){ if( locateInSphere( coord, iSphere ) ){ length =calcBlockLengthTransitionRegion( coord, iSphere ); break; } } } return std::min( calcBlockLengthNearSite(coord), length ); } // Decide whether the spacified point locate within the specified hemi-sphere bool MeshData::locateInSphere( const XYZ& coord, const int iSphere ) const{ if( iSphere < 0 || iSphere >= m_numSphere ){ std::cerr << "Wrong shepre ID: " << iSphere << std::endl; exit(1); } //const double depth = m_radius[iSphere] * ( 1.0 - m_oblateness[iSphere] ); //double val = pow( ( coord.X - m_centerCoordSpheres.X ) / m_radius[iSphere], 2 ) // + pow( ( coord.Y - m_centerCoordSpheres.Y ) / m_radius[iSphere], 2 ) // + pow( ( coord.Z - m_centerCoordSpheres.Z ) / depth, 2 ); const double vecXOrg = coord.X - m_centerCoordSpheres.X; const double vecYOrg = coord.Y - m_centerCoordSpheres.Y; // Coordinate transform const double vecX = vecXOrg * cos( - m_rotationAngle ) - vecYOrg * sin( - m_rotationAngle ); const double vecY = vecXOrg * sin( - m_rotationAngle ) + vecYOrg * cos( - m_rotationAngle ); const double vecZ = coord.Z - m_centerCoordSpheres.Z; const double longAxisLength = m_radius[iSphere]; const double shortAxisLength = longAxisLength * ( 1.0 - m_oblatenessHorizontal[iSphere] ); const double depth = longAxisLength * ( 1.0 - m_oblateness[iSphere] ); double val = pow( vecX / longAxisLength, 2 ) + pow( vecY / shortAxisLength, 2 ) + pow( vecZ / depth, 2 ); if( val <= 1.0 ){ return true; } return false; } // Calculate maximum block length in the transition region double MeshData::calcBlockLengthTransitionRegion( const XYZ& coord, const int iSphere ) const{ if( iSphere < 1 || iSphere >= m_numSphere ){ std::cerr << "Wrong shepre ID: " << iSphere << std::endl; exit(1); } //const double radiusInner = m_radius[iSphere-1]; //const double radiusOuter = m_radius[iSphere]; //const double edgeLengthInner = m_maxBlockLength[iSphere-1]; //const double edgeLengthOuter = m_maxBlockLength[iSphere]; //const double oblatenessInner = m_oblateness[iSphere-1]; //const double oblatenessOuter = m_oblateness[iSphere]; //const double radiusHorizontal = hypot( coord.X - m_centerCoordSpheres.X, coord.Y - m_centerCoordSpheres.Y ); //const double radius = hypot( radiusHorizontal, coord.Z - m_centerCoordSpheres.Z ); //const double slope = fabs( coord.Z - m_centerCoordSpheres.Z ) / radiusHorizontal; //const double radius0 = radiusInner * ( 1.0 - oblatenessInner ) * sqrt( ( slope*slope + 1.0 ) / ( slope*slope + (1.0-oblatenessInner)*(1.0-oblatenessInner) ) ); //const double radius1 = radiusOuter * ( 1.0 - oblatenessOuter ) * sqrt( ( slope*slope + 1.0 ) / ( slope*slope + (1.0-oblatenessOuter)*(1.0-oblatenessOuter) ) ); //if( radius1 < radius0 ){ // std::cerr << "Specified coordinate ( " << coord.X << ", " << coord.Y << ", " << coord.Z << " ) does't locate in the trasition region" << std::endl; // exit(1); //} //if( radius < radius0 ){ // std::cerr << "Specified coordinate ( " << coord.X << ", " << coord.Y << ", " << coord.Z << " ) does't locate in the trasition region" << std::endl; // std::cerr << "iSphere : " << iSphere << std::endl; // std::cerr << "radiusHorizontal : " << radiusHorizontal << std::endl; // std::cerr << "radius : " << radius << std::endl; // std::cerr << "radius0 : " << radius0 << std::endl; // std::cerr << "radius1 : " << radius1 << std::endl; // exit(1); //} //return ( radius - radius0 ) / ( radius1 - radius0 ) * ( edgeLengthOuter - edgeLengthInner ) + edgeLengthInner; const double vecXOrg = coord.X - m_centerCoordSpheres.X; const double vecYOrg = coord.Y - m_centerCoordSpheres.Y; // Coordinate transform const double vecX = vecXOrg * cos( - m_rotationAngle ) - vecYOrg * sin( - m_rotationAngle ); const double vecY = vecXOrg * sin( - m_rotationAngle ) + vecYOrg * cos( - m_rotationAngle ); const double vecZ = coord.Z - m_centerCoordSpheres.Z; const double angleHorizontal = atan2( vecY, vecX ); const double lengthHorizontal = hypot( vecY, vecX ); const double angleVertical = atan2( vecZ, lengthHorizontal ); const double length = hypot( lengthHorizontal, vecZ ); const double length0 = calculateLengthOnEllipsoid( angleHorizontal, angleVertical, iSphere-1 ); const double length1 = calculateLengthOnEllipsoid( angleHorizontal, angleVertical, iSphere ); if( length < length0 ){ std::cerr << "Specified coordinate ( " << coord.X << ", " << coord.Y << ", " << coord.Z << " ) does't locate in the trasition region" << std::endl; std::cerr << "iSphere : " << iSphere << std::endl; std::cerr << "vecX : " << vecX << std::endl; std::cerr << "vecY : " << vecY << std::endl; std::cerr << "vecZ : " << vecZ << std::endl; std::cerr << "lengthHorizontal : " << lengthHorizontal << std::endl; std::cerr << "angleH : " << angleHorizontal << std::endl; std::cerr << "angleV : " << angleVertical << std::endl; std::cerr << "length : " << length << std::endl; std::cerr << "length0 : " << length0 << std::endl; std::cerr << "length1 : " << length1 << std::endl; exit(1); } return ( length - length0 ) / ( length1 - length0 ) * ( m_maxBlockLength[iSphere] - m_maxBlockLength[iSphere-1] ) + m_maxBlockLength[iSphere-1]; } // Calculate length on ellipsoid double MeshData::calculateLengthOnEllipsoid( const double angleH, const double angleV, const int iSphere ) const{ if( iSphere < 0 || iSphere >= m_numSphere ){ std::cerr << "Wrong shepre ID: " << iSphere << std::endl; exit(1); } if( angleH < -PI || angleH > PI ){ std::cerr << "Horizontal angle is improper : " << angleH << std::endl; exit(1); } if( angleV < -PI || angleV > PI ){ std::cerr << "Vertical angle is improper : " << angleV << std::endl; exit(1); } const double longAxisLength = m_radius[iSphere]; const double shortAxisLength = longAxisLength * ( 1.0 - m_oblatenessHorizontal[iSphere] ); const double verticalLength = longAxisLength * ( 1.0 - m_oblateness[iSphere] ); const double eps = 1.0e-9; double lengthH(-1.0); if( fabs(angleH - PI*0.5) < eps || fabs(angleH + PI*0.5) < eps ){ lengthH = shortAxisLength; } else{ const double constValH = longAxisLength * shortAxisLength / hypot( shortAxisLength, longAxisLength * tan(angleH) ); lengthH = hypot( constValH, constValH * tan(angleH) ); } if( fabs(angleV - PI*0.5) < eps || fabs(angleV + PI*0.5) < eps ){ return verticalLength; } else{ const double constValV = lengthH * verticalLength / hypot( verticalLength, lengthH * tan(angleV) ); return hypot( constValV, constValV * tan(angleV) ); } } // Calculate maximum block length near site double MeshData::calcBlockLengthNearSite( const XYZ& coord ) const{ double length(1.0e20); for( int iObs = 0; iObs < m_numObsSite; ++iObs ){ const double radius = sqrt( pow( coord.X - m_obsSite[iObs].X, 2 ) + pow( coord.Y - m_obsSite[iObs].Y, 2 ) + pow( coord.Z - m_obsSite[iObs].Z, 2 ) ); if( radius <= m_obsSite[iObs].radius[0] ){ length = std::min(length, m_obsSite[iObs].length[0] ); continue; } for( int i = m_obsSite[iObs].numCircle - 1; i >= 1; --i ){ if( radius <= m_obsSite[iObs].radius[i] ){ const double lengthTemp = m_obsSite[iObs].length[i-1] + ( radius - m_obsSite[iObs].radius[i-1] ) / ( m_obsSite[iObs].radius[i] - m_obsSite[iObs].radius[i-1] ) * ( m_obsSite[iObs].length[i] - m_obsSite[iObs].length[i-1] ); length = std::min(length, lengthTemp ); }else{ break; } } } return length; } // Calculate gravity center of element MeshData::XYZ MeshData::calcGravityCenter( const int iElem ) const{ if( iElem < 0 || iElem >= m_numElements ){ std::cerr << "iElem " << iElem << " is out of range !!" << std::endl; exit(1); } //MeshData::XYZ coord = { 0.0, 0.0, 0.0 }; //for( int i = 0; i < 4; ++i ){ // const int iNode = m_elements[iElem].nodeID[i] - 1; // coord.X += m_nodeCoords[ iNode ].X; // coord.Y += m_nodeCoords[ iNode ].Y; // coord.Z += m_nodeCoords[ iNode ].Z; //} //coord.X *= 0.25; //coord.Y *= 0.25; //coord.Z *= 0.25; MeshData::XYZ coord = { calcGravityCenterX(iElem), calcGravityCenterY(iElem), calcGravityCenterZ(iElem) }; return coord; } // Calculate X coordinate of gravity center of element double MeshData::calcGravityCenterX( const int iElem ) const{ if( iElem < 0 || iElem >= m_numElements ){ std::cerr << "iElem " << iElem << " is out of range !!" << std::endl; exit(1); } double val(0.0); for( int i = 0; i < 4; ++i ){ val += m_nodeCoords[ m_elements[iElem].nodeID[i] - 1 ].X; } return val * 0.25; } // Calculate Y coordinate of gravity center of element double MeshData::calcGravityCenterY( const int iElem ) const{ if( iElem < 0 || iElem >= m_numElements ){ std::cerr << "iElem " << iElem << " is out of range !!" << std::endl; exit(1); } double val(0.0); for( int i = 0; i < 4; ++i ){ val += m_nodeCoords[ m_elements[iElem].nodeID[i] - 1 ].Y; } return val * 0.25; } // Calculate Z coordinate of gravity center of element double MeshData::calcGravityCenterZ( const int iElem ) const{ if( iElem < 0 || iElem >= m_numElements ){ std::cerr << "iElem " << iElem << " is out of range !!" << std::endl; exit(1); } double val(0.0); for( int i = 0; i < 4; ++i ){ val += m_nodeCoords[ m_elements[iElem].nodeID[i] - 1 ].Z; } return val * 0.25; } #ifdef _ADDITIONAL_FIXED_AREA // Add if the inputted faces of the earth's surface below which resistivity values are fixed void MeshData::addIfFaceIndexAboveAdditionalFixedRegion( const int iFace ){ if( iFace < 0 || iFace >= m_numFaces ){ std::cerr << "iFace ( " << iFace << " ) is wrong !!" << std::endl; exit(1); } const int nodeIndex[3] = { m_faceTetGen[iFace].nodeID[0] - 1, m_faceTetGen[iFace].nodeID[1] - 1, m_faceTetGen[iFace].nodeID[2] - 1 }; const XYZ coordCenter = { ( m_nodeCoords[nodeIndex[0]].X + m_nodeCoords[nodeIndex[1]].X + m_nodeCoords[nodeIndex[2]].X ) / 3.0, ( m_nodeCoords[nodeIndex[0]].Y + m_nodeCoords[nodeIndex[1]].Y + m_nodeCoords[nodeIndex[2]].Y ) / 3.0, ( m_nodeCoords[nodeIndex[0]].Z + m_nodeCoords[nodeIndex[1]].Z + m_nodeCoords[nodeIndex[2]].Z ) / 3.0 }; if( checkIfCoordInAdditionalFixedRegion( coordCenter ) ){ m_faceIndexAboveAdditionalFixedRegion.push_back(iFace); } } // Check if the inputted coordinate locates in the additional areal below which resistivity values are fixed bool MeshData::checkIfCoordInAdditionalFixedRegion( const XYZ& coord ) const{ const XYZ coordShifted = { coord.X - m_paramForAdditionalFixedRegion.centerCoord.X, coord.Y - m_paramForAdditionalFixedRegion.centerCoord.Y, coord.Z }; const XYZ coordRotated = { coordShifted.X * cos( - m_paramForAdditionalFixedRegion.rotationAngle ) - coordShifted.Y * sin( - m_paramForAdditionalFixedRegion.rotationAngle ), coordShifted.X * sin( - m_paramForAdditionalFixedRegion.rotationAngle ) + coordShifted.Y * cos( - m_paramForAdditionalFixedRegion.rotationAngle ), coordShifted.Z }; if( fabs(coordRotated.X) <= m_paramForAdditionalFixedRegion.xLength && fabs(coordRotated.Y) <= m_paramForAdditionalFixedRegion.yLength && coordRotated.Z >= m_paramForAdditionalFixedRegion.minDepthOfEarthSurface && coordRotated.Z <= m_paramForAdditionalFixedRegion.maxDepthOfEarthSurface ){ return true; } return false; } // Check if the inputted coordinate locates under the faces below which resistivity values are fixed bool MeshData::checkIfCoordUnderTheFacesConstrutingAdditionalFixedRegion( const XY& coord ) const{ const double EPS = 1.0e-6; for( std::vector<int>::const_iterator itrFace = m_faceIndexAboveAdditionalFixedRegion.begin(); itrFace != m_faceIndexAboveAdditionalFixedRegion.end(); ++itrFace ){ const int faceIndex = *itrFace; const int nodeIndex[3] = { m_faceTetGen[faceIndex].nodeID[0] - 1, m_faceTetGen[faceIndex].nodeID[1] - 1, m_faceTetGen[faceIndex].nodeID[2] - 1 }; const XY coordTri[3] = { { m_nodeCoords[nodeIndex[0]].X, m_nodeCoords[nodeIndex[0]].Y }, { m_nodeCoords[nodeIndex[1]].X, m_nodeCoords[nodeIndex[1]].Y }, { m_nodeCoords[nodeIndex[2]].X, m_nodeCoords[nodeIndex[2]].Y } }; //const double det0 = calcOuterProduct( coordTri[0], coordTri[1], coord ); //const double det1 = calcOuterProduct( coordTri[1], coordTri[2], coord ); //const double det2 = calcOuterProduct( coordTri[2], coordTri[0], coord ); //if( det0 > -EPS && det1 > -EPS && det2 > -EPS ){ // // Locate in triangle // return true; //} const double det = fabs( calcOuterProduct( coordTri[0], coordTri[1], coordTri[2] ) ); const double det0 = fabs( calcOuterProduct( coordTri[0], coordTri[1], coord ) ); const double det1 = fabs( calcOuterProduct( coordTri[1], coordTri[2], coord ) ); const double det2 = fabs( calcOuterProduct( coordTri[2], coordTri[0], coord ) ); if( fabs( det0 + det1 + det2 - det ) / det < EPS ){ // Locate in triangle return true; } } return false; } // Fix resistivity in the additional area in which resistivity values are fixed void MeshData::fixResistivityInAdditionalFixedRegion(){ const int attrAdditionalFixedRegion = m_paramForAdditionalFixedRegion.attribute; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ if( m_regionAttrAirOrSea.find( m_elements[iElem].attribute ) != m_regionAttrAirOrSea.end() ){ // Exclude sea or air continue; } const XY coordXY = { calcGravityCenterX(iElem), calcGravityCenterY(iElem) }; const double coordZ = calcGravityCenterZ(iElem); if( checkIfCoordUnderTheFacesConstrutingAdditionalFixedRegion( coordXY ) ){ // Locate in triangle if( fabs( coordZ - m_paramForAdditionalFixedRegion.centerCoord.Z ) < m_paramForAdditionalFixedRegion.zLength ){ // Locate in fixed region m_elements[iElem].attribute = attrAdditionalFixedRegion; } } } } // Calculate gravity centers of resistivity blocks MeshData::XYZ MeshData::calcGravityCenterOfResistivityBlock( const int blockIndex ) const{ XYZ coordGravityCenter = { 0.0, 0.0, 0.0 }; double sumVolume(0.0); for( std::vector<int>::const_iterator itr = m_blk2elem[blockIndex].begin(); itr != m_blk2elem[blockIndex].end(); ++itr ){ const int elemIndex = *itr; const double volume = calculateVolumeOfElement(elemIndex); MeshData::XYZ center = { calcGravityCenterX(elemIndex), calcGravityCenterY(elemIndex), calcGravityCenterZ(elemIndex) }; coordGravityCenter.X += center.X * volume; coordGravityCenter.Y += center.Y * volume; coordGravityCenter.Z += center.Z * volume; sumVolume += volume; } const double div = 1.0 / sumVolume; coordGravityCenter.X *= div; coordGravityCenter.Y *= div; coordGravityCenter.Z *= div; return coordGravityCenter; } // Calculate outer product double MeshData::calcOuterProduct( const MeshData::XY& startCoord, const MeshData::XY& endCoord, const MeshData::XY& coord ) const{ return ( endCoord.X - startCoord.X )*( coord.Y - startCoord.Y ) - ( endCoord.Y - startCoord.Y )*( coord.X - startCoord.X ); } // Write faces above the additional area in which resistivity values are fixed void MeshData::writeFacesAboveAdditionalFixedRegionToVTK( const std::string& rootName ) const{ std::map<int,int> nodeIDGlobal2Local; std::map<int,int> nodeIDLocal2Global; for( std::vector<int>::const_iterator itrFace = m_faceIndexAboveAdditionalFixedRegion.begin(); itrFace != m_faceIndexAboveAdditionalFixedRegion.end(); ++itrFace ){ const int faceIndex = *itrFace; const int nodeID[3] = { m_faceTetGen[faceIndex].nodeID[0], m_faceTetGen[faceIndex].nodeID[1], m_faceTetGen[faceIndex].nodeID[2] }; for( int iNode = 0; iNode < 3; ++iNode ){ const int nodeIDGlobal = m_faceTetGen[faceIndex].nodeID[iNode]; if( nodeIDGlobal2Local.find(nodeIDGlobal) == nodeIDGlobal2Local.end() ){ // Not found const int nodeIDLocal = static_cast<int>( nodeIDGlobal2Local.size() ) + 1; nodeIDGlobal2Local.insert( std::make_pair( nodeIDGlobal, nodeIDLocal ) ); nodeIDLocal2Global.insert( std::make_pair( nodeIDLocal, nodeIDGlobal ) ); } } } std::string fileName = rootName; fileName += ".faceAboveFixedRegion.vtk"; std::ofstream vtkFile( fileName.c_str() ); if( !vtkFile.is_open() ){ std::cerr << "Cannot open file " << fileName.c_str() << std::endl; exit(1); } std::cout << "Output faces above the additional area to " << fileName.c_str() << std::endl; vtkFile << "# vtk DataFile Version 2.0" << std::endl; vtkFile << "FaceData" << std::endl; vtkFile << "ASCII" << std::endl; vtkFile << "DATASET UNSTRUCTURED_GRID" << std::endl; vtkFile.precision(9); const int numNode = static_cast<int>( nodeIDGlobal2Local.size() ); vtkFile << "POINTS " << numNode << " double" << std::endl; for( std::map<int,int>::const_iterator itrNode = nodeIDLocal2Global.begin(); itrNode != nodeIDLocal2Global.end(); ++itrNode ){ const int nodeIDLocal = itrNode->first; std::map<int,int>::const_iterator itr = nodeIDLocal2Global.find(nodeIDLocal); if( itr == nodeIDLocal2Global.end() ){ // Not found std::cerr << "Node ID " << nodeIDLocal << " is NOT found in nodeIDLocal2Global !!" << std::endl; exit(1); } const int nodeIndexGlobal = itr->second - 1; vtkFile << std::setw(20) << std::scientific << m_nodeCoords[nodeIndexGlobal].X << std::setw(20) << std::scientific << m_nodeCoords[nodeIndexGlobal].Y << std::setw(20) << std::scientific << m_nodeCoords[nodeIndexGlobal].Z << std::endl; } const int numTriangles = static_cast<int>( m_faceIndexAboveAdditionalFixedRegion.size() ); vtkFile << "CELLS " << numTriangles << " " << numTriangles * 4 << std::endl; for( std::vector<int>::const_iterator itrFace = m_faceIndexAboveAdditionalFixedRegion.begin(); itrFace != m_faceIndexAboveAdditionalFixedRegion.end(); ++itrFace ){ vtkFile << std::setw(5) << 3; const int faceIndex = *itrFace; for( int iNode = 0; iNode < 3; ++iNode ){ const int nodeIDGlobal = m_faceTetGen[faceIndex].nodeID[iNode]; std::map<int,int>::const_iterator itr = nodeIDGlobal2Local.find(nodeIDGlobal); if( itr == nodeIDGlobal2Local.end() ){ // Not found std::cerr << "Node ID " << nodeIDGlobal << " is NOT found in nodeIDGlobal2Local !!" << std::endl; exit(1); } vtkFile << std::setw(10) << itr->second - 1; } vtkFile << std::endl; } vtkFile << "CELL_TYPES " << m_numElements << std::endl; for( int iElem = 0 ; iElem < m_numElements; ++iElem ){ vtkFile << std::setw(5) << 5 << std::endl; } vtkFile << "CELL_DATA " << m_numElements << std::endl; vtkFile << "SCALARS FaceIndex int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( std::vector<int>::const_iterator itrFace = m_faceIndexAboveAdditionalFixedRegion.begin(); itrFace != m_faceIndexAboveAdditionalFixedRegion.end(); ++itrFace ){ vtkFile << *itrFace << std::endl; } vtkFile << "POINT_DATA " << m_numNodes << std::endl; vtkFile << "SCALARS NodeID int" << std::endl; vtkFile << "LOOKUP_TABLE default" << std::endl; for( std::map<int,int>::const_iterator itr = nodeIDLocal2Global.begin(); itr != nodeIDLocal2Global.end(); ++itr ){ vtkFile << itr->second << std::endl; } vtkFile.close(); } #endif
32.149338
227
0.656553
yoshiya-usui
dc76a32955e0a8b0f3fa9d5e5e79b88305f97136
3,898
cc
C++
libqpdf/SF_FlateLzwDecode.cc
m-holger/qpdf
f1a9ba0c622deee0ed05004949b34f0126b12b6a
[ "Apache-2.0" ]
null
null
null
libqpdf/SF_FlateLzwDecode.cc
m-holger/qpdf
f1a9ba0c622deee0ed05004949b34f0126b12b6a
[ "Apache-2.0" ]
3
2021-11-19T15:59:21.000Z
2021-12-10T20:44:33.000Z
libqpdf/SF_FlateLzwDecode.cc
m-holger/qpdf
f1a9ba0c622deee0ed05004949b34f0126b12b6a
[ "Apache-2.0" ]
null
null
null
#include <qpdf/SF_FlateLzwDecode.hh> #include <qpdf/Pl_Flate.hh> #include <qpdf/Pl_LZWDecoder.hh> #include <qpdf/Pl_PNGFilter.hh> #include <qpdf/Pl_TIFFPredictor.hh> #include <qpdf/QIntC.hh> #include <qpdf/QTC.hh> SF_FlateLzwDecode::SF_FlateLzwDecode(bool lzw) : lzw(lzw), // Initialize values to their defaults as per the PDF spec predictor(1), columns(0), colors(1), bits_per_component(8), early_code_change(true) { } bool SF_FlateLzwDecode::setDecodeParms(QPDFObjectHandle decode_parms) { if (decode_parms.isNull()) { return true; } bool filterable = true; std::set<std::string> keys = decode_parms.getKeys(); for (auto const& key: keys) { QPDFObjectHandle value = decode_parms.getKey(key); if (key == "/Predictor") { if (value.isInteger()) { this->predictor = value.getIntValueAsInt(); if (!((this->predictor == 1) || (this->predictor == 2) || ((this->predictor >= 10) && (this->predictor <= 15)))) { filterable = false; } } else { filterable = false; } } else if ( (key == "/Columns") || (key == "/Colors") || (key == "/BitsPerComponent")) { if (value.isInteger()) { int val = value.getIntValueAsInt(); if (key == "/Columns") { this->columns = val; } else if (key == "/Colors") { this->colors = val; } else if (key == "/BitsPerComponent") { this->bits_per_component = val; } } else { filterable = false; } } else if (lzw && (key == "/EarlyChange")) { if (value.isInteger()) { int earlychange = value.getIntValueAsInt(); this->early_code_change = (earlychange == 1); if (!((earlychange == 0) || (earlychange == 1))) { filterable = false; } } else { filterable = false; } } } if ((this->predictor > 1) && (this->columns == 0)) { filterable = false; } return filterable; } Pipeline* SF_FlateLzwDecode::getDecodePipeline(Pipeline* next) { std::shared_ptr<Pipeline> pipeline; if ((this->predictor >= 10) && (this->predictor <= 15)) { QTC::TC("qpdf", "SF_FlateLzwDecode PNG filter"); pipeline = std::make_shared<Pl_PNGFilter>( "png decode", next, Pl_PNGFilter::a_decode, QIntC::to_uint(this->columns), QIntC::to_uint(this->colors), QIntC::to_uint(this->bits_per_component)); this->pipelines.push_back(pipeline); next = pipeline.get(); } else if (this->predictor == 2) { QTC::TC("qpdf", "SF_FlateLzwDecode TIFF predictor"); pipeline = std::make_shared<Pl_TIFFPredictor>( "tiff decode", next, Pl_TIFFPredictor::a_decode, QIntC::to_uint(this->columns), QIntC::to_uint(this->colors), QIntC::to_uint(this->bits_per_component)); this->pipelines.push_back(pipeline); next = pipeline.get(); } if (lzw) { pipeline = std::make_shared<Pl_LZWDecoder>( "lzw decode", next, early_code_change); } else { pipeline = std::make_shared<Pl_Flate>( "stream inflate", next, Pl_Flate::a_inflate); } this->pipelines.push_back(pipeline); return pipeline.get(); } std::shared_ptr<QPDFStreamFilter> SF_FlateLzwDecode::flate_factory() { return std::make_shared<SF_FlateLzwDecode>(false); } std::shared_ptr<QPDFStreamFilter> SF_FlateLzwDecode::lzw_factory() { return std::make_shared<SF_FlateLzwDecode>(true); }
30.692913
78
0.54156
m-holger
dc77b17128099c39402ad53daaf4c9408540af2c
2,242
cpp
C++
src/ngfx/porting/vulkan/VKDescriptorSetLayoutCache.cpp
kamranrad1993/ngfx
eeef60e3419a88371a97e8bc3109d2b35b82cc89
[ "Apache-2.0", "MIT-0", "MIT" ]
12
2021-04-03T16:50:22.000Z
2022-03-18T07:14:14.000Z
src/ngfx/porting/vulkan/VKDescriptorSetLayoutCache.cpp
kamranrad1993/ngfx
eeef60e3419a88371a97e8bc3109d2b35b82cc89
[ "Apache-2.0", "MIT-0", "MIT" ]
6
2021-05-06T21:02:19.000Z
2022-02-14T11:57:27.000Z
src/ngfx/porting/vulkan/VKDescriptorSetLayoutCache.cpp
kamranrad1993/ngfx
eeef60e3419a88371a97e8bc3109d2b35b82cc89
[ "Apache-2.0", "MIT-0", "MIT" ]
5
2021-06-11T20:15:37.000Z
2022-03-18T07:14:21.000Z
/* * Copyright 2020 GoPro Inc. * * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #include "ngfx/porting/vulkan/VKDescriptorSetLayoutCache.h" #include "ngfx/porting/vulkan/VKDebugUtil.h" using namespace ngfx; void VKDescriptorSetLayoutCache::create(VkDevice device) { this->device = device; initDescriptorSetLayout(VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER); initDescriptorSetLayout(VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER); initDescriptorSetLayout(VK_DESCRIPTOR_TYPE_STORAGE_IMAGE); initDescriptorSetLayout(VK_DESCRIPTOR_TYPE_STORAGE_BUFFER); } VKDescriptorSetLayoutCache::~VKDescriptorSetLayoutCache() { for (const auto &it : cache) { VK_TRACE(vkDestroyDescriptorSetLayout(device, it.second.layout, nullptr)); } } VkDescriptorSetLayout VKDescriptorSetLayoutCache::get(VkDescriptorType type, VkShaderStageFlags stageFlags) { return cache.at(type).layout; } void VKDescriptorSetLayoutCache::initDescriptorSetLayout( VkDescriptorType descriptorType) { VkResult vkResult; VKDescriptorSetLayoutData data; data.layoutBinding = {0, descriptorType, 1, VK_SHADER_STAGE_ALL, nullptr}; data.createInfo = {VK_STRUCTURE_TYPE_DESCRIPTOR_SET_LAYOUT_CREATE_INFO, nullptr, 0, 1, &data.layoutBinding}; V(vkCreateDescriptorSetLayout(device, &data.createInfo, nullptr, &data.layout)); cache[descriptorType] = std::move(data); }
40.035714
79
0.739518
kamranrad1993
dc799ad4bd4120e35fdc3585493978ce7d8b1cad
27,879
cpp
C++
CK2ToEU4/Source/EU4World/Country/Country.cpp
bavbeerhall/CK2ToEU4
a65edfb895b30e80af5bd7045dbfac7e2c5069e9
[ "MIT" ]
2
2020-04-25T15:14:10.000Z
2020-04-25T18:47:00.000Z
CK2ToEU4/Source/EU4World/Country/Country.cpp
bavbeerhall/CK2ToEU4
a65edfb895b30e80af5bd7045dbfac7e2c5069e9
[ "MIT" ]
null
null
null
CK2ToEU4/Source/EU4World/Country/Country.cpp
bavbeerhall/CK2ToEU4
a65edfb895b30e80af5bd7045dbfac7e2c5069e9
[ "MIT" ]
null
null
null
#include "Country.h" #include "../../CK2World/Characters/Character.h" #include "../../CK2World/Dynasties/Dynasty.h" #include "../../CK2World/Provinces/Province.h" #include "../../CK2World/Titles/Title.h" #include "../../Common/CommonFunctions.h" #include "../../Mappers/ColorScraper/ColorScraper.h" #include "../../Mappers/CultureMapper/CultureMapper.h" #include "../../Mappers/GovernmentsMapper/GovernmentsMapper.h" #include "../../Mappers/ProvinceMapper/ProvinceMapper.h" #include "../../Mappers/ReligionMapper/ReligionMapper.h" #include "../../Mappers/RulerPersonalitiesMapper/RulerPersonalitiesMapper.h" #include "../Province/EU4Province.h" #include "Log.h" #include <cmath> EU4::Country::Country(std::string theTag, const std::string& filePath): tag(std::move(theTag)) { // Load from a country file, if one exists. Otherwise rely on defaults. const auto startPos = filePath.find("/countries"); commonCountryFile = filePath.substr(startPos + 1, filePath.length() - startPos); details = CountryDetails(filePath); // We also must set a dummy history filepath for those countries that don't actually have a history file. const auto lastslash = filePath.find_last_of('/'); const auto rawname = filePath.substr(lastslash + 1, filePath.length()); historyCountryFile = "history/countries/" + tag + " - " + rawname; } void EU4::Country::loadHistory(const std::string& filePath) { const auto startPos = filePath.find("/history"); historyCountryFile = filePath.substr(startPos + 1, filePath.length() - startPos); details.parseHistory(filePath); } void EU4::Country::initializeFromTitle(std::string theTag, std::shared_ptr<CK2::Title> theTitle, const mappers::GovernmentsMapper& governmentsMapper, const mappers::ReligionMapper& religionMapper, const mappers::CultureMapper& cultureMapper, const mappers::ProvinceMapper& provinceMapper, const mappers::ColorScraper& colorScraper, const mappers::LocalizationMapper& localizationMapper, const mappers::RulerPersonalitiesMapper& rulerPersonalitiesMapper, date theConversionDate) { tag = std::move(theTag); conversionDate = theConversionDate; title.first = theTitle->getName(); title.second = std::move(theTitle); if (commonCountryFile.empty()) commonCountryFile = "countries/" + title.first + ".txt"; if (historyCountryFile.empty()) historyCountryFile = "history/countries/" + tag + " - " + title.first + ".txt"; const auto& actualHolder = title.second->getHolder().second; if (actualHolder->getDynasty().first) details.dynastyID = actualHolder->getDynasty().first; // --------------- History section details.government.clear(); details.reforms.clear(); const auto& newGovernment = governmentsMapper.matchGovernment(actualHolder->getGovernment(), title.first); if (newGovernment) { details.government = newGovernment->first; if (!newGovernment->second.empty()) details.reforms.insert(newGovernment->second); } else { Log(LogLevel::Warning) << "No government match for " << actualHolder->getGovernment() << " for title: " << title.first << ", defaulting to monarchy."; details.government = "monarchy"; } if (title.second->getSuccessionLaw() == "feudal_elective" && tag != "ROM" && tag != "HRE" && tag != "BYZ") { details.reforms = {"elective_monarchy"}; } if (title.first.find("e_") == 0) details.governmentRank = 3; else if (title.first.find("k_") == 0) details.governmentRank = 2; else details.governmentRank = 1; // do we have a religion? std::string baseReligion; if (!actualHolder->getReligion().empty()) baseReligion = actualHolder->getReligion(); else baseReligion = actualHolder->getCapitalProvince().second->getReligion(); const auto& religionMatch = religionMapper.getEu4ReligionForCk2Religion(baseReligion); if (religionMatch) details.religion = *religionMatch; else { // We failed to get a religion. This is not an issue. We'll set it later from the majority of owned provinces. details.religion.clear(); } const auto& capitalMatch = provinceMapper.getEU4ProvinceNumbers(actualHolder->getCapitalProvince().first); if (!capitalMatch.empty()) details.capital = *capitalMatch.begin(); else details.capital = 0; // We will see warning about this earlier, no need for more spam. // do we have a culture? std::string baseCulture; if (!actualHolder->getCulture().empty()) baseCulture = actualHolder->getCulture(); else baseCulture = actualHolder->getCapitalProvince().second->getCulture(); const auto& cultureMatch = cultureMapper.cultureMatch(baseCulture, details.religion, details.capital, tag); if (cultureMatch) details.primaryCulture = *cultureMatch; else { // We failed to get a primaryCulture. This is not an issue. We'll set it later from the majority of owned provinces. details.primaryCulture.clear(); } if (!details.primaryCulture.empty()) { const auto& techMatch = cultureMapper.getTechGroup(details.primaryCulture); if (techMatch) details.technologyGroup = *techMatch; } // We will set it later if primaryCulture is unavailable at this stage. if (title.first.find("c_") == 0) details.fixedCapital = true; else details.fixedCapital = false; if (details.reforms.count("merchants_reform")) details.mercantilism = 25; // simulates merchant power of merchant republics. else details.mercantilism = 0; // Unit type should automatically match tech group. If not we'll add logic for it here. details.unitType.clear(); // religious_school can be picked by player at leisure. details.religiousSchool.clear(); // ditto for cults details.cults.clear(); // We fill accepted cultures later, manually, once we can do a provincial census details.acceptedCultures.clear(); if (details.reforms.count("monastic_order_reform")) details.armyProfessionalism = 0.05; else details.armyProfessionalism = 0; // We don't do historical rivalries or friendships at this stage. details.historicalRivals.clear(); details.historicalFriends.clear(); // We don't do national focus at this stage. details.nationalFocus.clear(); // Piety is related to religious_school, which we don't set. details.piety = 0; // HRE Electorate is set later, once we can do a province/dev check. details.elector = false; if (title.second->isHREEmperor()) details.holyRomanEmperor = true; if (title.second->isInHRE()) details.inHRE = true; // ditto for secondary_religion and harmonized religions. details.secondaryReligion.clear(); details.harmonizedReligions.clear(); details.historicalScore = 0; // Not sure about this. // -------------- Common section if (!details.primaryCulture.empty()) { const auto& gfxmatch = cultureMapper.getGFX(details.primaryCulture); if (gfxmatch) details.graphicalCulture = *gfxmatch; else { Log(LogLevel::Warning) << tag << ": No gfx match for: " << details.primaryCulture << "! Substituting westerngfx!"; details.graphicalCulture = "westerngfx"; } } // We will set it later if primaryCulture is unavailable at this stage. if (!details.color) { if (title.second->getColor()) details.color = title.second->getColor(); else { const auto& colorMatch = colorScraper.getColorForTitle(title.first); if (colorMatch) details.color = *colorMatch; else Log(LogLevel::Warning) << tag << ": No color defined for title " << title.first << "!"; } } // If we imported some revolutionary colors we'll keep them, otherwise we're ignoring this. // If we imported historical idea groups, keeping them, otherwise blank. details.randomChance = false; // random chance related to RNW, wo it has no effect here. // If we imported historical units, keeping them, otherwise blank. details.monarchNames.clear(); if (!title.second->getPreviousHolders().empty()) { for (const auto& previousHolder: title.second->getPreviousHolders()) { const auto& blockItr = details.monarchNames.find(previousHolder.second->getName()); if (blockItr != details.monarchNames.end()) blockItr->second.first++; else { auto female = previousHolder.second->isFemale(); auto chance = 10; if (female) chance = -1; std::pair<int, int> newBlock = std::pair(1, chance); details.monarchNames.insert(std::pair(previousHolder.second->getName(), newBlock)); } } } if (!title.second->getHolder().second->getCourtierNames().empty()) { for (const auto& courtier: title.second->getHolder().second->getCourtierNames()) { const auto& blockItr = details.monarchNames.find(courtier.first); if (blockItr == details.monarchNames.end()) { auto female = !courtier.second; auto chance = 0; if (female) chance = -1; std::pair<int, int> newBlock = std::pair(0, chance); details.monarchNames.insert(std::pair(courtier.first, newBlock)); } } } // If we imported leader_names, keeping them, otherwise blank. // If we imported ship_names, keeping them, otherwise blank. // If we imported army_names, keeping them, otherwise blank. // If we imported fleet_names, keeping them, otherwise blank. // If we imported preferred_religion, keeping it, otherwise blank. // If we imported colonial_parent, keeping it, otherwise blank. // If we imported special_unit_culture, keeping it, otherwise blank. // If we imported all_your_core_are_belong_to_us, keeping it, otherwise blank. // If we imported right_to_bear_arms, keeping it, otherwise blank. // -------------- Misc if (actualHolder->getWealth()) details.addTreasury = lround(7 * log2(actualHolder->getWealth())); if (actualHolder->getPrestige()) details.addPrestige = -50 + std::max(-50, static_cast<int>(lround(15 * log2(actualHolder->getPrestige() - 100) - 50))); if (actualHolder->hasLoan()) details.loan = true; if (actualHolder->isExcommunicated()) details.excommunicated = true; auto nameSet = false; // Override for muslims kingdoms/empires. std::set<std::string> muslimReligions = {"sunni", "zikri", "yazidi", "ibadi", "kharijite", "shiite", "druze", "hurufi"}; if (muslimReligions.count(details.religion) && actualHolder->getDynasty().first && !actualHolder->getDynasty().second->getName().empty() && title.first != "k_rum" && title.first != "k_israel" && title.first != "e_india" && (title.first.find("e_") == 0 || title.first.find("k_") == 0)) { const auto& dynastyName = actualHolder->getDynasty().second->getName(); mappers::LocBlock newblock; newblock.english = dynastyName; newblock.spanish = dynastyName; newblock.french = dynastyName; newblock.german = dynastyName; localizations.insert(std::pair(tag, newblock)); nameSet = true; } if (!nameSet && !title.second->getDisplayName().empty()) { mappers::LocBlock newblock; newblock.english = title.second->getDisplayName(); newblock.spanish = title.second->getDisplayName(); newblock.french = title.second->getDisplayName(); newblock.german = title.second->getDisplayName(); localizations.insert(std::pair(tag, newblock)); nameSet = true; } if (!nameSet) { auto nameLocalizationMatch = localizationMapper.getLocBlockForKey(title.first); if (nameLocalizationMatch) { localizations.insert(std::pair(tag, *nameLocalizationMatch)); nameSet = true; } } if (!nameSet && !title.second->getBaseTitle().first.empty()) { // see if we can match vs base title. auto baseTitleName = title.second->getBaseTitle().first; auto nameLocalizationMatch = localizationMapper.getLocBlockForKey(baseTitleName); if (nameLocalizationMatch) { localizations.insert(std::pair(tag, *nameLocalizationMatch)); nameSet = true; } } if (!nameSet) { // Now get creative. This happens for c_titles that have localizations as b_title auto alternateName = title.second->getName(); alternateName = "b_" + alternateName.substr(2, alternateName.length()); auto nameLocalizationMatch = localizationMapper.getLocBlockForKey(alternateName); if (nameLocalizationMatch) { localizations.insert(std::pair(tag, *nameLocalizationMatch)); nameSet = true; } } if (!nameSet) { // using capital province name? auto capitalName = actualHolder->getCapitalProvince().second->getName(); if (!capitalName.empty()) { mappers::LocBlock newblock; newblock.english = capitalName; newblock.spanish = capitalName; newblock.french = capitalName; newblock.german = capitalName; localizations.insert(std::pair(tag, newblock)); nameSet = true; } } // giving up. if (!nameSet) Log(LogLevel::Warning) << tag << " help with localization! " << title.first; auto adjSet = false; if (muslimReligions.count(details.religion) && actualHolder->getDynasty().first && !actualHolder->getDynasty().second->getName().empty() && title.first != "k_rum" && title.first != "k_israel" && title.first != "e_india" && (title.first.find("e_") == 0 || title.first.find("k_") == 0)) { const auto& dynastyName = actualHolder->getDynasty().second->getName(); mappers::LocBlock newblock; newblock.english = dynastyName + "s'"; // plural so Ottomans' Africa newblock.spanish = "de los " + dynastyName; newblock.french = "des " + dynastyName; newblock.german = dynastyName + "-"; localizations.insert(std::pair(tag + "_ADJ", newblock)); adjSet = true; } if (!adjSet && !title.second->getDisplayName().empty()) { mappers::LocBlock newblock; newblock.english = title.second->getDisplayName() + "'s"; // singular Nordarike's Africa newblock.spanish = "de " + title.second->getDisplayName(); newblock.french = "de " + title.second->getDisplayName(); newblock.german = title.second->getDisplayName() + "s"; localizations.insert(std::pair(tag + "_ADJ", newblock)); adjSet = true; } if (!adjSet) { auto adjLocalizationMatch = localizationMapper.getLocBlockForKey(title.first + "_adj"); if (adjLocalizationMatch) { localizations.insert(std::pair(tag + "_ADJ", *adjLocalizationMatch)); adjSet = true; } } if (!adjSet && !title.second->getBaseTitle().first.empty()) { // see if we can match vs base title. auto baseTitleAdj = title.second->getBaseTitle().first + "_adj"; auto adjLocalizationMatch = localizationMapper.getLocBlockForKey(baseTitleAdj); if (adjLocalizationMatch) { localizations.insert(std::pair(tag + "_ADJ", *adjLocalizationMatch)); adjSet = true; } if (!adjSet && !title.second->getBaseTitle().second->getBaseTitle().first.empty()) { // maybe basetitlebasetitle? baseTitleAdj = title.second->getBaseTitle().second->getBaseTitle().first + "_adj"; adjLocalizationMatch = localizationMapper.getLocBlockForKey(baseTitleAdj); if (adjLocalizationMatch) { localizations.insert(std::pair(tag + "_ADJ", *adjLocalizationMatch)); adjSet = true; } } } if (!adjSet) { // Maybe c_something? auto alternateAdj = title.second->getName() + "_adj"; alternateAdj = "c_" + alternateAdj.substr(2, alternateAdj.length()); auto adjLocalizationMatch = localizationMapper.getLocBlockForKey(alternateAdj); if (adjLocalizationMatch) { localizations.insert(std::pair(tag, *adjLocalizationMatch)); adjSet = true; } } if (!adjSet) { // Or d_something? auto alternateAdj = title.second->getName() + "_adj"; alternateAdj = "d_" + alternateAdj.substr(2, alternateAdj.length()); auto adjLocalizationMatch = localizationMapper.getLocBlockForKey(alternateAdj); if (adjLocalizationMatch) { localizations.insert(std::pair(tag, *adjLocalizationMatch)); adjSet = true; } } if (!adjSet) Log(LogLevel::Warning) << tag << " help with localization for adjective! " << title.first << "_adj?"; // Rulers initializeRulers(religionMapper, cultureMapper, rulerPersonalitiesMapper); } bool EU4::Country::verifyCapital(const mappers::ProvinceMapper& provinceMapper) { // We have set a provisionary capital earlier, but now we can check if it's valid. if (title.first.empty()) return false; if (provinces.empty()) return false; if (details.capital && provinces.count(details.capital)) return false; const auto& actualHolder = title.second->getHolder().second; const auto& capitalMatch = provinceMapper.getEU4ProvinceNumbers(actualHolder->getCapitalProvince().first); if (!capitalMatch.empty()) { for (const auto& provinceID: capitalMatch) { if (provinces.count(provinceID)) { details.capital = provinceID; return true; } } } // Use any other province. details.capital = provinces.begin()->second->getProvinceID(); return true; } void EU4::Country::initializeAdvisers(const mappers::ReligionMapper& religionMapper, const mappers::CultureMapper& cultureMapper) { // We're doing this one separate from initial country generation so that country's primary culture and religion may have had time to get // initialized. if (title.first.empty() || !title.second->getHolder().first) return; // Vanilla and the dead do not get these. const auto& holder = title.second->getHolder().second; if (!holder->getPrimaryTitle().first.empty() && title.first != holder->getPrimaryTitle().first) return; // PU's don't get advisors on secondary countries. for (const auto& adviser: holder->getAdvisers()) { if (adviser.second->isSpent()) continue; Character newAdviser; newAdviser.name = adviser.second->getName(); if (adviser.second->getDynasty().first) newAdviser.name += " " + adviser.second->getDynasty().second->getName(); if (details.capital) newAdviser.location = details.capital; if (adviser.second->getJob() == "job_spiritual") { newAdviser.type = "theologian"; newAdviser.skill = std::min(3, std::max(1, adviser.second->getSkills().learning / 4)); } else if (adviser.second->getJob() == "job_marshal") { newAdviser.type = "army_organiser"; newAdviser.skill = std::min(3, std::max(1, adviser.second->getSkills().martial / 4)); } else if (adviser.second->getJob() == "job_spymaster") { newAdviser.type = "spymaster"; newAdviser.skill = std::min(3, std::max(1, adviser.second->getSkills().intrigue / 4)); } else if (adviser.second->getJob() == "job_treasurer") { newAdviser.type = "treasurer"; newAdviser.skill = std::min(3, std::max(1, adviser.second->getSkills().intrigue / 4)); } else if (adviser.second->getJob() == "job_chancellor") { newAdviser.type = "statesman"; newAdviser.skill = std::min(3, std::max(1, adviser.second->getSkills().diplomacy / 4)); } else { Log(LogLevel::Warning) << "Unrecognized job for " << adviser.first << ": " << adviser.second->getJob(); continue; } newAdviser.id = adviser.first; newAdviser.appearDate = adviser.second->getBirthDate(); newAdviser.appearDate.subtractYears(-16); newAdviser.deathDate = adviser.second->getBirthDate(); newAdviser.deathDate.subtractYears(-65); newAdviser.female = adviser.second->isFemale(); if (adviser.second->getReligion().empty()) newAdviser.religion = details.monarch.religion; // taking a shortcut. else { const auto& religionMatch = religionMapper.getEu4ReligionForCk2Religion(adviser.second->getReligion()); if (religionMatch) newAdviser.religion = *religionMatch; } if (newAdviser.religion.empty()) continue; if (adviser.second->getCulture().empty()) newAdviser.culture = details.monarch.culture; // taking a shortcut. else { const auto& cultureMatch = cultureMapper.cultureMatch(adviser.second->getCulture(), newAdviser.religion, 0, tag); if (cultureMatch) newAdviser.culture = *cultureMatch; } if (newAdviser.culture.empty()) continue; if (newAdviser.religion == "jewish") newAdviser.discount = true; // Tradeoff for not being promotable. details.advisers.emplace_back(newAdviser); adviser.second->setSpent(); } } void EU4::Country::initializeRulers(const mappers::ReligionMapper& religionMapper, const mappers::CultureMapper& cultureMapper, const mappers::RulerPersonalitiesMapper& rulerPersonalitiesMapper) { const auto& holder = title.second->getHolder().second; // Are we the ruler's primary title? (if he has any) if (!holder->getPrimaryTitle().first.empty() && title.first != holder->getPrimaryTitle().first) return; // PU's don't get monarchs. // Determine regnalness. if (details.government != "republic" && !details.monarchNames.empty()) { auto const& theName = holder->getName(); std::string roman; const auto& nameItr = details.monarchNames.find(theName); if (nameItr != details.monarchNames.end()) { const auto regnal = nameItr->second.first; if (regnal > 1) { roman = cardinalToRoman(regnal); roman = " " + roman; } } details.monarch.name = holder->getName() + roman; } else { details.monarch.name = holder->getName(); } if (holder->getDynasty().first) details.monarch.dynasty = holder->getDynasty().second->getName(); details.monarch.adm = std::min((holder->getSkills().stewardship + holder->getSkills().learning) / 4, 6); details.monarch.dip = std::min((holder->getSkills().diplomacy + holder->getSkills().intrigue) / 4, 6); details.monarch.mil = std::min((holder->getSkills().martial + holder->getSkills().learning) / 4, 6); details.monarch.birthDate = holder->getBirthDate(); details.monarch.female = holder->isFemale(); // religion and culture were already determining our country's primary culture and religion. If we set there, we'll copy here. if (!details.primaryCulture.empty()) details.monarch.culture = details.primaryCulture; if (!details.religion.empty()) details.monarch.religion = details.religion; details.monarch.personalities = rulerPersonalitiesMapper.evaluatePersonalities(title.second->getHolder()); details.monarch.isSet = true; if (!holder->getSpouses().empty()) { // What's the first spouse that's still alive? for (const auto& spouse: holder->getSpouses()) { if (spouse.second->getDeathDate() != date("1.1.1")) continue; // She's dead. details.queen.name = spouse.second->getName(); if (spouse.second->getDynasty().first) details.queen.dynasty = spouse.second->getDynasty().second->getName(); details.queen.adm = std::min((spouse.second->getSkills().stewardship + spouse.second->getSkills().learning) / 4, 6); details.queen.dip = std::min((spouse.second->getSkills().diplomacy + spouse.second->getSkills().intrigue) / 4, 6); details.queen.mil = std::min((spouse.second->getSkills().martial + spouse.second->getSkills().learning) / 4, 6); details.queen.birthDate = spouse.second->getBirthDate(); details.queen.female = spouse.second->isFemale(); if (spouse.second->getReligion().empty()) details.queen.religion = details.monarch.religion; // taking a shortcut. else { const auto& religionMatch = religionMapper.getEu4ReligionForCk2Religion(spouse.second->getReligion()); if (religionMatch) details.queen.religion = *religionMatch; } if (spouse.second->getCulture().empty()) details.queen.culture = details.monarch.culture; // taking a shortcut. else { const auto& cultureMatch = cultureMapper.cultureMatch(spouse.second->getCulture(), details.queen.religion, 0, tag); if (cultureMatch) details.queen.culture = *cultureMatch; } details.queen.originCountry = tag; details.queen.deathDate = details.queen.birthDate; details.queen.deathDate.subtractYears(-60); details.queen.personalities = rulerPersonalitiesMapper.evaluatePersonalities(spouse); details.queen.isSet = true; break; } } if (holder->getHeir().first) { const auto& heir = holder->getHeir(); details.heir.name = heir.second->getName(); // We're setting future regnalness if (details.government != "republic" && !details.monarchNames.empty()) { auto const& theName = heir.second->getName(); std::string roman; const auto& nameItr = details.monarchNames.find(theName); if (nameItr != details.monarchNames.end()) { const auto regnal = nameItr->second.first; if (regnal >= 1) { roman = cardinalToRoman(regnal + 1); roman = " " + roman; } } details.heir.monarchName = heir.second->getName() + roman; } if (heir.second->getDynasty().first) details.heir.dynasty = heir.second->getDynasty().second->getName(); details.heir.adm = std::min((heir.second->getSkills().stewardship + heir.second->getSkills().learning) / 3, 6); details.heir.dip = std::min((heir.second->getSkills().diplomacy + heir.second->getSkills().intrigue) / 3, 6); details.heir.mil = std::min((heir.second->getSkills().martial + heir.second->getSkills().learning) / 3, 6); details.heir.birthDate = heir.second->getBirthDate(); details.heir.female = heir.second->isFemale(); if (heir.second->getReligion().empty()) details.heir.religion = details.monarch.religion; // taking a shortcut. else { const auto& religionMatch = religionMapper.getEu4ReligionForCk2Religion(heir.second->getReligion()); if (religionMatch) details.heir.religion = *religionMatch; } if (heir.second->getCulture().empty()) details.heir.culture = details.monarch.culture; // taking a shortcut. else { const auto& cultureMatch = cultureMapper.cultureMatch(heir.second->getCulture(), details.heir.religion, 0, tag); if (cultureMatch) details.heir.culture = *cultureMatch; } details.heir.deathDate = details.heir.birthDate; details.heir.deathDate.subtractYears(-65); details.heir.claim = 89; // good enough? details.heir.personalities = rulerPersonalitiesMapper.evaluatePersonalities(heir); details.heir.isSet = true; } if (conversionDate.diffInYears(details.monarch.birthDate) < 16) { details.heir = details.monarch; details.heir.monarchName.clear(); details.heir.deathDate = details.heir.birthDate; details.heir.deathDate.subtractYears(-65); details.heir.claim = 89; // good enough? details.heir.adm = std::min(details.heir.adm + 2, 6); details.heir.mil = std::min(details.heir.mil + 2, 6); details.heir.dip = std::min(details.heir.dip + 2, 6); details.heir.personalities.clear(); details.monarch.name = "(Regency Council)"; details.monarch.regency = true; details.monarch.birthDate = date("1.1.1"); details.monarch.female = false; details.monarch.dynasty.clear(); details.monarch.personalities.clear(); } } void EU4::Country::setPrimaryCulture(const std::string& culture) { details.primaryCulture = culture; if (details.monarch.isSet && details.monarch.culture.empty()) details.monarch.culture = culture; if (details.queen.isSet && details.queen.culture.empty()) details.queen.culture = culture; if (details.heir.isSet && details.heir.culture.empty()) details.heir.culture = culture; } void EU4::Country::setReligion(const std::string& religion) { details.religion = religion; if (details.monarch.isSet && details.monarch.religion.empty()) details.monarch.religion = religion; if (details.queen.isSet && details.queen.religion.empty()) details.queen.religion = religion; if (details.heir.isSet && details.heir.religion.empty()) details.heir.religion = religion; } int EU4::Country::getDevelopment() const { auto dev = 0; for (const auto& province: provinces) dev += province.second->getDev(); return dev; } void EU4::Country::annexCountry(const std::pair<std::string, std::shared_ptr<Country>>& theCountry) { // Provinces const auto& targetProvinces = theCountry.second->getProvinces(); for (const auto& province: targetProvinces) { province.second->addCore(tag); // Adding, not replacing. province.second->setOwner(tag); province.second->setController(tag); provinces.insert(province); } theCountry.second->clearProvinces(); // Vassals const auto& targetVassals = theCountry.second->getTitle().second->getGeneratedVassals(); for (const auto& vassal: targetVassals) { vassal.second->registerGeneratedLiege(title); title.second->registerGeneratedVassal(vassal); } theCountry.second->getTitle().second->clearGeneratedVassals(); // Bricking the title -> eu4tag is not necessary and not desirable. As soon as the country has 0 provinces, it's effectively dead. }
37.930612
152
0.713225
bavbeerhall
dc80da7254804763fce455be71df9c82d3fa0116
9,775
cpp
C++
TurboX-Engine/TurboX-Engine/ModuleCamera3D.cpp
moon-funding/TurboX-Engine
0ebcc94f0c93fa0a5d1f88f8f46e90df28b5c8a6
[ "MIT", "Zlib", "Apache-2.0", "BSD-3-Clause" ]
null
null
null
TurboX-Engine/TurboX-Engine/ModuleCamera3D.cpp
moon-funding/TurboX-Engine
0ebcc94f0c93fa0a5d1f88f8f46e90df28b5c8a6
[ "MIT", "Zlib", "Apache-2.0", "BSD-3-Clause" ]
null
null
null
TurboX-Engine/TurboX-Engine/ModuleCamera3D.cpp
moon-funding/TurboX-Engine
0ebcc94f0c93fa0a5d1f88f8f46e90df28b5c8a6
[ "MIT", "Zlib", "Apache-2.0", "BSD-3-Clause" ]
null
null
null
#include "Globals.h" #include "Application.h" #include "ModuleCamera3D.h" #include "ModuleInput.h" #include "ModuleConsole.h" #include "ModuleScene.h" #include "ModuleEditor.h" #include "W_Hierarchy.h" #include "GameObject.h" #include "MathGeoLib/MathGeoLib.h" #include "ModuleRenderer3D.h" #include "Component.h" #include "Component_Camera.h" #include "Component_Mesh.h" #include "Component_Transformation.h" #include "ResourceMesh.h" ModuleCamera3D::ModuleCamera3D(Application* app, bool start_enabled) : Module(app, start_enabled) { name = "Camera"; X = { 1.0f,0.0f,0.0f }; Y = { 0.0f,1.0f,0.0f }; Z = { 0.0f,0.0f,1.0f }; Position = { 0.0f, 20.0f, 30.0f }; Reference = { 0.0f,0.0f,0.0f }; cameraLookingAtSelectedGameObject = false; camera = new C_Camera(Component::Type::Camera, nullptr); camera->active = false; } ModuleCamera3D::~ModuleCamera3D() {} // ----------------------------------------------------------------- bool ModuleCamera3D::Start() { MY_LOG("Setting up the camera"); bool ret = true; return ret; } // ----------------------------------------------------------------- bool ModuleCamera3D::CleanUp() { MY_LOG("Cleaning camera"); return true; } bool ModuleCamera3D::LoadSettings(Config* data) { cameraSpeed = data->GetFloat("cameraSpeed"); mouseSensitivity = data->GetFloat("mouseSensitivity"); wheelSensitivity = data->GetFloat("wheelSensitivity"); zoomDistance = data->GetFloat("zoomDistance"); return true; } bool ModuleCamera3D::SaveSettings(Config* data) const { data->AddFloat("cameraSpeed", cameraSpeed); data->AddFloat("mouseSensitivity", mouseSensitivity); data->AddFloat("wheelSensitivity", wheelSensitivity); data->AddFloat("zoomDistance", zoomDistance); return true; } void ModuleCamera3D::OnResize(int width, int height) { float newAR = (float)width / (float)height; camera->setAspectRatio(newAR); App->renderer3D->changedFOV = true; } // ----------------------------------------------------------------- update_status ModuleCamera3D::Update(float dt) { if (App->input->GetMouseButton(SDL_BUTTON_RIGHT) == KEY_REPEAT) { vec newPos(0, 0, 0); float speed = cameraSpeed * dt; if (App->input->GetKey(SDL_SCANCODE_LSHIFT) == KEY_REPEAT) speed *= 2; else if (App->input->GetKey(SDL_SCANCODE_LCTRL) == KEY_REPEAT) speed /= 2; if (App->input->GetKey(SDL_SCANCODE_E) == KEY_REPEAT) newPos.y += speed; if (App->input->GetKey(SDL_SCANCODE_Q) == KEY_REPEAT) newPos.y -= speed; if (App->input->GetKey(SDL_SCANCODE_W) == KEY_REPEAT) newPos += camera->frustum.front * speed; if (App->input->GetKey(SDL_SCANCODE_S) == KEY_REPEAT) newPos -= camera->frustum.front * speed; if (App->input->GetKey(SDL_SCANCODE_A) == KEY_REPEAT) newPos -= camera->frustum.WorldRight() * speed; if (App->input->GetKey(SDL_SCANCODE_D) == KEY_REPEAT) newPos += camera->frustum.WorldRight() * speed; Position += newPos; Reference += newPos; Reference = Position - GetMovementFactor(); } // Rotation over object ---------------- if (App->input->GetKey(SDL_SCANCODE_LALT) == KEY_REPEAT && App->input->GetMouseButton(SDL_BUTTON_LEFT) == KEY_REPEAT) { camera->frustum.pos = Position = Reference + GetMovementFactor(); } if (App->input->GetMouseButton(SDL_BUTTON_MIDDLE) == KEY_REPEAT) { vec newPos(0, 0, 0); int dx = -App->input->GetMouseXMotion(); int dy = -App->input->GetMouseYMotion(); if (dx != 0) { float DeltaX = (float)dx * mouseSensitivity; newPos += X * DeltaX; } if (dy != 0) { float DeltaY = (float)dy * mouseSensitivity; newPos -= Y * DeltaY; } Position += newPos; Reference += newPos; } if (App->input->GetMouseZ() != 0) { vec newPos(0, 0, 0); float Sensitivity = wheelSensitivity; vec vec_distance = Reference - Position; if (vec_distance.Length() < zoomDistance) { Sensitivity = vec_distance.Length() / zoomDistance; } if (App->input->GetKey(SDL_SCANCODE_LSHIFT) == KEY_REPEAT) Sensitivity = 2; if (App->input->GetMouseZ() > 0) { newPos -= Z * Sensitivity; } else { newPos += Z * Sensitivity; } Position += newPos; } if (App->input->GetKey(SDL_SCANCODE_F) == KEY_REPEAT) { LookAt({ 0,0,0 }); } camera->frustum.pos = Position; Z = -camera->frustum.front; Y = camera->frustum.up; X = camera->frustum.WorldRight(); if (App->input->GetMouseButton(SDL_BUTTON_LEFT) == KEY_DOWN && App->input->GetKey(SDL_SCANCODE_LALT) != KEY_REPEAT && (!ImGuizmo::IsEnabled() || !ImGuizmo::IsOver())) { App->scene->selectGameObject(CheckMousePick()); } return UPDATE_CONTINUE; } // ----------------------------------------------------------------- void ModuleCamera3D::Look(const vec& Position, const vec& Reference, bool RotateAroundReference) { this->Position = Position; this->Reference = Reference; Z = (Position - Reference).Normalized(); X = (vec(0.0f, 1.0f, 0.0f).Cross(Z)).Normalized(); Y = Z.Cross(X); if (!RotateAroundReference) { this->Reference = this->Position; this->Position += Z * 0.05f; } } // ----------------------------------------------------------------- void ModuleCamera3D::LookAt( const vec &Spot) { Reference = Spot; //calculate direction to look vec dir = Spot - camera->frustum.pos; //caluclate the new view matrix float3x3 viewMat = float3x3::LookAt(camera->frustum.front, dir.Normalized(), camera->frustum.up, vec(0.0f, 1.0f, 0.0f)); //set new front and up for the frustum camera->frustum.front = viewMat.MulDir(camera->frustum.front).Normalized(); camera->frustum.up = viewMat.MulDir(camera->frustum.up).Normalized(); } // ----------------------------------------------------------------- void ModuleCamera3D::Move(const vec &Movement) { Position += Movement; Reference += Movement; } void ModuleCamera3D::FitCamera(const AABB& boundingBox) { vec diagonal = boundingBox.Diagonal(); vec center = boundingBox.CenterPoint(); Position.z = camera->frustum.pos.z = (center.z + diagonal.Length()); Position.y = camera->frustum.pos.y = center.y; Position.x = camera->frustum.pos.x = center.x; LookAt({ center.x,center.y,center.z }); } vec ModuleCamera3D::GetMovementFactor() { int dx = -App->input->GetMouseXMotion(); int dy = -App->input->GetMouseYMotion(); vec newPosition = Position - Reference; if (dx != 0) { float DeltaX = (float)dx * mouseSensitivity; Quat rotation = Quat::RotateY(DeltaX); camera->frustum.front = rotation.Mul(camera->frustum.front).Normalized(); camera->frustum.up = rotation.Mul(camera->frustum.up).Normalized(); } if (dy != 0) { float DeltaY = (float)dy * mouseSensitivity; Quat rotation = Quat::RotateAxisAngle(camera->frustum.WorldRight(), DeltaY); if (rotation.Mul(camera->frustum.up).Normalized().y > 0.0f) { camera->frustum.up = rotation.Mul(camera->frustum.up).Normalized(); camera->frustum.front = rotation.Mul(camera->frustum.front).Normalized(); } } return -camera->frustum.front * newPosition.Length(); } GameObject* ModuleCamera3D::CheckMousePick() { GameObject* ret = nullptr; float mouseX = App->input->GetMouseX() - App->editor->sceneX; float mouseY = App->input->GetMouseY() - App->editor->sceneY; mouseX = (mouseX / (App->editor->sceneW / 2)) - 1; mouseY = (mouseY / (App->editor->sceneH / 2)) - 1; LineSegment ray = camera->frustum.UnProjectLineSegment(mouseX, -mouseY); App->renderer3D->clickA = ray.a; App->renderer3D->clickB = ray.b; //Fill queue std::priority_queue<HitGameObject*, std::vector<HitGameObject*>, OrderCrit> gameObjects; fillHitGameObjects(App->scene->root, gameObjects, ray); if (gameObjects.size() > 0) ret = checkCloserGameObjects(gameObjects, ray); return ret; } void ModuleCamera3D::fillHitGameObjects(GameObject* current, std::priority_queue<HitGameObject*, std::vector<HitGameObject*>, OrderCrit>& gameObjects, LineSegment ray) { float distance, exitDistance; if (ray.Intersects(current->boundingBox, distance, exitDistance)) { HitGameObject* hit = new HitGameObject(current, distance); gameObjects.push(hit); } for (std::vector<GameObject*>::iterator it_c = current->childs.begin(); it_c != current->childs.end(); it_c++) { fillHitGameObjects((*it_c), gameObjects, ray); } } GameObject* ModuleCamera3D::checkCloserGameObjects(std::priority_queue<HitGameObject*, std::vector<HitGameObject*>, OrderCrit>& queue, LineSegment ray, float distance) { GameObject* ret = nullptr; HitGameObject* curr = queue.top(); queue.pop(); float TriDistance = hitsTriangle(curr->GO, ray); if (TriDistance != -1 && (TriDistance < distance || distance == -1)) { distance = TriDistance; ret = curr->GO; } if (queue.size() > 0 && (queue.top()->distance < distance || distance == -1)) { GameObject* GO2 = checkCloserGameObjects(queue, ray, distance); if (GO2 != nullptr) ret = GO2; } RELEASE(curr); return ret; } float ModuleCamera3D::hitsTriangle(GameObject* gameObject, LineSegment ray) { float smallestDistance = -1.0f; C_Transform* transformation = (C_Transform*)gameObject->GetComponent(Component::Type::Transform); if (transformation != nullptr) ray.Transform(transformation->globalMatrix.Inverted()); C_Mesh* mesh = (C_Mesh*)gameObject->GetComponent(Component::Type::Mesh); if (mesh != nullptr) { uint* indices = mesh->GetResourceMesh()->index; float3* vertices = mesh->GetResourceMesh()->vertex; for (int i = 0; i < mesh->GetResourceMesh()->num_index;) { math::Triangle tri; tri.a = vertices[indices[i]]; ++i; tri.b = vertices[indices[i]]; ++i; tri.c = vertices[indices[i]]; ++i; float distance; float3 intPoint; bool hit = ray.Intersects(tri, &distance, &intPoint); if (distance > 0 && (distance < smallestDistance || smallestDistance == -1.0f)) { smallestDistance = distance; } } } return smallestDistance; }
26.854396
167
0.664041
moon-funding
dc84567633603b84e46cb221af36c2dc63a877b5
5,535
cc
C++
src/libmodelbox/engine/single_node.cc
fujl/modelbox
390541a87318bb6f8a37163668b439e5387f5d9a
[ "Apache-2.0" ]
1
2021-12-16T06:53:00.000Z
2021-12-16T06:53:00.000Z
src/libmodelbox/engine/single_node.cc
fujl/modelbox
390541a87318bb6f8a37163668b439e5387f5d9a
[ "Apache-2.0" ]
null
null
null
src/libmodelbox/engine/single_node.cc
fujl/modelbox
390541a87318bb6f8a37163668b439e5387f5d9a
[ "Apache-2.0" ]
1
2021-12-03T06:19:09.000Z
2021-12-03T06:19:09.000Z
/* * Copyright 2021 The Modelbox Project Authors. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "modelbox/single_node.h" namespace modelbox { #define DEFAULT_QUEUE_SIZE 8192 SingleNode::SingleNode(const std::string& unit_name, const std::string& unit_type, const std::string& unit_device_id, std::shared_ptr<FlowUnitManager> flowunit_mgr, std::shared_ptr<Configuration> config, std::shared_ptr<Profiler> profiler, std::shared_ptr<StatisticsItem> graph_stats) : config_(config) { SetFlowUnitInfo(unit_name, unit_type, unit_device_id, flowunit_mgr); SetProfiler(profiler); SetStats(graph_stats); } Status SingleNode::Init() { flowunit_group_ = std::make_shared<FlowUnitGroup>( flowunit_name_, flowunit_type_, flowunit_device_id_, config_, profiler_); std::set<std::string> input_port_names; auto input_ports = flowunit_manager_->GetFlowUnitDesc(flowunit_type_, flowunit_name_) ->GetFlowUnitInput(); for (auto& input_port : input_ports) { auto input_port_name = input_port.GetPortName(); queue_size_ = config_->GetUint64("queue_size", DEFAULT_QUEUE_SIZE); if (0 == queue_size_) { return {STATUS_INVALID, "invalid queue_size config: 0"}; } auto in_queue_size = config_->GetUint64("queue_size_" + input_port_name, queue_size_); if (0 == in_queue_size) { return {STATUS_INVALID, "invalid queue_size_" + input_port_name + " config: 0"}; } input_ports_.emplace_back(std::make_shared<InPort>( input_port_name, std::dynamic_pointer_cast<NodeBase>(shared_from_this()), GetPriority(), in_queue_size)); } auto out_ports = flowunit_manager_->GetFlowUnitDesc(flowunit_type_, flowunit_name_) ->GetFlowUnitOutput(); for (auto& output_port : out_ports) { auto output_port_name = output_port.GetPortName(); output_ports_.emplace_back( std::make_shared<OutPort>(output_port_name, shared_from_this())); } std::set<std::string> input_ports_name, output_ports_name; auto status = flowunit_group_->Init(input_ports_name, output_ports_name, flowunit_manager_, false); if (status != STATUS_OK) { MBLOG_ERROR << "failed init flowunit group"; return status; } flowunit_group_->SetNode(std::dynamic_pointer_cast<Node>(shared_from_this())); return STATUS_OK; } std::shared_ptr<FlowUnitDataContext> SingleNode::CreateDataContext() { auto flowunit_desc = flowunit_manager_->GetFlowUnitDesc(flowunit_type_, flowunit_name_); if (flowunit_desc->GetFlowType() == NORMAL) { data_context_ = std::make_shared<NormalFlowUnitDataContext>(this, nullptr, nullptr); } else { MBLOG_ERROR << "flowunit type is stream, return null"; } return data_context_; } Status SingleNode::RecvData(const std::shared_ptr<DataHandler>& data) { auto input_ports = GetInputPorts(); auto data_map = std::make_shared<PortDataMap>(); for (auto& iter : input_ports) { auto name = iter->GetName(); if (input_ports.size() == 1) { name = DEFAULT_PORT_NAME; } auto bufferlist = data->GetBufferList(name); if (!bufferlist) { MBLOG_ERROR << "bufferlist is nullptr, RecvData error "; return STATUS_INVALID; } bufferlist->Swap(data_map->at(name)); } if (data_context_ == nullptr) { data_context_ = std::make_shared<NormalFlowUnitDataContext>(this, nullptr, nullptr); } auto data_ctx = std::static_pointer_cast<NormalFlowUnitDataContext>(data_context_); data_ctx->WriteInputData(data_map); return STATUS_OK; } Status SingleNode::Process() { if (!flowunit_group_) { MBLOG_ERROR << "flowunit_group not created . "; return STATUS_INVALID; } std::list<std::shared_ptr<FlowUnitDataContext>> data_ctx_list; data_ctx_list.push_back(data_context_); auto status = flowunit_group_->Run(data_ctx_list); if (status != STATUS_OK) { return STATUS_FAULT; } return STATUS_OK; } Status SingleNode::PushDataToDataHandler( std::shared_ptr<DataHandler>& data_handler) { if (data_context_ == nullptr || data_handler == nullptr) { return STATUS_INVALID; } PortDataMap port_data_map; data_context_->PopOutputData(port_data_map); if (port_data_map.size() == 0) { return STATUS_NODATA; } for (auto& iter : port_data_map) { std::string port_name = iter.first; for (auto buffer : iter.second) { data_handler->PushData(buffer, port_name); } } data_context_->ClearData(); return STATUS_OK; } void SingleNode::Run(const std::shared_ptr<DataHandler>& data) { auto status = RecvData(data); if (status != STATUS_OK) { MBLOG_ERROR << "failed recv data ..."; return; } status = Process(); if (status != STATUS_OK) { MBLOG_ERROR << "process data failed ..."; return; } } } // namespace modelbox
31.810345
80
0.688166
fujl
dc84d559c8a64a20a65233dc48bb5fd5b52e6985
3,819
inl
C++
include/QuickMaffs/Private/Polygon2.inl
PoetaKodu/quickmaffs
d74d514ff817f70a435609c95b5dec11feeff60e
[ "MIT" ]
2
2018-04-30T20:49:22.000Z
2019-01-13T13:30:58.000Z
include/QuickMaffs/Private/Polygon2.inl
PoetaKodu/quickmaffs
d74d514ff817f70a435609c95b5dec11feeff60e
[ "MIT" ]
null
null
null
include/QuickMaffs/Private/Polygon2.inl
PoetaKodu/quickmaffs
d74d514ff817f70a435609c95b5dec11feeff60e
[ "MIT" ]
null
null
null
// Note: this file is not meant to be included on its own. // Include "Polygon2.hpp" instead. namespace quickmaffs { //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> Polygon2<TValueType>::Polygon2(const ContainerType& points_) : m_points{ points_ } { } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> Polygon2<TValueType>::Polygon2(ContainerType&& points_) : m_points{ std::forward< ContainerType >(points_) } { } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> void Polygon2<TValueType>::setPointCount(typename ContainerType::size_type const size_) { m_points.resize(size_); } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> void Polygon2<TValueType>::setPoint(typename ContainerType::size_type const index_, VertexType const& value_) { m_points[index_] = value_; } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> void Polygon2<TValueType>::addPoint(VertexType const& value_) { m_points.push_back(value_); } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> typename Polygon2<TValueType>::ContainerType::size_type Polygon2<TValueType>::getPointCount() const { return m_points.size(); } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> typename Polygon2<TValueType>::ContainerType const& Polygon2< TValueType >::getPoints() const { return m_points; } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> Polygon2<TValueType> Polygon2<TValueType>::rectangle(ValueType const width_, ValueType const height_, bool const centered_) { if (centered_) { return Polygon2{ { { -width_ / ValueType(2), -height_ / ValueType(2) }, // top left { width_ / ValueType(2), -height_ / ValueType(2) }, // top right { width_ / ValueType(2), height_ / ValueType(2) }, // bottom right { -width_ / ValueType(2), height_ / ValueType(2) }, // bottom left } }; } else { return Polygon2{ { { ValueType(0), ValueType(0) }, // top left { width_, ValueType(0) }, // top right { width_, height_ }, // bottom right { ValueType(0), height_ }, // bottom left } }; } } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> Polygon2<TValueType> Polygon2<TValueType>::square(ValueType const size_, bool const centered_) { return Polygon2::rectangle(size_, size_, centered_); } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> Polygon2<TValueType> Polygon2<TValueType>::ellipse(ValueType const xRadius_, ValueType const yRadius_, std::size_t pointCount_) { pointCount_ = std::max(std::size_t(3), pointCount_); ContainerType points(pointCount_); for (std::size_t i = 0; i < pointCount_; ++i) { double const angleRad = convertToRadians(i * (360.0 / pointCount_)); points[i] = { static_cast< ValueType >(std::cos(angleRad) * xRadius_), static_cast< ValueType >(std::sin(angleRad) * yRadius_) }; } return Polygon2{ std::move(points) }; } //////////////////////////////////////////////////////////////////////////////////////// template <typename TValueType> Polygon2<TValueType> Polygon2<TValueType>::circle(ValueType const radius_, std::size_t pointCount_) { return Polygon2::ellipse(radius_, radius_, pointCount_); } }
32.364407
123
0.532076
PoetaKodu
dc85d12a88082faea4d1486df0d0715a8501c41e
6,731
cpp
C++
plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp
ikonovalova/trik-studio
f084274a7663bb7f341169ee029e46b6079c7274
[ "Apache-2.0" ]
null
null
null
plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp
ikonovalova/trik-studio
f084274a7663bb7f341169ee029e46b6079c7274
[ "Apache-2.0" ]
null
null
null
plugins/robots/common/twoDModel/src/engine/items/imageItem.cpp
ikonovalova/trik-studio
f084274a7663bb7f341169ee029e46b6079c7274
[ "Apache-2.0" ]
null
null
null
/* Copyright 2016-2018 CyberTech Labs Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include "imageItem.h" #include <QtGui/QPainter> #include <QtWidgets/QAction> #include <QtWidgets/QGraphicsSceneMouseEvent> #include <qrkernel/settingsManager.h> using namespace twoDModel::items; using namespace qReal; using namespace graphicsUtils; ImageItem::ImageItem(model::Image *image, const QRect &geometry) : mImage(image) { setX(0); setY(0); setX1(geometry.left()); setY1(geometry.top()); setX2(geometry.right()); setY2(geometry.bottom()); setBackgroundRole(false); unsetCursor(); } AbstractItem *ImageItem::clone() const { const auto cloned = new ImageItem(mImage, QRect(x1(), y1(), x2() - x1(), y2() - y1())); AbstractItem::copyTo(cloned); return cloned; } void ImageItem::drawExtractionForItem(QPainter* painter) { if (isSelected() || !isBackground()) { AbstractItem::drawExtractionForItem(painter); setPenBrushDriftRect(painter); painter->drawRect(calcNecessaryBoundingRect().toRect()); } } QPainterPath ImageItem::resizeArea() const { QRectF itemBoundingRect = calcNecessaryBoundingRect(); const qreal x1 = itemBoundingRect.left(); const qreal x2 = itemBoundingRect.right(); const qreal y1 = itemBoundingRect.top(); const qreal y2 = itemBoundingRect.bottom(); QPainterPath result; result.addRect(QRectF(x1, y1, resizeDrift, resizeDrift)); result.addRect(QRectF(x2 - resizeDrift, y2 - resizeDrift, resizeDrift, resizeDrift)); result.addRect(QRectF(x1, y2 - resizeDrift, resizeDrift, resizeDrift)); result.addRect(QRectF(x2 - resizeDrift, y1, resizeDrift, resizeDrift)); return result; } QAction *ImageItem::imageTool() { QAction * const result = new QAction(QIcon(":/icons/2d_image.svg"), tr("Image (I)"), nullptr); result->setShortcuts({QKeySequence(Qt::Key_I), QKeySequence(Qt::Key_0)}); result->setCheckable(false); return result; } QRectF ImageItem::boundingRect() const { return mImpl.boundingRect(x1(), y1(), x2(), y2(), drift); } QRectF ImageItem::calcNecessaryBoundingRect() const { return QRectF(qMin(x1(), x2()), qMin(y1(), y2()), qAbs(x2() - x1()), qAbs(y2() - y1())); } void ImageItem::drawItem(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option) Q_UNUSED(widget) const qreal zoom = scene()->views().isEmpty() ? 1.0 : scene()->views().first()->transform().m11(); mImage->draw(*painter, calcNecessaryBoundingRect().toRect(), zoom); } QPainterPath ImageItem::shape() const { QPainterPath result; result.addRect(calcNecessaryBoundingRect()); return result; } QDomElement ImageItem::serialize(QDomElement &parent) const { QDomElement imageNode = AbstractItem::serialize(parent); imageNode.setTagName("image"); // mImage.serialize(imageNode); imageNode.setAttribute("rect", QString("%1:%2:%3:%4").arg( QString::number(x1()) , QString::number(y1()) , QString::number(x2() - x1()) , QString::number(y2() - y1()))); imageNode.setAttribute("position", QString::number(x()) + ":" + QString::number(y())); imageNode.setAttribute("imageId", mImage->imageId()); imageNode.setAttribute("isBackground", mBackgroundRole ? "true" : "false"); return imageNode; } void ImageItem::deserialize(const QDomElement &element) { AbstractItem::deserialize(element); QRectF rect; if (element.hasAttribute("backgroundRect")) { rect = deserializeRect(element.attribute("backgroundRect")); setPos(0, 0); setBackgroundRole(true); } else { rect = deserializeRect(element.attribute("rect")); setPos(mImpl.deserializePoint(element.attribute("position"))); setBackgroundRole(element.attribute("isBackground", "false") == "true"); } setX1(rect.left()); setX2(rect.right()); setY1(rect.top()); setY2(rect.bottom()); } twoDModel::model::Image *ImageItem::image() const { return mImage; } bool ImageItem::memorizes() const { return !mImage->external(); } QString ImageItem::path() const { return mImage->path(); } void ImageItem::setMemorize(bool memorize) { mImage->setExternal(!memorize); emit internalImageChanged(); } void ImageItem::setPath(const QString &path) { mImage->setPath(path); update(); emit internalImageChanged(); } void ImageItem::setBackgroundRole(bool background) { mBackgroundRole = background; if (!isSelected()) { setFlag(ItemIsSelectable, !mBackgroundRole); } setZValue(background ? ZValue::Background : ZValue::Picture); } bool ImageItem::isBackground() const { return mBackgroundRole; } QVariant ImageItem::itemChange(QGraphicsItem::GraphicsItemChange change, const QVariant &value) { if (change == QGraphicsItem::ItemSelectedHasChanged) { emit selectedChanged(value.toBool()); if (!value.toBool() && isBackground()) { setFlag(ItemIsSelectable, false); unsetCursor(); } } return AbstractItem::itemChange(change, value); } void ImageItem::hoverMoveEvent(QGraphicsSceneHoverEvent *event) { if (isSelected() || !isBackground()) { if (resizeArea().contains(event->pos())) { setCursor(getResizeCursor()); } else { unsetCursor(); } // TODO: Why not AstractItem::hoverMoveEvent() QGraphicsItem::hoverMoveEvent(event); } } void ImageItem::mousePressEvent(QGraphicsSceneMouseEvent *event) { if (isSelected() || !isBackground()) { AbstractItem::mousePressEvent(event); } else { event->accept(); } } void ImageItem::mouseMoveEvent(QGraphicsSceneMouseEvent *event) { if (isSelected() || !isBackground()) { AbstractItem::mouseMoveEvent(event); } else { event->accept(); } } void ImageItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) { if (isSelected() || !isBackground()) { AbstractItem::mouseReleaseEvent(event); } else { event->accept(); } } void ImageItem::mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event) { if (isBackground()) { setFlag(ItemIsSelectable); } AbstractItem::mousePressEvent(event); } QRectF ImageItem::deserializeRect(const QString &string) const { const QStringList splittedStr = string.split(":"); if (splittedStr.count() == 4) { const auto x = splittedStr[0].toDouble(); const auto y = splittedStr[1].toDouble(); const auto w = splittedStr[2].toDouble(); const auto h = splittedStr[3].toDouble(); return QRectF(x, y, w, h); } return QRectF(); }
26.089147
100
0.720844
ikonovalova
dc8771f921307ba55361dfe808866e77417ec3d3
13,149
cpp
C++
tests/cpu/fileformats/FileFormatCDL_tests.cpp
rakoman/OpenColorIO
7ec3772ac7f3594584041261f362cd952b8b6acf
[ "BSD-3-Clause" ]
2
2015-01-23T09:26:29.000Z
2020-11-21T08:16:27.000Z
tests/cpu/fileformats/FileFormatCDL_tests.cpp
rakoman/OpenColorIO
7ec3772ac7f3594584041261f362cd952b8b6acf
[ "BSD-3-Clause" ]
2
2020-05-21T11:19:23.000Z
2020-05-21T11:26:09.000Z
tests/cpu/fileformats/FileFormatCDL_tests.cpp
rakoman/OpenColorIO
7ec3772ac7f3594584041261f362cd952b8b6acf
[ "BSD-3-Clause" ]
2
2021-08-04T22:07:38.000Z
2021-08-06T20:23:03.000Z
/* Copyright (c) 2014 Cinesite VFX Ltd, et al. All Rights Reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Sony Pictures Imageworks nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "fileformats/FileFormatCDL.cpp" #include "testutils/UnitTest.h" #include "UnitTestLogUtils.h" #include "UnitTestUtils.h" namespace OCIO = OCIO_NAMESPACE; namespace { OCIO::LocalCachedFileRcPtr LoadCDLFile(const std::string & fileName) { return OCIO::LoadTestFile<OCIO::LocalFileFormat, OCIO::LocalCachedFile>( fileName, std::ios_base::in); } } OCIO_ADD_TEST(FileFormatCDL, test_cdl) { // As a warning message is expected, please mute it. OCIO::MuteLogging mute; // CDL file const std::string fileName("cdl_test1.cdl"); OCIO::LocalCachedFileRcPtr cdlFile; OCIO_CHECK_NO_THROW(cdlFile = LoadCDLFile(fileName)); OCIO_REQUIRE_ASSERT(cdlFile); // Check that Descriptive element children of <ColorDecisionList> are preserved. OCIO_REQUIRE_EQUAL(cdlFile->metadata.getNumChildrenElements(), 4); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(0).getName()), "Description"); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(0).getValue()), "This is a color decision list example."); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(1).getName()), "InputDescription"); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(1).getValue()), "These should be applied in ACESproxy color space."); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(2).getName()), "ViewingDescription"); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(2).getValue()), "View using the ACES RRT+ODT transforms."); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(3).getName()), "Description"); OCIO_CHECK_EQUAL(std::string(cdlFile->metadata.getChildElement(3).getValue()), "It includes all possible description uses."); OCIO_CHECK_EQUAL(5, cdlFile->transformVec.size()); // Two of the five CDLs in the file don't have an id attribute and are not // included in the transformMap since it used the id as the key. OCIO_CHECK_EQUAL(3, cdlFile->transformMap.size()); { // Note: Descriptive elements that are children of <ColorDecision> are not preserved. std::string idStr(cdlFile->transformVec[0]->getID()); OCIO_CHECK_EQUAL("cc0001", idStr); // Check that Descriptive element children of <ColorCorrection> are preserved. auto & formatMetadata = cdlFile->transformVec[0]->getFormatMetadata(); OCIO_REQUIRE_EQUAL(formatMetadata.getNumChildrenElements(), 6); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(0).getName()), "Description"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(0).getValue()), "CC-level description 1"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(1).getName()), "InputDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(1).getValue()), "CC-level input description 1"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(2).getName()), "ViewingDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(2).getValue()), "CC-level viewing description 1"); // Check that Descriptive element children of SOPNode and SatNode are preserved. OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(3).getName()), "SOPDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(3).getValue()), "Example look"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(4).getName()), "SOPDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(4).getValue()), "For scenes 1 and 2"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(5).getName()), "SATDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(5).getValue()), "boosting sat"); double slope[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[0]->getSlope(slope)); OCIO_CHECK_EQUAL(1.0, slope[0]); OCIO_CHECK_EQUAL(1.0, slope[1]); OCIO_CHECK_EQUAL(0.9, slope[2]); double offset[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[0]->getOffset(offset)); OCIO_CHECK_EQUAL(-0.03, offset[0]); OCIO_CHECK_EQUAL(-0.02, offset[1]); OCIO_CHECK_EQUAL(0.0, offset[2]); double power[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[0]->getPower(power)); OCIO_CHECK_EQUAL(1.25, power[0]); OCIO_CHECK_EQUAL(1.0, power[1]); OCIO_CHECK_EQUAL(1.0, power[2]); OCIO_CHECK_EQUAL(1.7, cdlFile->transformVec[0]->getSat()); } { std::string idStr(cdlFile->transformVec[1]->getID()); OCIO_CHECK_EQUAL("cc0002", idStr); auto & formatMetadata = cdlFile->transformVec[1]->getFormatMetadata(); OCIO_REQUIRE_EQUAL(formatMetadata.getNumChildrenElements(), 6); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(0).getName()), "Description"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(0).getValue()), "CC-level description 2"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(1).getName()), "InputDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(1).getValue()), "CC-level input description 2"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(2).getName()), "ViewingDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(2).getValue()), "CC-level viewing description 2"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(3).getName()), "SOPDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(3).getValue()), "pastel"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(4).getName()), "SOPDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(4).getValue()), "another example"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(5).getName()), "SATDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(5).getValue()), "dropping sat"); double slope[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[1]->getSlope(slope)); OCIO_CHECK_EQUAL(0.9, slope[0]); OCIO_CHECK_EQUAL(0.7, slope[1]); OCIO_CHECK_EQUAL(0.6, slope[2]); double offset[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[1]->getOffset(offset)); OCIO_CHECK_EQUAL(0.1, offset[0]); OCIO_CHECK_EQUAL(0.1, offset[1]); OCIO_CHECK_EQUAL(0.1, offset[2]); double power[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[1]->getPower(power)); OCIO_CHECK_EQUAL(0.9, power[0]); OCIO_CHECK_EQUAL(0.9, power[1]); OCIO_CHECK_EQUAL(0.9, power[2]); OCIO_CHECK_EQUAL(0.7, cdlFile->transformVec[1]->getSat()); } { std::string idStr(cdlFile->transformVec[2]->getID()); OCIO_CHECK_EQUAL("cc0003", idStr); auto & formatMetadata = cdlFile->transformVec[2]->getFormatMetadata(); OCIO_REQUIRE_EQUAL(formatMetadata.getNumChildrenElements(), 6); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(0).getName()), "Description"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(0).getValue()), "CC-level description 3"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(1).getName()), "InputDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(1).getValue()), "CC-level input description 3"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(2).getName()), "ViewingDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(2).getValue()), "CC-level viewing description 3"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(3).getName()), "SOPDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(3).getValue()), "golden"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(4).getName()), "SATDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(4).getValue()), "no sat change"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(5).getName()), "SATDescription"); OCIO_CHECK_EQUAL(std::string(formatMetadata.getChildElement(5).getValue()), "sat==1"); double slope[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[2]->getSlope(slope)); OCIO_CHECK_EQUAL(1.2, slope[0]); OCIO_CHECK_EQUAL(1.1, slope[1]); OCIO_CHECK_EQUAL(1.0, slope[2]); double offset[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[2]->getOffset(offset)); OCIO_CHECK_EQUAL(0.0, offset[0]); OCIO_CHECK_EQUAL(0.0, offset[1]); OCIO_CHECK_EQUAL(0.0, offset[2]); double power[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[2]->getPower(power)); OCIO_CHECK_EQUAL(0.9, power[0]); OCIO_CHECK_EQUAL(1.0, power[1]); OCIO_CHECK_EQUAL(1.2, power[2]); OCIO_CHECK_EQUAL(1.0, cdlFile->transformVec[2]->getSat()); } { std::string idStr(cdlFile->transformVec[3]->getID()); OCIO_CHECK_EQUAL("", idStr); auto & formatMetadata = cdlFile->transformVec[3]->getFormatMetadata(); OCIO_CHECK_EQUAL(formatMetadata.getNumChildrenElements(), 0); double slope[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[3]->getSlope(slope)); OCIO_CHECK_EQUAL(1.2, slope[0]); OCIO_CHECK_EQUAL(1.1, slope[1]); OCIO_CHECK_EQUAL(1.0, slope[2]); double offset[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[3]->getOffset(offset)); OCIO_CHECK_EQUAL(0.0, offset[0]); OCIO_CHECK_EQUAL(0.0, offset[1]); OCIO_CHECK_EQUAL(0.0, offset[2]); double power[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[3]->getPower(power)); OCIO_CHECK_EQUAL(0.9, power[0]); OCIO_CHECK_EQUAL(1.0, power[1]); OCIO_CHECK_EQUAL(1.2, power[2]); // SatNode missing from XML, uses a default of 1.0. OCIO_CHECK_EQUAL(1.0, cdlFile->transformVec[3]->getSat()); } { std::string idStr(cdlFile->transformVec[4]->getID()); OCIO_CHECK_EQUAL("", idStr); auto & formatMetadata = cdlFile->transformVec[4]->getFormatMetadata(); OCIO_CHECK_EQUAL(formatMetadata.getNumChildrenElements(), 0); // SOPNode missing from XML, uses default values. double slope[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[4]->getSlope(slope)); OCIO_CHECK_EQUAL(1.0, slope[0]); OCIO_CHECK_EQUAL(1.0, slope[1]); OCIO_CHECK_EQUAL(1.0, slope[2]); double offset[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[4]->getOffset(offset)); OCIO_CHECK_EQUAL(0.0, offset[0]); OCIO_CHECK_EQUAL(0.0, offset[1]); OCIO_CHECK_EQUAL(0.0, offset[2]); double power[3] = { 0., 0., 0. }; OCIO_CHECK_NO_THROW(cdlFile->transformVec[4]->getPower(power)); OCIO_CHECK_EQUAL(1.0, power[0]); OCIO_CHECK_EQUAL(1.0, power[1]); OCIO_CHECK_EQUAL(1.0, power[2]); OCIO_CHECK_EQUAL(0.0, cdlFile->transformVec[4]->getSat()); } }
53.234818
118
0.686212
rakoman
dc8d4f8c998a560d7110a9dc9e7fcd0d93911ceb
2,155
cpp
C++
CardsPermutation/CardsPermutation.cpp
HPCCS/Computation-Kernel-Dataset
5a184c7846c1abff39426a7f53fb837de8ba36e3
[ "MIT" ]
1
2019-05-03T19:37:24.000Z
2019-05-03T19:37:24.000Z
CardsPermutation/CardsPermutation.cpp
HPCCS/Computation-Kernel-Dataset
5a184c7846c1abff39426a7f53fb837de8ba36e3
[ "MIT" ]
null
null
null
CardsPermutation/CardsPermutation.cpp
HPCCS/Computation-Kernel-Dataset
5a184c7846c1abff39426a7f53fb837de8ba36e3
[ "MIT" ]
null
null
null
// problem statement is in https://www.hackerrank.com/contests/womens-codesprint-4/challenges/cards-permutation/problem #include <bits/stdc++.h> #include <cmath> #include <cstdio> #include <vector> #include <iostream> #include <algorithm> #include <set> #include <string> #include <cstring> #include <ctime> using namespace std; const long long P = 1000000007LL; const int N = 310000; long long f[N]; int a[N], n, s[N]; bool used[N]; int t[N]; void update(int k, int value) { for (int i = k; i < N; i |= (i + 1)) { t[i] += value; } } int get(int k) { int res = 0; for (int i = k; i >= 0; i = (i & (i + 1)) - 1) { res += t[i]; } return res; } int main() { freopen("../input_files/CardsPermutation", "r", stdin); f[0] = 1; int az=89; for (int i = 1; i < N; ++i) { f[i] = (long long)(i) * f[i - 1]; f[i] %= P; } scanf("%d", &n); az=89; for (int i = 0; i < n; ++i) { scanf("%d", &a[i]); used[a[i]] = true; s[i] = (a[i] == 0); if (i > 0) { s[i] += s[i - 1]; } } vector < int > current(n); az=89; for (int i = 0; i < n; ++i) { current[i] = i + 1; } vector < int > unused; long long sum = 0; az=89; for (int i = 1; i <= n; ++i) { if (!used[i]) { unused.push_back(i); sum += i - 1; } } sum %= P; long long w = unused.size(); long long w2 = ((w * (w - 1)) / 2) % P; long long res = f[w]; long long cnt = 0; az=89; for (int i = 0; i < n; ++i) { if (a[i] != 0) { long long total = get(a[i]), m = s[i]; long long index = upper_bound(unused.begin(), unused.end(), a[i]) - unused.begin(); long long current = (f[w] * (a[i] - total - 1)) % P; if (w > 0) { current -= f[w - 1] * ((index * m) % P); } current = (current % P + P) % P; current = (current * f[n - i - 1]) % P; res = (res + current) % P; cnt = (cnt + w - index) % P; update(a[i], 1); } else { long long current = (f[w - 1] * (sum - cnt)) % P; if (w >= 2) { current -= ((f[w - 2] * w2) % P) * (s[i] - 1); } current = (current % P + P) % P; current = (current * f[n - i - 1]) % P; res = (res + current) % P; } } res = (res % P + P) % P; cout << res << endl; return 0; }
19.953704
119
0.495592
HPCCS
dc95b42c5c323c12ab2af60744b3b128eddf837e
9,936
cpp
C++
src/ClientData/CaptureData.cpp
akopich/orbit
c7935085023cce1abb70ce96dd03339f47a1c826
[ "BSD-2-Clause" ]
null
null
null
src/ClientData/CaptureData.cpp
akopich/orbit
c7935085023cce1abb70ce96dd03339f47a1c826
[ "BSD-2-Clause" ]
null
null
null
src/ClientData/CaptureData.cpp
akopich/orbit
c7935085023cce1abb70ce96dd03339f47a1c826
[ "BSD-2-Clause" ]
null
null
null
// Copyright (c) 2020 The Orbit Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. #include "ClientData/CaptureData.h" #include <absl/container/flat_hash_map.h> #include <algorithm> #include <cmath> #include <cstdint> #include <iterator> #include <memory> #include <vector> #include "ClientData/ModuleData.h" #include "ClientData/ScopeIdConstants.h" #include "ClientData/ScopeInfo.h" #include "ObjectUtils/Address.h" #include "OrbitBase/Result.h" using orbit_grpc_protos::CaptureStarted; using orbit_grpc_protos::InstrumentedFunction; using orbit_grpc_protos::ProcessInfo; namespace orbit_client_data { CaptureData::CaptureData(const CaptureStarted& capture_started, std::optional<std::filesystem::path> file_path, absl::flat_hash_set<uint64_t> frame_track_function_ids, DataSource data_source) : memory_sampling_period_ns_(capture_started.capture_options().memory_sampling_period_ns()), selection_callstack_data_(std::make_unique<CallstackData>()), frame_track_function_ids_{std::move(frame_track_function_ids)}, file_path_{std::move(file_path)}, scope_id_provider_(NameEqualityScopeIdProvider::Create(capture_started.capture_options())), thread_track_data_provider_( std::make_unique<ThreadTrackDataProvider>(data_source == DataSource::kLoadedCapture)) { ProcessInfo process_info; process_info.set_pid(capture_started.process_id()); std::filesystem::path executable_path{capture_started.executable_path()}; process_info.set_full_path(executable_path.string()); process_info.set_name(executable_path.filename().string()); process_info.set_is_64_bit(true); process_.SetProcessInfo(process_info); absl::flat_hash_map<uint64_t, FunctionInfo> instrumented_functions; for (const auto& instrumented_function : capture_started.capture_options().instrumented_functions()) { instrumented_functions_.insert_or_assign(instrumented_function.function_id(), instrumented_function); } } void CaptureData::ForEachThreadStateSliceIntersectingTimeRange( uint32_t thread_id, uint64_t min_timestamp, uint64_t max_timestamp, const std::function<void(const ThreadStateSliceInfo&)>& action) const { absl::MutexLock lock{&thread_state_slices_mutex_}; auto tid_thread_state_slices_it = thread_state_slices_.find(thread_id); if (tid_thread_state_slices_it == thread_state_slices_.end()) { return; } const std::vector<ThreadStateSliceInfo>& tid_thread_state_slices = tid_thread_state_slices_it->second; auto slice_it = std::lower_bound(tid_thread_state_slices.begin(), tid_thread_state_slices.end(), min_timestamp, [](const ThreadStateSliceInfo& slice, uint64_t min_timestamp) { return slice.end_timestamp_ns() < min_timestamp; }); while (slice_it != tid_thread_state_slices.end() && slice_it->begin_timestamp_ns() < max_timestamp) { action(*slice_it); ++slice_it; } } const ScopeStats& CaptureData::GetScopeStatsOrDefault(uint64_t scope_id) const { static const ScopeStats kDefaultScopeStats; auto scope_stats_it = scope_stats_.find(scope_id); if (scope_stats_it == scope_stats_.end()) { return kDefaultScopeStats; } return scope_stats_it->second; } void CaptureData::UpdateScopeStats(const TimerInfo& timer_info) { const uint64_t scope_id = ProvideScopeId(timer_info); if (scope_id == kInvalidScopeId) return; ScopeStats& stats = scope_stats_[scope_id]; const uint64_t elapsed_nanos = timer_info.end() - timer_info.start(); stats.UpdateStats(elapsed_nanos); } void CaptureData::AddScopeStats(uint64_t scope_id, ScopeStats stats) { scope_stats_.insert_or_assign(scope_id, stats); } void CaptureData::OnCaptureComplete() { thread_track_data_provider_->OnCaptureComplete(); UpdateTimerDurations(); } const InstrumentedFunction* CaptureData::GetInstrumentedFunctionById(uint64_t function_id) const { auto instrumented_functions_it = instrumented_functions_.find(function_id); if (instrumented_functions_it == instrumented_functions_.end()) { return nullptr; } return &instrumented_functions_it->second; } const LinuxAddressInfo* CaptureData::GetAddressInfo(uint64_t absolute_address) const { auto address_info_it = address_infos_.find(absolute_address); if (address_info_it == address_infos_.end()) { return nullptr; } return &address_info_it->second; } void CaptureData::InsertAddressInfo(LinuxAddressInfo address_info) { const uint64_t absolute_address = address_info.absolute_address(); const uint64_t absolute_function_address = absolute_address - address_info.offset_in_function(); // Ensure we know the symbols also for the resolved function address; if (!address_infos_.contains(absolute_function_address)) { LinuxAddressInfo function_info{absolute_function_address, /*offset_in_function=*/0, address_info.module_path(), address_info.function_name()}; address_infos_.emplace(absolute_function_address, std::move(function_info)); } address_infos_.emplace(absolute_address, std::move(address_info)); } uint32_t CaptureData::process_id() const { return process_.pid(); } std::string CaptureData::process_name() const { return process_.name(); } void CaptureData::EnableFrameTrack(uint64_t instrumented_function_id) { if (frame_track_function_ids_.contains(instrumented_function_id)) { const auto* function = GetInstrumentedFunctionById(instrumented_function_id); ORBIT_CHECK(function != nullptr); ORBIT_LOG("Warning: Frame track for instrumented function \"%s\" is already enabled", function->function_name()); return; } frame_track_function_ids_.insert(instrumented_function_id); } void CaptureData::DisableFrameTrack(uint64_t instrumented_function_id) { frame_track_function_ids_.erase(instrumented_function_id); } bool CaptureData::IsFrameTrackEnabled(uint64_t instrumented_function_id) const { return frame_track_function_ids_.contains(instrumented_function_id); } uint64_t CaptureData::ProvideScopeId(const orbit_client_protos::TimerInfo& timer_info) const { ORBIT_CHECK(scope_id_provider_); return scope_id_provider_->ProvideId(timer_info); } [[nodiscard]] std::vector<uint64_t> CaptureData::GetAllProvidedScopeIds() const { return scope_id_provider_->GetAllProvidedScopeIds(); } const ScopeInfo& CaptureData::GetScopeInfo(uint64_t scope_id) const { ORBIT_CHECK(scope_id_provider_); return scope_id_provider_->GetScopeInfo(scope_id); } uint64_t CaptureData::FunctionIdToScopeId(uint64_t function_id) const { ORBIT_CHECK(scope_id_provider_); return scope_id_provider_->FunctionIdToScopeId(function_id); } const std::vector<uint64_t>* CaptureData::GetSortedTimerDurationsForScopeId( uint64_t scope_id) const { const auto it = scope_id_to_timer_durations_.find(scope_id); if (it == scope_id_to_timer_durations_.end()) return nullptr; return &it->second; } [[nodiscard]] std::vector<const TimerInfo*> CaptureData::GetAllScopeTimers( const absl::flat_hash_set<ScopeType> types, uint64_t min_tick, uint64_t max_tick) const { std::vector<const TimerInfo*> result; // The timers corresponding to dynamically instrumented functions and manual instrumentation // (kApiScope) are stored in ThreadTracks. Hence, they're acquired separately from the manual // async (kApiScope). if (types.contains(ScopeType::kApiScope) || types.contains(ScopeType::kDynamicallyInstrumentedFunction)) { for (const uint32_t thread_id : GetThreadTrackDataProvider()->GetAllThreadIds()) { const std::vector<const TimerInfo*> thread_track_timers = GetThreadTrackDataProvider()->GetTimers(thread_id, min_tick, max_tick); std::copy_if(std::begin(thread_track_timers), std::end(thread_track_timers), std::back_inserter(result), [this, &types](const TimerInfo* timer) { return types.contains(GetScopeInfo(ProvideScopeId(*timer)).GetType()); }); } } if (types.contains(ScopeType::kApiScopeAsync)) { std::vector<const TimerInfo*> async_timer_infos = timer_data_manager_.GetTimers( orbit_client_protos::TimerInfo::kApiScopeAsync, min_tick, max_tick); result.insert(std::end(result), std::begin(async_timer_infos), std::end(async_timer_infos)); } return result; } void CaptureData::UpdateTimerDurations() { ORBIT_SCOPE_FUNCTION; scope_id_to_timer_durations_.clear(); static const absl::flat_hash_set<ScopeType> all_valid_scope_types = { ScopeType::kApiScope, ScopeType::kApiScopeAsync, ScopeType::kDynamicallyInstrumentedFunction}; for (const TimerInfo* timer : GetAllScopeTimers(all_valid_scope_types)) { const uint64_t scope_id = ProvideScopeId(*timer); if (scope_id != orbit_client_data::kInvalidScopeId) { scope_id_to_timer_durations_[scope_id].push_back(timer->end() - timer->start()); } } for (auto& [id, timer_durations] : scope_id_to_timer_durations_) { std::sort(timer_durations.begin(), timer_durations.end()); } } [[nodiscard]] std::vector<const TimerInfo*> CaptureData::GetTimersForScope( uint64_t scope_id, uint64_t min_tick, uint64_t max_tick) const { const std::vector<const TimerInfo*> all_timers = GetAllScopeTimers({GetScopeInfo(scope_id).GetType()}, min_tick, max_tick); std::vector<const TimerInfo*> result; std::copy_if(std::begin(all_timers), std::end(all_timers), std::back_inserter(result), [this, scope_id](const TimerInfo* timer) { return scope_id_provider_->ProvideId(*timer) == scope_id; }); return result; } } // namespace orbit_client_data
40.721311
100
0.74849
akopich
dc9770a49853fcf24cb319e0682fa3b56d3c9521
1,951
hpp
C++
test/unit/workgroup/tests/test-util-workgroup-WorkStorage.hpp
researchapps/RAJA
122fa519ebc84f1ed114b70444fb807bd8e4efa9
[ "BSD-3-Clause" ]
319
2016-04-28T23:53:29.000Z
2022-03-29T16:30:36.000Z
test/unit/workgroup/tests/test-util-workgroup-WorkStorage.hpp
researchapps/RAJA
122fa519ebc84f1ed114b70444fb807bd8e4efa9
[ "BSD-3-Clause" ]
1,071
2016-05-04T23:15:51.000Z
2022-03-31T23:47:48.000Z
test/unit/workgroup/tests/test-util-workgroup-WorkStorage.hpp
researchapps/RAJA
122fa519ebc84f1ed114b70444fb807bd8e4efa9
[ "BSD-3-Clause" ]
103
2016-05-02T22:48:37.000Z
2022-03-23T13:51:21.000Z
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// // Copyright (c) 2016-21, Lawrence Livermore National Security, LLC // and RAJA project contributors. See the RAJA/LICENSE file for details. // // SPDX-License-Identifier: (BSD-3-Clause) //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~// /// /// Header file containing tests for RAJA workgroup constructors. /// #ifndef __TEST_UTIL_WORKGROUP_WORKSTORAGE__ #define __TEST_UTIL_WORKGROUP_WORKSTORAGE__ #include "RAJA_test-workgroup.hpp" #include <random> #include <array> #include <cstddef> template < typename T > struct TestCallable { TestCallable(T _val) : val(_val) { } TestCallable(TestCallable const&) = delete; TestCallable& operator=(TestCallable const&) = delete; TestCallable(TestCallable&& o) : val(o.val) , move_constructed(true) { o.moved_from = true; } TestCallable& operator=(TestCallable&& o) { val = o.val; o.moved_from = true; return *this; } RAJA_HOST_DEVICE void operator()( void* val_ptr, bool* move_constructed_ptr, bool* moved_from_ptr) const { *static_cast<T*>(val_ptr) = val; *move_constructed_ptr = move_constructed; *moved_from_ptr = moved_from; } private: T val; public: bool move_constructed = false; bool moved_from = false; }; // work around inconsistent std::array support over stl versions template < typename T, size_t N > struct TestArray { T a[N]{}; T& operator[](size_t i) { return a[i]; } T const& operator[](size_t i) const { return a[i]; } friend inline bool operator==(TestArray const& lhs, TestArray const& rhs) { for (size_t i = 0; i < N; ++i) { if (lhs[i] == rhs[i]) continue; else return false; } return true; } friend inline bool operator!=(TestArray const& lhs, TestArray const& rhs) { return !(lhs == rhs); } }; #endif //__TEST_UTIL_WORKGROUP_WORKSTORAGE__
23.22619
79
0.623783
researchapps
dc9aa1b6f6b033836268382f4420406356cfd2ec
9,994
hpp
C++
include/poac/util/semver/parser/parser.hpp
ken-matsui/poac
e4503027f3993be493824f48dc31818029784238
[ "Apache-2.0" ]
null
null
null
include/poac/util/semver/parser/parser.hpp
ken-matsui/poac
e4503027f3993be493824f48dc31818029784238
[ "Apache-2.0" ]
null
null
null
include/poac/util/semver/parser/parser.hpp
ken-matsui/poac
e4503027f3993be493824f48dc31818029784238
[ "Apache-2.0" ]
null
null
null
#ifndef SEMVER_PARSER_PARSER_HPP #define SEMVER_PARSER_PARSER_HPP #include <cstddef> #include <cstdint> #include <string_view> #include <vector> #include <optional> #include <poac/util/semver/parser/lexer.hpp> #include <poac/util/semver/parser/range.hpp> #include <poac/util/semver/parser/token.hpp> namespace semver::parser { struct Parser { using string_type = std::string_view; using value_type = string_type::value_type; Lexer lexer; Token c1; /// Construct a new parser for the given input. explicit Parser(string_type str) : lexer(str), c1(lexer.next()) {} /// Pop one token. inline Token pop() { Token c1_ = this->c1; this->c1 = lexer.next(); return c1_; } /// Peek one token. inline Token peek() const noexcept { return this->c1; } /// Skip whitespace if present. void skip_whitespace() { if (peek().is_whitespace()) { pop(); } } /// Parse an optional comma separator, then if that is present a predicate. std::optional<Predicate> comma_predicate() { const bool has_comma = has_ws_separator(Token::Comma); if (const auto predicate = this->predicate()) { return predicate; } else if (has_comma) { return std::nullopt; // Err(EmptyPredicate) } else { return std::nullopt; } } /// Parse an optional or separator `||`, then if that is present a range. std::optional<VersionReq> or_range() { if (!this->has_ws_separator(Token::Or)) { return std::nullopt; } return this->range(); } /// Parse a single component. /// /// Returns `None` if the component is a wildcard. std::optional<std::uint_fast64_t> component() { if (const Token token = this->pop(); token.kind == Token::Numeric) { return std::get<Token::numeric_type>(token.component); } else if (token.is_whildcard()) { return std::nullopt; } else { return std::nullopt; // Err(UnexpectedToken(tok)) } } /// Parse a single numeric. std::optional<std::uint_fast64_t> numeric() { if (const Token token = this->pop(); token.kind == Token::Numeric) { return std::get<Token::numeric_type>(token.component); } return std::nullopt; } /// Optionally parse a dot, then a component. /// /// The second component of the tuple indicates if a wildcard has been encountered, and is /// always `false` if the first component is `Some`. /// /// If a dot is not encountered, `(None, false)` is returned. /// /// If a wildcard is encountered, `(None, true)` is returned. std::optional<std::uint_fast64_t> dot_component() { if (this->peek() != Token::Dot) { return std::nullopt; } // pop the peeked dot. this->pop(); return this->component(); } /// Parse a dot, then a numeric. std::optional<std::uint_fast64_t> dot_numeric() { if (pop() != Token::Dot) { return std::nullopt; } return numeric(); } /// Parse an string identifier. /// /// Like, `foo`, or `bar`. std::optional<Identifier> identifier() { const Token& token = pop(); if (token.kind == Token::AlphaNumeric) { return Identifier(Identifier::AlphaNumeric, std::get<Token::alphanumeric_type>(token.component)); } else if (token.kind == Token::Numeric) { return Identifier(Identifier::Numeric, std::get<Token::numeric_type>(token.component)); } return std::nullopt; } /// Parse all pre-release identifiers, separated by dots. /// /// Like, `abcdef.1234`. std::vector<Identifier> pre() { if (peek() != Token::Hyphen) { return {}; } // pop the peeked hyphen. pop(); return parts(); } /// Parse a dot-separated set of identifiers. std::vector<Identifier> parts() { std::vector<Identifier> parts{}; parts.push_back(identifier().value()); while (peek() == Token::Dot) { // pop the peeked hyphen. pop(); parts.push_back(identifier().value()); } return parts; } /// Parse optional build metadata. /// /// Like, `` (empty), or `+abcdef`. std::vector<Identifier> plus_build_metadata() { if (peek() != Token::Plus) { return {}; } // pop the peeked plus. pop(); return parts(); } /// Optionally parse a single operator. /// /// Like, `~`, or `^`. Op op() { Op op(Op::Compatible); switch (peek().kind) { case Token::Eq: op.kind = Op::Ex; case Token::Gt: op.kind = Op::Gt; case Token::GtEq: op.kind = Op::GtEq; case Token::Lt: op.kind = Op::Lt; case Token::LtEq: op.kind = Op::LtEq; case Token::Tilde: op.kind = Op::Tilde; case Token::Caret: op.kind = Op::Compatible; // default op default: op.kind = Op::Compatible; } // remove the matched token. pop(); skip_whitespace(); return op; } /// Parse a single predicate. /// /// Like, `^1`, or `>=2.0.0`. std::optional<Predicate> predicate() { if (is_eof()) { return std::nullopt; } Op op = this->op(); std::uint_fast64_t major; if (const auto m = this->component()) { major = m.value(); } else { return std::nullopt; } const auto minor = this->dot_component(); const auto patch = this->dot_component(); const auto pre = this->pre(); // TODO: avoid illegal combinations, like `1.*.0`. if (!minor.has_value()) { op = Op(Op::Wildcard, WildcardVersion::Minor); } if (!patch.has_value()) { op = Op(Op::Wildcard, WildcardVersion::Patch); } // ignore build metadata this->plus_build_metadata(); return Predicate{ op, major, minor, patch, pre }; } /// Parse a single range. /// /// Like, `^1.0` or `>=3.0.0, <4.0.0`. VersionReq range() { std::vector<Predicate> predicates{}; if (const auto predicate = this->predicate()) { predicates.push_back(predicate.value()); while (const auto next = this->comma_predicate()) { predicates.push_back(next.value()); } } return VersionReq{ predicates }; } /// Parse a comparator. /// /// Like, `1.0 || 2.0` or `^1 || >=3.0.0, <4.0.0`. Comparator comparator() { std::vector<VersionReq> ranges{}; ranges.push_back(this->range()); while (const auto next = this->or_range()) { ranges.push_back(next.value()); } return Comparator{ ranges }; } /// Parse a version. /// /// Like, `1.0.0` or `3.0.0-beta.1`. Version version() { this->skip_whitespace(); const std::uint_fast64_t major = this->numeric().value(); const std::uint_fast64_t minor = this->dot_numeric().value(); const std::uint_fast64_t patch = this->dot_numeric().value(); const std::vector<Identifier> pre = this->pre(); const std::vector<Identifier> build = this->plus_build_metadata(); this->skip_whitespace(); return Version{ major, minor, patch, pre, build }; } /// Check if we have reached the end of input. bool is_eof() const { return lexer.size() < lexer.c1_index; } /// Get the rest of the tokens in the parser. /// /// Useful for debugging. std::vector<Token> tail() { std::vector<Token> out{}; out.push_back(c1); for (const Token token = lexer.next(); token != Token::Unexpected; ) { out.push_back(token); } return out; } private: bool has_ws_separator(const Token::Kind& pat) { skip_whitespace(); if (peek() == pat) { // pop the separator. pop(); // strip suffixing whitespace. skip_whitespace(); return true; } return false; } }; // std::optional<Version> // parse(std::string_view input) { // // } // // namespace range { // VersionReq // parse(std::string_view input) { // // } // } // end namespace range } // end namespace semver::parser #endif // !SEMVER_PARSER_PARSER_HPP
29.307918
113
0.471683
ken-matsui
dc9c97a62751863b1e297638c4bbc535cf3679f5
447
cpp
C++
LuaGame/src/LuaGame.cpp
davidliljefors/Hazel
1467f1c20ba46bdfe943d72a75b6d86bca1c2a66
[ "Apache-2.0" ]
1
2020-09-27T09:22:33.000Z
2020-09-27T09:22:33.000Z
LuaGame/src/LuaGame.cpp
davidliljefors/Hazel
1467f1c20ba46bdfe943d72a75b6d86bca1c2a66
[ "Apache-2.0" ]
null
null
null
LuaGame/src/LuaGame.cpp
davidliljefors/Hazel
1467f1c20ba46bdfe943d72a75b6d86bca1c2a66
[ "Apache-2.0" ]
null
null
null
#include <Hazel.h> #include <Hazel/Core/EntryPoint.h> #include "Platform/OpenGL/OpenGLShader.h" #include "imgui/imgui.h" #include <glm/gtx/string_cast.hpp> #include <glm/gtc/type_ptr.hpp> #include "LuaLayer.h" class LuaGame : public Hazel::Application { public: LuaGame() { //PushLayer(new ExampleLayer()); PushLayer(new LuaLayer()); } ~LuaGame() { } }; Hazel::Application* Hazel::CreateApplication() { return new LuaGame(); }
13.545455
46
0.695749
davidliljefors
dca4fcb5fafbad50cdbf1a830c7ee1c7b7721a6d
4,471
cc
C++
examples/cpp_api/array_metadata.cc
upj977155/TileDB
1c96c6a0c030e058930ff9d47409865fbfe2178f
[ "MIT" ]
1,478
2017-06-15T13:58:50.000Z
2022-03-30T13:46:00.000Z
examples/cpp_api/array_metadata.cc
upj977155/TileDB
1c96c6a0c030e058930ff9d47409865fbfe2178f
[ "MIT" ]
1,435
2017-05-25T01:16:18.000Z
2022-03-31T21:57:06.000Z
examples/cpp_api/array_metadata.cc
upj977155/TileDB
1c96c6a0c030e058930ff9d47409865fbfe2178f
[ "MIT" ]
169
2017-06-09T18:35:45.000Z
2022-03-13T01:11:18.000Z
/** * @file array_metadata.cc * * @section LICENSE * * The MIT License * * @copyright Copyright (c) 2018-2021 TileDB, Inc. * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN * THE SOFTWARE. * * @section DESCRIPTION * * This program shows how to write, read and consolidate array metadata. */ #include <iostream> #include <tiledb/tiledb> using namespace tiledb; // Name of array std::string array_name("array_metadata_array"); void create_array() { // Create a TileDB context. Context ctx; // Create some array (it can be dense or sparse, with // any number of dimensions and attributes). Domain domain(ctx); domain.add_dimension(Dimension::create<int>(ctx, "rows", {{1, 4}}, 4)) .add_dimension(Dimension::create<int>(ctx, "cols", {{1, 4}}, 4)); // The array will be sparse. ArraySchema schema(ctx, TILEDB_SPARSE); schema.set_domain(domain).set_order({{TILEDB_ROW_MAJOR, TILEDB_ROW_MAJOR}}); // Add a single attribute "a" so each (i,j) cell can store an integer. schema.add_attribute(Attribute::create<int>(ctx, "a")); // Create the (empty) array on disk. Array::create(array_name, schema); } void write_array_metadata() { // Create TileDB context Context ctx; // Open array for writing Array array(ctx, array_name, TILEDB_WRITE); // Write some metadata int v = 100; array.put_metadata("aaa", TILEDB_INT32, 1, &v); float f[] = {1.1f, 1.2f}; array.put_metadata("bb", TILEDB_FLOAT32, 2, f); // Close array - Important so that the metadata get flushed array.close(); } void read_array_metadata() { // Create TileDB context Context ctx; // Open array for reading Array array(ctx, array_name, TILEDB_READ); // Read with key tiledb_datatype_t v_type; uint32_t v_num; const void* v; array.get_metadata("aaa", &v_type, &v_num, &v); std::cout << "Details of item with key: aaa\n"; std::cout << "- Value type: " << ((v_type == TILEDB_INT32) ? "INT32" : "something went wrong") << "\n"; std::cout << "- Value num: " << v_num << "\n"; std::cout << "- Value: " << *(const int*)v << "\n"; array.get_metadata("bb", &v_type, &v_num, &v); std::cout << "Details of item with key: bb\n"; std::cout << "- Value type: " << ((v_type == TILEDB_FLOAT32) ? "FLOAT32" : "something went wrong") << "\n"; std::cout << "- Value num: " << v_num << "\n"; std::cout << "- Value: " << ((const float*)v)[0] << " " << ((const float*)v)[1] << "\n"; // Enumerate all metadata items std::string key; uint64_t num = array.metadata_num(); printf("Enumerate all metadata items:\n"); for (uint64_t i = 0; i < num; ++i) { array.get_metadata_from_index(i, &key, &v_type, &v_num, &v); std::cout << "# Item " << i << "\n"; const char* v_type_str = (v_type == TILEDB_INT32) ? "INT32" : "FLOAT32"; std::cout << "- Key: " << key << "\n"; std::cout << "- Value type: " << v_type_str << "\n"; std::cout << "- Value num: " << v_num << "\n"; std::cout << "- Value: "; if (v_type == TILEDB_INT32) { for (uint32_t j = 0; j < v_num; ++j) std::cout << ((const int*)v)[j] << " "; } else if (v_type == TILEDB_FLOAT32) { for (uint32_t j = 0; j < v_num; ++j) std::cout << ((const float*)v)[j] << " "; } std::cout << "\n"; } // Close array array.close(); } int main() { create_array(); write_array_metadata(); read_array_metadata(); return 0; }
31.70922
80
0.638112
upj977155
dca683ed63f1fcac60b32781a75007e828ddf502
36,150
cpp
C++
sizzlingstats/serverplugin_empty.cpp
SizzlingStats/sizzlingplugins
f4947ca0533fe8f9241387a26fb1df4cd04f4c98
[ "Unlicense", "BSD-3-Clause" ]
5
2015-06-23T23:21:28.000Z
2021-09-14T00:35:33.000Z
sizzlingstats/serverplugin_empty.cpp
SizzlingStats/sizzlingplugins
f4947ca0533fe8f9241387a26fb1df4cd04f4c98
[ "Unlicense", "BSD-3-Clause" ]
8
2015-04-06T23:06:57.000Z
2017-06-15T20:28:17.000Z
sizzlingstats/serverplugin_empty.cpp
SizzlingStats/sizzlingplugins
f4947ca0533fe8f9241387a26fb1df4cd04f4c98
[ "Unlicense", "BSD-3-Clause" ]
3
2015-10-16T22:22:29.000Z
2021-11-10T05:03:37.000Z
/*======== This file is part of SizzlingPlugins. Copyright (c) 2010-2013, Jordan Cristiano. This file is subject to the terms and conditions defined in the file 'LICENSE', which is part of this source code package. */ #include "dbgflag.h" #include <stdio.h> #include "SizzlingStats.h" #include "interface.h" #include "filesystem.h" #include "engine/iserverplugin.h" #include "game/server/iplayerinfo.h" #include "eiface.h" #include "igameevents.h" #include "convar.h" #include "engine/IEngineTrace.h" #include "dt_send.h" #include "server_class.h" #include "SizzFileSystem.h" #include "ThreadCallQueue.h" #include "SC_helpers.h" #include "PluginDefines.h" #include "autoupdate.h" #include "UserIdTracker.h" #include "ServerPluginHandler.h" #include "LogStats.h" #include "curl/curl.h" #include "ConCommandHook.h" #include "teamplay_gamerule_states.h" #include "SizzPluginContext.h" #include "UserMessageHelpers.h" #include "MRecipientFilter.h" #include "TFPlayerWrapper.h" #include "TFTeamWrapper.h" #ifdef PROTO_STATS #include "EventStats.h" #endif // memdbgon must be the last include file in a .cpp file!!! #include "tier0/memdbgon.h" // Interfaces from the engine IEngineTrace *enginetrace = NULL; IServerGameDLL *pServerDLL = NULL; IFileSystem *g_pFullFileSystem = NULL; //===========================================================================// void VersionChangeCallback( IConVar *var, const char *pOldValue, float flOldValue ); static ConVar version("sizz_stats_version", PLUGIN_VERSION_STRING, FCVAR_NOTIFY, "The version of SizzlingStats running.", &VersionChangeCallback); void VersionChangeCallback( IConVar *var, const char *pOldValue, float flOldValue ) { if (strcmp(version.GetString(), PLUGIN_VERSION_STRING)) { var->SetValue(PLUGIN_VERSION_STRING); } } static char *UTIL_VarArgs( char *format, ... ) { va_list argptr; static char string[1024]; va_start (argptr, format); Q_vsnprintf(string, sizeof(string), format,argptr); va_end (argptr); return string; } //--------------------------------------------------------------------------------- // Purpose: a sample 3rd party plugin class //--------------------------------------------------------------------------------- class CEmptyServerPlugin: public IServerPluginCallbacks, public IGameEventListener2, public ICommandHookCallback { public: CEmptyServerPlugin(); ~CEmptyServerPlugin(); // IServerPluginCallbacks methods virtual bool Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory ); virtual void Unload( void ); virtual void Pause( void ); virtual void UnPause( void ); virtual const char *GetPluginDescription( void ); virtual void LevelInit( char const *pMapName ); virtual void ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ); virtual void GameFrame( bool simulating ); virtual void LevelShutdown( void ); virtual void ClientActive( edict_t *pEntity ); virtual void ClientDisconnect( edict_t *pEntity ); virtual void ClientPutInServer( edict_t *pEntity, char const *playername ); virtual void SetCommandClient( int index ); virtual void ClientSettingsChanged( edict_t *pEdict ); virtual PLUGIN_RESULT ClientConnect( bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen ); virtual PLUGIN_RESULT ClientCommand( edict_t *pEntity, const CCommand &args ); virtual PLUGIN_RESULT NetworkIDValidated( const char *pszUserName, const char *pszNetworkID ); virtual void OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue ); virtual void OnEdictAllocated( edict_t *edict ); virtual void OnEdictFreed( const edict_t *edict ); // Additions bool ConfirmInterfaces( void ); void LoadCurrentPlayers(); virtual bool CommandPreExecute( const CCommand &args ); virtual void CommandPostExecute( const CCommand &args, bool bWasCommandExecuted ); // IGameEventListener Interface virtual void FireGameEvent( IGameEvent *event ); virtual int GetCommandIndex() { return m_iClientCommandIndex; } private: void LoadUpdatedPlugin(); void OnAutoUpdateReturn( bool bLoadUpdate ); void GetGameRules(); void GetPropOffsets(); void TournamentMatchStarted(); void TournamentMatchEnded(); private: CSizzPluginContext m_plugin_context; #ifdef PROTO_STATS CEventStats m_EventStats; #endif #ifdef LOG_STATS CLogStats m_logstats; #else CNullLogStats m_logstats; #endif SizzlingStats m_SizzlingStats; CConCommandHook m_SayHook; CConCommandHook m_SayTeamHook; CConCommandHook m_SwitchTeamsHook; CConCommandHook m_PauseHook; CConCommandHook m_UnpauseHook; ConVarRef m_refTournamentMode; CAutoUpdateThread *m_pAutoUpdater; CTeamplayRoundBasedRules *m_pTeamplayRoundBasedRules; int *m_iRoundState; bool *m_bInWaitingForPlayers; int m_iClientCommandIndex; int m_iLastCapTick; bool m_bShouldRecord; bool m_bTournamentMatchStarted; // this var makes sure that LevelShutdown is // only called once for every LevelInit bool m_bAlreadyLevelShutdown; CON_COMMAND_MEMBER_F(CEmptyServerPlugin, "printservertables", PrintServerTables, "prints the server tables ya", 0); }; // // The plugin is a static singleton that is exported as an interface // static CEmptyServerPlugin g_EmptyServerPlugin; EXPOSE_SINGLE_INTERFACE_GLOBALVAR(CEmptyServerPlugin, IServerPluginCallbacks, INTERFACEVERSION_ISERVERPLUGINCALLBACKS_VERSION_1, g_EmptyServerPlugin ); //--------------------------------------------------------------------------------- // Purpose: constructor/destructor //--------------------------------------------------------------------------------- CEmptyServerPlugin::CEmptyServerPlugin(): m_logstats(), m_SizzlingStats(), m_SayHook(), m_SayTeamHook(), m_SwitchTeamsHook(), m_PauseHook(), m_UnpauseHook(), m_refTournamentMode((IConVar*)NULL), m_pAutoUpdater(NULL), m_pTeamplayRoundBasedRules(NULL), m_iRoundState(NULL), m_bInWaitingForPlayers(NULL), m_iClientCommandIndex(0), m_iLastCapTick(0), m_bShouldRecord(false), m_bTournamentMatchStarted(false), m_bAlreadyLevelShutdown(false) { } CEmptyServerPlugin::~CEmptyServerPlugin() { } //--------------------------------------------------------------------------------- // Purpose: called when the plugin is loaded, load the interface we need from the engine //--------------------------------------------------------------------------------- bool CEmptyServerPlugin::Load( CreateInterfaceFn interfaceFactory, CreateInterfaceFn gameServerFactory ) { //ConnectTier1Libraries( &interfaceFactory, 1 ); //ConnectTier2Libraries( &interfaceFactory, 1 ); curl_global_init(CURL_GLOBAL_ALL); autoUpdateInfo_t a = { FULL_PLUGIN_PATH, URL_TO_UPDATED, URL_TO_META, PLUGIN_PATH, 0, PLUGIN_VERSION }; m_pAutoUpdater = new CAutoUpdateThread(a, s_pluginInfo); using namespace std::placeholders; m_pAutoUpdater->SetOnFinishedUpdateCallback(std::bind(&CEmptyServerPlugin::OnAutoUpdateReturn, this, _1)); m_pAutoUpdater->StartThread(); g_pFullFileSystem = (IFileSystem *)interfaceFactory(FILESYSTEM_INTERFACE_VERSION, NULL); if (!g_pFullFileSystem) { Warning( "Unable to load g_pFullFileSystem, aborting load\n" ); return false; } if ( !cvar ) { Warning( "[SizzlingStats]: cvar is null.\n" ); cvar = (ICvar*)interfaceFactory(CVAR_INTERFACE_VERSION, NULL); if ( !cvar ) { Warning( "[SizzlingStats]: Couldn't get cvar, aborting load.\n" ); return false; } Warning( "[SizzlingStats]: got cvar.\n" ); } if ( !g_pCVar ) { Warning( "linking g_pCVar to cvar\n" ); g_pCVar = cvar; } enginetrace = (IEngineTrace*)interfaceFactory(INTERFACEVERSION_ENGINETRACE_SERVER, NULL); pServerDLL = (IServerGameDLL *)gameServerFactory(INTERFACEVERSION_SERVERGAMEDLL, NULL); if ( !ConfirmInterfaces() ) { return false; } plugin_context_init_t init; init.pEngine = (IVEngineServer*)interfaceFactory(INTERFACEVERSION_VENGINESERVER, NULL); init.pPlayerInfoManager = (IPlayerInfoManager *)gameServerFactory(INTERFACEVERSION_PLAYERINFOMANAGER,NULL); init.pHelpers = (IServerPluginHelpers*)interfaceFactory(INTERFACEVERSION_ISERVERPLUGINHELPERS, NULL); init.pGameEventManager = (IGameEventManager2*)interfaceFactory(INTERFACEVERSION_GAMEEVENTSMANAGER2, NULL); init.pServerGameDLL = (IServerGameDLL *)gameServerFactory(INTERFACEVERSION_SERVERGAMEDLL, NULL); if (!m_plugin_context.Initialize(init)) { return false; } CTFPlayerWrapper::InitializeOffsets(); CTFTeamWrapper::InitializeOffsets(); m_logstats.Load(m_plugin_context); //GetGameRules(); GetPropOffsets(); //HookProps(); //m_plugin_context.AddListener( this, "teamplay_round_stalemate", true ); //m_plugin_context.AddListener( this, "teamplay_round_active", true ); // 9:54 //m_plugin_context.AddListener( this, "arena_round_start", true ); //m_plugin_context.AddListener( this, "teamplay_round_win", true ); // end round m_plugin_context.AddListener( this, "teamplay_point_captured", true ); // point captured // for team scores m_plugin_context.AddListener( this, "arena_win_panel", true ); m_plugin_context.AddListener( this, "teamplay_win_panel", true ); // player changes name //m_plugin_context.AddListener( this, "player_changename", true ); // player healed (not incl buffs) m_plugin_context.AddListener( this, "player_healed", true ); // happens when mp_winlimit or mp_timelimit is met or something i don't know, i forget m_plugin_context.AddListener( this, "teamplay_game_over", true ); m_plugin_context.AddListener( this, "tf_game_over", true ); // when a medic dies m_plugin_context.AddListener( this, "medic_death", true ); // when a player types in chat (doesn't include data to differentiate say and say_team) m_plugin_context.AddListener( this, "player_say", true ); // to track times for classes m_plugin_context.AddListener( this, "player_changeclass", true ); m_plugin_context.AddListener( this, "player_team", true ); m_plugin_context.AddListener( this, "player_death", true ); //m_plugin_context.AddListener( this, "tournament_stateupdate", true ); // for getting team names //m_plugin_context.AddListener( this, "player_shoot", true ); // for accuracy stats //m_plugin_context.AddListener( this, "player_chargedeployed", true ); // when a medic deploys uber/kritz //m_plugin_context.AddListener( this, "player_spawn", true ); // when a player spawns... //m_plugin_context.AddListener( this, "teamplay_suddendeath_end", true ); //m_plugin_context.AddListener( this, "teamplay_overtime_end", true ); #ifdef PROTO_STATS m_EventStats.Initialize(); m_plugin_context.AddListenerAll(this, true); #endif m_SizzlingStats.Load(&m_plugin_context); LoadCurrentPlayers(); //Name: player_changename //Structure: //short userid user ID on server //string oldname players old (current) name //string newname players new name //Name: player_chat //Structure: //bool teamonly true if team only chat //short userid chatting player //string text chat text m_SayHook.Hook(this, cvar, "say"); m_SayTeamHook.Hook(this, cvar, "say_team"); m_SwitchTeamsHook.Hook(this, cvar, "mp_switchteams"); m_PauseHook.Hook(this, cvar, "pause"); m_UnpauseHook.Hook(this, cvar, "unpause"); m_refTournamentMode.Init("mp_tournament", false); MathLib_Init( 2.2f, 2.2f, 0.0f, 2 ); ConVar_Register( 0 ); return true; } //--------------------------------------------------------------------------------- // Purpose: called when the plugin is unloaded (turned off) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::Unload( void ) { if (m_bTournamentMatchStarted) { TournamentMatchEnded(); } m_SayHook.Unhook(); m_SayTeamHook.Unhook(); m_SwitchTeamsHook.Unhook(); m_PauseHook.Unhook(); m_UnpauseHook.Unhook(); if (m_plugin_context.GetEngine()) { m_plugin_context.LogPrint("Unload\n"); } m_SizzlingStats.SS_Msg( "plugin unloading\n" ); if (m_plugin_context.GetGameEventManager()) { m_plugin_context.RemoveListener( this ); // make sure we are unloaded from the event system } m_SizzlingStats.SS_DeleteAllPlayerData(); m_SizzlingStats.Unload(&m_plugin_context); #ifdef PROTO_STATS m_EventStats.Shutdown(); #endif m_logstats.Unload(); //UnhookProps(); if (cvar) { ConVar_Unregister( ); } m_pAutoUpdater->ShutDown(); delete m_pAutoUpdater; m_pAutoUpdater = NULL; curl_global_cleanup(); //DisconnectTier2Libraries( ); //DisconnectTier1Libraries( ); // MSVC++ 12.0 _MSC_VER == 1800 (Visual Studio 2013) // MSVC++ 11.0 _MSC_VER == 1700 (Visual Studio 2012) #if defined(_WIN32) && !defined(_DLL) && (_MSC_VER >= 1700) // MS Fix // // http://connect.microsoft.com/VisualStudio/feedback/details/781665/stl-using-std-threading-objects-adds-extra-load-count-for-hosted-dll // // get the current module handle MEMORY_BASIC_INFORMATION mbi; static int address; VirtualQuery(&address, &mbi, sizeof(mbi)); // decrement the reference count FreeLibrary(reinterpret_cast<HMODULE>(mbi.AllocationBase)); // vs2013 requires two FreeLibrary calls #if (_MSC_VER == 1800) FreeLibrary(reinterpret_cast<HMODULE>(mbi.AllocationBase)); #endif // // #endif } //--------------------------------------------------------------------------------- // Purpose: called when the plugin is paused (i.e should stop running but isn't unloaded) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::Pause( void ) { } //--------------------------------------------------------------------------------- // Purpose: called when the plugin is unpaused (i.e should start executing again) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::UnPause( void ) { } //--------------------------------------------------------------------------------- // Purpose: the name of this plugin, returned in "plugin_print" command //--------------------------------------------------------------------------------- const char *CEmptyServerPlugin::GetPluginDescription( void ) { return "SizzlingStats v" PLUGIN_VERSION ", SizzlingCalamari. " __DATE__; } //--------------------------------------------------------------------------------- // Purpose: called on level start //--------------------------------------------------------------------------------- void CEmptyServerPlugin::LevelInit( char const *pMapName ) { m_plugin_context.LogPrint( "[SizzlingStats]: Attempting update.\n" ); m_pAutoUpdater->StartThread(); m_plugin_context.LogPrint( "[SizzlingStats]: Update attempt complete.\n" ); m_SizzlingStats.LevelInit(&m_plugin_context, pMapName); m_logstats.LevelInit(pMapName); } //--------------------------------------------------------------------------------- // Purpose: called on level start, when the server is ready to accept client connections // edictCount is the number of entities in the level, clientMax is the max client count //--------------------------------------------------------------------------------- void CEmptyServerPlugin::ServerActivate( edict_t *pEdictList, int edictCount, int clientMax ) { m_bAlreadyLevelShutdown = false; m_plugin_context.ServerActivate(pEdictList, edictCount, clientMax); //GetGameRules(); GetPropOffsets(); m_SizzlingStats.ServerActivate(&m_plugin_context); //HookProps(); } //--------------------------------------------------------------------------------- // Purpose: called once per server frame, do recurring work here (like checking for timeouts) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::GameFrame( bool simulating ) { m_plugin_context.GameFrame(simulating); m_SizzlingStats.GameFrame(); if (m_iRoundState && m_bInWaitingForPlayers) { bool bWaitingForPlayers = *m_bInWaitingForPlayers; static bool oldWaitingForPlayers = true; int roundstate = *m_iRoundState; static int oldRoundState = roundstate; if (oldWaitingForPlayers != bWaitingForPlayers) { using namespace Teamplay_GameRule_States; Msg( UTIL_VarArgs( "round state is %s\n", GetStateName((gamerules_roundstate_t)roundstate) ) ); bool bTournamentMode = m_refTournamentMode.GetInt() == 1; if (bWaitingForPlayers == true) { if (m_bTournamentMatchStarted) { TournamentMatchEnded(); } } else { if (bTournamentMode && !m_bTournamentMatchStarted && (roundstate != GR_STATE_PREGAME)) { TournamentMatchStarted(); } } oldWaitingForPlayers = bWaitingForPlayers; } if (oldRoundState != roundstate) { using namespace Teamplay_GameRule_States; //Msg( UTIL_VarArgs( "round state is now %s\n", GetStateName(state) ) ); switch (roundstate) { case GR_STATE_PREROUND: { m_bShouldRecord = true; // start extra stats recording m_logstats.PreRoundFreezeStarted(m_bTournamentMatchStarted); m_SizzlingStats.SS_PreRoundFreeze(&m_plugin_context); } break; case GR_STATE_RND_RUNNING: { m_SizzlingStats.SS_RoundStarted(&m_plugin_context); } break; /*case GR_STATE_TEAM_WIN: case GR_STATE_RESTART: case GR_STATE_STALEMATE: { m_bShouldRecord = false; // stop extra stats recording m_SizzlingStats.SS_RoundEnded(); } break;*/ default: break; } oldRoundState = roundstate; } } } //--------------------------------------------------------------------------------- // Purpose: called on level end (as the server is shutting down or going to a new map) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::LevelShutdown( void ) // !!!!this can get called multiple times per map change { if (!m_bAlreadyLevelShutdown) { m_bAlreadyLevelShutdown = true; if (m_bTournamentMatchStarted) { TournamentMatchEnded(); } m_pTeamplayRoundBasedRules = NULL; m_SizzlingStats.SS_DeleteAllPlayerData(); m_plugin_context.LevelShutdown(); } } //--------------------------------------------------------------------------------- // Purpose: called when a client spawns into a server (i.e as they begin to play) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::ClientActive( edict_t *pEdict ) { if (pEdict && !pEdict->IsFree()) { int ent_index = m_plugin_context.ClientActive(pEdict); m_SizzlingStats.SS_PlayerConnect(&m_plugin_context, pEdict); m_logstats.ClientActive(ent_index); } } //--------------------------------------------------------------------------------- // Purpose: called when a client leaves a server (or is timed out) //--------------------------------------------------------------------------------- void CEmptyServerPlugin::ClientDisconnect( edict_t *pEdict ) { if (pEdict && !pEdict->IsFree()) { // ClientDisconnect isn't called for bots // on LevelShutdown, so I just call // ClientDisconnect myself in LevelShutdown // for all players. // This check makes sure that ClientDisconnect // isn't called twice for the same player. if (!m_bAlreadyLevelShutdown) { m_SizzlingStats.SS_PlayerDisconnect(&m_plugin_context, pEdict); m_logstats.ClientDisconnect(SCHelpers::EntIndexFromEdict(pEdict)); m_plugin_context.ClientDisconnect(pEdict); } } } //--------------------------------------------------------------------------------- // Purpose: called on //--------------------------------------------------------------------------------- void CEmptyServerPlugin::ClientPutInServer( edict_t *pEntity, char const *playername ) { } //--------------------------------------------------------------------------------- // Purpose: called on level start //--------------------------------------------------------------------------------- void CEmptyServerPlugin::SetCommandClient( int index ) { m_iClientCommandIndex = ++index; } //--------------------------------------------------------------------------------- // Purpose: called on level start //--------------------------------------------------------------------------------- void CEmptyServerPlugin::ClientSettingsChanged( edict_t *pEdict ) { } //--------------------------------------------------------------------------------- // Purpose: called when a client joins a server //--------------------------------------------------------------------------------- PLUGIN_RESULT CEmptyServerPlugin::ClientConnect( bool *bAllowConnect, edict_t *pEntity, const char *pszName, const char *pszAddress, char *reject, int maxrejectlen ) { return PLUGIN_CONTINUE; } //--------------------------------------------------------------------------------- // Purpose: called when a client types in a command (only a subset of commands however, not CON_COMMAND's) //--------------------------------------------------------------------------------- PLUGIN_RESULT CEmptyServerPlugin::ClientCommand( edict_t *pEntity, const CCommand &args ) { using namespace SCHelpers; const char *pcmd = args[0]; if ( !pEntity || pEntity->IsFree() ) { return PLUGIN_CONTINUE; } int entindex = SCHelpers::EntIndexFromEdict(pEntity); if (entindex > 0) { if ( FStrEq(pcmd, "sizz_show_stats") ) { m_SizzlingStats.SS_ShowHtmlStats(&m_plugin_context, entindex, false); } else if ( FStrEq(pcmd, "sizz_hide_stats") ) { m_SizzlingStats.SS_HideHtmlStats(&m_plugin_context, entindex); } #ifdef DEV_COMMANDS_ON else if ( FStrEq( pcmd, "gibuber" ) ) { if ( entindex > 0 ) { m_SizzlingStats.GiveUber( &m_plugin_context, entindex ); } } else if ( FStrEq( pcmd, "tryend" ) ) { m_SizzlingStats.SS_EndOfRound(&m_plugin_context); } else if ( FStrEq( pcmd, "menutest" ) ) { KeyValues *kv = new KeyValues( "menu" ); kv->SetString( "title", "You've got options, hit ESC" ); kv->SetInt( "level", 1 ); kv->SetColor( "color", Color( 255, 0, 0, 255 )); kv->SetInt( "time", 20 ); kv->SetString( "msg", "Pick an option\nOr don't." ); for( int i = 1; i < 9; i++ ) { char num[10], msg[10], cmd[10]; Q_snprintf( num, sizeof(num), "%i", i ); Q_snprintf( msg, sizeof(msg), "Option %i", i ); Q_snprintf( cmd, sizeof(cmd), "option%i", i ); KeyValues *item1 = kv->FindKey( num, true ); item1->SetString( "msg", msg ); item1->SetString( "command", cmd ); } if ( entindex > 0 ) { m_plugin_context.CreateMessage(entindex, DIALOG_MENU, kv, this); } kv->deleteThis(); } #endif } return PLUGIN_CONTINUE; } //--------------------------------------------------------------------------------- // Purpose: called when a client is authenticated //--------------------------------------------------------------------------------- PLUGIN_RESULT CEmptyServerPlugin::NetworkIDValidated( const char *pszUserName, const char *pszNetworkID ) { return PLUGIN_CONTINUE; } //--------------------------------------------------------------------------------- // Purpose: called when a cvar value query is finished //--------------------------------------------------------------------------------- void CEmptyServerPlugin::OnQueryCvarValueFinished( QueryCvarCookie_t iCookie, edict_t *pPlayerEntity, EQueryCvarValueStatus eStatus, const char *pCvarName, const char *pCvarValue ) { //Msg( "Cvar query (cookie: %d, status: %d) - name: %s, value: %s\n", iCookie, eStatus, pCvarName, pCvarValue ); } void CEmptyServerPlugin::OnEdictAllocated( edict_t *edict ) { } void CEmptyServerPlugin::OnEdictFreed( const edict_t *edict ) { } //--------------------------------------------------------------------------------- // Purpose: confirm the validity of the interface pointers //--------------------------------------------------------------------------------- bool CEmptyServerPlugin::ConfirmInterfaces( void ) { if (!enginetrace) { Warning( "Unable to load enginetrace, aborting load\n" ); return false; } if (!pServerDLL) { Warning( "Unable to load pServerDLL, aborting load\n" ); return false; } Msg( "All interfaces sucessfully loaded\n" ); return true; } //--------------------------------------------------------------------------------- // Purpose: called once on plugin load incase the plugin is loaded dynamically //--------------------------------------------------------------------------------- void CEmptyServerPlugin::LoadCurrentPlayers() { int max_clients = m_plugin_context.GetMaxClients(); for ( int i = 1; i <= max_clients; ++i ) { edict_t *pEdict = m_plugin_context.EdictFromEntIndex(i); if (pEdict && !pEdict->IsFree()) { // might not need this second check if (SCHelpers::EdictToBaseEntity(pEdict)) { int ent_index = m_plugin_context.ClientActive(pEdict); m_SizzlingStats.SS_PlayerConnect(&m_plugin_context, pEdict); m_logstats.ClientActive(ent_index); } } } } bool CEmptyServerPlugin::CommandPreExecute( const CCommand &args ) { using namespace SCHelpers; const char *szCommand = args[0]; if (m_bTournamentMatchStarted) { if (m_iClientCommandIndex > 0) { if ( FStrEq( szCommand, "say" ) ) { m_SizzlingStats.ChatEvent( &m_plugin_context, m_iClientCommandIndex, args.ArgS(), false ); } else if ( FStrEq( szCommand, "say_team" ) ) { m_SizzlingStats.ChatEvent( &m_plugin_context, m_iClientCommandIndex, args.ArgS(), true ); } } if ( FStrEq( szCommand, "mp_switchteams" ) ) { //Msg( "teams switched\n" ); } #ifdef PROTO_STATS else if ( FStrEq( szCommand, "pause" ) ) { bool paused = m_plugin_context.IsPaused(); if (!paused) { m_EventStats.SendNamedEvent("ss_pause", m_plugin_context.GetCurrentTick()); } } else if ( FStrEq( szCommand, "unpause" ) ) { bool paused = m_plugin_context.IsPaused(); if (paused) { m_EventStats.SendNamedEvent("ss_unpause", m_plugin_context.GetCurrentTick()); } } #endif } // dispatch the command return true; } void CEmptyServerPlugin::CommandPostExecute( const CCommand &args, bool bWasCommandExecuted ) { } //--------------------------------------------------------------------------------- // Purpose: called when an event is fired //--------------------------------------------------------------------------------- void CEmptyServerPlugin::FireGameEvent( IGameEvent *event ) { #ifdef PROTO_STATS if (m_bTournamentMatchStarted) { m_EventStats.OnFireGameEvent(event, m_plugin_context.GetCurrentTick()); } #endif using namespace SCHelpers; const char *RESTRICT name = event->GetName(); if ( m_bShouldRecord && FStrEq( name, "player_healed" ) ) { int patient = event->GetInt( "patient" ); if ( patient != event->GetInt( "healer" ) ) { int patientIndex = m_plugin_context.EntIndexFromUserID(patient); if (patientIndex > 0) { m_SizzlingStats.PlayerHealed( patientIndex, event->GetInt("amount") ); } } } else if ( m_bShouldRecord && FStrEq( name, "player_death" ) ) { const int victim = event->GetInt("victim_entindex"); const int inflictor = event->GetInt("inflictor_entindex"); m_SizzlingStats.OnPlayerDeath(inflictor, victim); //m_SizzlingStats.CheckPlayerDropped( &m_plugin_context, victim ); } else if ( m_bShouldRecord && FStrEq( name, "medic_death" ) ) { int killerIndex = m_plugin_context.EntIndexFromUserID(event->GetInt( "attacker" )); // med picks int victimIndex = m_plugin_context.EntIndexFromUserID(event->GetInt( "userid" )); bool charged = event->GetBool( "charged" ); // med drops if ( killerIndex > 0 && killerIndex != victimIndex ) { m_SizzlingStats.MedPick( killerIndex ); } if ( charged && victimIndex > 0 ) { m_SizzlingStats.UberDropped( victimIndex ); } } else if ( FStrEq( name, "player_changeclass" ) ) { int userid = event->GetInt( "userid" ); int entindex = m_plugin_context.EntIndexFromUserID(userid); EPlayerClass player_class = static_cast<EPlayerClass>(event->GetInt("class")); m_SizzlingStats.PlayerChangedClass( entindex, player_class ); } else if ( FStrEq( name, "teamplay_point_captured" ) ) { m_iLastCapTick = m_plugin_context.GetCurrentTick(); m_SizzlingStats.TeamCapped( event->GetInt("team") ); } else if ( FStrEq( name, "player_team" ) ) { bool bDisconnect = event->GetBool("disconnect"); if (!bDisconnect) { int teamid = event->GetInt("team"); // if they are switching to spec if (teamid == 1) //TODO: verify that 1 is spec { int userid = event->GetInt( "userid" ); int entindex = m_plugin_context.EntIndexFromUserID(userid); m_SizzlingStats.PlayerChangedClass(entindex, k_ePlayerClassUnknown); } } } else if ( FStrEq( name, "teamplay_win_panel" ) || FStrEq( name, "arena_win_panel" ) ) { m_SizzlingStats.SetTeamScores(event->GetInt("red_score"), event->GetInt("blue_score")); if ( m_iLastCapTick == m_plugin_context.GetCurrentTick() ) { if ( event->GetInt("winreason") == Teamplay_GameRule_States::WINREASON_ALL_POINTS_CAPTURED ) { const char *RESTRICT cappers = event->GetString("cappers"); int length = V_strlen(cappers); m_SizzlingStats.CapFix( cappers, length ); } } m_bShouldRecord = false; // stop extra stats recording m_SizzlingStats.SS_RoundEnded(&m_plugin_context); } else if ( FStrEq( name, "teamplay_game_over" ) || FStrEq( name, "tf_game_over" ) ) { CUserMessageHelpers h(&m_plugin_context); h.AllUserChatMessage("\x03This server is running SizzlingStats v" PLUGIN_VERSION "\n"); h.AllUserChatMessage("\x03\x46or credits type \".ss_credits\"\n"); // \x03F is recognised as '?' if (m_bTournamentMatchStarted) { h.AllUserChatMessage("\x03To view the match stats, type \".sizzlingstats\" or \".ss\"\n"); } } else if ( FStrEq( name, "player_say" ) ) { const char *RESTRICT text = event->GetString( "text" ); if ( FStrEq( text, ".ss_credits" ) ) { int userid = event->GetInt( "userid" ); int entindex = m_plugin_context.EntIndexFromUserID(userid); // don't try to send messages to worldspawn if ( entindex != 0 ) { m_SizzlingStats.SS_Credits( &m_plugin_context, entindex, PLUGIN_VERSION ); } } else if ( FStrEq( text, ".ss" ) || FStrEq( text, ".stats" ) || FStrEq( text, ".showstats" ) || FStrEq( text, ".sizzlingstats" ) || FStrEq( text, ".ss_showstats" ) || FStrEq( text, ".doritos" ) || FStrEq( text, ".gg" ) ) { int userid = event->GetInt( "userid" ); int entindex = m_plugin_context.EntIndexFromUserID(userid); m_SizzlingStats.SS_ShowHtmlStats( &m_plugin_context, entindex, true ); } } } void CEmptyServerPlugin::LoadUpdatedPlugin() { int plugin_index = m_plugin_context.GetPluginIndex(this); if (plugin_index >= 0) { char temp[576]; // unload the old plugin, load the new plugin V_snprintf(temp, sizeof(temp), "plugin_unload %i; plugin_load %s\n", plugin_index, FULL_PLUGIN_PATH); m_plugin_context.ServerCommand(temp); // the plugin will be unloaded when tf2 executes the command, // which then also loads the new version of the plugin. // the new version runs the updater which checks for plugin_old // and deletes it. } } void CEmptyServerPlugin::OnAutoUpdateReturn( bool bLoadUpdate ) { if (bLoadUpdate) { m_plugin_context.EnqueueGameFrameFunctor(CreateFunctor(this, &CEmptyServerPlugin::LoadUpdatedPlugin)); } } void CEmptyServerPlugin::GetGameRules() { m_pTeamplayRoundBasedRules = SCHelpers::GetTeamplayRoundBasedGameRulesPointer(); } void CEmptyServerPlugin::GetPropOffsets() { using namespace SCHelpers; if (!m_pTeamplayRoundBasedRules) { GetGameRules(); } unsigned int gamerulesoffset = GetPropOffsetFromTable( "DT_TFGameRulesProxy", "baseclass" ) + GetPropOffsetFromTable( "DT_TeamplayRoundBasedRulesProxy", "teamplayroundbased_gamerules_data" ); int roundstateoffset = gamerulesoffset + GetPropOffsetFromTable( "DT_TeamplayRoundBasedRules", "m_iRoundState" ); int waitingoffset = gamerulesoffset + GetPropOffsetFromTable( "DT_TeamplayRoundBasedRules", "m_bInWaitingForPlayers" ); m_iRoundState = ByteOffsetFromPointer<int*>(m_pTeamplayRoundBasedRules, roundstateoffset); m_bInWaitingForPlayers = ByteOffsetFromPointer<bool*>(m_pTeamplayRoundBasedRules, waitingoffset); } void CEmptyServerPlugin::TournamentMatchStarted() { const char *RESTRICT hostname = m_plugin_context.GetHostName(); const char *RESTRICT mapname = m_plugin_context.GetMapName(); const char *RESTRICT bluname = m_plugin_context.GetBluTeamName(); const char *RESTRICT redname = m_plugin_context.GetRedTeamName(); m_logstats.TournamentMatchStarted(hostname, mapname, bluname, redname); m_SizzlingStats.SS_TournamentMatchStarted(&m_plugin_context); #ifdef PROTO_STATS int tick = m_plugin_context.GetCurrentTick(); m_EventStats.OnTournamentMatchStart(&m_plugin_context, tick); #endif m_bTournamentMatchStarted = true; } void CEmptyServerPlugin::TournamentMatchEnded() { m_logstats.TournamentMatchEnded(); m_SizzlingStats.SS_TournamentMatchEnded(&m_plugin_context); #ifdef PROTO_STATS m_EventStats.OnTournamentMatchEnd(&m_plugin_context, m_plugin_context.GetCurrentTick()); #endif m_bTournamentMatchStarted = false; } #ifdef GetProp #undef GetProp #endif static void RecurseServerTable( SendTable *pTable, int &spacing ) { SendTable *pSendTable = pTable; if (pSendTable == NULL) { spacing--; return; } char TableName[128]; int size = sizeof(TableName); memset( TableName, 0, size ); for (int i = 0; i < spacing; i++) V_strcat( TableName, " |", size ); V_strcat( TableName, pSendTable->GetName(), size ); Msg( "%s\n", TableName ); spacing++; int num = pSendTable->GetNumProps(); for (int i = 0; i < num; i++) { SendProp *pProp = pSendTable->GetProp(i); SendPropType PropType = pProp->m_Type; char type[10]; switch( PropType ) { case 0: Q_strncpy( type, "int", 10 ); break; case 1: Q_strncpy( type, "float", 10 ); break; case 2: Q_strncpy( type, "vector", 10 ); break; case 3: Q_strncpy( type, "vectorxy", 10 ); break; case 4: Q_strncpy( type, "string", 10 ); break; case 5: Q_strncpy( type, "array", 10 ); break; case 6: Q_strncpy( type, "datatable", 10 ); break; default: break; } memset( TableName, 0, sizeof(TableName) ); for (int j = 0; j < spacing; j++) V_strcat( TableName, " |", size ); V_strcat( TableName, pProp->GetName(), size ); Msg( "%s, Offset: %i ( type: %s, size: %i bits )\n", TableName, pProp->GetOffset(), type, pProp->m_nBits ); RecurseServerTable( pProp->GetDataTable(), ++spacing ); } spacing-=2; } void CEmptyServerPlugin::PrintServerTables( const CCommand &args ) { ServerClass *pClass = m_plugin_context.GetAllServerClasses(); while ( pClass ) { Msg("%s\n", pClass->m_pNetworkName ); SendTable *pTable = pClass->m_pTable; int i = 1; RecurseServerTable( pTable, i ); Msg("\n"); pClass = pClass->m_pNext; } }
32.655827
181
0.627939
SizzlingStats
dcaebb4ccb7339aa1c444ed84fb96d2d2e08f5c2
76
cpp
C++
src/third_party/doctest.cpp
ThomasGale/pytorch-cpp-rl
e25fa6418e308eefb7213c2d45528eaac20780ee
[ "MIT" ]
445
2019-04-11T12:30:34.000Z
2022-03-28T08:14:42.000Z
src/third_party/doctest.cpp
ThomasGale/pytorch-cpp-rl
e25fa6418e308eefb7213c2d45528eaac20780ee
[ "MIT" ]
21
2019-04-11T20:18:02.000Z
2021-11-27T12:56:58.000Z
src/third_party/doctest.cpp
ThomasGale/pytorch-cpp-rl
e25fa6418e308eefb7213c2d45528eaac20780ee
[ "MIT" ]
87
2019-04-11T17:42:05.000Z
2022-03-10T15:55:48.000Z
#define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include "third_party/doctest.h"
25.333333
42
0.868421
ThomasGale
dcb6b232200032a1d1b5d1a613e3c821e7ff1ff5
17,683
cpp
C++
src/MinimiseProgramTransformer.cpp
ohamel-softwaresecure/souffle
d4b9fe641f0c51d2a25408af45416a7e5123f866
[ "UPL-1.0" ]
null
null
null
src/MinimiseProgramTransformer.cpp
ohamel-softwaresecure/souffle
d4b9fe641f0c51d2a25408af45416a7e5123f866
[ "UPL-1.0" ]
null
null
null
src/MinimiseProgramTransformer.cpp
ohamel-softwaresecure/souffle
d4b9fe641f0c51d2a25408af45416a7e5123f866
[ "UPL-1.0" ]
null
null
null
/* * Souffle - A Datalog Compiler * Copyright (c) 2018, The Souffle Developers. All rights reserved. * Licensed under the Universal Permissive License v 1.0 as shown at: * - https://opensource.org/licenses/UPL * - <souffle root>/licenses/SOUFFLE-UPL.txt */ /************************************************************************ * * @file MinimiseProgramTransformer.cpp * * Define classes and functionality related to program minimisation. * ***********************************************************************/ #include "AstArgument.h" #include "AstClause.h" #include "AstIO.h" #include "AstIOTypeAnalysis.h" #include "AstLiteral.h" #include "AstProgram.h" #include "AstRelation.h" #include "AstRelationIdentifier.h" #include "AstTransforms.h" #include "AstTranslationUnit.h" #include "AstUtils.h" #include "AstVisitor.h" #include <map> #include <memory> #include <stack> #include <string> #include <vector> namespace souffle { /** * Extract valid permutations from a given permutation matrix of valid moves. */ std::vector<std::vector<unsigned int>> extractPermutations( const std::vector<std::vector<unsigned int>>& permutationMatrix) { size_t clauseSize = permutationMatrix.size(); // keep track of the possible end-positions of each atom in the first clause std::vector<std::vector<unsigned int>> validMoves; for (size_t i = 0; i < clauseSize; i++) { std::vector<unsigned int> currentRow; for (size_t j = 0; j < clauseSize; j++) { if (permutationMatrix[i][j] == 1) { currentRow.push_back(j); } } validMoves.push_back(currentRow); } // extract the possible permutations, DFS style std::vector<std::vector<unsigned int>> permutations; std::vector<unsigned int> seen(clauseSize); std::vector<unsigned int> currentPermutation; std::stack<std::vector<unsigned int>> todoStack; todoStack.push(validMoves[0]); size_t currentIdx = 0; while (!todoStack.empty()) { if (currentIdx == clauseSize) { // permutation is complete permutations.push_back(currentPermutation); if (currentIdx == 0) { // already at starting position, so no more permutations possible break; } // undo the last number added to the permutation currentIdx--; seen[currentPermutation[currentIdx]] = 0; currentPermutation.pop_back(); // see if we can pick up other permutations continue; } // pull out the possibilities for the current point of the permutation std::vector<unsigned int> possibilities = todoStack.top(); todoStack.pop(); if (possibilities.empty()) { // no more possibilities at this point, so undo our last move if (currentIdx == 0) { // already at starting position, so no more permutations possible break; } currentIdx--; seen[currentPermutation[currentIdx]] = 0; currentPermutation.pop_back(); // continue looking for permutations continue; } // try the next possibility unsigned int nextNum = possibilities[0]; // update the possibility vector for the current position possibilities.erase(possibilities.begin()); todoStack.push(possibilities); if (seen[nextNum] != 0u) { // number already seen in this permutation continue; } else { // number can be used seen[nextNum] = 1; currentPermutation.push_back(nextNum); currentIdx++; // if we havent reached the end of the permutation, // push up the valid moves for the next position if (currentIdx < clauseSize) { todoStack.push(validMoves[currentIdx]); } } } // found all permutations return permutations; } /** * Check if the atom at leftIdx in the left clause can potentially be matched up * with the atom at rightIdx in the right clause. * NOTE: index 0 refers to the head atom, index 1 to the first body atom, and so on. */ bool isValidMove(const AstClause* left, size_t leftIdx, const AstClause* right, size_t rightIdx) { // invalid indices if (leftIdx < 0 || rightIdx < 0) { return false; } // handle the case where one of the indices refers to the head if (leftIdx == 0 && rightIdx == 0) { const AstAtom* leftHead = left->getHead()->getAtom(); const AstAtom* rightHead = right->getHead()->getAtom(); return leftHead->getName() == rightHead->getName(); } else if (leftIdx == 0 || rightIdx == 0) { return false; } // both must hence be body atoms int leftBodyAtomIdx = leftIdx - 1; const AstAtom* leftAtom = dynamic_cast<AstAtomLiteral*>(left->getBodyLiterals()[leftBodyAtomIdx])->getAtom(); int rightBodyAtomIdx = rightIdx - 1; const AstAtom* rightAtom = dynamic_cast<AstAtomLiteral*>(right->getBodyLiterals()[rightBodyAtomIdx])->getAtom(); return leftAtom->getName() == rightAtom->getName(); } /** * Check whether a valid variable mapping exists for the given permutation. */ bool isValidPermutation( const AstClause* left, const AstClause* right, const std::vector<unsigned int>& permutation) { // --- perform the permutation --- auto reorderedLeft = std::unique_ptr<AstClause>(left->clone()); // deduce the body atom permutation from the full clause permutation std::vector<unsigned int> bodyPermutation(permutation.begin() + 1, permutation.end()); for (unsigned int& i : bodyPermutation) { i -= 1; } // currently, <permutation[i] == j> indicates that atom i should map to position j // internally, for the clause class' reordering function, <permutation[i] == j> indicates // that position i should contain atom j // rearrange the permutation to match the internals // TODO (azreika): perhaps change the internal reordering strategy because this came up in MST too std::vector<unsigned int> reorderedPermutation(bodyPermutation.size()); for (size_t i = 0; i < bodyPermutation.size(); i++) { reorderedPermutation[bodyPermutation[i]] = i; } // perform the permutation reorderedLeft.reset(reorderAtoms(reorderedLeft.get(), reorderedPermutation)); // --- check if a valid variable exists corresponding to this permutation --- std::map<std::string, std::string> variableMap; visitDepthFirst(*reorderedLeft, [&](const AstVariable& var) { variableMap[var.getName()] = ""; }); // need to match the variables in the body std::vector<AstLiteral*> leftAtoms = reorderedLeft->getBodyLiterals(); std::vector<AstLiteral*> rightAtoms = right->getBodyLiterals(); // need to match the variables in the head leftAtoms.push_back(reorderedLeft->getHead()); rightAtoms.push_back(right->getHead()); // check if a valid variable mapping exists auto isVariable = [&](const AstArgument* arg) { return dynamic_cast<const AstVariable*>(arg) != nullptr; }; auto isConstant = [&](const AstArgument* arg) { return dynamic_cast<const AstConstant*>(arg) != nullptr; }; bool validMapping = true; for (size_t i = 0; i < leftAtoms.size() && validMapping; i++) { // match arguments std::vector<AstArgument*> leftArgs = dynamic_cast<AstAtomLiteral*>(leftAtoms[i])->getAtom()->getArguments(); std::vector<AstArgument*> rightArgs = dynamic_cast<AstAtomLiteral*>(rightAtoms[i])->getAtom()->getArguments(); for (size_t j = 0; j < leftArgs.size(); j++) { AstArgument* leftArg = leftArgs[j]; AstArgument* rightArg = rightArgs[j]; if (isVariable(leftArg) && isVariable(rightArg)) { // both variables, their names should match to each other through the clause std::string leftVarName = dynamic_cast<AstVariable*>(leftArg)->getName(); std::string rightVarName = dynamic_cast<AstVariable*>(rightArg)->getName(); std::string currentMap = variableMap[leftVarName]; if (currentMap.empty()) { // unassigned yet, so assign it appropriately variableMap[leftVarName] = rightVarName; } else if (currentMap != rightVarName) { // mapping is inconsistent! // clauses cannot be equivalent under this permutation validMapping = false; break; } } else if (isConstant(leftArg) && isConstant(rightArg)) { // check if its the same constant auto leftCst = dynamic_cast<AstConstant*>(leftArg)->getRamRepresentation(); auto rightCst = dynamic_cast<AstConstant*>(rightArg)->getRamRepresentation(); if (leftCst != rightCst) { // constants don't match, failed! validMapping = false; break; } } else { // not the same type, failed! validMapping = false; break; } } } // return whether a valid variable mapping exists for this permutation return validMapping; } /** * Check whether two clauses are bijectively equivalent. */ bool areBijectivelyEquivalent(const AstClause* left, const AstClause* right) { // only check bijective equivalence for a subset of the possible clauses auto isValidClause = [&](const AstClause* clause) { // check that all body literals are atoms // i.e. avoid clauses with constraints or negations // TODO (azreika): extend to constraints and negations for (AstLiteral* lit : clause->getBodyLiterals()) { if (dynamic_cast<AstAtom*>(lit) == nullptr) { return false; } } // check that all arguments are either constants or variables // i.e. only allow primitive arguments bool valid = true; visitDepthFirst(*clause, [&](const AstArgument& arg) { if (dynamic_cast<const AstVariable*>(&arg) == nullptr && dynamic_cast<const AstConstant*>(&arg) == nullptr) { valid = false; } }); return valid; }; if (!isValidClause(left) || !isValidClause(right)) { return false; } // rules must be the same length to be equal if (left->getBodyLiterals().size() != right->getBodyLiterals().size()) { return false; } // head atoms must have the same arity if (left->getHead()->getArity() != right->getHead()->getArity()) { return false; } // set up the n x n permutation matrix, where n is the number of // atoms in the clause, including the head atom size_t size = left->getBodyLiterals().size() + 1; auto permutationMatrix = std::vector<std::vector<unsigned int>>(size); for (auto& i : permutationMatrix) { i = std::vector<unsigned int>(size); } // create permutation matrix permutationMatrix[0][0] = 1; for (size_t i = 1; i < size; i++) { for (size_t j = 1; j < size; j++) { if (isValidMove(left, i, right, j)) { permutationMatrix[i][j] = 1; } } } // check if any of these permutations have valid variable mappings associated with them std::vector<std::vector<unsigned int>> permutations = extractPermutations(permutationMatrix); for (auto permutation : permutations) { if (isValidPermutation(left, right, permutation)) { // valid permutation with valid corresponding variable mapping exists // therefore, the two clauses are equivalent! return true; } } return false; } /** * Reduces locally-redundant clauses. * A clause is locally-redundant if there is another clause within the same relation * that computes the same set of tuples. * @return true iff the program was changed */ bool reduceLocallyEquivalentClauses(AstTranslationUnit& translationUnit) { AstProgram& program = *translationUnit.getProgram(); std::vector<AstClause*> clausesToDelete; // split up each relation's rules into equivalence classes // TODO (azreika): consider turning this into an ast analysis instead for (AstRelation* rel : program.getRelations()) { std::vector<std::vector<AstClause*>> equivalenceClasses; for (AstClause* clause : rel->getClauses()) { bool added = false; for (std::vector<AstClause*>& eqClass : equivalenceClasses) { AstClause* rep = eqClass[0]; if (areBijectivelyEquivalent(rep, clause)) { // clause belongs to an existing equivalence class, so delete it eqClass.push_back(clause); clausesToDelete.push_back(clause); added = true; break; } } if (!added) { // clause does not belong to any existing equivalence class, so keep it std::vector<AstClause*> clauseToAdd = {clause}; equivalenceClasses.push_back(clauseToAdd); } } } // remove non-representative clauses for (auto clause : clausesToDelete) { program.removeClause(clause); } // changed iff any clauses were deleted return !clausesToDelete.empty(); } /** * Removes redundant singleton relations. * Singleton relations are relations with a single clause. A singleton relation is redundant * if there exists another singleton relation that computes the same set of tuples. * @return true iff the program was changed */ bool reduceSingletonRelations(AstTranslationUnit& translationUnit) { // Note: This reduction is particularly useful in conjunction with the // body-partitioning transformation AstProgram& program = *translationUnit.getProgram(); auto* ioTypes = translationUnit.getAnalysis<IOType>(); // Find all singleton relations to consider std::vector<AstClause*> singletonRelationClauses; for (AstRelation* rel : program.getRelations()) { if (!ioTypes->isIO(rel) && rel->getClauses().size() == 1) { AstClause* clause = rel->getClauses()[0]; singletonRelationClauses.push_back(clause); } } // Keep track of clauses found to be redundant std::set<AstClause*> redundantClauses; // Keep track of canonical relation name for each redundant clause std::map<AstRelationIdentifier, AstRelationIdentifier> canonicalName; // Check pairwise equivalence of each singleton relation for (size_t i = 0; i < singletonRelationClauses.size(); i++) { AstClause* first = singletonRelationClauses[i]; if (redundantClauses.find(first) != redundantClauses.end()) { // Already found to be redundant, no need to check continue; } for (size_t j = i + 1; j < singletonRelationClauses.size(); j++) { AstClause* second = singletonRelationClauses[j]; // Note: Bijective-equivalence check does not care about the head relation name if (areBijectivelyEquivalent(first, second)) { AstRelationIdentifier firstName = first->getHead()->getName(); AstRelationIdentifier secondName = second->getHead()->getName(); redundantClauses.insert(second); canonicalName.insert(std::pair(secondName, firstName)); } } } // Remove redundant relation definitions for (AstClause* clause : redundantClauses) { auto relName = clause->getHead()->getName(); AstRelation* rel = program.getRelation(relName); assert(rel != nullptr && "relation does not exist in program"); program.removeClause(clause); program.removeRelation(relName); } // Replace each redundant relation appearance with its canonical name struct replaceRedundantRelations : public AstNodeMapper { const std::map<AstRelationIdentifier, AstRelationIdentifier>& canonicalName; replaceRedundantRelations(const std::map<AstRelationIdentifier, AstRelationIdentifier>& canonicalName) : canonicalName(canonicalName) {} std::unique_ptr<AstNode> operator()(std::unique_ptr<AstNode> node) const override { // Remove appearances from children nodes node->apply(*this); if (auto* atom = dynamic_cast<AstAtom*>(node.get())) { auto pos = canonicalName.find(atom->getName()); if (pos != canonicalName.end()) { auto newAtom = std::unique_ptr<AstAtom>(atom->clone()); newAtom->setName(pos->second); return newAtom; } } return node; } }; replaceRedundantRelations update(canonicalName); program.apply(update); // Program was changed iff a relation was replaced return !canonicalName.empty(); } bool MinimiseProgramTransformer::transform(AstTranslationUnit& translationUnit) { bool changed = false; changed |= reduceLocallyEquivalentClauses(translationUnit); changed |= reduceSingletonRelations(translationUnit); return changed; } } // namespace souffle
37.227368
110
0.618673
ohamel-softwaresecure
dcbc873ec2bf7e2e84d96a3d9d262182b862bc67
10,745
cpp
C++
src/coreclr/src/md/compiler/custattr_import.cpp
abock/runtime
b3346807be96f6089fc1538946b3611f607389e2
[ "MIT" ]
6
2020-01-04T14:02:35.000Z
2020-01-05T15:28:09.000Z
src/coreclr/src/md/compiler/custattr_import.cpp
abock/runtime
b3346807be96f6089fc1538946b3611f607389e2
[ "MIT" ]
15
2017-01-27T20:18:50.000Z
2019-11-14T00:52:58.000Z
src/coreclr/src/md/compiler/custattr_import.cpp
abock/runtime
b3346807be96f6089fc1538946b3611f607389e2
[ "MIT" ]
3
2021-02-10T16:20:05.000Z
2021-03-12T07:55:36.000Z
// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. //***************************************************************************** // // CustAttr_Import.cpp // // Implementation for the meta data custom attribute import code (code:IMetaDataImport). // //***************************************************************************** #include "stdafx.h" #include "regmeta.h" #include "metadata.h" #include "corerror.h" #include "mdutil.h" #include "rwutil.h" #include "mdlog.h" #include "importhelper.h" #include "mdperf.h" #include "posterror.h" #include "cahlprinternal.h" #include "custattr.h" #include "corhdr.h" #include <metamodelrw.h> //***************************************************************************** // Implementation of hash for custom attribute types. //***************************************************************************** unsigned int CCustAttrHash::Hash(const CCustAttrHashKey *pData) { return static_cast<unsigned int>(pData->tkType); } // unsigned long CCustAttrHash::Hash() unsigned int CCustAttrHash::Compare(const CCustAttrHashKey *p1, CCustAttrHashKey *p2) { if (p1->tkType == p2->tkType) return 0; return 1; } // unsigned long CCustAttrHash::Compare() CCustAttrHash::ELEMENTSTATUS CCustAttrHash::Status(CCustAttrHashKey *p) { if (p->tkType == FREE) return (FREE); if (p->tkType == DELETED) return (DELETED); return (USED); } // CCustAttrHash::ELEMENTSTATUS CCustAttrHash::Status() void CCustAttrHash::SetStatus(CCustAttrHashKey *p, CCustAttrHash::ELEMENTSTATUS s) { p->tkType = s; } // void CCustAttrHash::SetStatus() void* CCustAttrHash::GetKey(CCustAttrHashKey *p) { return &p->tkType; } // void* CCustAttrHash::GetKey() //***************************************************************************** // Get the value of a CustomAttribute, using only TypeName for lookup. //***************************************************************************** STDMETHODIMP RegMeta::GetCustomAttributeByName( // S_OK or error. mdToken tkObj, // [IN] Object with Custom Attribute. LPCWSTR wzName, // [IN] Name of desired Custom Attribute. const void **ppData, // [OUT] Put pointer to data here. ULONG *pcbData) // [OUT] Put size of data here. { HRESULT hr; // A result. BEGIN_ENTRYPOINT_NOTHROW; LPUTF8 szName; // Name in UFT8. int iLen; // A length. CMiniMdRW *pMiniMd = NULL; START_MD_PERF(); LOCKREAD(); pMiniMd = &(m_pStgdb->m_MiniMd); iLen = WszWideCharToMultiByte(CP_UTF8,0, wzName,-1, NULL,0, 0,0); szName = (LPUTF8)_alloca(iLen); VERIFY(WszWideCharToMultiByte(CP_UTF8,0, wzName,-1, szName,iLen, 0,0)); hr = ImportHelper::GetCustomAttributeByName(pMiniMd, tkObj, szName, ppData, pcbData); ErrExit: STOP_MD_PERF(GetCustomAttributeByName); END_ENTRYPOINT_NOTHROW; return hr; } // STDMETHODIMP RegMeta::GetCustomAttributeByName() //***************************************************************************** // Enumerate the CustomAttributes for a given token. //***************************************************************************** STDMETHODIMP RegMeta::EnumCustomAttributes( HCORENUM *phEnum, // Pointer to the enum. mdToken tk, // Token to scope the enumeration. mdToken tkType, // Type to limit the enumeration. mdCustomAttribute rCustomAttributes[], // Put CustomAttributes here. ULONG cMax, // Max CustomAttributes to put. ULONG *pcCustomAttributes) // Put # tokens returned here. { HRESULT hr = S_OK; BEGIN_ENTRYPOINT_NOTHROW; HENUMInternal **ppmdEnum = reinterpret_cast<HENUMInternal **> (phEnum); ULONG ridStart; ULONG ridEnd; HENUMInternal *pEnum = *ppmdEnum; CustomAttributeRec *pRec; ULONG index; LOG((LOGMD, "RegMeta::EnumCustomAttributes(0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x, 0x%08x)\n", phEnum, tk, tkType, rCustomAttributes, cMax, pcCustomAttributes)); START_MD_PERF(); LOCKREAD(); if ( pEnum == 0 ) { // instantiating a new ENUM CMiniMdRW *pMiniMd = &(m_pStgdb->m_MiniMd); CLookUpHash *pHashTable = pMiniMd->m_pLookUpHashs[TBL_CustomAttribute]; // Does caller want all custom Values? if (IsNilToken(tk)) { IfFailGo( HENUMInternal::CreateSimpleEnum(mdtCustomAttribute, 1, pMiniMd->getCountCustomAttributes()+1, &pEnum) ); } else { // Scope by some object. if ( pMiniMd->IsSorted( TBL_CustomAttribute ) ) { // Get CustomAttributes for the object. IfFailGo(pMiniMd->getCustomAttributeForToken(tk, &ridEnd, &ridStart)); if (IsNilToken(tkType)) { // Simple enumerator for object's entire list. IfFailGo( HENUMInternal::CreateSimpleEnum( mdtCustomAttribute, ridStart, ridEnd, &pEnum) ); } else { // Dynamic enumerator for subsetted list. IfFailGo( HENUMInternal::CreateDynamicArrayEnum( mdtCustomAttribute, &pEnum) ); for (index = ridStart; index < ridEnd; index ++ ) { IfFailGo(pMiniMd->GetCustomAttributeRecord(index, &pRec)); if (tkType == pMiniMd->getTypeOfCustomAttribute(pRec)) { IfFailGo( HENUMInternal::AddElementToEnum(pEnum, TokenFromRid(index, mdtCustomAttribute) ) ); } } } } else { if (pHashTable) { // table is not sorted but hash is built // We want to create dynmaic array to hold the dynamic enumerator. TOKENHASHENTRY *p; ULONG iHash; int pos; mdToken tkParentTmp; mdToken tkTypeTmp; // Hash the data. iHash = pMiniMd->HashCustomAttribute(tk); IfFailGo( HENUMInternal::CreateDynamicArrayEnum( mdtCustomAttribute, &pEnum) ); // Go through every entry in the hash chain looking for ours. for (p = pHashTable->FindFirst(iHash, pos); p; p = pHashTable->FindNext(pos)) { CustomAttributeRec *pCustomAttribute; IfFailGo(pMiniMd->GetCustomAttributeRecord(RidFromToken(p->tok), &pCustomAttribute)); tkParentTmp = pMiniMd->getParentOfCustomAttribute(pCustomAttribute); tkTypeTmp = pMiniMd->getTypeOfCustomAttribute(pCustomAttribute); if (tkParentTmp == tk) { if (IsNilToken(tkType) || tkType == tkTypeTmp) { // compare the blob value IfFailGo( HENUMInternal::AddElementToEnum(pEnum, TokenFromRid(p->tok, mdtCustomAttribute )) ); } } } } else { // table is not sorted and hash is not built so we have to create dynmaic array // create the dynamic enumerator and loop through CA table linearly // ridStart = 1; ridEnd = pMiniMd->getCountCustomAttributes() + 1; IfFailGo( HENUMInternal::CreateDynamicArrayEnum( mdtCustomAttribute, &pEnum) ); for (index = ridStart; index < ridEnd; index ++ ) { IfFailGo(pMiniMd->GetCustomAttributeRecord(index, &pRec)); if ( tk == pMiniMd->getParentOfCustomAttribute(pRec) && (tkType == pMiniMd->getTypeOfCustomAttribute(pRec) || IsNilToken(tkType))) { IfFailGo( HENUMInternal::AddElementToEnum(pEnum, TokenFromRid(index, mdtCustomAttribute) ) ); } } } } } // set the output parameter *ppmdEnum = pEnum; } // fill the output token buffer hr = HENUMInternal::EnumWithCount(pEnum, cMax, rCustomAttributes, pcCustomAttributes); ErrExit: HENUMInternal::DestroyEnumIfEmpty(ppmdEnum); STOP_MD_PERF(EnumCustomAttributes); END_ENTRYPOINT_NOTHROW; return hr; } // STDMETHODIMP RegMeta::EnumCustomAttributes() //***************************************************************************** // Get information about a CustomAttribute. //***************************************************************************** STDMETHODIMP RegMeta::GetCustomAttributeProps( mdCustomAttribute cv, // The attribute token mdToken *ptkObj, // [OUT, OPTIONAL] Put object token here. mdToken *ptkType, // [OUT, OPTIONAL] Put TypeDef/TypeRef token here. void const **ppBlob, // [OUT, OPTIONAL] Put pointer to data here. ULONG *pcbSize) // [OUT, OPTIONAL] Put size of data here. { HRESULT hr = S_OK; // A result. BEGIN_ENTRYPOINT_NOTHROW; CMiniMdRW *pMiniMd; START_MD_PERF(); LOCKREAD(); _ASSERTE(TypeFromToken(cv) == mdtCustomAttribute); pMiniMd = &(m_pStgdb->m_MiniMd); CustomAttributeRec *pCustomAttributeRec; // The custom value record. IfFailGo(pMiniMd->GetCustomAttributeRecord(RidFromToken(cv), &pCustomAttributeRec)); if (ptkObj) *ptkObj = pMiniMd->getParentOfCustomAttribute(pCustomAttributeRec); if (ptkType) *ptkType = pMiniMd->getTypeOfCustomAttribute(pCustomAttributeRec); if (ppBlob != NULL) { IfFailGo(pMiniMd->getValueOfCustomAttribute(pCustomAttributeRec, (const BYTE **)ppBlob, pcbSize)); } ErrExit: STOP_MD_PERF(GetCustomAttributeProps); END_ENTRYPOINT_NOTHROW; return hr; } // RegMeta::GetCustomAttributeProps
37.968198
126
0.530014
abock
dcc3545da60d25d0055cba79b7ec9299ad6c4975
492
cpp
C++
light.cpp
jesuisthanos/RayTracer
df8658eb0c9206fc7084712b1436caa1a4086e1e
[ "MIT" ]
null
null
null
light.cpp
jesuisthanos/RayTracer
df8658eb0c9206fc7084712b1436caa1a4086e1e
[ "MIT" ]
null
null
null
light.cpp
jesuisthanos/RayTracer
df8658eb0c9206fc7084712b1436caa1a4086e1e
[ "MIT" ]
null
null
null
// // Framework for a raytracer // File: light.cpp // // Created for the Computer Science course "Introduction Computer Graphics" // taught at the University of Groningen by Tobias Isenberg. // // Author: Maarten Everts // Stephane Gosset // Sy-Thanh Ho // // This framework is inspired by and uses code of the raytracer framework of // Bert Freudenberg that can be found at // http://isgwww.cs.uni-magdeburg.de/graphik/lehre/cg2/projekt/rtprojekt.html // #include "light.h"
27.333333
79
0.715447
jesuisthanos
dcc4c51646836ed86bf4cd3a6a48f5b26d7e8e3d
929
cpp
C++
EXP5/AntEdgeDetection.cpp
PrasekMatej/AntEdgeDetection
f98577a83cf6da7a76f30e66afd3ed16ab360127
[ "BSD-2-Clause" ]
null
null
null
EXP5/AntEdgeDetection.cpp
PrasekMatej/AntEdgeDetection
f98577a83cf6da7a76f30e66afd3ed16ab360127
[ "BSD-2-Clause" ]
null
null
null
EXP5/AntEdgeDetection.cpp
PrasekMatej/AntEdgeDetection
f98577a83cf6da7a76f30e66afd3ed16ab360127
[ "BSD-2-Clause" ]
null
null
null
#include <iostream> #include <chrono> #include "CommandParser.h" #include "ImageParser.h" #include "AntColonySystem.h" #include "Parameters.h" using namespace std; int main(int argc, char** argv) { cout << "Parsing m_parameters." << endl; Parameters parameters; Parse(argc, argv, parameters); cout << "Parameters parsed." << endl; cout << "Parsing image." << endl; ParseIntensity(parameters); cout << "Image parsed." << endl; auto begin = chrono::steady_clock::now(); cout << "Starting simulation." << endl; AntColonySystem acs (std::move(parameters)); acs.Run(); auto end = chrono::steady_clock::now(); ofstream performance; performance.open("RESULTS/performance.txt"); performance << "Simulation lasted " << chrono::duration_cast<std::chrono::milliseconds> (end - begin).count() / 1000.0 << " seconds"; performance.close(); cout << "Simulation ended." << endl; }
25.805556
135
0.663079
PrasekMatej
dcc8569f3d6328bdcdfcb22284a2e2c83b05ab71
54,372
cpp
C++
src/dbdump/dbdump_MutgosDumpFileReader.cpp
mutgos/mutgos_server
115270d07db22d320e0b51095e9219f0a0e15ddb
[ "MIT" ]
5
2019-02-24T06:42:52.000Z
2021-04-09T19:16:24.000Z
src/dbdump/dbdump_MutgosDumpFileReader.cpp
mutgos/mutgos_server
115270d07db22d320e0b51095e9219f0a0e15ddb
[ "MIT" ]
40
2019-02-24T15:25:54.000Z
2021-05-17T04:22:43.000Z
src/dbdump/dbdump_MutgosDumpFileReader.cpp
mutgos/mutgos_server
115270d07db22d320e0b51095e9219f0a0e15ddb
[ "MIT" ]
2
2019-02-23T22:58:36.000Z
2019-02-27T01:27:42.000Z
/* * dbdump_MutgosDumpFileReader.cpp */ #include <stddef.h> #include <fstream> #include <boost/algorithm/string/trim.hpp> #include <boost/algorithm/string/case_conv.hpp> #include "text/text_StringConversion.h" #include "text/text_Utf8Tools.h" #include "utilities/mutgos_config.h" #include "dbdump_MutgosDumpFileReader.h" #include "dbtypes/dbtype_Id.h" #include "dbtypes/dbtype_DocumentProperty.h" #include "dbtypes/dbtype_IdProperty.h" #include "dbtypes/dbtype_Security.h" #include "dbtypes/dbtype_EntityField.h" #include "dbtypes/dbtype_Lock.h" #define VAR_OPEN_PREFIX '{' #define VAR_CLOSE_PREFIX '}' #define PROG_REG_PREFIX '$' #define OBJ_REG_PREFIX '%' #define COMMENT_PREFIX '#' #define FILE_STACK_LIMIT 16 namespace { const std::string INCLUDE_COMMAND = "@@INCLUDE "; } // TODO: Need a way to clear out a site namespace mutgos { namespace dbdump { // ---------------------------------------------------------------------- MutgosDumpFileReader::MutgosDumpFileReader( const std::string &file_name, const std::string &base_path) : error_condition(false), file_parsed(false), parser_mode(MutgosDumpFileReader::PARSER_NONE), subparser_mode(MutgosDumpFileReader::SUBPARSER_NONE), current_site(0), current_entity_field(dbtype::ENTITYFIELD_invalid), current_document_ptr(0), items_left(0), current_set_type(dbtype::PROPERTYDATATYPE_invalid), current_set_ptr(0), operation_not(false), base_file_path(base_path) { if (file_name.empty()) { set_error("The file name provided was empty."); } else if (base_path.empty()) { set_error("The base path provided was empty."); } else { add_file_to_stack(file_name); } } // ---------------------------------------------------------------------- MutgosDumpFileReader::~MutgosDumpFileReader() { while (not file_stack.empty()) { FileStream * const file_ptr = file_stack.back(); file_stack.pop_back(); delete file_ptr; } delete current_document_ptr; current_document_ptr = 0; delete current_set_ptr; current_set_ptr = 0; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::parse(std::string &message) { bool result = true; message.clear(); if (error_condition) { // File was already bad, just return error and stop. result = false; message = status_message; } else { FileStream *file = file_stack.back(); std::string line; // Confirm version // file->increment_line(); std::getline(file->stream, line); boost::trim(line); if (line != "MUTGOS DUMP VERSION 1") { // Not a dump file. set_error("Not a MUTGOS version 1 dump file!"); } // Parse the file line by line // while ((not file_stack.empty()) and (not file_parsed) and (not error_condition)) { line.clear(); file->increment_line(); std::getline(file->stream, line); if (file->stream.bad()) { set_error("I/O error"); } else if (line == "MUTGOS DUMP END") { file_parsed = true; } else if (not text::utf8_valid(line)) { set_error("Line is not UTF8 compliant."); } else { if (not current_document_ptr) { boost::trim(line); } parse_line(line); } if ((file->stream.eof()) and (not error_condition)) { // End of file. If this is an inner file, pop // and go to the previous file. // if (file_stack.size() > 1) { delete file_stack.back(); file_stack.pop_back(); } else { set_error("Primary dump file ended unexpectedly."); } } if (file_stack.empty()) { file = 0; } else { file = file_stack.back(); } } // Parsing completed. Determine if there was an error and if the // file was complete. // if ((not error_condition) and (file_stack.size() != 1)) { error_condition = true; status_message += "File stack is empty or has more files than expected!"; } if (not error_condition) { if ((parser_mode == PARSER_NONE) and (subparser_mode == SUBPARSER_NONE)) { message = "Parsing completed successfully."; } else { result = false; message = "Parsing error: File is incomplete, not " "properly closed, or in the wrong mode to close."; } } else { result = false; message = status_message; db.set_error(); } } return result; } // ---------------------------------------------------------------------- size_t MutgosDumpFileReader::get_current_line_index(void) const { size_t result = 0; if (not file_stack.empty()) { result = file_stack.back()->current_line; } return result; } // ---------------------------------------------------------------------- std::string MutgosDumpFileReader::get_current_file(void) const { std::string result; if (not file_stack.empty()) { result = file_stack.back()->file_name; } return result; } // ---------------------------------------------------------------------- size_t MutgosDumpFileReader::get_current_line_index_prev_file(void) const { size_t result = 0; if (file_stack.size() > 1) { result = file_stack[file_stack.size() - 2]->current_line; } return result; } // ---------------------------------------------------------------------- std::string MutgosDumpFileReader::get_prev_file(void) const { std::string result; if (file_stack.size() > 1) { result = file_stack[file_stack.size() - 2]->file_name; } return result; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::add_file_to_stack(const std::string &file_name) { bool result = true; if (file_stack.size() >= FILE_STACK_LIMIT) { result = false; set_error("File stack size exceeded. Too many nested files."); } else { FileStream *const file = new FileStream(file_name); file_stack.push_back(file); if ((not file->stream.good()) or (not file->stream.is_open())) { set_error("The file " + file_name + " cannot be read."); result = false; delete file; file_stack.pop_back(); } } return result; } // ---------------------------------------------------------------------- void MutgosDumpFileReader::parse_line(const std::string &input) { if (not input.empty()) { if (input.find(INCLUDE_COMMAND) == 0) { // They want to jump parsing to a new file. // Do not allow absolute paths or going up a directory // for security purposes. // std::string file_path = input.substr(INCLUDE_COMMAND.size()); boost::trim(file_path); if (file_path.empty() or (file_path.find("..") != std::string::npos) or (file_path[0] == '/')) { set_error("File include path is empty or not allowed: " + file_path); } else { // Potentially valid file. Form the full path and try and // open. // file_path = base_file_path + "/" + file_path; add_file_to_stack(file_path); } } else if (current_document_ptr or (input[0] != COMMENT_PREFIX)) { if (subparser_mode != SUBPARSER_NONE) { // In the middle of a multi-line item, so let those // parsers handle it. // switch (subparser_mode) { case SUBPARSER_LOCK: { subparse_lock(input); break; } case SUBPARSER_LOCK_ID: { subparse_lock_id(input); break; } case SUBPARSER_LOCK_PROPERTY: { subparse_lock_property(input); break; } case SUBPARSER_DOCUMENT: { subparse_document(input); break; } default: { set_error("Unknown subparser mode!"); } } } else { // Standard line // switch (parser_mode) { case PARSER_NONE: { parse_none(input); break; } case PARSER_ENTITY: { parse_entity(input); break; } case PARSER_SECURITY: { parse_security(input); break; } case PARSER_FIELDS: { parse_fields(input); break; } case PARSER_PROPERTIES: { parse_properties(input); break; } default: { set_error("Unknown parser mode!"); } } } } } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::parse_none(const std::string &input) { // Supports these commands: // mksite // setsitedesc // setsite // mkentity // modify // end site std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if (command == "mksite") { if (not db.make_site(parsed_input, current_site)) { set_error("Unable to make site " + parsed_input); } } else if (command == "setsitedesc") { if (not db.set_site_description(parsed_input)) { set_error("Unable to set site description to " + parsed_input); } } else if (command == "setsite") { dbtype::Id::SiteIdType parsed_site_id = 0; if (not text::from_string<dbtype::Id::SiteIdType>( parsed_input, parsed_site_id)) { set_error("Cannot convert site ID: " + parsed_input); } else { if (not db.set_site(parsed_site_id)) { set_error("Unable to set site " + parsed_input); } } } else if (command == "mkentity") { const std::string entity_type_str = boost::to_lower_copy(get_word(parsed_input)); const dbtype::EntityType entity_type = dbtype::string_to_entity_type(entity_type_str); current_id = db.make_entity(entity_type); if (current_id.is_default()) { set_error("mkentity: Could not make Entity with type " + entity_type_str); } else { parser_mode = PARSER_ENTITY; // Made entity, now see if we need to store it in the lookup if (not parsed_input.empty()) { if (not set_variable(parsed_input, current_id)) { set_error("mkentity: unable to set variable " + parsed_input + ". Wrong format?"); } } } } else if (command == "modentity") { if (parsed_input.empty()) { set_error("modentity: missing variable or regname"); } else { if (is_variable(parsed_input)) { const dbtype::Id &var_id = get_variable(parsed_input); if (var_id.is_default()) { set_error("modentity: variable does not exist: " + parsed_input); } else { if (db.set_entity(var_id)) { parser_mode = PARSER_ENTITY; } else { set_error("modentity: unable to set Entity " + var_id.to_string(true)); } } } else if (is_prog_reg_name(parsed_input)) { const dbtype::Id id = get_prog_reg(parsed_input); if (id.is_default()) { set_error("modentity: Program reg name does " "not exist: " + parsed_input); } else { if (db.set_entity(id)) { parser_mode = PARSER_ENTITY; } else { set_error("modentity: unable to set Entity " + id.to_string(true)); } } } else { set_error("modentity: Unknown ID type"); } } } else if (command == "end") { boost::to_lower(parsed_input); if (parsed_input == "site") { if (not db.end_site()) { set_error("end site: Wrong mode to end site!"); } else { current_site = 0; } } else { set_error("end: Invalid end command for this mode: " + parsed_input); } } else { set_error("Unknown command: " + command); } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::parse_entity(const std::string &input) { // Supports these commands: // print // owner // name // flag // security // fields // properties // end entity // std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if (command == "print") { db.log_entity(); } else if (command == "owner") { if (not is_variable(parsed_input)) { set_error("entity owner: invalid variable reference"); } else { const dbtype::Id &owner = get_variable(parsed_input); if (owner.is_default()) { set_error("entity owner: cannot find variable " + parsed_input); } else { if (not db.set_entity_owner(owner)) { set_error("entity owner: cannot set"); } } } } else if (command == "name") { if (parsed_input.empty()) { set_error("entity name: Missing name"); } else if (not db.set_entity_name(parsed_input)) { set_error("entity name: Unable to set!"); } } else if (command == "flag") { if (parsed_input.empty()) { set_error("entity name: Missing flag"); } else if (not db.add_entity_flag(parsed_input)) { set_error("entity flag: Unable to add flag!"); } } else if (command == "security") { if (db.set_entity_security()) { parser_mode = PARSER_SECURITY; } else { set_error("entity security: Unable to set mode!"); } } else if (command == "fields") { parser_mode = PARSER_FIELDS; } else if (command == "properties") { // TODO Actually confirm entity can support properties parser_mode = PARSER_PROPERTIES; } else if (command == "end") { boost::to_lower(parsed_input); if (parsed_input == "entity") { if (not db.end_entity()) { set_error("end entity: Wrong mode to end Entity."); } else { current_id = default_id; parser_mode = PARSER_NONE; } } else { set_error("entity: Unknown mode to end: " + parsed_input); } } else { set_error("entity: Unknown command: " + command); } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::parse_security(const std::string &input) { // Supports these commands: // group // admin // flag (group, other) // end security // std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if (command == "group") { if (not is_variable(parsed_input)) { set_error("security group: invalid variable reference"); } else { const dbtype::Id &group = get_variable(parsed_input); if (group.is_default()) { set_error("security group: cannot find variable " + parsed_input); } else { if (not db.add_to_security_group(group)) { set_error("security group: cannot add"); } } } } else if (command == "admin") { if (not is_variable(parsed_input)) { set_error("security admin: invalid variable reference"); } else { const dbtype::Id &admin = get_variable(parsed_input); if (admin.is_default()) { set_error("security admin: cannot find variable " + parsed_input); } else { if (not db.add_to_security_admins(admin)) { set_error("security admin: cannot add"); } } } } else if (command == "flag") { boost::to_lower(parsed_input); const std::string flag_list = get_word(parsed_input); dbtype::SecurityFlag parsed_flag = dbtype::Security::security_flag_from_string(parsed_input); if (parsed_flag == dbtype::SECURITYFLAG_invalid) { set_error("security flag: Unknown flag " + parsed_input); } else { if (flag_list == "group") { if (not db.add_security_flag_list(parsed_flag)) { set_error("security flag set group: Could not set flag " + parsed_input); } } else if (flag_list == "other") { if (not db.add_security_flag_other(parsed_flag)) { set_error("security flag set other: Could not set flag " + parsed_input); } } else { set_error("security flag set: Unknown flag list " + flag_list); } } } else if (command == "end") { boost::to_lower(parsed_input); if (parsed_input == "security") { if (not db.end_security()) { set_error("end security: Wrong mode to end Security"); } else { if (current_property.empty()) { parser_mode = PARSER_ENTITY; } else { parser_mode = PARSER_PROPERTIES; } } } else { set_error("security: Unknown mode to end: " + parsed_input); } } else { set_error("security: Unknown command: " + command); } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::parse_fields(const std::string &input) { std::string field_string; std::string value; if (not get_key_value(input, field_string, value)) { // Not a key/value, see if it's an end // std::string parsed_input = boost::to_lower_copy(input); const std::string command = get_word(parsed_input); if ((command == "end") and (parsed_input == "fields")) { parser_mode = PARSER_ENTITY; } else { set_error("entity field: Malformed input: " + input); } } else { boost::to_lower(field_string); const dbtype::EntityField field = dbtype::string_to_entity_field(field_string); if (field == dbtype::ENTITYFIELD_invalid) { set_error("entity field: Unknown field " + field_string); } else { current_entity_field = field; switch (db.which_set_field_method(field)) { // String fields // case DumpReaderInterface::METHOD_string: case DumpReaderInterface::METHOD_string_multiple: { // Field is a string type // if (not db.set_entity_field(field, value)) { set_error("entity field (string): Cannot set field " + field_string + " to " + value); } break; } // ID fields // case DumpReaderInterface::METHOD_id: case DumpReaderInterface::METHOD_id_multiple: { if (is_variable(value)) { const dbtype::Id &id = get_variable(value); if (id.is_default()) { set_error("entity field (id): Variable does " "not exist: " + value); } else { if (not db.set_entity_field(field, id)) { set_error("entity field (id): Unable to " "set ID " + id.to_string(true)); } } } else if (is_prog_reg_name(value)) { switch (field) { case dbtype::ENTITYFIELD_linked_programs: case dbtype::ENTITYFIELD_action_targets: { const dbtype::Id id = get_prog_reg(value); if (id.is_default()) { set_error("entity field (id): " "Program reg name does " "not exist: " + value); } else { db.set_entity_field(field, id); } break; } default: { set_error("entity field (id): " "Cannot use program reg names with " "this field"); } } } else { set_error("entity field (id): Unknown ID type"); } break; } // Document fields // case DumpReaderInterface::METHOD_document: { // Going into a subparser. Set the subparser mode, // then call it with the value. // subparser_mode = SUBPARSER_DOCUMENT; subparse_document(value); break; } // Lock fields // case DumpReaderInterface::METHOD_lock: { subparser_mode = SUBPARSER_LOCK; subparse_lock(value); break; } // Invalid // case DumpReaderInterface::METHOD_invalid: { set_error("entity field: Invalid field for being set: " + field_string); break; } // Unknown // default: { set_error("entity field: Unknown field type " "(internal error)."); break; } } } } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::parse_properties(const std::string &input) { std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); std::string property_path; dbtype::PropertyData *property_data_ptr = 0; // Handle a command if not currently in the middle of parsing a // multiline property, or parse a new property. // if ((not is_parsing_property_data()) and command == "security") { // Extract the application name and owner variable const std::string application = get_word(parsed_input); if (application.empty() or (not is_variable(parsed_input))) { set_error("properties: application name empty or no " "variable for owner: " + input); } else { const dbtype::Id &id = get_variable(parsed_input); if (id.is_default()) { set_error("properties: Cannot find variable for owner: " + parsed_input); } else { if (db.add_application(application, id) and db.set_application_props_security(application)) { // Added application, parse security parameters // current_property = application; parser_mode = PARSER_SECURITY; } else { set_error("properties: Unable to add application or " "set security for " + application); } } } } else if ((not is_parsing_property_data()) and command == "end") { boost::to_lower(parsed_input); if (parsed_input == "properties") { parser_mode = PARSER_ENTITY; current_property.clear(); } else { set_error("properties: Invalid end command for this " "mode: " + parsed_input); } } else { // A property to parse, or one already in progress. // if (shared_property_parser(input, property_path, property_data_ptr)) { // Completed parsing, set it. if (not db.set_prop(property_path, *property_data_ptr)) { set_error("properties: Unable to set property " + property_path); } delete property_data_ptr; property_data_ptr = 0; } } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::subparse_lock(const std::string &input) { // supports only two commands, basically a brancher: // id (lock by) // property (lock by) // const std::string &parsed_input = boost::to_lower_copy(input); if (parsed_input == "id") { subparser_mode = SUBPARSER_LOCK_ID; operation_not = false; } else if (parsed_input == "!id") { subparser_mode = SUBPARSER_LOCK_ID; operation_not = true; } else if (parsed_input == "property") { subparser_mode = SUBPARSER_LOCK_PROPERTY; operation_not = false; } else if (parsed_input == "!property") { subparser_mode = SUBPARSER_LOCK_PROPERTY; operation_not = true; } else { set_error("lock: Unknown lock type " + input); } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::subparse_lock_id(const std::string &input) { // Supports locking by ID and end (lock) // if (is_variable(input)) { // An ID, try and look it up and use as the lock // const dbtype::Id &id = get_variable(input); if (id.is_default()) { set_error("lock by ID: variable " + input + " not found"); } else { if (not db.set_entity_lock_field( current_entity_field, id, operation_not)) { set_error("lock by ID: Could not lock against ID " + id.to_string(true)); } } } else { std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if (command != "end") { set_error("lock by ID: Unknown command " + command); } else { if (parsed_input != "lock") { set_error("lock by ID: Unknown type to end " + parsed_input); } else { subparser_mode = SUBPARSER_NONE; operation_not = false; } } } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::subparse_lock_property(const std::string &input) { std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if ((not is_parsing_property_data()) and (command == "end")) { if (parsed_input != "lock") { set_error("lock by property: Unknown type to end " + parsed_input); } else { subparser_mode = SUBPARSER_NONE; operation_not = false; } } else { // Probably the property. Go ahead and try to parse it. // std::string property_key; dbtype::PropertyData *property_value_ptr = 0; if (shared_property_parser(input, property_key, property_value_ptr)) { // Finished parsing, go ahead and use property info. if (not property_value_ptr) { set_error("lock by property: Unexpected null property value!"); } else { if (not db.set_entity_lock_field( current_entity_field, property_key, *property_value_ptr, operation_not)) { set_error("lock by property: Unable to set lock"); } delete property_value_ptr; property_value_ptr = 0; } } } } // ---------------------------------------------------------------------- void MutgosDumpFileReader::subparse_document(const std::string &input) { if (shared_document_parser(input)) { // All done, set the document and continue. // if (current_property.empty()) { // Setting on a field // if (not db.set_entity_field( current_entity_field, *current_document_ptr)) { set_error("document: Unable to set document on field " + dbtype::entity_field_to_string( current_entity_field)); } } else { // Setting on a property // if (not db.set_prop( current_property, *current_document_ptr)) { set_error( "document: Unable to set document on property " + current_property); } } subparser_mode = SUBPARSER_NONE; delete current_document_ptr; current_document_ptr = 0; } } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::shared_document_parser(const std::string &input) { bool result = false; if (not current_document_ptr) { // First call. Figure out how many lines we will have // std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if (command == "lines") { if (not text::from_string<MG_UnsignedInt>( parsed_input, items_left)) { set_error("document: Cannot convert number of lines: " + parsed_input); } else { current_document_ptr = new dbtype::DocumentProperty(); if (current_entity_field == dbtype::EntityField::ENTITYFIELD_program_source_code) { // Source code gets a longer Document length. current_document_ptr->set_max_lines( config::db::limits_program_lines()); } } } else { set_error("document: Missing number of lines: " + input); } } else if (items_left) { // Document in progress. You can end it early with '.end'. // TODO Eliminate line count altogether? // if (input == ".end") { items_left = 1; result = true; } else if (not current_document_ptr->append_line(input)) { set_error("document: Unable to append line."); } --items_left; } else { // We're at the end; confirm by looking for an 'end', then returning // true so caller knows they can set the document. // std::string parsed_input = boost::to_lower_copy(input); const std::string command = get_word(parsed_input); if (command == "end") { if (parsed_input == "lines") { result = true; } else { set_error("document: Unknown mode to end: " + parsed_input); } } else { set_error("document: Unexpected command: " + input); } } return result; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::shared_set_parser( const dbtype::PropertyDataType &set_type, const std::string &input) { bool result = false; if (not current_set_ptr) { // First call. Figure out how many items we will have // std::string parsed_input = input; const std::string command = boost::to_lower_copy(get_word(parsed_input)); if (command == "items") { if (not text::from_string<MG_UnsignedInt>( parsed_input, items_left)) { set_error("set: Cannot convert number of items: " + parsed_input); } else { current_set_ptr = new dbtype::SetProperty(); } } else { set_error("set: Missing number of items: " + input); } } else if (items_left) { // Set in progress // dbtype::PropertyData *item_data = db.create_property_data(current_set_type, input); if (not item_data) { set_error("set: Unable to parse item: " + input); } else { if (not current_set_ptr->add(*item_data)) { set_error("set: Unable to add item data: " + item_data->get_as_string()); } delete item_data; item_data = 0; } --items_left; } else { // We're at the end; confirm by looking for an 'end', then returning // true so caller knows they can set the 'set'. // std::string parsed_input = boost::to_lower_copy(input); const std::string command = get_word(parsed_input); if (command == "end") { if (parsed_input == "items") { result = true; } else { set_error("set: Unknown mode to end: " + parsed_input); } } else { set_error("set: Unexpected command: " + input); } } return result; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::shared_property_parser( const std::string &input, std::string &property_key, dbtype::PropertyData *&value_ptr) { bool result = false; if (current_document_ptr) { // In the middle of parsing a document, so call that instead if (shared_document_parser(input)) { // Finished the document, return the data. // property_key = current_property; value_ptr = current_document_ptr; current_property.clear(); current_document_ptr = 0; result = true; } } else if (current_set_ptr) { // In the middle of parsing a set, so call that instead. if (shared_set_parser(current_set_type, input)) { // Finished the set, return the data. // property_key = current_property; value_ptr = current_set_ptr; current_property.clear(); current_set_ptr = 0; result = true; } } else { std::string parsed_input = input; const std::string property_type_string = boost::to_lower_copy(get_word(parsed_input)); dbtype::PropertyDataType property_type = dbtype::string_to_property_data_type(property_type_string); if (property_type == dbtype::PROPERTYDATATYPE_invalid) { set_error("property: Unknown property type " + property_type_string); } else { std::string property_value; // Parse a property, including any special multi-line or other // cases. // if (property_type == dbtype::PROPERTYDATATYPE_document) { // Special case for documents since they are multi-line // if (not get_key_value( parsed_input, current_property, property_value)) { set_error("property (document): Unable to parse " "key value pair: " + parsed_input); } else { // Prime the document parser with number of lines shared_document_parser(property_value); } } else if (property_type == dbtype::PROPERTYDATATYPE_id) { // Special case for IDs because they only use variables. // if (not get_key_value( parsed_input, property_key, property_value)) { set_error("property (id): Unable to parse " "key value pair: " + parsed_input); } else { if (not is_variable(property_value)) { set_error("property (id): Value is not a variable"); } else { const dbtype::Id &id = get_variable(property_value); if (id.is_default()) { set_error("property (id): Variable " + property_value + " does not exist."); } else { value_ptr = new dbtype::IdProperty(id); result = true; } } } } else if (property_type == dbtype::PROPERTYDATATYPE_set) { // Special case for sets. Next word is the type of the // set values // const std::string set_type_string = boost::to_lower_copy(get_word(parsed_input)); const dbtype::PropertyDataType set_type = dbtype::string_to_property_data_type(set_type_string); if (set_type == dbtype::PROPERTYDATATYPE_invalid) { set_error("property (set): Invalid set type " + set_type_string); } else if (not get_key_value( parsed_input, current_property, property_value)) { set_error("property (set): Unable to parse key value " "pair: " + parsed_input); } else { shared_set_parser(set_type, property_value); } } else { // Normal case // if (not get_key_value( parsed_input, property_key, property_value)) { set_error("property (simple): Unable to parse key value " "pair: " + parsed_input); } else { value_ptr = db.create_property_data(property_type, property_value); result = value_ptr; } } } } return result; } // ---------------------------------------------------------------------- void MutgosDumpFileReader::set_error(const std::string &cause) { error_condition = true; status_message = cause; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::get_key_value( const std::string &input, std::string &key, std::string &value) const { bool result = true; const size_t equals_index = input.find_first_of('='); key.clear(); value.clear(); if (equals_index == std::string::npos) { result = false; } else { if (equals_index) { key = boost::trim_right_copy(input.substr(0, equals_index)); } if ((input.size() - 1) > equals_index) { value = boost::trim_left_copy(input.substr(equals_index + 1)); } } return result; } // ---------------------------------------------------------------------- std::string MutgosDumpFileReader::get_word( std::string &input) const { std::string result; const size_t index = input.find_first_of(' '); if (index == std::string::npos) { // Not found or whole string is just the command. if (not input.empty()) { result = input; input.clear(); } } else { result = input.substr(0, index); input.erase(0, index + 1); boost::trim_left(input); } return result; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::is_variable(const std::string &input) const { return (input.size() > 2) and (input[0] == VAR_OPEN_PREFIX) and (input[input.size() - 1] == VAR_CLOSE_PREFIX); } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::is_prog_reg_name(const std::string &input) const { return (input.size() > 1) and (input[0] == PROG_REG_PREFIX); } // ---------------------------------------------------------------------- const dbtype::Id& MutgosDumpFileReader::get_variable( const std::string &variable) const { if (is_variable(variable)) { VariableMap::const_iterator var_iter = variables.find(variable.substr(1, variable.size() - 2)); if (var_iter != variables.end()) { return var_iter->second; } } return default_id; } // ---------------------------------------------------------------------- const dbtype::Id MutgosDumpFileReader::get_prog_reg( const std::string &regname) { dbtype::Id result; if (is_prog_reg_name(regname)) { db.get_dbinterface()->find_program_by_reg_name( current_site, regname.substr(1), result); if (result.is_default() and (current_site > 1)) { // Could not find in current site... try site 1 db.get_dbinterface()->find_program_by_reg_name( 1, regname.substr(1), result); } } return result; } // ---------------------------------------------------------------------- bool MutgosDumpFileReader::set_variable( const std::string &variable, const dbtype::Id &id) { bool result = false; if (is_variable(variable)) { const std::string variable_name = variable.substr(1, variable.size() - 2); variables[variable_name] = id; result = true; } return result; } } }
31.740806
83
0.394302
mutgos
dccd6840981511233989eacb9d154b203b1112ba
499
cpp
C++
shared/source/gen12lp/enable_family_full_core_gen12lp.cpp
troels/compute-runtime
3269e719a3ee7bcd97c50ec2cfe78fc8674adec0
[ "Intel", "MIT" ]
778
2017-09-29T20:02:43.000Z
2022-03-31T15:35:28.000Z
shared/source/gen12lp/enable_family_full_core_gen12lp.cpp
troels/compute-runtime
3269e719a3ee7bcd97c50ec2cfe78fc8674adec0
[ "Intel", "MIT" ]
478
2018-01-26T16:06:45.000Z
2022-03-30T10:19:10.000Z
shared/source/gen12lp/enable_family_full_core_gen12lp.cpp
troels/compute-runtime
3269e719a3ee7bcd97c50ec2cfe78fc8674adec0
[ "Intel", "MIT" ]
215
2018-01-30T08:39:32.000Z
2022-03-29T11:08:51.000Z
/* * Copyright (C) 2020-2021 Intel Corporation * * SPDX-License-Identifier: MIT * */ #include "shared/source/gen12lp/hw_cmds.h" #include "shared/source/helpers/hw_helper.h" namespace NEO { extern HwHelper *hwHelperFactory[IGFX_MAX_CORE]; typedef TGLLPFamily Family; static auto gfxFamily = IGFX_GEN12LP_CORE; struct EnableCoreGen12LP { EnableCoreGen12LP() { hwHelperFactory[gfxFamily] = &HwHelperHw<Family>::get(); } }; static EnableCoreGen12LP enable; } // namespace NEO
19.192308
64
0.733467
troels
dcce03f8043c67170a684aaa944338fb5e7d8d4a
3,028
ipp
C++
implement/oglplus/detail/glsl_source.ipp
highfidelity/oglplus
c5fb7cc21869cb9555cfa2a7e28ea6bc6491d11e
[ "BSL-1.0" ]
2
2017-06-09T00:28:35.000Z
2017-06-09T00:28:43.000Z
implement/oglplus/detail/glsl_source.ipp
highfidelity/oglplus
c5fb7cc21869cb9555cfa2a7e28ea6bc6491d11e
[ "BSL-1.0" ]
null
null
null
implement/oglplus/detail/glsl_source.ipp
highfidelity/oglplus
c5fb7cc21869cb9555cfa2a7e28ea6bc6491d11e
[ "BSL-1.0" ]
8
2017-01-30T22:06:41.000Z
2020-01-14T17:24:36.000Z
/** * .file oglplus/detail/glsl_source.ipp * .brief Implementation of GLSLSource helpers * * @author Matus Chochlik * * Copyright 2010-2015 Matus Chochlik. Distributed under the Boost * Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #include <stdexcept> namespace oglplus { namespace aux { OGLPLUS_LIB_FUNC StrCRefsGLSLSrcWrap::StrCRefsGLSLSrcWrap( AnyInputIter<StrCRef>&& i, AnyInputIter<StrCRef>&& e ): _ptrs(distance(i, e)) , _sizes(distance(i, e)) { auto pptr = _ptrs.begin(); auto psize = _sizes.begin(); while(i != e) { assert(pptr != _ptrs.end()); assert(psize != _sizes.end()); *pptr = i->begin(); *psize = int(i->size()); ++i; ++pptr; ++psize; } assert(_ptrs.size() == _sizes.size()); } OGLPLUS_LIB_FUNC void StrsGLSLSrcWrap::_init(void) { for(std::size_t i=0, n=_storage.size(); i!=n; ++i) { _ptrs[i] = _storage[i].c_str(); _sizes[i] = GLint(_storage[i].size()); } } OGLPLUS_LIB_FUNC StrsGLSLSrcWrap::StrsGLSLSrcWrap( AnyInputIter<String>&& i, AnyInputIter<String>&& e ): _storage(i, e) , _ptrs(_storage.size(), nullptr) , _sizes(_storage.size(), 0) { _init(); } OGLPLUS_LIB_FUNC StrsGLSLSrcWrap::StrsGLSLSrcWrap(std::vector<String>&& storage) : _storage(std::move(storage)) , _ptrs(_storage.size(), nullptr) , _sizes(_storage.size(), 0) { _init(); } OGLPLUS_LIB_FUNC GLint InputStreamGLSLSrcWrap::_check_and_get_size(std::istream& in) { GLint default_size = 1023; if(!in.good()) { std::string msg("Failed to read GLSL input stream."); throw std::runtime_error(msg); } in.exceptions(std::ios::badbit); std::streampos begin = in.tellg(); in.seekg(0, std::ios::end); if(in.good()) { std::streampos end = in.tellg(); if(in.good()) { in.seekg(0, std::ios::beg); if(in.good()) { return GLint(end - begin); } } } else { in.clear(); return default_size; } in.clear(); in.seekg(0, std::ios::beg); if(in.good()) { return default_size; } return 0; } OGLPLUS_LIB_FUNC std::vector<GLchar> InputStreamGLSLSrcWrap::_read_data( std::istream& input, std::size_t size ) { std::vector<GLchar> data; if(size > 0) { data.reserve(size+1); typedef std::istreambuf_iterator<GLchar> _iit; data.assign(_iit(input), _iit()); data.push_back('\0'); } return data; } OGLPLUS_LIB_FUNC InputStreamGLSLSrcWrap::InputStreamGLSLSrcWrap(std::istream& input) : _storage(_read_data(input, _check_and_get_size(input))) , _pdata(_storage.data()) , _size(GLint(_storage.size())) { } OGLPLUS_LIB_FUNC FileGLSLSrcWrapOpener::FileGLSLSrcWrapOpener(const char* path) : _file(path, std::ios::in) { if(!_file.good()) { std::string msg("Failed to open file '"); msg.append(path); msg.append("' for reading."); throw std::runtime_error(msg); } } OGLPLUS_LIB_FUNC FileGLSLSrcWrap::FileGLSLSrcWrap(const char* path) : FileGLSLSrcWrapOpener(path) , InputStreamGLSLSrcWrap(_file) { _file.close(); } } // namespace aux } // namespace oglplus
19.662338
68
0.679326
highfidelity
dcd556fe318f1f4491d507c709871f067892b1f4
696
cpp
C++
net.ssa/xrLC/Occlusion/visibilitytester.cpp
ixray-team/xray-vss-archive
b245c8601dcefb505b4b51f58142da6769d4dc92
[ "Linux-OpenIB" ]
1
2022-03-26T17:00:19.000Z
2022-03-26T17:00:19.000Z
xrLC/Occlusion/visibilitytester.cpp
ixray-team/xray-vss-archive
b245c8601dcefb505b4b51f58142da6769d4dc92
[ "Linux-OpenIB" ]
null
null
null
xrLC/Occlusion/visibilitytester.cpp
ixray-team/xray-vss-archive
b245c8601dcefb505b4b51f58142da6769d4dc92
[ "Linux-OpenIB" ]
1
2022-03-26T17:00:21.000Z
2022-03-26T17:00:21.000Z
#include "stdafx.h" #include "visibilitytester.h" void CVisibilityTest::Calculate(void) { if (Count>0) { CHK_DX(Device()->SetTransform(D3DTRANSFORMSTATE_WORLD,precalc_identity.d3d())); CHK_DX(Device()->ComputeSphereVisibility( (D3DVECTOR*)&(Center[0]), &(Radius[0]), Count, 0, &(Result[0]))); } } void CFrustumClipper::BuildFrustum() { Planes[fcpLeft ].n.set(-1,0,-1); Planes[fcpLeft].d = 0; Planes[fcpRight ].n.set( 1,0,-1); Planes[fcpLeft].d = 0; // Planes[fcpBottom].n.set(-1,0,-1); Planes[fcpLeft].d = 0; // Planes[fcpLeft ].n.set(-1,0,-1); Planes[fcpLeft].d = 0; // Planes[fcpFar ].n.set(Device.vCameraDirection); Planes[fcpLeft].d = 30; }
26.769231
82
0.636494
ixray-team
dcd620f917ccd110b6aee3cd3ebd5afc896f6340
405
cpp
C++
solutions_cpp/first_bad_version.cpp
aaishikasb/Leetcoding
c6ad25486716d43c780d840cc80aa20ef51a8674
[ "MIT" ]
null
null
null
solutions_cpp/first_bad_version.cpp
aaishikasb/Leetcoding
c6ad25486716d43c780d840cc80aa20ef51a8674
[ "MIT" ]
null
null
null
solutions_cpp/first_bad_version.cpp
aaishikasb/Leetcoding
c6ad25486716d43c780d840cc80aa20ef51a8674
[ "MIT" ]
null
null
null
// The API isBadVersion is defined for you. // bool isBadVersion(int version); class Solution { public: int firstBadVersion(int n) { int first = 1; int last = n; int mid; while(first <= last){ mid = ((last-first)>> 1) + first; if(isBadVersion(mid)) last = mid - 1; else first = mid + 1; } return last + 1; } };
21.315789
49
0.503704
aaishikasb
dcd927bf7c72133c9d7494b14aec4e32d4590a89
941
cpp
C++
src/yaodaq/ConnectionState.cpp
yaodaq/YAODAQ
3a7e60ef3eb415b0852b47a0bed698980dbc7777
[ "MIT" ]
null
null
null
src/yaodaq/ConnectionState.cpp
yaodaq/YAODAQ
3a7e60ef3eb415b0852b47a0bed698980dbc7777
[ "MIT" ]
null
null
null
src/yaodaq/ConnectionState.cpp
yaodaq/YAODAQ
3a7e60ef3eb415b0852b47a0bed698980dbc7777
[ "MIT" ]
1
2022-01-04T10:05:01.000Z
2022-01-04T10:05:01.000Z
/** \copyright Copyright 2022 flagarde */ #include "yaodaq/ConnectionState.hpp" #include "yaodaq/Identifier.hpp" namespace yaodaq { std::list<std::pair<std::string, std::string>> ConnectionState::m_Ids{}; ConnectionState::ConnectionState() : ix::ConnectionState() {} ConnectionState::~ConnectionState() { std::lock_guard<std::mutex> guard( m_Mutex ); m_Ids.remove( m_Pair ); } void ConnectionState::computeId( const std::string& host, const Identifier& id ) { std::lock_guard<std::mutex> guard( m_Mutex ); m_Pair = std::pair<std::string, std::string>( host, id.getName() ); if( id.empty() ) { _id = std::to_string( _globalId++ ); } else { std::list<std::pair<std::string, std::string>>::iterator found = std::find( m_Ids.begin(), m_Ids.end(), m_Pair ); if( found == m_Ids.end() ) { _id = id.getName(); m_Ids.push_back( m_Pair ); } else { setTerminated(); } } } } // namespace yaodaq
22.95122
117
0.651435
yaodaq
dcdb04c5fa4a93d6750c351edfd6bcef3a3cbc82
2,948
cpp
C++
export/release/windows/obj/src/polymod/format/EndLineType.cpp
SamuraiOfSecrets/Goatmeal-Time-v0.2
7b89cbaf6895495b90ee1a5679e9cc696a7fbb53
[ "Apache-2.0" ]
null
null
null
export/release/windows/obj/src/polymod/format/EndLineType.cpp
SamuraiOfSecrets/Goatmeal-Time-v0.2
7b89cbaf6895495b90ee1a5679e9cc696a7fbb53
[ "Apache-2.0" ]
null
null
null
export/release/windows/obj/src/polymod/format/EndLineType.cpp
SamuraiOfSecrets/Goatmeal-Time-v0.2
7b89cbaf6895495b90ee1a5679e9cc696a7fbb53
[ "Apache-2.0" ]
null
null
null
// Generated by Haxe 4.2.2 #include <hxcpp.h> #ifndef INCLUDED_polymod_format_EndLineType #include <polymod/format/EndLineType.h> #endif namespace polymod{ namespace format{ ::polymod::format::EndLineType EndLineType_obj::ANY; ::polymod::format::EndLineType EndLineType_obj::CR; ::polymod::format::EndLineType EndLineType_obj::CRLF; ::polymod::format::EndLineType EndLineType_obj::LF; bool EndLineType_obj::__GetStatic(const ::String &inName, ::Dynamic &outValue, ::hx::PropertyAccess inCallProp) { if (inName==HX_("ANY",cc,96,31,00)) { outValue = EndLineType_obj::ANY; return true; } if (inName==HX_("CR",af,3a,00,00)) { outValue = EndLineType_obj::CR; return true; } if (inName==HX_("CRLF",e9,c6,87,2c)) { outValue = EndLineType_obj::CRLF; return true; } if (inName==HX_("LF",7a,42,00,00)) { outValue = EndLineType_obj::LF; return true; } return super::__GetStatic(inName, outValue, inCallProp); } HX_DEFINE_CREATE_ENUM(EndLineType_obj) int EndLineType_obj::__FindIndex(::String inName) { if (inName==HX_("ANY",cc,96,31,00)) return 3; if (inName==HX_("CR",af,3a,00,00)) return 1; if (inName==HX_("CRLF",e9,c6,87,2c)) return 2; if (inName==HX_("LF",7a,42,00,00)) return 0; return super::__FindIndex(inName); } int EndLineType_obj::__FindArgCount(::String inName) { if (inName==HX_("ANY",cc,96,31,00)) return 0; if (inName==HX_("CR",af,3a,00,00)) return 0; if (inName==HX_("CRLF",e9,c6,87,2c)) return 0; if (inName==HX_("LF",7a,42,00,00)) return 0; return super::__FindArgCount(inName); } ::hx::Val EndLineType_obj::__Field(const ::String &inName,::hx::PropertyAccess inCallProp) { if (inName==HX_("ANY",cc,96,31,00)) return ANY; if (inName==HX_("CR",af,3a,00,00)) return CR; if (inName==HX_("CRLF",e9,c6,87,2c)) return CRLF; if (inName==HX_("LF",7a,42,00,00)) return LF; return super::__Field(inName,inCallProp); } static ::String EndLineType_obj_sStaticFields[] = { HX_("LF",7a,42,00,00), HX_("CR",af,3a,00,00), HX_("CRLF",e9,c6,87,2c), HX_("ANY",cc,96,31,00), ::String(null()) }; ::hx::Class EndLineType_obj::__mClass; Dynamic __Create_EndLineType_obj() { return new EndLineType_obj; } void EndLineType_obj::__register() { ::hx::Static(__mClass) = ::hx::_hx_RegisterClass(HX_("polymod.format.EndLineType",6a,c9,1c,17), ::hx::TCanCast< EndLineType_obj >,EndLineType_obj_sStaticFields,0, &__Create_EndLineType_obj, &__Create, &super::__SGetClass(), &CreateEndLineType_obj, 0 #ifdef HXCPP_VISIT_ALLOCS , 0 #endif #ifdef HXCPP_SCRIPTABLE , 0 #endif ); __mClass->mGetStaticField = &EndLineType_obj::__GetStatic; } void EndLineType_obj::__boot() { ANY = ::hx::CreateConstEnum< EndLineType_obj >(HX_("ANY",cc,96,31,00),3); CR = ::hx::CreateConstEnum< EndLineType_obj >(HX_("CR",af,3a,00,00),1); CRLF = ::hx::CreateConstEnum< EndLineType_obj >(HX_("CRLF",e9,c6,87,2c),2); LF = ::hx::CreateConstEnum< EndLineType_obj >(HX_("LF",7a,42,00,00),0); } } // end namespace polymod } // end namespace format
31.031579
162
0.707938
SamuraiOfSecrets
dcdf2794d75299674187c37f12a4c2fe2779f2c3
36,987
cxx
C++
run/scheduler/src/FieldPropagationHandler.cxx
Geant-RnD/geant
ffff95e23547531f3254ada2857c062a31f33e8f
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
run/scheduler/src/FieldPropagationHandler.cxx
Geant-RnD/geant
ffff95e23547531f3254ada2857c062a31f33e8f
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
run/scheduler/src/FieldPropagationHandler.cxx
Geant-RnD/geant
ffff95e23547531f3254ada2857c062a31f33e8f
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
#include "Geant/FieldPropagationHandler.h" #include "Geant/FieldConfig.h" #include "Geant/FieldLookup.h" #include "Geant/GUFieldPropagatorPool.h" #include "Geant/GUFieldPropagator.h" #include "Geant/ConstBzFieldHelixStepper.h" #include "Geant/ConstFieldHelixStepper.h" #include "Geant/FieldTrack.h" #include "Geant/Track.h" #include <sstream> #include "base/SOA3D.h" // #include "SOA6D.h" #include "Geant/VectorTypes.h" // Defines geant::Double_v etc #include "Geant/SystemOfUnits.h" #include "Geant/WorkspaceForFieldPropagation.h" #include "Geant/FlexIntegrationDriver.h" #include "navigation/NavigationState.h" #include "Geant/ScalarNavInterfaceVG.h" #include "Geant/ScalarNavInterfaceVGM.h" #include "Geant/VectorNavInterface.h" using Double_v = geant::Double_v; // #define CHECK_VS_RK 1 //#define CHECK_VS_HELIX 1 // #define REPORT_AND_CHECK 1 // #define STATS_METHODS 1 // #define DEBUG_FIELD 1 #ifdef CHECK_VS_HELIX #define CHECK_VS_SCALAR 1 #endif #ifdef CHECK_VS_RK #define CHECK_VS_SCALAR 1 #endif namespace geant { inline namespace GEANT_IMPL_NAMESPACE { const double FieldPropagationHandler::gEpsDeflection = 1.E-2 * units::cm; auto stageAfterCrossing = kPostPropagationStage; #ifdef STATS_METHODS static std::atomic<unsigned long> numRK, numHelixZ, numHelixGen, numTot; #endif //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE FieldPropagationHandler::FieldPropagationHandler(int threshold, Propagator *propagator, double epsTol) : Handler(threshold, propagator), fEpsTol(epsTol) { // Default constructor // std::cout << " FieldPropagationHandler c-tor called: threshold= " << threshold << std::endl; SetName("FieldPropagation"); InitializeStats(); } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::InitializeStats() { #ifdef STATS_METHODS numTot = 0; numRK = 0; numHelixZ = 0; numHelixGen = 0; #else // std::cout << " Field Propagation Handler: no statistics for types of steps." << std::endl; #endif } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE FieldPropagationHandler::~FieldPropagationHandler() { // Destructor std::cerr << "Statistics from FieldPropagation destructor." << std::endl; PrintStats(); } //______________________________________________________________________________ void FieldPropagationHandler::Cleanup(TaskData *td) { delete td->fSpace4FieldProp; td->fSpace4FieldProp = nullptr; } //______________________________________________________________________________ // Curvature for general field VECCORE_ATT_HOST_DEVICE double FieldPropagationHandler::Curvature(const Track &track) const { using ThreeVector_d = vecgeom::Vector3D<double>; constexpr double tiny = 1.E-30; constexpr double inv_kilogauss = 1.0 / units::kilogauss; ThreeVector_d MagFld; double bmag = 0.0; ThreeVector_d Position(track.X(), track.Y(), track.Z()); FieldLookup::GetFieldValue(Position, MagFld, bmag); // , td); bmag *= inv_kilogauss; MagFld *= inv_kilogauss; // Calculate transverse momentum 'Pt' for field 'B' // ThreeVector_d Momentum(track.Px(), track.Py(), track.Pz()); ThreeVector_d PtransB; // Transverse wrt direction of B double ratioOverFld = 0.0; if (bmag > 0) ratioOverFld = Momentum.Dot(MagFld) / (bmag * bmag); PtransB = Momentum - ratioOverFld * MagFld; double Pt_mag = PtransB.Mag(); return fabs(Track::kB2C * track.Charge() * bmag / (Pt_mag + tiny)); } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::DoIt(Track *track, Basket &output, TaskData *td) { // Scalar geometry length computation. The track is moved into the output basket. using vecCore::math::Max; using vecCore::math::Min; constexpr double step_push = 1.e-4; // The minimum step is step_push in case the physics step limit is not smaller double step_min = Min(track->GetPstep(), step_push); // The track snext value is already the minimum between geometry and physics double step_geom_phys = Max(step_min, track->GetSnext()); // Field step limit. We use the track sagitta to estimate the "bending" error, // i.e. what is the propagated length for which the track deviation in // magnetic field with respect to straight propagation is less than epsilon. double step_field = Max(SafeLength(*track, gEpsDeflection), track->GetSafety()); double step = Min(step_geom_phys, step_field); // Propagate in magnetic field PropagateInVolume(*track, step, td); // Update number of partial steps propagated in field td->fNmag++; // Set continuous processes stage as follow-up for tracks that reached the // physics process if (track->Status() == kPhysics) { // Update number of steps to physics and total number of steps td->fNphys++; td->fNsteps++; track->SetStage(stageAfterCrossing); // Future: (kPostPropagationStage); } else { // Crossing tracks continue to continuous processes, the rest have to // query again the geometry if (!IsSameLocation(*track, td)) { td->fNcross++; td->fNsteps++; } else { track->SetStage(kGeometryStepStage); } } output.AddTrack(track); } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::DoIt(Basket &input, Basket &output, TaskData *td) { // Vector geometry length computation. The tracks are moved into the output basket. using vecCore::math::Max; using vecCore::math::Min; constexpr double step_push = 1.e-4; TrackVec_t &tracks = input.Tracks(); int ntracks = tracks.size(); double *steps = td->GetDblArray(ntracks); for (int itr = 0; itr < ntracks; itr++) { // Can this loop be vectorized? Track &track = *tracks[itr]; // The minimum step is step_push in case the physics step limit is not smaller double step_min = Min(track.GetPstep(), step_push); // The track snext value is already the minimum between geometry and physics double step_geom_phys = Max(step_min, track.GetSnext()); // Field step limit. We use the track sagitta to estimate the "bending" error, // i.e. what is the propagated length for which the track deviation in // magnetic field with respect to straight propagation is less than epsilon. double step_field = Max(SafeLength(track, gEpsDeflection), track.GetSafety()); // Select step to propagate as the minimum among the "safe" step and: // the straight distance to boundary (if fboundary=1) or the proposed physics // step (fboundary=0) steps[itr] = Min(step_geom_phys, step_field); } // Propagate the vector of tracks PropagateInVolume(input.Tracks(), steps, td); // Update number of partial steps propagated in field td->fNmag += ntracks; // Update time of flight and number of interaction lengths. // Check also if it makes sense to call the vector interfaces #if !(defined(VECTORIZED_GEOMERY) && defined(VECTORIZED_SAMELOC)) for (auto track : tracks) { if (track->Status() == kPhysics) { // Update number of steps to physics and total number of steps td->fNphys++; // Find a new Counter !!! TODO td->fNsteps++; track->SetStage(stageAfterCrossing); // kPostPropagationStage); } else { // Vector treatment was not requested, so proceed with scalar if (!IsSameLocation(*track, td)) { td->fNcross++; td->fNsteps++; } else { track->SetStage(kGeometryStepStage); } } output.AddTrack(track); } #else // If vectorized treatment was requested and the remaining population is // large enough, continue with vectorized treatment constexpr int kMinVecSize = 8; // this should be retrieved from elsewhere int nvect = 0; if (nvect < kMinVecSize) { for (auto track : tracks) { if (track->Status() == kPhysics) { output.AddTrack(track); continue; } if (!IsSameLocation(*track, td)) { td->fNcross++; td->fNsteps++; // Why not ? track->SetStage(stageAfterCrossing); // Future: (kPostPropagationStage); } else { track->SetStage(kGeometryStepStage); } output.AddTrack(track); continue; } return; } // This part deals with vectorized treatment // Copy data to SOA and dispatch for vector mode TrackGeo_v &track_geo = *td.fGeoTrack; for (auto track : tracks) { if (track.Status() != kPhysics && (track.GetSafety() < 1.E-10 || track.GetSnext() < 1.E-10)) track_geo.AddTrack(*track); } bool *same = td->GetBoolArray(nvect); NavigationState *tmpstate = td->GetPath(); VectorNavInterface::NavIsSameLocation(nvect, track_geo.fXposV, track_geo.fYposV, track_geo.fZposV, track_geo.fXdirV, track_geo.fYdirV, track_geo.fZdirV, (const VolumePath_t **)fPathV, fNextpathV, same, tmpstate); track_geo.UpdateOriginalTracks(); for (itr = 0; itr < nsel; itr++) { Track *track = track_geo.fOriginalV[itr]; if (!same[itr]) { td->fNcross++; td->fNsteps++; track->SetBoundary(true); track->SetStatus(kBoundary); if (track->NextPath()->IsOutside()) track->SetStatus(kExitingSetup); // if (track->GetStep() < 1.E-8) td->fNsmall++; } else { track->SetBoundary(false); track->SetStage(kGeometryStepStage); } output.AddTrack(track); } #endif } void FieldPropagationHandler::VectorDispatchOverhead(TrackVec_t &tracks, TaskData *td) { // This function just reproduces the overhead for gather/scatter in vector mode using vecgeom::SOA3D; using vecgeom::Vector3D; const int nTracks = tracks.size(); PrepareBuffers(nTracks, td); auto wsp = td->fSpace4FieldProp; // WorkspaceForFieldPropagation * double *fltCharge = wsp->fChargeInp; double *momentumMag = wsp->fMomentumInp; double *steps = wsp->fStepsInp; SOA3D<double> &position3D = *(wsp->fPositionInp); SOA3D<double> &direction3D = *(wsp->fDirectionInp); SOA3D<double> &PositionOut = *(wsp->fPositionOutp); SOA3D<double> &DirectionOut = *(wsp->fDirectionOutp); for (int itr = 0; itr < nTracks; ++itr) { Track *pTrack = tracks[itr]; // gather fltCharge[itr] = pTrack->Charge(); momentumMag[itr] = pTrack->P(); steps[itr] = 0; position3D.push_back(pTrack->X(), pTrack->Y(), pTrack->Z()); direction3D.push_back(pTrack->Dx(), pTrack->Dy(), pTrack->Dz()); // scatter PositionOut.push_back(pTrack->X(), pTrack->Y(), pTrack->Z()); DirectionOut.push_back(pTrack->Dx(), pTrack->Dy(), pTrack->Dz()); } } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::PropagateInVolume(Track &track, double crtstep, TaskData *td) { // Single track propagation in a volume. The method is to be called // only with charged tracks in magnetic field.The method decreases the fPstepV // fSafetyV and fSnextV with the propagated values while increasing the fStepV. // The status and boundary flags are set according to which gets hit first: // - physics step (bdr=0) // - safety step (bdr=0) // - snext step (bdr=1) // std::cout << "FieldPropagationHandler::PropagateInVolume called for 1 track" << std::endl; using ThreeVector = vecgeom::Vector3D<double>; constexpr double toKiloGauss = 1.0 / units::kilogauss; // Converts to kilogauss bool useRungeKutta = td->fPropagator->fConfig->fUseRungeKutta; auto fieldConfig = FieldLookup::GetFieldConfig(); double bmag = -1.0; ThreeVector BfieldInitial; ThreeVector Position(track.X(), track.Y(), track.Z()); FieldLookup::GetFieldValue(Position, BfieldInitial, bmag); auto fieldPropagator = td->fFieldPropagator; #if DEBUG_FIELD bool verboseDiff = true; // If false, print just one line. Else more details. bool epsilonRK = td->fPropagator->fConfig->fEpsilonRK; double curvaturePlus = fabs(Track::kB2C * track.Charge() * (bmag * toKiloGauss)) / (track.P() + 1.0e-30); // norm for step const double angle = crtstep * curvaturePlus; #endif #ifdef PRINT_STEP_SINGLE Print("--PropagateInVolume(Single): ", "Momentum= %9.4g (MeV) Curvature= %9.4g (1/mm) CurvPlus= %9.4g (1/mm) step= " "%f (mm) Bmag=%8.4g KG angle= %g\n", (track.P() / units::MeV), Curvature(track) * units::mm, curvaturePlus * units::mm, crtstep / units::mm, bmag * toKiloGauss, angle); // Print("\n"); #endif ThreeVector Direction(track.Dx(), track.Dy(), track.Dz()); ThreeVector PositionNew(0., 0., 0.); ThreeVector DirectionNew(0., 0., 0.); // char method= '0'; ThreeVector PositionNewCheck(0., 0., 0.); ThreeVector DirectionNewCheck(0., 0., 0.); if (useRungeKutta || !fieldConfig->IsFieldUniform()) { assert(fieldPropagator); fieldPropagator->DoStep(Position, Direction, track.Charge(), track.P(), crtstep, PositionNew, DirectionNew); #ifdef DEBUG_FIELD // cross check #ifndef CHECK_VS_BZ ConstFieldHelixStepper stepper(BfieldInitial * toKiloGauss); stepper.DoStep<double>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNewCheck, DirectionNewCheck); #else double Bz = BfieldInitial[2] * toKiloGauss; ConstBzFieldHelixStepper stepper_bz(Bz); // stepper_bz.DoStep<ThreeVector, double, int>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNewCheck, DirectionNewCheck); #endif double posShift = (PositionNew - PositionNewCheck).Mag(); double dirShift = (DirectionNew - DirectionNewCheck).Mag(); if (posShift > epsilonRK || dirShift > epsilonRK) { std::cout << "*** position/direction shift RK vs. HelixConstBz :" << posShift << " / " << dirShift << "\n"; printf("*** position/direction shift RK vs. HelixConstBz : %f / %f \n", posShift, dirShift); if (verboseDiff) { printf("%s End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", " FPH::PiV(1)-RK: ", PositionNew.x(), PositionNew.y(), PositionNew.z(), DirectionNew.x(), DirectionNew.y(), DirectionNew.z()); printf("%s End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", " FPH::PiV(1)-Bz: ", PositionNewCheck.x(), PositionNewCheck.y(), PositionNewCheck.z(), DirectionNewCheck.x(), DirectionNewCheck.y(), DirectionNewCheck.z()); } } #endif // method= 'R'; #ifdef STATS_METHODS numRK++; #endif } else { // Must agree with values in magneticfield/inc/Units.h double Bz = BfieldInitial[2] * toKiloGauss; const bool dominantBz = false; if (dominantBz) { // Constant field in Z-direction ConstBzFieldHelixStepper stepper(Bz); // stepper.DoStep<ThreeVector, double, int>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNew, DirectionNew); // method= 'z'; #ifdef STATS_METHODS numHelixZ++; #endif } else { // geant:: double BfieldArr[3] = {BfieldInitial.x() * toKiloGauss, BfieldInitial.y() * toKiloGauss, BfieldInitial.z() * toKiloGauss}; ConstFieldHelixStepper stepper(BfieldArr); stepper.DoStep<double>(Position, Direction, track.Charge(), track.P(), crtstep, PositionNew, DirectionNew); // method= 'v'; #ifdef STATS_METHODS numHelixGen++; #endif } } #ifdef PRINT_FIELD // Print(" FPH::PiV(1): Start>", " Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f", Position.x(), Position.y(), // Position.z(), Direction.x(), Direction.y(), Direction.z() ); // Print(" FPH::PiV(1): End> ", " Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f", PositionNew.x(), PositionNew.y(), // PositionNew.z(), DirectionNew.x(), DirectionNew.y(), DirectionNew.z() ); // printf(" FPH::PiV(1): "); printf(" FPH::PiV(1):: ev= %3d trk= %3d %3d %c ", track.Event(), track.Particle(), track.GetNsteps(), method); printf("Start> Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f ", Position.x(), Position.y(), Position.z(), Direction.x(), Direction.y(), Direction.z()); printf(" s= %10.6f ang= %7.5f ", crtstep / units::mm, angle); printf( // " FPH::PiV(1): " "End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", PositionNew.x(), PositionNew.y(), PositionNew.z(), DirectionNew.x(), DirectionNew.y(), DirectionNew.z()); #endif #ifdef STATS_METHODS unsigned long modbase = 100; if (numTot % modbase < 1) { PrintStats(); if (numTot > 10 * modbase) modbase = 10 * modbase; } #endif // may normalize direction here // vecCore::math::Normalize(dirnew); ThreeVector DirectionUnit = DirectionNew.Unit(); double posShiftSq = (PositionNew - Position).Mag2(); track.SetPosition(PositionNew); track.SetDirection(DirectionUnit); track.NormalizeFast(); // Reset relevant variables track.SetStatus(kInFlight); track.IncreaseStep(crtstep); track.DecreasePstep(crtstep); if (track.GetPstep() < 1.E-10) { track.SetPstep(0); track.SetStatus(kPhysics); } track.DecreaseSnext(crtstep); if (track.GetSnext() < 1.E-10) { track.SetSnext(0); } double preSafety = track.GetSafety(); if (posShiftSq > preSafety * preSafety) { track.SetSafety(0); } else { double posShift = std::sqrt(posShiftSq); track.DecreaseSafety(posShift); if (track.GetSafety() < 1.E-10) track.SetSafety(0); } #ifdef REPORT_AND_CHECK CheckTrack(track, "End of Propagate-In-Volume", 1.0e-5); #endif } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::PropagateInVolume(TrackVec_t &tracks, const double *stepSize, TaskData *td) { // The Vectorized Implementation for Magnetic Field Propagation using ThreeVector = vecgeom::Vector3D<double>; constexpr double toKiloGauss = 1.0 / units::kilogauss; // Converts to kilogauss bool useRungeKutta = td->fPropagator->fConfig->fUseRungeKutta; const int nTracks = tracks.size(); auto fieldConfig = FieldLookup::GetFieldConfig(); assert(fieldConfig != nullptr); #if 1 // VECTOR_FIELD_PROPAGATION using vecgeom::SOA3D; using vecgeom::Vector3D; constexpr int Npm = 6; // double yInput[8*nTracks], yOutput[8*nTracks]; bool succeeded[nTracks]; // int intCharge[nTracks]; // Choice 1. SOA3D PrepareBuffers(nTracks, td); auto wsp = td->fSpace4FieldProp; // WorkspaceForFieldPropagation * double *fltCharge = wsp->fChargeInp; double *momentumMag = wsp->fMomentumInp; double *steps = wsp->fStepsInp; SOA3D<double> &position3D = *(wsp->fPositionInp); SOA3D<double> &direction3D = *(wsp->fDirectionInp); SOA3D<double> &PositionOut = *(wsp->fPositionOutp); SOA3D<double> &DirectionOut = *(wsp->fDirectionOutp); for (int itr = 0; itr < nTracks; ++itr) { Track *pTrack = tracks[itr]; fltCharge[itr] = pTrack->Charge(); momentumMag[itr] = pTrack->P(); steps[itr] = stepSize[itr]; position3D.push_back(pTrack->X(), pTrack->Y(), pTrack->Z()); direction3D.push_back(pTrack->Dx(), pTrack->Dy(), pTrack->Dz()); } if (!useRungeKutta && fieldConfig->IsFieldUniform()) { vecgeom::Vector3D<double> BfieldUniform = fieldConfig->GetUniformFieldValue(); ConstFieldHelixStepper stepper(BfieldUniform * toKiloGauss); // stepper.DoStep<ThreeVector,double,int>(Position, Direction, track.Charge(), track.P(), stepSize, // PositionNew, DirectionNew); // std::cout << "Before Helix stepper - Position addresses: x= " << PositionOut.x() << " y= " << PositionOut.y() // << " z=" << PositionOut.z() << std::endl; stepper.DoStepArr<Double_v>(position3D.x(), position3D.y(), position3D.z(), direction3D.x(), direction3D.y(), direction3D.z(), fltCharge, momentumMag, stepSize, PositionOut.x(), PositionOut.y(), PositionOut.z(), DirectionOut.x(), DirectionOut.y(), DirectionOut.z(), nTracks); for (int itr = 0; itr < nTracks; ++itr) { Track &track = *tracks[itr]; Vector3D<double> startPosition = {track.X(), track.Y(), track.Z()}; Vector3D<double> startDirection = {track.Dx(), track.Dy(), track.Dz()}; #ifdef DEBUG_FIELD // Quick Crosscheck against helix stepper ThreeVector PositionNew(0., 0., 0.), DirectionNew(0., 0., 0.); stepper.DoStep<double>(startPosition, startDirection, track.Charge(), track.P(), stepSize[itr], PositionNew, DirectionNew); double posDiff = (PositionNew - PositionOut[itr]).Mag(); double dirDiff = (DirectionNew - DirectionOut[itr]).Mag(); if (posDiff > 1.e-6 || dirDiff > 1.e-6) { std::cout << "*** position/direction shift HelixStepper scalar vs. vector :" << posDiff << " / " << dirDiff << "\n"; } #endif Vector3D<double> positionMove = startPosition - PositionOut[itr]; // Store revised positions and location in original tracks track.SetPosition(PositionOut.x(itr), PositionOut.y(itr), PositionOut.z(itr)); track.SetDirection(DirectionOut.x(itr), DirectionOut.y(itr), DirectionOut.z(itr)); track.NormalizeFast(); // Update status, step and safety track.SetStatus(kInFlight); track.IncreaseStep(stepSize[itr]); track.DecreasePstep(stepSize[itr]); if (track.GetPstep() < 1.E-10) { track.SetPstep(0); track.SetStatus(kPhysics); } track.DecreaseSnext(stepSize[itr]); if (track.GetSnext() < 1.E-10) { track.SetSnext(0); } double posShiftSq = positionMove.Mag2(); double preSafety = track.GetSafety(); if (posShiftSq > preSafety * preSafety) { track.SetSafety(0); } else { double posShift = std::sqrt(posShiftSq); track.DecreaseSafety(posShift); // Was crtstep; if (track.GetSafety() < 1.0e-10) track.SetSafety(0); } } } else { // Prepare for Runge Kutta stepping // Choice 3. Array of FieldTrack FieldTrack fldTracksIn[nTracks], fldTracksOut[nTracks]; for (int itr = 0; itr < nTracks; ++itr) { Track *pTrack = tracks[itr]; double trackVals[Npm] = {pTrack->X(), pTrack->Y(), pTrack->Z(), pTrack->Px(), pTrack->Py(), pTrack->Pz()}; fldTracksIn[itr].LoadFromArray(trackVals, Npm); } auto fieldPropagator = td->fFieldPropagator; assert(fieldPropagator); auto vectorDriver = fieldPropagator ? fieldPropagator->GetFlexibleIntegrationDriver() : nullptr; assert(vectorDriver); if (vectorDriver) { // Integrate using Runge Kutta method vectorDriver->AccurateAdvance(fldTracksIn, steps, fltCharge, fEpsTol, fldTracksOut, nTracks, succeeded); #ifdef CHECK_VS_SCALAR bool checkVsScalar = true; #ifdef CHECK_VS_HELIX const char *diffBanner = "Differences between vector RK vs scalar Helix method:"; #else const char *diffBanner = "Differences between vector RK vs scalar RK method:"; #endif bool bannerUsed = false; #endif // Store revised positions and location in original tracks for (int itr = 0; itr < nTracks; ++itr) { Track &track = *tracks[itr]; FieldTrack &fldTrackEnd = fldTracksOut[itr]; Vector3D<double> startPosition = {track.X(), track.Y(), track.Z()}; Vector3D<double> startDirection = {track.Dx(), track.Dy(), track.Dz()}; Vector3D<double> endPosition = {fldTrackEnd[0], fldTrackEnd[1], fldTrackEnd[2]}; const double pmag_inv = 1.0 / track.P(); ThreeVector endDirVector = pmag_inv * ThreeVector(fldTrackEnd[3], fldTrackEnd[4], fldTrackEnd[5]); #ifdef CHECK_VS_SCALAR double posShift = (startPosition - endPosition).Mag(); // ---- Perform checks ThreeVector endPositionScalar(0., 0., 0.), endDirScalar(0., 0., 0.); fieldPropagator->DoStep(startPosition, startDirection, track.Charge(), track.P(), stepSize[itr], endPositionScalar, endDirScalar); double posErr = (endPositionScalar - endPosition).Mag(); double dirErr = (endDirScalar - endDirVector).Mag(); if (posErr > 1.e-3 * posShift || dirErr > 1.e-6) { std::cout << "*** position/direction shift scalar RK vs. vector RK :" << posErr << " / " << dirErr << "\n"; } if (magDiff > perMillion) { if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; } std::cerr << "Track " << itr << " has momentum magnitude difference " << magDiff << " Momentum magnitude @ end = " << std::sqrt(pMag2End) << " vs. start = " << track.P() << std::endl; assert(pMag2End > 0.0 && fabs(magDiff) < 0.003 && "ERROR in direction normal."); } #endif #ifdef DEBUG_FIELD // ---- Start verbose print (of selected events/tracks) // int maxPartNo = 2, maxEvSlot = 3; bool printTrack = false; // = (track.Particle() < maxPartNo) && (track.EventSlot() < maxEvSlot ); if (printTrack) { // Select a few tracks to print ... printf(" FPH::PiV(V)/rk: ev= %3d trk= %3d Start> Pos= %8.5f %8.5f %8.5f Mom= %8.5f %8.5f %8.5f ", track.Event(), track.Particle(), startPosition.x(), startPosition.y(), startPosition.z(), startDirection.x(), startDirection.y(), startDirection.z()); double angle = std::acos(endDirVector.Dot(startDirection)); printf(" s= %10.6f ang= %7.5f ", *stepSize / units::mm, angle); printf("End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", endPosition.x(), endPosition.y(), endPosition.z(), endDirVector.x(), endDirVector.y(), endDirVector.z()); } // ---- End verbose print #endif #ifdef CHECK_VS_SCALAR // ---- Perform checks if (checkVsScalar) { bool checkVsHelix = true; double curv = Curvature(track); CheckVsScalar(startPosition, startDirection, track.Charge(), track.P(), stepSize[itr], endPosition, endDirVector, curv, itr, td, checkVsHelix); } #endif // Update the state of this track track.SetPosition(fldTrackEnd[0], fldTrackEnd[1], fldTrackEnd[2]); track.SetDirection(endDirVector); track.NormalizeFast(); track.SetStatus(kInFlight); track.IncreaseStep(stepSize[itr]); track.DecreasePstep(stepSize[itr]); if (track.GetPstep() < 1.E-10) { track.SetPstep(0); track.SetStatus(kPhysics); } track.DecreaseSnext(stepSize[itr]); if (track.GetSnext() < 1.E-10) { track.SetSnext(0); } // Exact update of the safety - using true move (not distance along curve) // track.DecreaseSafety(posShift) // More accurate double posShiftSq = (startPosition - endPosition).Mag2(); double preSafety = track.GetSafety(); if (posShiftSq > preSafety * preSafety) { track.SetSafety(0); } else { double posShift = std::sqrt(posShiftSq); track.DecreaseSafety(posShift); // Was crtstep; if (track.GetSafety() < 1.0e-10) track.SetSafety(0); } } } else { // geant::Error( ... ); std::cerr << "ERROR in FieldPropagationHandler: no Flexible/Vector Integration Driver found." << std::endl; exit(1); } } #else // Placeholder - implemented just as a loop for (int itr = 0; itr < nTracks; ++itr) PropagateInVolume(*tracks[itr], stepSize[itr], td); #endif // VECTOR_FIELD_PROPAGATION } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE bool FieldPropagationHandler::IsSameLocation(Track &track, TaskData *td) { // Query geometry if the location has changed for a track // Returns number of tracks crossing the boundary (0 or 1) if (track.GetSafety() > 1.E-10 && track.GetSnext() > 1.E-10) { // Track stays in the same volume track.SetBoundary(false); return true; } // Track may have crossed, check it bool same; vecgeom::NavigationState *tmpstate = td->GetPath(); ScalarNavInterfaceVGM::NavIsSameLocation(track, same, tmpstate); if (same) { track.SetBoundary(false); return true; } track.SetBoundary(true); track.SetStatus(kBoundary); if (track.NextPath()->IsOutside()) track.SetStatus(kExitingSetup); // if (track.GetStep() < 1.E-8) td->fNsmall++; return false; } #define IsNan(x) (!(x > 0 || x <= 0.0)) //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::CheckTrack(Track &track, const char *msg, double epsilon) const { // Ensure that values are 'sensible' - else print msg and track if (epsilon <= 0.0 || epsilon > 0.01) { epsilon = 1.e-6; } double x = track.X(), y = track.Y(), z = track.Z(); bool badPosition = IsNan(x) || IsNan(y) || IsNan(z); const double maxRadius = 10000.0; // Should be a property of the geometry const double maxRadXY = 5000.0; // Should be a property of the geometry // const double maxUnitDev = 1.0e-4; // Deviation from unit of the norm of the direction double radiusXy2 = x * x + y * y; double radius2 = radiusXy2 + z * z; badPosition = badPosition || (radiusXy2 > maxRadXY * maxRadXY) || (radius2 > maxRadius * maxRadius); const double maxUnitDev = epsilon; // Use epsilon for max deviation of direction norm from 1.0 double dx = track.Dx(), dy = track.Dy(), dz = track.Dz(); double dirNorm2 = dx * dx + dy * dy + dz * dz; bool badDirection = std::fabs(dirNorm2 - 1.0) > maxUnitDev; if (badPosition || badDirection) { static const char *errMsg[4] = {" All ok - No error. ", " Bad position.", // [1] " Bad direction.", // [2] " Bad direction and position. "}; // [3] int iM = 0; if (badPosition) { iM++; } if (badDirection) { iM += 2; } // if( badDirection ) { // Printf( " Norm^2 direction= %f , Norm -1 = %g", dirNorm2, sqrt(dirNorm2)-1.0 ); // } Printf("ERROR> Problem with track %p . Issue: %s. Info message: %s -- Mag^2(dir)= %9.6f Norm-1= %g", (void *)&track, errMsg[iM], msg, dirNorm2, sqrt(dirNorm2) - 1.0); track.Print(msg); } } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::PrintStats() const { #ifdef STATS_METHODS unsigned long nTot = numTot++; unsigned long rk = numRK, hZ = numHelixZ, hGen = numHelixGen; std::cerr << "Step statistics (field Propagation): total= " << nTot << " RK = " << rk << " HelixGen = " << hGen << " Helix-Z = " << hZ << std::endl; #endif } //______________________________________________________________________________ VECCORE_ATT_HOST_DEVICE void FieldPropagationHandler::CheckVsScalar(const vecgeom::Vector3D<double> &startPosition, const vecgeom::Vector3D<double> &startDirection, double charge, double momentum, // starting magnitude double stepSize, const vecgeom::Vector3D<double> &endPosition, const vecgeom::Vector3D<double> &endDirection, double curvature, int index, TaskData *td, bool checkVsHelix) { using ThreeVector = vecgeom::Vector3D<double>; constexpr double toKiloGauss = 1.0 / units::kilogauss; // static bool bannerUsed = false; auto fieldPropagator = td->fFieldPropagator; bool useRungeKutta = td->fPropagator->fConfig->fUseRungeKutta; bool differs = false; // Check against 'scalar' propagation of the same track ThreeVector EndPositionScalar(0., 0., 0.), EndDirScalar(0., 0., 0.); vecgeom::Vector3D<double> BfieldInitial; double bmag; FieldLookup::GetFieldValue(startPosition, BfieldInitial, bmag); BfieldInitial *= toKiloGauss; bmag *= toKiloGauss; checkVsHelix = checkVsHelix || (!useRungeKutta); // Cannot check vs RK if it is not available if (checkVsHelix) { ConstFieldHelixStepper stepper(BfieldInitial); stepper.DoStep<double>(startPosition, startDirection, charge, momentum, stepSize, EndPositionScalar, EndDirScalar); } else { fieldPropagator->DoStep(startPosition, startDirection, charge, momentum, stepSize, EndPositionScalar, EndDirScalar); } // checking direction ThreeVector diffDir = endDirection - EndDirScalar; double diffDirMag = diffDir.Mag(); const double maxDiffMom = 1.0e-4; // 1.5 * fEpsTol; // 10.0 * units::perMillion; if (diffDirMag > maxDiffMom) { differs = true; // if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; } std::ostringstream strDiff; strDiff // std::cerr << "Track [" << index << "] : direction differs " << " by " << diffDir << " ( mag = " << diffDirMag << " ) " // << " Direction vector = " << endDirection << " scalar = " << EndDirScalar << " stepSize = " << stepSize << " curv = " << curvature << " B-field = " << BfieldInitial << " kilo-Gauss " // << " End position= " << endPosition << std::endl; std::cout << strDiff.str(); std::cerr << strDiff.str(); } else { // checking against magnitude of direction difference ThreeVector changeDirVector = endDirection - startDirection; ThreeVector changeDirScalar = EndDirScalar - startDirection; double magChangeDirScalar = changeDirScalar.Mag(); const double relativeDiffMax = 1.0e-3; if (diffDirMag > relativeDiffMax * magChangeDirScalar && (diffDirMag > 1.e-9) && (magChangeDirScalar > 1.e-10)) { differs = true; // if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; } std::ostringstream strDiff; strDiff // std::cerr << "Track [" << index << "] : direction CHANGE has high RELATIVE difference " << " by " << diffDir << " ( mag = " << diffDirMag << " vs |delta Dir scalar| " << magChangeDirScalar << " ) " << " DeltaDir/V = " << changeDirVector << " scalar = " << changeDirScalar << " End position= " << endPosition << std::endl; std::cout << strDiff.str(); std::cerr << strDiff.str(); } } // checking position ThreeVector diffPos = endPosition - EndPositionScalar; const double maxDiffPos = 1.5 * fEpsTol; // * distanceAlongPath if (diffPos.Mag() > maxDiffPos) { differs = true; // if (!bannerUsed) { std::cerr << diffBanner << std::endl; bannerUsed = true; } std::cerr << "Track [" << index << "] : position diff " << diffPos << " mag= " << diffPos.Mag() << " " // << " Pos: vec = " << endPosition << " scalar = " << EndPositionScalar << " move (vector) = " << endPosition - startPosition << " its-mag= " << (endPosition - startPosition).Mag() << " stepSize = " << stepSize << " move (scalar) = " << EndPositionScalar - startPosition << std::endl; } if (differs) { printf(" FPH::PiV-Start: Start> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f\n", startPosition.x(), startPosition.y(), startPosition.z(), startDirection.x(), startDirection.y(), startDirection.z()); printf(" FPH::PiV/Vector: End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f Delta-p: %6.2g %6.2g %6.2g \n", endPosition.x(), endPosition.y(), endPosition.z(), endDirection.x(), endDirection.y(), endDirection.z(), endDirection.x() - startDirection.x(), endDirection.y() - startDirection.y(), endDirection.z() - startDirection.z()); printf(" FPH::PiV-1/chk: End> Pos= %9.6f %9.6f %9.6f Mom= %9.6f %9.6f %9.6f Delta-p: %6.2g %6.2g %6.2g \n", EndPositionScalar.x(), EndPositionScalar.y(), EndPositionScalar.z(), EndDirScalar.x(), EndDirScalar.y(), EndDirScalar.z(), EndDirScalar.x() - startDirection.x(), EndDirScalar.y() - startDirection.y(), EndDirScalar.z() - startDirection.z()); } } } // namespace GEANT_IMPL_NAMESPACE } // namespace geant
39.899676
120
0.642577
Geant-RnD
dcdf63702b8b1e8eb49eda54c4a526878c3ead09
4,707
cpp
C++
nodes/accelerated_vadd/src/host.cpp
dirksavage88/acceleration_examples
97140d08d84e53d7c7cc04340dfefe2c4a954117
[ "Apache-2.0" ]
null
null
null
nodes/accelerated_vadd/src/host.cpp
dirksavage88/acceleration_examples
97140d08d84e53d7c7cc04340dfefe2c4a954117
[ "Apache-2.0" ]
null
null
null
nodes/accelerated_vadd/src/host.cpp
dirksavage88/acceleration_examples
97140d08d84e53d7c7cc04340dfefe2c4a954117
[ "Apache-2.0" ]
null
null
null
/* * Copyright 2020 Xilinx, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #define DATA_SIZE 4096 // 2**12 // #define DATA_SIZE 16384 // 2**14 // #define DATA_SIZE 65536 // 2**16 // #define DATA_SIZE 262144 // 2**18 #include <vector> #include <vitis_common/common/ros_opencl_120.hpp> #include <vitis_common/common/utilities.hpp> int main(int argc, char** argv) { std::cout << "INFO: Add accelerated vector example" << std::endl; // ------------------------------------------------------------------------------------ // Step 1: Initialize the OpenCL environment // ------------------------------------------------------------------------------------ cl_int err; std::string binaryFile = (argc != 2) ? "vadd.xclbin" : argv[1]; unsigned fileBufSize; std::vector<cl::Device> devices = get_xilinx_devices(); devices.resize(1); cl::Device device = devices[0]; cl::Context context(device, NULL, NULL, NULL, &err); char* fileBuf = read_binary_file(binaryFile, fileBufSize); cl::Program::Binaries bins{{fileBuf, fileBufSize}}; cl::Program program(context, devices, bins, NULL, &err); cl::CommandQueue q(context, device, CL_QUEUE_PROFILING_ENABLE, &err); cl::Kernel krnl_vector_add(program,"vadd", &err); // ------------------------------------------------------------------------------------ // Step 2: Create buffers and initialize test values // ------------------------------------------------------------------------------------ // Create the buffers and allocate memory cl::Buffer in1_buf(context, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_ONLY, sizeof(int) * DATA_SIZE, NULL, &err); cl::Buffer in2_buf(context, CL_MEM_ALLOC_HOST_PTR | CL_MEM_READ_ONLY, sizeof(int) * DATA_SIZE, NULL, &err); cl::Buffer out_buf(context, CL_MEM_ALLOC_HOST_PTR | CL_MEM_WRITE_ONLY, sizeof(int) * DATA_SIZE, NULL, &err); // Map buffers to kernel arguments, thereby assigning them to specific device memory banks krnl_vector_add.setArg(0, in1_buf); krnl_vector_add.setArg(1, in2_buf); krnl_vector_add.setArg(2, out_buf); // Map host-side buffer memory to user-space pointers int *in1 = (int *)q.enqueueMapBuffer(in1_buf, CL_TRUE, CL_MAP_WRITE, 0, sizeof(int) * DATA_SIZE); int *in2 = (int *)q.enqueueMapBuffer(in2_buf, CL_TRUE, CL_MAP_WRITE, 0, sizeof(int) * DATA_SIZE); int *out = (int *)q.enqueueMapBuffer(out_buf, CL_TRUE, CL_MAP_WRITE | CL_MAP_READ, 0, sizeof(int) * DATA_SIZE); // Initialize the vectors used in the test for(int i = 0 ; i < DATA_SIZE ; i++){ in1[i] = rand() % DATA_SIZE; in2[i] = rand() % DATA_SIZE; out[i] = 0; } // ------------------------------------------------------------------------------------ // Step 3: Run the kernel // ------------------------------------------------------------------------------------ // Set kernel arguments krnl_vector_add.setArg(0, in1_buf); krnl_vector_add.setArg(1, in2_buf); krnl_vector_add.setArg(2, out_buf); krnl_vector_add.setArg(3, DATA_SIZE); // Schedule transfer of inputs to device memory, execution of kernel, and transfer of outputs back to host memory q.enqueueMigrateMemObjects({in1_buf, in2_buf}, 0 /* 0 means from host*/); q.enqueueTask(krnl_vector_add); q.enqueueMigrateMemObjects({out_buf}, CL_MIGRATE_MEM_OBJECT_HOST); // Wait for all scheduled operations to finish q.finish(); // ------------------------------------------------------------------------------------ // Step 4: Check Results and Release Allocated Resources // ------------------------------------------------------------------------------------ bool match = true; for (int i = 0 ; i < DATA_SIZE ; i++){ int expected = in1[i]+in2[i]; if (out[i] != expected){ std::cout << "Error: Result mismatch" << std::endl; std::cout << "i = " << i << " CPU result = " << expected << " Device result = " << out[i] << std::endl; match = false; // break; } } delete[] fileBuf; std::cout << "TEST " << (match ? "PASSED" : "FAILED") << std::endl; return (match ? EXIT_SUCCESS : EXIT_FAILURE); }
43.583333
117
0.571277
dirksavage88
dce0339cc92eebdda64e8689118d841d62e23bd4
2,390
cpp
C++
src/tests/pack-field-ordering.cpp
sbu-fsl/DataSeries
8436462519eb22fc653387885b5f0339fb419061
[ "BSD-2-Clause" ]
6
2015-02-27T19:15:11.000Z
2018-10-25T14:22:31.000Z
src/tests/pack-field-ordering.cpp
yoursunny/DataSeries
b5b9db8e40a79a3e546a59cd72a80be89412d7b2
[ "BSD-2-Clause" ]
7
2015-08-17T15:18:50.000Z
2017-08-16T00:16:19.000Z
src/tests/pack-field-ordering.cpp
sbu-fsl/DataSeries
8436462519eb22fc653387885b5f0339fb419061
[ "BSD-2-Clause" ]
8
2015-07-13T23:02:28.000Z
2020-09-28T19:06:26.000Z
// -*-C++-*- /* (c) Copyright 2008, Hewlett-Packard Development Company, LP See the file named COPYING for license details */ /** @file Test the pad-record options */ #include <iostream> #include <DataSeries/Extent.hpp> #include <DataSeries/ExtentField.hpp> using namespace std; void testSimpleCheckOffsets(const string &type_xml, int off_bool, int off_byte, int off_i32, int off_v32, int off_i64, int off_dbl, unsigned recordsize) { const ExtentType::Ptr a(ExtentTypeLibrary::sharedExtentTypePtr(type_xml)); SINVARIANT(a->getOffset("bool") == off_bool); SINVARIANT(a->getOffset("byte") == off_byte); SINVARIANT(a->getOffset("i32") == off_i32); SINVARIANT(a->getOffset("v32") == off_v32); SINVARIANT(a->getOffset("i64") == off_i64); SINVARIANT(a->getOffset("dbl") == off_dbl); SINVARIANT(a->fixedrecordsize() == recordsize); } void testSimple() { // packed as bool, byte, pad2, i32, var32, pad4, i64, dbl string test1_xml("<ExtentType name=\"Test::FieldOrder\" pack_field_ordering=\"small_to_big_sep_var32\">\n" " <field type=\"int64\" name=\"i64\" />\n" " <field type=\"variable32\" name=\"v32\" />\n" " <field type=\"bool\" name=\"bool\" />\n" " <field type=\"int32\" name=\"i32\" />\n" " <field type=\"double\" name=\"dbl\" />\n" " <field type=\"byte\" name=\"byte\" />\n" "</ExtentType>\n"); testSimpleCheckOffsets(test1_xml, 0, 1, 4, 8, 16, 24, 32); // packed as dbl, i64, i32, v32, byte, bool, pad6 string test2_xml("<ExtentType name=\"Test::FieldOrder\" pack_field_ordering=\"big_to_small_sep_var32\">\n" " <field type=\"variable32\" name=\"v32\" />\n" " <field type=\"bool\" name=\"bool\" />\n" " <field type=\"int32\" name=\"i32\" />\n" " <field type=\"byte\" name=\"byte\" />\n" " <field type=\"double\" name=\"dbl\" />\n" " <field type=\"int64\" name=\"i64\" />\n" "</ExtentType>\n"); testSimpleCheckOffsets(test2_xml, 25,24,16,20,8,0, 32); } int main() { testSimple(); cout << "Passed pack_field_ordering tests\n"; return 0; }
37.34375
110
0.546862
sbu-fsl
dce0e724a6fdbd41565c04e97316bfbaee89cb4d
5,495
cpp
C++
modules/world/objects/agent.cpp
cirrostratus1/bark
6629a9bbc455d0fd708e09bb8e162425e62c4165
[ "MIT" ]
null
null
null
modules/world/objects/agent.cpp
cirrostratus1/bark
6629a9bbc455d0fd708e09bb8e162425e62c4165
[ "MIT" ]
null
null
null
modules/world/objects/agent.cpp
cirrostratus1/bark
6629a9bbc455d0fd708e09bb8e162425e62c4165
[ "MIT" ]
null
null
null
// Copyright (c) 2019 fortiss GmbH, Julian Bernhard, Klemens Esterle, Patrick Hart, Tobias Kessler // // This work is licensed under the terms of the MIT license. // For a copy, see <https://opensource.org/licenses/MIT>. #include <limits> #include <cmath> #include "modules/world/objects/agent.hpp" #include "modules/world/objects/object.hpp" #include "modules/world/observed_world.hpp" namespace modules { namespace world { namespace objects { using models::dynamic::StateDefinition; using modules::geometry::Point2d; using modules::world::map::MapInterfacePtr; using StateDefinition::TIME_POSITION; Agent::Agent(const State& initial_state, const BehaviorModelPtr& behavior_model_ptr, const DynamicModelPtr& dynamic_model_ptr, const ExecutionModelPtr& execution_model, const geometry::Polygon& shape, commons::Params* params, const GoalDefinitionPtr& goal_definition, const MapInterfacePtr& map_interface, const geometry::Model3D& model_3d) : Object(shape, params, model_3d), behavior_model_(behavior_model_ptr), dynamic_model_(dynamic_model_ptr), execution_model_(execution_model), local_map_(new LocalMap(goal_definition, map_interface)), history_(), max_history_length_(10), goal_definition_(goal_definition) { if (params) { max_history_length_ = params->get_int( "MaxHistoryLength", "Maximum number of state-input pairs in state-input history", 50); } models::behavior::StateActionPair pair; pair.first = initial_state; pair.second = modules::models::behavior::Action( modules::models::behavior::DiscreteAction(0)); // Initially select a DiscreteAction of zero history_.push_back(pair); if (map_interface != nullptr) { GenerateLocalMap(); } } Agent::Agent(const Agent& other_agent) : Object(other_agent), behavior_model_(other_agent.behavior_model_), dynamic_model_(other_agent.dynamic_model_), execution_model_(other_agent.execution_model_), local_map_(other_agent.local_map_), history_(other_agent.history_), max_history_length_(other_agent.max_history_length_), goal_definition_(other_agent.goal_definition_) {} void Agent::BehaviorPlan(const float &dt, const ObservedWorld &observed_world) { //! plan behavior for given horizon T using step-size dt behavior_model_->Plan(dt, observed_world); } void Agent::ExecutionPlan(const float &dt) { execution_model_->Execute(dt, behavior_model_->get_last_trajectory(), dynamic_model_, history_.back().first); } void Agent::Execute(const float& world_time) { //! find closest state in execution-trajectory int index_world_time = 0; float min_time_diff = std::numeric_limits<float>::max(); Trajectory last_trajectory = execution_model_->get_last_trajectory(); for (int i = 0; i < last_trajectory.rows(); i++) { float diff_time = fabs(last_trajectory(i, TIME_POSITION) - world_time); if (diff_time < min_time_diff) { index_world_time = i; min_time_diff = diff_time; } } models::behavior::StateActionPair state_action_pair( State(execution_model_->get_last_trajectory().row(index_world_time)), behavior_model_->get_last_action()); history_.push_back(state_action_pair); //! remove states if queue becomes to large if (history_.size() > max_history_length_) { history_.erase(history_.begin()); } } geometry::Polygon Agent::GetPolygonFromState(const State& state) const { using namespace modules::geometry; using namespace modules::geometry::standard_shapes; Pose agent_pose(state(StateDefinition::X_POSITION), state(StateDefinition::Y_POSITION), state(StateDefinition::THETA_POSITION)); std::shared_ptr<geometry::Polygon> polygon( std::dynamic_pointer_cast<geometry::Polygon>( this->get_shape().transform(agent_pose))); return *polygon; } bool Agent::AtGoal() const { BARK_EXPECT_TRUE((bool)goal_definition_); return goal_definition_->AtGoal(*this); } void Agent::GenerateLocalMap() { local_map_->set_goal_definition(goal_definition_); State agent_state = get_current_state(); Point2d agent_xy(agent_state(StateDefinition::X_POSITION), agent_state(StateDefinition::Y_POSITION)); if (!local_map_->Generate(agent_xy)) { LOG(ERROR) << "LocalMap generation for agent " << get_agent_id() << " failed." << std::endl; } // TODO(@hart): parameter UpdateDrivingCorridor(20.0); } void Agent::UpdateDrivingCorridor(double horizon = 20.0) { State agent_state = get_current_state(); Point2d agent_xy(agent_state(StateDefinition::X_POSITION), agent_state(StateDefinition::Y_POSITION)); if (!local_map_->ComputeHorizonCorridor(agent_xy, horizon)) { LOG_EVERY_N(ERROR, 100) << "Horizon DrivingCorridor generation for agent " << get_agent_id() << " failed."; } } std::shared_ptr<Object> Agent::Clone() const { std::shared_ptr<Agent> new_agent = std::make_shared<Agent>(*this); new_agent->set_agent_id(this->get_agent_id()); if (behavior_model_) { new_agent->behavior_model_ = behavior_model_->Clone(); } if (dynamic_model_) { new_agent->dynamic_model_ = dynamic_model_->Clone(); } if (execution_model_) { new_agent->execution_model_ = execution_model_->Clone(); } return std::dynamic_pointer_cast<Object>(new_agent); } } // namespace objects } // namespace world } // namespace modules
34.34375
98
0.720291
cirrostratus1
dce137036a30ec9e64e21e77ce7b1e72a22c4b26
3,032
cpp
C++
vs2017_static_lib/DokeviNetwork/DokeviException.cpp
kaygundraka/Dokevi-TCPServer
00c3ceb04c133d1959c89f6b3708ecf7607ef572
[ "MIT" ]
7
2020-03-23T12:09:50.000Z
2020-05-19T02:35:42.000Z
vs2017_static_lib/DokeviNetwork/DokeviException.cpp
kaygundraka/Dokevi-Network
00c3ceb04c133d1959c89f6b3708ecf7607ef572
[ "MIT" ]
null
null
null
vs2017_static_lib/DokeviNetwork/DokeviException.cpp
kaygundraka/Dokevi-Network
00c3ceb04c133d1959c89f6b3708ecf7607ef572
[ "MIT" ]
null
null
null
#include "pch.h" #include "DokeviException.h" #include "ConfigManager.h" #include <iostream> #include <fstream> using namespace DokeviNet; std::vector<void(*)(void)> DokeviNet::Exception::excpetionHandler; std::string serverInfoText = ""; void DokeviNet::MakeMinidump(EXCEPTION_POINTERS* e) { auto dbgHelp = LoadLibraryA("dbghelp"); if (dbgHelp == nullptr) return; auto miniDumpWriteDump = (decltype(&MiniDumpWriteDump))GetProcAddress(dbgHelp, "MiniDumpWriteDump"); if (miniDumpWriteDump == nullptr) return; char fileName[MAX_PATH]; SYSTEMTIME t; GetSystemTime(&t); sprintf(fileName, "./Minidmp_%4d%02d%02d_%02d%02d%02d.dmp", t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond); auto file = CreateFileA(fileName, GENERIC_WRITE, FILE_SHARE_READ, 0, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0); if (file == INVALID_HANDLE_VALUE) return; MINIDUMP_EXCEPTION_INFORMATION exceptionInfo; exceptionInfo.ThreadId = GetCurrentThreadId(); exceptionInfo.ExceptionPointers = e; exceptionInfo.ClientPointers = FALSE; _MINIDUMP_TYPE type = MiniDumpNormal; if (SINGLETON(ConfigManager)->GetInt("System", "FullDump") == 1) { type = MiniDumpWithFullMemory; } auto dumped = miniDumpWriteDump( GetCurrentProcess(), GetCurrentProcessId(), file, type, e ? &exceptionInfo : nullptr, nullptr, nullptr); CloseHandle(file); return; } void DokeviNet::ReportCallStack() { auto stackTraceArray = StackTracer::GetInstance()->GetStackFrameArray(); int i = 0; char temp[1024] = ""; for (auto stackFrameList : stackTraceArray) { sprintf_s(temp, "[Stack Trace : %d]\n", i); serverInfoText += temp; for (auto frame : stackFrameList) { sprintf_s(temp, " func:%s, file:%s, line:%d\n", frame._function, frame._file, frame._line); serverInfoText += temp; } } } void DokeviNet::ReportLockStack() { auto lockStackTraceArray = LockStackTracer::GetInstance()->GetLockStackFrameArray(); int i = 0; char temp[1024] = ""; for (auto lockStackList : lockStackTraceArray) { sprintf_s(temp, "[Lock Stack Trace : %d]\n", i); serverInfoText += temp; for (auto lockStack : lockStackList) { sprintf_s(temp, " lock:%s, enter:%d\n", (char*)lockStack._lockAddress, lockStack._isEnter); serverInfoText += temp; } } } void DokeviNet::MakeReportFile() { char fileName[MAX_PATH]; SYSTEMTIME t; GetSystemTime(&t); sprintf(fileName, "./ServerCrashReport_%4d%02d%02d_%02d%02d%02d.txt", t.wYear, t.wMonth, t.wDay, t.wHour, t.wMinute, t.wSecond); ofstream reportFile; reportFile.open(fileName); reportFile.write(serverInfoText.c_str(), serverInfoText.size()); reportFile.close(); } LONG CALLBACK UnhandledHandler(EXCEPTION_POINTERS* e) { DokeviNet::MakeMinidump(e); DokeviNet::ReportCallStack(); DokeviNet::ReportLockStack(); DokeviNet::MakeReportFile(); for (auto handler : DokeviNet::Exception::excpetionHandler) { handler(); } return EXCEPTION_CONTINUE_SEARCH; } void DokeviNet::SetMinidumpEvent() { SetUnhandledExceptionFilter(UnhandledHandler); }
22.294118
129
0.725264
kaygundraka
dce158fbeb1cb933a484ff199db054bedb0ff95c
732
cpp
C++
00118_pascals-triangle/200207-1.cpp
yanlinlin82/leetcode
ddcc0b9606d951cff9c08d1f7dfbc202067c8d65
[ "MIT" ]
6
2019-10-23T01:07:29.000Z
2021-12-05T01:51:16.000Z
00118_pascals-triangle/200207-1.cpp
yanlinlin82/leetcode
ddcc0b9606d951cff9c08d1f7dfbc202067c8d65
[ "MIT" ]
null
null
null
00118_pascals-triangle/200207-1.cpp
yanlinlin82/leetcode
ddcc0b9606d951cff9c08d1f7dfbc202067c8d65
[ "MIT" ]
1
2021-12-03T06:54:57.000Z
2021-12-03T06:54:57.000Z
// https://leetcode-cn.com/problems/pascals-triangle/ #include <cstdio> #include <vector> using namespace std; class Solution { public: vector<vector<int>> generate(int numRows) { vector<vector<int>> res; if (numRows > 0) { vector<int> a; for (int i = 0; i < numRows; ++i) { vector<int> b; for (int j = 0; j < a.size(); ++j) { b.push_back(j == 0 ? 1 : a[j - 1] + a[j]); } b.push_back(1); res.push_back(b); a = b; } } return res; } }; void print(const vector<vector<int>>& a) { printf("[\n"); for (const auto& r : a) { printf(" [ "); for (auto e : r) printf("%d ", e); printf("]\n"); } printf("]\n"); } int main() { Solution s; print(s.generate(5)); return 0; }
17.023256
53
0.539617
yanlinlin82
dce15a4d25d287b75102069143843a394741005a
9,265
cpp
C++
benchmarks/puma_benchmarks/vgg19.cpp
souravsanyal06/puma-simulator
9580656dc0e16fb36eb268054abe4391ade183db
[ "MIT" ]
33
2019-04-18T01:16:07.000Z
2022-02-18T20:21:05.000Z
benchmarks/puma_benchmarks/vgg19.cpp
souravsanyal06/puma-simulator
9580656dc0e16fb36eb268054abe4391ade183db
[ "MIT" ]
26
2019-09-06T16:05:43.000Z
2022-03-11T23:29:29.000Z
benchmarks/puma_benchmarks/vgg19.cpp
souravsanyal06/puma-simulator
9580656dc0e16fb36eb268054abe4391ade183db
[ "MIT" ]
35
2019-04-19T08:40:55.000Z
2022-02-13T11:18:00.000Z
#include <assert.h> #include <string> #include <vector> #include "puma.h" #include "conv-layer.h" #include "fully-connected-layer.h" void isolated_fully_connected_layer(Model model, std::string layerName, unsigned int in_size, unsigned int out_size) { // Input vector auto in = InputVector::create(model, "in", in_size); // Output vector auto out = OutputVector::create(model, "out", out_size); // Layer out = fully_connected_layer(model, layerName, in_size, out_size, in); } int main() { Model model = Model::create("vgg19"); // Input unsigned int in_size_x = 224; unsigned int in_size_y = 224; unsigned int in_channels = 3; auto in_stream = InputImagePixelStream::create(model, "in_stream", in_size_x, in_size_y, in_channels); // Layer 1 (convolution) configurations unsigned int k_size_x1 = 3; unsigned int k_size_y1 = 3; unsigned int in_size_x1 = 224; unsigned int in_size_y1 = 224; unsigned int in_channels1 = 3; unsigned int out_channels1 = 64; // Layer 2 (convolution with max pool) configurations unsigned int k_size_x2 = 3; unsigned int k_size_y2 = 3; unsigned int in_size_x2 = 224; unsigned int in_size_y2 = 224; unsigned int in_channels2 = 64; unsigned int out_channels2 = 64; unsigned int max_pool_size_x2 = 2; unsigned int max_pool_size_y2 = 2; // Layer 3 (convolution) configurations unsigned int k_size_x3 = 3; unsigned int k_size_y3 = 3; unsigned int in_size_x3 = 112; unsigned int in_size_y3 = 112; unsigned int in_channels3 = 64; unsigned int out_channels3 = 128; // Layer 4 (convolution with max pool) configurations unsigned int k_size_x4 = 3; unsigned int k_size_y4 = 3; unsigned int in_size_x4 = 112; unsigned int in_size_y4 = 112; unsigned int in_channels4 = 128; unsigned int out_channels4 = 128; unsigned int max_pool_size_x4 = 2; unsigned int max_pool_size_y4 = 2; // Layer 5 (convolution) configurations unsigned int k_size_x5 = 3; unsigned int k_size_y5 = 3; unsigned int in_size_x5 = 56; unsigned int in_size_y5 = 56; unsigned int in_channels5 = 128; unsigned int out_channels5 = 256; // Layer 6 (convolution) configurations unsigned int k_size_x6 = 3; unsigned int k_size_y6 = 3; unsigned int in_size_x6 = 56; unsigned int in_size_y6 = 56; unsigned int in_channels6 = 256; unsigned int out_channels6 = 256; // Layer 6x (convolution) configurations unsigned int k_size_x6x = 3; unsigned int k_size_y6x = 3; unsigned int in_size_x6x = 56; unsigned int in_size_y6x = 56; unsigned int in_channels6x = 256; unsigned int out_channels6x = 256; // Layer 7 (convolution with max pool) configurations unsigned int k_size_x7 = 3; unsigned int k_size_y7 = 3; unsigned int in_size_x7 = 56; unsigned int in_size_y7 = 56; unsigned int in_channels7 = 256; unsigned int out_channels7 = 256; unsigned int max_pool_size_x7 = 2; unsigned int max_pool_size_y7 = 2; // Layer 8 (convolution) configurations unsigned int k_size_x8 = 3; unsigned int k_size_y8 = 3; unsigned int in_size_x8 = 28; unsigned int in_size_y8 = 28; unsigned int in_channels8 = 256; unsigned int out_channels8 = 512; // Layer 9 (convolution) configurations unsigned int k_size_x9 = 3; unsigned int k_size_y9 = 3; unsigned int in_size_x9 = 28; unsigned int in_size_y9 = 28; unsigned int in_channels9 = 512; unsigned int out_channels9 = 512; // Layer 9x (convolution) configurations unsigned int k_size_x9x = 3; unsigned int k_size_y9x = 3; unsigned int in_size_x9x = 28; unsigned int in_size_y9x = 28; unsigned int in_channels9x = 512; unsigned int out_channels9x = 512; // Layer 10 (convolution with max pool) configurations unsigned int k_size_x10 = 3; unsigned int k_size_y10 = 3; unsigned int in_size_x10 = 28; unsigned int in_size_y10 = 28; unsigned int in_channels10 = 512; unsigned int out_channels10 = 512; unsigned int max_pool_size_x10 = 2; unsigned int max_pool_size_y10 = 2; // Layer 11 (convolution) configurations unsigned int k_size_x11 = 3; unsigned int k_size_y11 = 3; unsigned int in_size_x11 = 14; unsigned int in_size_y11 = 14; unsigned int in_channels11 = 512; unsigned int out_channels11 = 512; // Layer 12 (convolution) configurations unsigned int k_size_x12 = 3; unsigned int k_size_y12 = 3; unsigned int in_size_x12 = 14; unsigned int in_size_y12 = 14; unsigned int in_channels12 = 512; unsigned int out_channels12 = 512; // Layer 12x (convolution) configurations unsigned int k_size_x12x = 3; unsigned int k_size_y12x = 3; unsigned int in_size_x12x = 14; unsigned int in_size_y12x = 14; unsigned int in_channels12x = 512; unsigned int out_channels12x = 512; // Layer 13 (convolution with max pool) configurations unsigned int k_size_x13 = 3; unsigned int k_size_y13 = 3; unsigned int in_size_x13 = 14; unsigned int in_size_y13 = 14; unsigned int in_channels13 = 512; unsigned int out_channels13 = 512; unsigned int max_pool_size_x13 = 2; unsigned int max_pool_size_y13 = 2; // Output unsigned int out_size_x = 7; unsigned int out_size_y = 7; unsigned int out_channels = 512; auto out_stream = OutputImagePixelStream::create(model, "out_stream", out_size_x, out_size_y, out_channels); // Layer 17 (fully-connected) configurations unsigned int in_size17 = 25088; unsigned int out_size17 = 4096; // Layer 18 (fully-connected) configurations unsigned int in_size18 = 4096; unsigned int out_size18 = 4096; // Layer 19 (fully-connected) configurations unsigned int in_size19 = 4096; unsigned int out_size19 = 1000; // Define network auto out1 = conv_layer(model, "layer" + std::to_string(1), k_size_x1, k_size_y1, in_size_x1, in_size_y1, in_channels1, out_channels1, in_stream); auto out2 = convmax_layer(model, "layer" + std::to_string(2), k_size_x2, k_size_y2, in_size_x2, in_size_y2, in_channels2, out_channels2, max_pool_size_x2, max_pool_size_y2, out1); auto out3 = conv_layer(model, "layer" + std::to_string(3), k_size_x3, k_size_y3, in_size_x3, in_size_y3, in_channels3, out_channels3, out2); auto out4 = convmax_layer(model, "layer" + std::to_string(4), k_size_x4, k_size_y4, in_size_x4, in_size_y4, in_channels4, out_channels4, max_pool_size_x4, max_pool_size_y4, out3); auto out5 = conv_layer(model, "layer" + std::to_string(5), k_size_x5, k_size_y5, in_size_x5, in_size_y5, in_channels5, out_channels5, out4); auto out6 = conv_layer(model, "layer" + std::to_string(6), k_size_x6, k_size_y6, in_size_x6, in_size_y6, in_channels6, out_channels6, out5); auto out6x = conv_layer(model, "layer" + std::to_string(6) + "x", k_size_x6x, k_size_y6x, in_size_x6x, in_size_y6x, in_channels6x, out_channels6x, out6); auto out7 = convmax_layer(model, "layer" + std::to_string(7), k_size_x7, k_size_y7, in_size_x7, in_size_y7, in_channels7, out_channels7, max_pool_size_x7, max_pool_size_y7, out6x); auto out8 = conv_layer(model, "layer" + std::to_string(8), k_size_x8, k_size_y8, in_size_x8, in_size_y8, in_channels8, out_channels8, out7); auto out9 = conv_layer(model, "layer" + std::to_string(9), k_size_x9, k_size_y9, in_size_x9, in_size_y9, in_channels9, out_channels9, out8); auto out9x = conv_layer(model, "layer" + std::to_string(9) + "x", k_size_x9x, k_size_y9x, in_size_x9x, in_size_y9x, in_channels9x, out_channels9x, out9); auto out10 = convmax_layer(model, "layer" + std::to_string(10), k_size_x10, k_size_y10, in_size_x10, in_size_y10, in_channels10, out_channels10, max_pool_size_x10, max_pool_size_y10, out9x); auto out11 = conv_layer(model, "layer" + std::to_string(11), k_size_x11, k_size_y11, in_size_x11, in_size_y11, in_channels11, out_channels11, out10); auto out12 = conv_layer(model, "layer" + std::to_string(12), k_size_x12, k_size_y12, in_size_x12, in_size_y12, in_channels12, out_channels12, out11); auto out12x = conv_layer(model, "layer" + std::to_string(12) + "x", k_size_x12x, k_size_y12x, in_size_x12x, in_size_y12x, in_channels12x, out_channels12x, out12); auto out13 = convmax_layer(model, "layer" + std::to_string(13), k_size_x13, k_size_y13, in_size_x13, in_size_y13, in_channels13, out_channels13, max_pool_size_x13, max_pool_size_y13, out12x); out_stream = out13; // FIXME: Transition from convolution to fully-connected (vector stream to single vector) isolated_fully_connected_layer(model, std::to_string(17), in_size17, out_size17); isolated_fully_connected_layer(model, std::to_string(18), in_size18, out_size18); isolated_fully_connected_layer(model, std::to_string(19), in_size19, out_size19); // Compile model.compile(); // Destroy model model.destroy(); return 0; }
41.734234
196
0.696168
souravsanyal06
dce2321018127dcdf01006fb475203e1ccd35d43
2,026
cpp
C++
Competitive/CoderBoy/C++/DSA/interleaved_string.cpp
prskid1000/Coding
e1f77c26f1bfc9160c97a8bbe181c9f851045340
[ "MIT" ]
null
null
null
Competitive/CoderBoy/C++/DSA/interleaved_string.cpp
prskid1000/Coding
e1f77c26f1bfc9160c97a8bbe181c9f851045340
[ "MIT" ]
null
null
null
Competitive/CoderBoy/C++/DSA/interleaved_string.cpp
prskid1000/Coding
e1f77c26f1bfc9160c97a8bbe181c9f851045340
[ "MIT" ]
null
null
null
#include <bits/stdc++.h> #define ld long double #define ll long long int //Constant declarations #define INF 1000000000000000000LL //IO modifiers #define fast ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr); #define io1 std::ifstream in("in.txt");std::cin.rdbuf(in.rdbuf()); #define io2 std::ofstream out("out.txt");std::cout.rdbuf(out.rdbuf()); //Time Counter #define time1 auto start = high_resolution_clock::now(); #define time2 auto stop = high_resolution_clock::now(); auto duration = duration_cast<microseconds>(stop - start); cout << "------------------------\n" << "Time taken: " << ceil(duration.count() / 1000000.0) << " seconds" << "\n"; //For outer loop #define fr(i, start, stop, increment) for(i = start; i < stop; i += increment) #define dfr(i, start, stop, decrement) for( i = start; i >= stop; i -= decrement) //namespace declarations using namespace std; using namespace std::chrono; bool dp(map<string, int> memo, string a, string b, string c, int i, int j, int k) { if(k == c.length()) { if(i == a.length() && j == b.length()) return true; else return false; } string key = to_string(i) + '-' + to_string(j) + '-' + to_string(k); if(memo.find(key) != memo.end()) return memo[key]; int p = k, q = k, r = i, s = j; while(i < a.length() && c[p] == a[i]) { r++; p++; } while(j < a.length() && c[q] == b[j]) { s++; q++; } if(p == k && q == k) return false; bool x = false, y = false; if(p != k) { x = dp(memo, a, b, c, r, j, p); } if(q != k) { y = dp(memo, a, b, c, i, s, q); } return x || y; } int main() { #ifndef ONLINE_JUDGE time1 io1 io2 #endif #ifdef ONLINE_JUDGE fast #endif ll t = 1, i = 0, j = 0, k = 0; //cin >> t; while(t--) { string a = "", b = "", c = ""; cin >> a >> b >> c; map<string, int> memo; cout << dp(memo, a, b, c, 0, 0, 0) << "\n"; } #ifndef ONLINE_JUDGE time2 #endif //fflush(stdout); return 0; }
22.021739
231
0.555775
prskid1000
dce52de557444fd00956cf3e0027b3dcf7cc740a
2,283
cc
C++
modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc
ztchu/2020_04_05_webrtc
2e3e36312b10b8711c467e7bdc4582c01914e4d0
[ "BSD-3-Clause" ]
45
2020-11-25T06:17:12.000Z
2022-03-26T03:49:51.000Z
modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc
ztchu/2020_04_05_webrtc
2e3e36312b10b8711c467e7bdc4582c01914e4d0
[ "BSD-3-Clause" ]
31
2020-11-17T05:30:13.000Z
2021-12-14T02:19:00.000Z
modules/congestion_controller/rtp/transport_feedback_demuxer_unittest.cc
ztchu/2020_04_05_webrtc
2e3e36312b10b8711c467e7bdc4582c01914e4d0
[ "BSD-3-Clause" ]
20
2020-11-17T06:24:14.000Z
2022-03-10T07:08:53.000Z
/* * Copyright (c) 2019 The WebRTC project authors. All Rights Reserved. * * Use of this source code is governed by a BSD-style license * that can be found in the LICENSE file in the root of the source * tree. An additional intellectual property rights grant can be found * in the file PATENTS. All contributing project authors may * be found in the AUTHORS file in the root of the source tree. */ #include "modules/congestion_controller/rtp/transport_feedback_demuxer.h" #include "modules/rtp_rtcp/source/rtcp_packet/transport_feedback.h" #include "test/gmock.h" #include "test/gtest.h" namespace webrtc { namespace { using ::testing::_; static constexpr uint32_t kSsrc = 8492; class MockStreamFeedbackObserver : public webrtc::StreamFeedbackObserver { public: MOCK_METHOD1(OnPacketFeedbackVector, void(std::vector<StreamPacketInfo> packet_feedback_vector)); }; RtpPacketSendInfo CreatePacket(uint32_t ssrc, int16_t rtp_sequence_number, int64_t transport_sequence_number) { RtpPacketSendInfo res; res.ssrc = ssrc; res.transport_sequence_number = transport_sequence_number; res.rtp_sequence_number = rtp_sequence_number; return res; } } // namespace TEST(TransportFeedbackDemuxerTest, ObserverSanity) { TransportFeedbackDemuxer demuxer; MockStreamFeedbackObserver mock; demuxer.RegisterStreamFeedbackObserver({kSsrc}, &mock); demuxer.AddPacket(CreatePacket(kSsrc, 55, 1)); demuxer.AddPacket(CreatePacket(kSsrc, 56, 2)); demuxer.AddPacket(CreatePacket(kSsrc, 57, 3)); rtcp::TransportFeedback feedback; feedback.SetBase(1, 1000); ASSERT_TRUE(feedback.AddReceivedPacket(1, 1000)); ASSERT_TRUE(feedback.AddReceivedPacket(2, 2000)); ASSERT_TRUE(feedback.AddReceivedPacket(3, 3000)); EXPECT_CALL(mock, OnPacketFeedbackVector(_)).Times(1); demuxer.OnTransportFeedback(feedback); demuxer.DeRegisterStreamFeedbackObserver(&mock); demuxer.AddPacket(CreatePacket(kSsrc, 58, 4)); rtcp::TransportFeedback second_feedback; second_feedback.SetBase(4, 4000); ASSERT_TRUE(second_feedback.AddReceivedPacket(4, 4000)); EXPECT_CALL(mock, OnPacketFeedbackVector(_)).Times(0); demuxer.OnTransportFeedback(second_feedback); } } // namespace webrtc
34.074627
75
0.756899
ztchu
dce69c3f11c87b3317cd19467dea01975346ec84
3,202
cpp
C++
bigOrribleSwitchInline.cpp
abwilson/type_erasure_and_dispatch
44e39643843c99d6327a9673f16782fe4bbc4993
[ "MIT" ]
5
2017-09-27T13:33:42.000Z
2018-10-20T15:53:40.000Z
bigOrribleSwitchInline.cpp
abwilson/type_erasure_and_dispatch
44e39643843c99d6327a9673f16782fe4bbc4993
[ "MIT" ]
null
null
null
bigOrribleSwitchInline.cpp
abwilson/type_erasure_and_dispatch
44e39643843c99d6327a9673f16782fe4bbc4993
[ "MIT" ]
null
null
null
#include "reader.h" #include "HandlerHolder.h" #include "MsgReader.h" template<template<typename, int> class Handler> struct BigOrribleSwitch: HandlerHolder<Handler> { using Base = HandlerHolder<Handler>; const char* handle( int i, const char* msg, const MessageHeaderCompT& header, uint32_t& seqNo) const { switch(i) { case TID_ADD_COMPLEX_INSTRUMENT: return Base::addComplexInstrument( msg, header, seqNo); // 13400 case TID_AUCTION_BBO: return Base::auctionBBO( msg, header, seqNo); // 13500 case TID_AUCTION_CLEARING_PRICE: return Base::auctionClearingPrice( msg, header, seqNo); // 13501 case TID_CROSS_REQUEST: return Base::crossRequest( msg, header, seqNo); // 13502 case TID_EXECUTION_SUMMARY: return Base::executionSummary( msg, header, seqNo); // 13202 case TID_FULL_ORDER_EXECUTION: return Base::fullOrderExecution( msg, header, seqNo); // 13104 case TID_HEARTBEAT: return Base::heartbeat( msg, header, seqNo); // 13001 case TID_INSTRUMENT_STATE_CHANGE: return Base::instrumentStateChange( msg, header, seqNo); // 13301 case TID_INSTRUMENT_SUMMARY: return Base::instrumentSummary( msg, header, seqNo); // 13601 case TID_ORDER_ADD: return Base::orderAdd( msg, header, seqNo); // 13100 case TID_ORDER_DELETE: return Base::orderDelete( msg, header, seqNo); // 13102 case TID_ORDER_MASS_DELETE: return Base::orderMassDelete( msg, header, seqNo); // 13103 case TID_ORDER_MODIFY: return Base::orderModify( msg, header, seqNo); // 13101 case TID_ORDER_MODIFY_SAME_PRIO: return Base::orderModifySamePrio( msg, header, seqNo); // 13106 case TID_PACKET_HEADER: return Base::packetHeader( msg, header, seqNo); // 13002 case TID_PARTIAL_ORDER_EXECUTION: return Base::partialOrderExecution( msg, header, seqNo); // 13105 case TID_PRODUCT_STATE_CHANGE: return Base::productStateChange( msg, header, seqNo); // 13300 case TID_PRODUCT_SUMMARY: return Base::productSummary( msg, header, seqNo); // 13600 case TID_QUOTE_REQUEST: return Base::quoteRequest( msg, header, seqNo); // 13503 case TID_SNAPSHOT_ORDER: return Base::snapshotOrder( msg, header, seqNo); // 13602 case TID_TOP_OF_BOOK: return Base::topOfBook( msg, header, seqNo); // 13504 case TID_TRADE_REPORT: return Base::tradeReport( msg, header, seqNo); // 13201 case TID_TRADE_REVERSAL: return Base::tradeReversal( msg, header, seqNo); // 13200 default: return Base::defaultHandler( msg, header, seqNo); } } }; int main(const int argc, const char** argv) { using BigOrribleSwitchInline = BigOrribleSwitch<MsgReader>; BigOrribleSwitchInline underTest; return runner("BigOrribleSwitch", underTest, argc, argv); }
60.415094
107
0.623048
abwilson
dce6bd2731579c2461e131be104cae9375b7113c
2,691
hpp
C++
libember/Headers/ember/glow/StreamFormat.hpp
purefunsolutions/ember-plus
d022732f2533ad697238c6b5210d7fc3eb231bfc
[ "BSL-1.0" ]
78
2015-07-31T14:46:38.000Z
2022-03-28T09:28:28.000Z
libember/Headers/ember/glow/StreamFormat.hpp
purefunsolutions/ember-plus
d022732f2533ad697238c6b5210d7fc3eb231bfc
[ "BSL-1.0" ]
81
2015-08-03T07:58:19.000Z
2022-02-28T16:21:19.000Z
libember/Headers/ember/glow/StreamFormat.hpp
purefunsolutions/ember-plus
d022732f2533ad697238c6b5210d7fc3eb231bfc
[ "BSL-1.0" ]
49
2015-08-03T12:53:10.000Z
2022-03-17T17:25:49.000Z
/* libember -- C++ 03 implementation of the Ember+ Protocol Copyright (C) 2012-2016 Lawo GmbH (http://www.lawo.com). Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ #ifndef __LIBEMBER_GLOW_STREAMFORMAT_HPP #define __LIBEMBER_GLOW_STREAMFORMAT_HPP //SimianIgnore namespace libember { namespace glow { /** * Structure listing the available stream formats. */ struct StreamFormat { public: enum _Domain { UnsignedInt8 = 0, /* 00000 00 0 */ UnsignedInt16BigEndian = 2, /* 00000 01 0 */ UnsignedInt16LittleEndian = 3, /* 00000 01 1 */ UnsignedInt32BigEndian = 4, /* 00000 10 0 */ UnsignedInt32LittleEndian = 5, /* 00000 10 1 */ UnsignedInt64BigEndian = 6, /* 00000 11 0 */ UnsignedInt64LittleEndian = 7, /* 00000 11 1 */ SignedInt8 = 8, /* 00001 00 0 */ SignedInt16BigEndian = 10, /* 00001 01 0 */ SignedInt16LittleEndian = 11, /* 00001 01 1 */ SignedInt32BigEndian = 12, /* 00001 10 0 */ SignedInt32LittleEndian = 13, /* 00001 10 1 */ SignedInt64BigEndian = 14, /* 00001 11 0 */ SignedInt64LittleEndian = 15, /* 00001 11 1 */ IeeeFloat32BigEndian = 20, /* 00010 10 0 */ IeeeFloat32LittleEndian = 21, /* 00010 10 1 */ IeeeFloat64BigEndian = 22, /* 00010 11 0 */ IeeeFloat64LittleEndian = 23 /* 00010 11 1 */ }; typedef std::size_t value_type; /** * Initializes a new instance. * @param value The value to initialize this instance with. */ StreamFormat(_Domain value) : m_value(value) {} /** * Initializes a new instance. * @param value The value to initialize this instance with. */ explicit StreamFormat(value_type value) : m_value(value) {} /** * Returns the value. * @return The value. */ value_type value() const { return m_value; } private: value_type m_value; }; } } //EndSimianIgnore #endif // __LIBEMBER_GLOW_STREAMFORMAT_HPP
32.421687
91
0.49424
purefunsolutions
dcebf5e5fbe49f62095af2f241fdc373e1efa6bc
373,430
cpp
C++
Source/MediaInfo/MediaInfo_Config_Automatic.cpp
3CHosler/MediaInfoLib
3c1543ed46bec4bcdaa6065ba884fb1085c4f559
[ "BSD-2-Clause" ]
1
2019-12-03T16:00:42.000Z
2019-12-03T16:00:42.000Z
Source/MediaInfo/MediaInfo_Config_Automatic.cpp
3CHosler/MediaInfoLib
3c1543ed46bec4bcdaa6065ba884fb1085c4f559
[ "BSD-2-Clause" ]
null
null
null
Source/MediaInfo/MediaInfo_Config_Automatic.cpp
3CHosler/MediaInfoLib
3c1543ed46bec4bcdaa6065ba884fb1085c4f559
[ "BSD-2-Clause" ]
null
null
null
/* Copyright (c) MediaArea.net SARL. All Rights Reserved. * * Use of this source code is governed by a BSD-style license that can * be found in the License.html file in the root of the source tree. */ //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // Automaticly generated methods for MediaInfo // Don't modify, this will be deleted at the next automatic update // //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ //--------------------------------------------------------------------------- #include "MediaInfo/PreComp.h" #include "ZenLib/ZtringListList.h" #include "ZenLib/InfoMap.h" #include "ZenLib/Translation.h" using namespace ZenLib; //--------------------------------------------------------------------------- namespace MediaInfoLib { //--------------------------------------------------------------------------- void MediaInfo_Config_DefaultLanguage (Translation &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( " Language_ISO639;en\n" " Author_Email;Info@MediaArea.net\n" " Author_Name;Zen\n" " Author_OldNames;Initial translator\n" " Language_Name;English\n" " Config_Text_ColumnSize;40\n" " Config_Text_Separator; : \n" " Config_Text_NumberTag; #\n" " Config_Text_FloatSeparator;.\n" " Config_Text_ThousandsSeparator; \n" " audio stream1; audio stream\n" " audio stream2; audio streams\n" " audio stream3; audio streams\n" " bit1; bit\n" " bit2; bits\n" " bit3; bits\n" " bps; b/s\n" " Bps; B/s\n" " Byte1; Byte\n" " Byte2; Bytes\n" " Byte3; Bytes\n" " channel1; channel\n" " channel2; channels\n" " channel3; channels\n" " chapter1; chapter\n" " chapter2; chapters\n" " chapter3; chapters\n" " chapters stream1; chapters stream\n" " chapters stream2; chapters streams\n" " chapters stream3; chapters streams\n" " character1; character\n" " character2; characters\n" " character3; characters\n" " day1; day\n" " day2; days\n" " day3; days\n" " dB1; dB\n" " dB2; dB\n" " dB3; dB\n" " file1; file\n" " file2; files\n" " file3; files\n" " fps1; FPS\n" " fps2; FPS\n" " fps3; FPS\n" " frame1; frame\n" " frame2; frames\n" " frame3; frames\n" " GB; GB\n" " Gb; Gb\n" " Gbps; Gb/s\n" " GBps; GB/s\n" " GHz; GHz\n" " GiB; GiB\n" " GibiByte1; GibiBytes\n" " GibiByte2; GibiBytes\n" " GibiByte3; GibiBytes\n" " GiBps; GiB/s\n" " GigaBit1; GigaBit\n" " GigaBit2; GigaBits\n" " GigaBit3; GigaBits\n" " GigaByte1; GigaByte\n" " GigaByte2; GigaBytes\n" " GigaByte3; GigaBytes\n" " hour1; hour\n" " hour2; hours\n" " hour3; hours\n" " Hz; Hz\n" " image stream1; image stream\n" " image stream2; image streams\n" " image stream3; image streams\n" " KB; kB\n" " Kb; kb\n" " KBps; kB/s\n" " Kbps; kb/s\n" " KHz; kHz\n" " KiB; KiB\n" " KibiBit1; KibiBit\n" " KibiBit2; KibiBits\n" " KibiBit3; KibiBits\n" " KibiByte1; KibiByte\n" " KibiByte2; KibiBytes\n" " KibiByte3; KibiBytes\n" " KiBps; KiB/s\n" " KiloBit1; KiloBit\n" " KiloBit2; KiloBits\n" " KiloBit3; KiloBits\n" " KiloByte1; KiloByte\n" " KiloByte2; KiloBytes\n" " KiloByte3; KiloBytes\n" " MB; MB\n" " Mb; Mb\n" " Mbps; Mb/s\n" " MBps; MebiBytes\n" " MebiBit1; MebiBit\n" " MebiBit2; MebiBits\n" " MebiBit3; MebiBits\n" " MebiByte1; MebiByte\n" " MebiByte2; MebiBytes\n" " MebiByte3; MebiBytes\n" " MegaBit1; MegaBit\n" " MegaBit2; MegaBits\n" " MegaBit3; MegaBits\n" " MegaByte1; MegaByte\n" " MegaByte2; MegaBytes\n" " MegaByte3; MegaBytes\n" " MHz; MHz\n" " MiB; MiB\n" " Mib; Mib\n" " MiBps; MiB/s\n" " millisecond1; millisecond\n" " millisecond2; milliseconds\n" " millisecond3; milliseconds\n" " minute1; minute\n" " minute2; minutes\n" " minute3; minutes\n" " month1; month\n" " month2; months\n" " month3; months\n" " pixel1; pixel\n" " pixel2; pixels\n" " pixel3; pixels\n" " second1; second\n" " second2; seconds\n" " second3; seconds\n" " text stream1; text stream\n" " text stream2; text streams\n" " text stream3; text streams\n" " video frames1; video frame\n" " video frames2; video frames\n" " video frames3; video frames\n" " video stream1; video stream\n" " video stream2; video streams\n" " video stream3; video streams\n" " warppoint0;No warppoints\n" " warppoint1; warppoint\n" " warppoint2; warppoints\n" " warppoint3; warppoints\n" " week1; week\n" " week2; weeks\n" " week3; weeks\n" " year1; year\n" " year2; years\n" " year3; years\n" ", ;, \n" ": ;: \n" "3D;3D\n" "3DType;3D Type\n" "About;About\n" "About_Hint;How to contact me and find last version\n" "Accompaniment;Accompaniment\n" "ActiveFormatDescription;Active Format Description\n" "ActiveFormatDescription_MuxingMode;Active Format Description, Muxing mode\n" "Actor;Actor\n" "Actor_Character;Character played\n" "Added_Date;Added date\n" "Address;Address\n" "AdID;Ad-ID identifier\n" "Advanced;Advanced\n" "Advanced mode;Advanced mode\n" "Album;Album\n" "Album_ReplayGain_Gain;Album replay gain\n" "Album_ReplayGain_Peak;Album replay gain peak\n" "Alignment;Alignment\n" "Alignment_Aligned;Aligned on interleaves\n" "Alignment_Split;Split across interleaves\n" "All;All\n" "AlternateGroup;Alternate group\n" "Archival_Location;Archival location\n" "Arranger;Arranger\n" "ArtDirector;ArtDirector\n" "AspectRatio;Aspect ratio\n" "AssistantDirector;AssistantDirector\n" "at;at\n" "At least one file;(You must at least open one file)\n" "Audio;Audio\n" "Audio stream(s);Audio streams\n" "Audio_Codec_List;Audio codecs\n" "Audio_No;No audio\n" "Audio1;First audio stream\n" "Audio2;Second audio stream\n" "AudioComments;Audio Comments\n" "AudioCount;Count of audio streams\n" "AudioDescriptionPresent;Audio Description Present\n" "AudioDescriptionType;Audio Description Type\n" "AudioLoudnessStandard;Audio Loudness Standard\n" "AudioTrackLayout;Audio Track Layout\n" "Author;Author\n" "BarCode;BarCode\n" "Basic;Basic\n" "Basic_Note;Note : for more information about this file, you must select a different view (Sheet, Tree...)\n" "BedChannelConfiguration;Bed channel configuration\n" "BedChannelCount;Bed channel count\n" "BitDepth;Bit depth\n" "BitDepth_Detected;Detected bit depth\n" "BitDepth_Stored;Stored bit depth\n" "BitRate;Bit rate\n" "BitRate_Encoded;Encoded bit rate\n" "BitRate_Maximum;Maximum bit rate\n" "BitRate_Minimum;Minimum bit rate\n" "BitRate_Mode;Bit rate mode\n" "BitRate_Mode_CBR;Constant\n" "BitRate_Mode_VBR;Variable\n" "BitRate_Nominal;Nominal bit rate\n" "Bits-(Pixel*Frame);Bits/(Pixel*Frame)\n" "BufferSize;Buffer size\n" "Cancel;Cancel\n" "Channel(s);Channel(s)\n" "ChannelLayout;Channel layout\n" "ChannelPositions;Channel positions\n" "Chapter(s);Chapter(s)\n" "Chapters;Chapters\n" "Chapters stream(s);Chapters stream(s)\n" "Chapters_Codec_List;Chapters Codecs\n" "Chapters_No;No chapters\n" "ChaptersCount;Count of chapter streams\n" "CheckNewVersion;Check for new version\n" "Choose custom;Choose custom\n" "Choose custom sheet;Choose your desired custom sheet\n" "Choose custom text;Choose your desired custom text\n" "Choose export format;Choose your desired export format\n" "Choose file(s);Choose the files to open\n" "Choose filename;Choose your desired filename\n" "Choose language;Choose your desired language\n" "Choreographer;Choreographer\n" "Chroma;Chroma\n" "ChromaSubsampling;Chroma subsampling\n" "Close;Close\n" "Close all before open;Close all before open\n" "ClosedCaptionsLanguage;Closed Captions Language\n" "ClosedCaptionsPresent;Closed Captions Present\n" "ClosedCaptionsType;Closed Captions Type\n" "Codec;Codec\n" "Codec_Description;Codec description\n" "Codec_Info;Details for codec\n" "Codec_Profile;Codec profile\n" "Codec_Settings;Codec settings\n" "Codec_Settings_BVOP;Codec settings, BVOP\n" "Codec_Settings_CABAC;Codec settings, CABAC\n" "Codec_Settings_Endianness;Codec settings, Endianness\n" "Codec_Settings_Firm;Codec settings, Firm\n" "Codec_Settings_Floor;Codec settings, Floor\n" "Codec_Settings_GMC;Codec settings, GMC\n" "Codec_Settings_ITU;Codec settings, ITU\n" "Codec_Settings_Law;Codec settings, Law\n" "Codec_Settings_Matrix;Codec settings, Matrix\n" "Codec_Settings_PacketBitStream;Codec settings, Packet bitstream\n" "Codec_Settings_QPel;Codec settings, QPel\n" "Codec_Settings_Sign;Codec settings, Sign\n" "Codec_Url;Weblink for codec\n" "CodecConfigurationBox;Codec configuration box\n" "CodecID;Codec ID\n" "CodecID_Description;Description of the codec\n" "CoDirector;Codirector\n" "Collection;Collection\n" "Colorimetry;Colorimetry\n" "ColorSpace;Color space\n" "colour_primaries;Color primaries\n" "colour_range;Color range\n" "Comment;Comment\n" "CommissionedBy;Commissioned by\n" "Compilation;Compilation\n" "CompleteName;Complete name\n" "CompletionDate;Completion Date\n" "ComplexityIndex;Complexity index\n" "Composer;Composer\n" "Compression_Mode;Compression mode\n" "Compression_Mode_Lossless;Lossless\n" "Compression_Mode_Lossy;Lossy\n" "Compression_Ratio;Compression ratio\n" "Conductor;Conductor\n" "ConformanceCheck;Conformance check\n" "ContactEmail;Contact Email\n" "ContactTelephoneNumber;Contact Telephone Number\n" "Container and general information;Container and general information\n" "ContentType;ContentType\n" "CoProducer;Coproducer\n" "Copyright;Copyright\n" "CopyrightYear;Copyright Year\n" "CostumeDesigner;Costume designer\n" "Count;Count\n" "Country;Country\n" "Cover;Cover\n" "Cover_Datas;Cover datas\n" "Cover_Description;Cover description\n" "Cover_Mime;Cover MIME\n" "Cover_Type;Cover type\n" "Cropped;Crop dimensions\n" "Custom;Custom\n" "Customize;Customize\n" "Date;Date\n" "Debug;Debug\n" "Decimal point;Decimal point\n" "Delay;Delay\n" "Delay_Source;Delay, origin\n" "Delay_Source_Container;Container\n" "Delay_Source_Stream;Raw stream\n" "Delete;Delete\n" "Description;Description\n" "Digitized_Date;Digitized date\n" "Dimensions;Dimensions\n" "Director;Director\n" "DirectorOfPhotography;Director of photography\n" "Disabled;Disabled\n" "DisplayAspectRatio;Display aspect ratio\n" "DisplayAspectRatio_CleanAperture;Clean aperture display aspect ratio\n" "DisplayAspectRatio_Original;Original display aspect ratio\n" "DistributedBy;Distributed by\n" "Distributor;Distributor\n" "Donate;Donate\n" "DotsPerInch;Dots per inch\n" "DrcSets_Count;DRC set count\n" "DrcSets_Effects;DRC effect type(s)\n" "Duration;Duration\n" "Duration_End;End time\n" "Duration_Start;Start time\n" "Edit;Edit\n" "EditedBy;Edited by\n" "ElementCount;Count of elements\n" "EMail;E-Mail\n" "Encoded_Application;Writing application\n" "Encoded_Date;Encoded date\n" "Encoded_Library;Writing library\n" "Encoded_Library_Settings;Encoding settings\n" "Encoded_Original;Original support\n" "EncodedBy;Encoded by\n" "EPG_Positions;EPG positions (internal)\n" "EpisodeTitleNumber;Episode Title Number\n" "Error_File;Error while reading file\n" "ExecutiveProducer;Executive producer\n" "Exit;Exit\n" "Exit_Hint;Quit the program\n" "Export;Export\n" "Export_Hint;Export in a customized format\n" "Extensions;Extensions usually used\n" "Family;Family\n" "Fax;Fax\n" "File;File\n" "File size;File size\n" "File_Append;Append to the existing file (Warning : be careful to have the same parameters)\n" "File_Created_Date;File creation date\n" "File_Created_Date_Local;File creation date (local)\n" "File_Hint;Select a multimedia file to examine\n" "File_Modified_Date;File last modification date\n" "File_Modified_Date_Local;File last modification date (local)\n" "FileExtension;File extension\n" "FileName;File name\n" "FileNameExtension;File name extension\n" "FileSize;File size\n" "Folder;Folder\n" "Folder (R);Folder (R)\n" "Folder (R)_Hint;Select a folder to examine (with all folders recursively)\n" "Folder (Recursively);Folder (Recursively)\n" "Folder_Hint;Select a folder to examine\n" "FolderName;Folder name\n" "Format;Format\n" "Format_Commercial;Commercial name\n" "Format_Commercial_IfAny;Commercial name\n" "Format_Description;Format description\n" "Format_Info;Details for format\n" "Format_Level;Format level\n" "Format_Profile;Format profile\n" "Format_Settings;Format settings\n" "Format_Settings_BVOP;Format settings, BVOP\n" "Format_Settings_CABAC;Format settings, CABAC\n" "Format_Settings_Emphasis;Emphasis\n" "Format_Settings_Endianness;Format settings, Endianness\n" "Format_Settings_Firm;Format settings, Firm\n" "Format_Settings_Floor;Format settings, Floor\n" "Format_Settings_FrameMode;Frame mode\n" "Format_Settings_GMC;Format settings, GMC\n" "Format_Settings_GOP;Format settings, GOP\n" "Format_Settings_ITU;Format settings, ITU\n" "Format_Settings_Law;Format settings, Law\n" "Format_Settings_Matrix;Format settings, Matrix\n" "Format_Settings_Matrix_Custom;Custom\n" "Format_Settings_Matrix_Default;Default\n" "Format_Settings_Mode;Mode\n" "Format_Settings_ModeExtension;Mode extension\n" "Format_Settings_PacketBitStream;Format settings, Packet bitstream\n" "Format_Settings_PictureStructure;Format settings, picture structure\n" "Format_Settings_PS;Format settings, PS\n" "Format_Settings_Pulldown;Format settings, Pulldown\n" "Format_Settings_QPel;Format settings, QPel\n" "Format_Settings_RefFrames;Format settings, Reference frames\n" "Format_Settings_SBR;Format settings, SBR\n" "Format_Settings_Sign;Format settings, Sign\n" "Format_Settings_Wrapping;Format settings, wrapping mode\n" "Format_Tier;Format tier\n" "Format_Url;Weblink for format\n" "Format_Version;Format version\n" "FpaManufacturer;FPA Manufacturer\n" "FpaPass;FPA Pass\n" "FpaVersion;FPA Version\n" "FrameCount;Frame count\n" "FrameRate;Frame rate\n" "FrameRate_Maximum;Maximum frame rate\n" "FrameRate_Minimum;Minimum frame rate\n" "FrameRate_Mode;Frame rate mode\n" "FrameRate_Mode_CFR;Constant\n" "FrameRate_Mode_VFR;Variable\n" "FrameRate_Nominal;Nominal frame rate\n" "FrameRate_Original;Original frame rate\n" "General;General\n" "Genre;Genre\n" "Genre_000;Blues\n" "Genre_001;Classic Rock\n" "Genre_002;Country\n" "Genre_003;Dance\n" "Genre_004;Disco\n" "Genre_005;Funk\n" "Genre_006;Grunge\n" "Genre_007;Hip-Hop\n" "Genre_008;Jazz\n" "Genre_009;Metal\n" "Genre_010;New Age\n" "Genre_011;Oldies\n" "Genre_012;Other\n" "Genre_013;Pop\n" "Genre_014;R&B\n" "Genre_015;Rap\n" "Genre_016;Reggae\n" "Genre_017;Rock\n" "Genre_018;Techno\n" "Genre_019;Industrial\n" "Genre_020;Alternative\n" "Genre_021;Ska\n" "Genre_022;Death Metal\n" "Genre_023;Pranks\n" "Genre_024;Soundtrack\n" "Genre_025;Euro-Techno\n" "Genre_026;Ambient\n" "Genre_027;Trip-Hop\n" "Genre_028;Vocal\n" "Genre_029;Jazz+Funk\n" "Genre_030;Fusion\n" "Genre_031;Trance\n" "Genre_032;Classical\n" "Genre_033;Instrumental\n" "Genre_034;Acid\n" "Genre_035;House\n" "Genre_036;Game\n" "Genre_037;Sound Clip\n" "Genre_038;Gospel\n" "Genre_039;Noise\n" "Genre_040;Alt. Rock\n" "Genre_041;Bass\n" "Genre_042;Soul\n" "Genre_043;Punk\n" "Genre_044;Space\n" "Genre_045;Meditative\n" "Genre_046;Instrumental Pop\n" "Genre_047;Instrumental Rock\n" "Genre_048;Ethnic\n" "Genre_049;Gothic\n" "Genre_050;Darkwave\n" "Genre_051;Techno-Industrial\n" "Genre_052;Electronic\n" "Genre_053;Pop-Folk\n" "Genre_054;Eurodance\n" "Genre_055;Dream\n" "Genre_056;Southern Rock\n" "Genre_057;Comedy\n" "Genre_058;Cult\n" "Genre_059;Gangsta Rap\n" "Genre_060;Top 40\n" "Genre_061;Christian Rap\n" "Genre_062;Pop/Funk\n" "Genre_063;Jungle\n" "Genre_064;Native American\n" "Genre_065;Cabaret\n" "Genre_066;New Wave\n" "Genre_067;Psychedelic\n" "Genre_068;Rave\n" "Genre_069;Showtunes\n" "Genre_070;Trailer\n" "Genre_071;Lo-Fi\n" "Genre_072;Tribal\n" "Genre_073;Acid Punk\n" "Genre_074;Acid Jazz\n" "Genre_075;Polka\n" "Genre_076;Retro\n" "Genre_077;Musical\n" "Genre_078;Rock & Roll\n" "Genre_079;Hard Rock\n" "Genre_080;Folk\n" "Genre_081;Folk-Rock\n" "Genre_082;National Folk\n" "Genre_083;Swing\n" "Genre_084;Fast-Fusion\n" "Genre_085;Bebop\n" "Genre_086;Latin\n" "Genre_087;Revival\n" "Genre_088;Celtic\n" "Genre_089;Bluegrass\n" "Genre_090;Avantgarde\n" "Genre_091;Gothic Rock\n" "Genre_092;Progressive Rock\n" "Genre_093;Psychedelic Rock\n" "Genre_094;Symphonic Rock\n" "Genre_095;Slow Rock\n" "Genre_096;Big Band\n" "Genre_097;Chorus\n" "Genre_098;Easy Listening\n" "Genre_099;Acoustic\n" "Genre_100;Humour\n" "Genre_101;Speech\n" "Genre_102;Chanson\n" "Genre_103;Opera\n" "Genre_104;Chamber Music\n" "Genre_105;Sonata\n" "Genre_106;Symphony\n" "Genre_107;Booty Bass\n" "Genre_108;Primus\n" "Genre_109;Porn Groove\n" "Genre_110;Satire\n" "Genre_111;Slow Jam\n" "Genre_112;Club\n" "Genre_113;Tango\n" "Genre_114;Samba\n" "Genre_115;Folklore\n" "Genre_116;Ballad\n" "Genre_117;Power Ballad\n" "Genre_118;Rhythmic Soul\n" "Genre_119;Freestyle\n" "Genre_120;Duet\n" "Genre_121;Punk Rock\n" "Genre_122;Drum Solo\n" "Genre_123;A Cappella\n" "Genre_124;Euro-House\n" "Genre_125;Dance Hall\n" "Genre_126;Goa\n" "Genre_127;Drum & Bass\n" "Genre_128;Club-House\n" "Genre_129;Hardcore\n" "Genre_130;Terror\n" "Genre_131;Indie\n" "Genre_132;BritPop\n" "Genre_133;Afro-Punk\n" "Genre_134;Polsk Punk\n" "Genre_135;Beat\n" "Genre_136;Christian Gangsta Rap\n" "Genre_137;Heavy Metal\n" "Genre_138;Black Metal\n" "Genre_139;Crossover\n" "Genre_140;Contemporary Christian\n" "Genre_141;Christian Rock\n" "Genre_142;Merengue\n" "Genre_143;Salsa\n" "Genre_144;Thrash Metal\n" "Genre_145;Anime\n" "Genre_146;JPop\n" "Genre_147;Synthpop\n" "Genre_148;Abstract\n" "Genre_149;Art Rock\n" "Genre_150;Baroque\n" "Genre_151;Bhangra\n" "Genre_152;Big Beat\n" "Genre_153;Breakbeat\n" "Genre_154;Chillout\n" "Genre_155;Downtempo\n" "Genre_156;Dub\n" "Genre_157;EBM\n" "Genre_158;Eclectic\n" "Genre_159;Electro\n" "Genre_160;Electroclash\n" "Genre_161;Emo\n" "Genre_162;Experimental\n" "Genre_163;Garage\n" "Genre_164;Global\n" "Genre_165;IDM\n" "Genre_166;Illbient\n" "Genre_167;Industro-Goth\n" "Genre_168;Jam Band\n" "Genre_169;Krautrock\n" "Genre_170;Leftfield\n" "Genre_171;Lounge\n" "Genre_172;Math Rock\n" "Genre_173;New Romantic\n" "Genre_174;Nu-Breakz\n" "Genre_175;Post-Punk\n" "Genre_176;Post-Rock\n" "Genre_177;Psytrance\n" "Genre_178;Shoegaze\n" "Genre_179;Space Rock\n" "Genre_180;Trop Rock\n" "Genre_181;World Music\n" "Genre_182;Neoclassical\n" "Genre_183;Audiobook\n" "Genre_184;Audio Theatre\n" "Genre_185;Neue Deutsche Welle\n" "Genre_186;Podcast\n" "Genre_187;Indie Rock\n" "Genre_188;G-Funk\n" "Genre_189;Dubstep\n" "Genre_190;Garage Rock\n" "Genre_191;Psybient\n" "Go to WebSite;Go to website\n" "Gop_OpenClosed;GOP, Open/Closed\n" "Gop_OpenClosed_Closed;Closed\n" "Gop_OpenClosed_FirstFrame;GOP, Open/Closed of first frame\n" "Gop_OpenClosed_Open;Open\n" "Grouping;Grouping\n" "h; h\n" "HDR_Format;HDR format\n" "Header file;Create a header file\n" "Height;Height\n" "Height_CleanAperture;Clean aperture height\n" "Height_Original;Original height\n" "Help;Help\n" "Hint;Hint\n" "How many audio streams?;How many audio streams?\n" "How many chapters streams?;How many chapters streams?\n" "How many text streams?;How many text streams?\n" "How many video streams?;How many video streams?\n" "HTML;HTML\n" "ID;ID\n" "IdentClockStart;Ident Clock Start\n" "Image;Image\n" "Image stream(s);Image streams\n" "Image_Codec_List;Codecs Image\n" "ImageCount;Count of image streams\n" "Info;Info\n" "Instruments;Instruments\n" "Interlaced_BFF;Bottom Field First\n" "Interlaced_Interlaced;Interlaced\n" "Interlaced_PPF;Progressive\n" "Interlaced_Progressive;Progressive\n" "Interlaced_TFF;Top Field First\n" "Interlacement;Interlacement\n" "Interleave_Duration;Interleave, duration\n" "Interleave_Preload;Interleave, preload duration\n" "Interleave_VideoFrames;Interleave, duration\n" "Interleaved;Interleaved\n" "InternetMediaType;Internet media type\n" "IRCA;IRCA\n" "ISBN;ISBN\n" "ISRC;ISRC\n" "Keywords;Keywords\n" "Known codecs;Known codecs\n" "Known formats;Known formats\n" "Known parameters;Known parameters\n" "Label;Label\n" "Language;Language\n" "Language_aa;Afar\n" "Language_ab;Abkhazian\n" "Language_ae;Avestan\n" "Language_af;Afrikaans\n" "Language_ak;Akan\n" "Language_am;Amharic\n" "Language_an;Aragonese\n" "Language_ar;Arabic\n" "Language_as;Assamese\n" "Language_av;Avaric\n" "Language_ay;Aymara\n" "Language_az;Azerbaijani\n" "Language_ba;Bashkir\n" "Language_be;Belarusian\n" "Language_bg;Bulgarian\n" "Language_bh;Bihari\n" "Language_bi;Bislama\n" "Language_bm;Bambara\n" "Language_bn;Bengali\n" "Language_bo;Tibetan\n" "Language_br;Breton\n" "Language_bs;Bosnian\n" "Language_ca;Catalan\n" "Language_ce;Chechen\n" "Language_ch;Chamorro\n" "Language_co;Corsican\n" "Language_cr;Cree\n" "Language_cs;Czech\n" "Language_cu;Slave\n" "Language_cv;Chuvash\n" "Language_cy;Welsh\n" "Language_da;Danish\n" "Language_de;German\n" "Language_dv;Divehi\n" "Language_dz;Dzongkha\n" "Language_ee;Ewe\n" "Language_el;Greek\n" "Language_en;English\n" "Language_en-gb;English (Great Britain)\n" "Language_en-us;English (United States)\n" "Language_eo;Esperanto\n" "Language_es;Spanish\n" "Language_es-419;Spanish (Latin America)\n" "Language_et;Estonian\n" "Language_eu;Basque\n" "Language_fa;Persian\n" "Language_ff;Fulah\n" "Language_fi;Finnish\n" "Language_fj;Fijian\n" "Language_fo;Faroese\n" "Language_fr;French\n" "Language_fy;Frisian\n" "Language_ga;Irish\n" "Language_gd;Gaelic\n" "Language_gl;Galician\n" "Language_gn;Guarani\n" "Language_gu;Gujarati\n" "Language_gv;Manx\n" "Language_ha;Hausa\n" "Language_he;Hebrew\n" "Language_hi;Hindi\n" "Language_ho;Hiri Motu\n" "Language_hr;Croatian\n" "Language_ht;Haitian\n" "Language_hu;Hungarian\n" "Language_hy;Armenian\n" "Language_hy-az;Armenian (Azerbaijani)\n" "Language_hz;Herero\n" "Language_ia;Auxiliary Language Association\n" "Language_id;Indonesian\n" "Language_ie;Interlingue\n" "Language_ig;Igbo\n" "Language_ii;Sichuan Yi\n" "Language_ik;Inupiaq\n" "Language_Info;Language info\n" "Language_io;Ido\n" "Language_is;Icelandic\n" "Language_it;Italian\n" "Language_iu;Inuktitut\n" "Language_ja;Japanese\n" "Language_jv;Javanese\n" "Language_ka;Georgian\n" "Language_kg;Kongo\n" "Language_ki;Kikuyu\n" "Language_kj;Kuanyama\n" "Language_kk;Kazakh\n" "Language_kl;Kalaallisut\n" "Language_km;Khmer\n" "Language_kn;Kannada\n" "Language_ko;Korean\n" "Language_kr;Kanuri\n" "Language_ks;Kashmiri\n" "Language_ku;Kurdish\n" "Language_kv;Komi\n" "Language_kw;Cornish\n" "Language_ky;Kirghiz\n" "Language_la;Latin\n" "Language_lb;Luxembourgish\n" "Language_lg;Ganda\n" "Language_li;Limburgish\n" "Language_ln;Lingala\n" "Language_lo;Lao\n" "Language_lt;Lithuanian\n" "Language_lu;Luba-Katanga\n" "Language_lv;Latvian\n" "Language_mg;Malagasy\n" "Language_mh;Marshallese\n" "Language_mi;Maori\n" "Language_mk;Macedonian\n" "Language_ml;Malayalam\n" "Language_mn;Mongolian\n" "Language_mn-cn;Mongolian (China)\n" "Language_mo;Moldavian\n" "Language_More;Language, more info\n" "Language_mr;Marathi\n" "Language_ms;Malay\n" "Language_ms-bn;Malay (Brunei)\n" "Language_mt;Maltese\n" "Language_mul;Multiple languages\n" "Language_my;Burmese\n" "Language_na;Nauru\n" "Language_nb;Norwegian Bokmal\n" "Language_nd;Ndebele\n" "Language_ne;Nepali\n" "Language_ng;Ndonga\n" "Language_nl;Dutch\n" "Language_nl-be;Flemish\n" "Language_nn;Norwegian Nynorsk\n" "Language_no;Norwegian\n" "Language_nr;Ndebele\n" "Language_nv;Navaho\n" "Language_ny;Nyanja\n" "Language_oc;Occitan\n" "Language_oj;Ojibwa\n" "Language_om;Oromo\n" "Language_or;Oriya\n" "Language_os;Ossetic\n" "Language_pa;Panjabi\n" "Language_pi;Pali\n" "Language_pl;Polish\n" "Language_ps;Pushto\n" "Language_pt;Portuguese\n" "Language_pt-br;Portuguese (Brazil)\n" "Language_qu;Quechua\n" "Language_rm;Raeto-Romance\n" "Language_rn;Rundi\n" "Language_ro;Romanian\n" "Language_ru;Russian\n" "Language_rw;Kinyarwanda\n" "Language_sa;Sanskrit\n" "Language_sc;Sardinian\n" "Language_sd;Sindhi\n" "Language_se;Northern Sami\n" "Language_sg;Sango\n" "Language_si;Sinhala\n" "Language_sk;Slovak\n" "Language_sl;Slovenian\n" "Language_sm;Samoan\n" "Language_smi;Sami\n" "Language_sn;Shona\n" "Language_so;Somali\n" "Language_sq;Albanian\n" "Language_sr;Serbian\n" "Language_ss;Swati\n" "Language_st;Sotho\n" "Language_su;Sundanese\n" "Language_sv;Swedish\n" "Language_sw;Swahili\n" "Language_ta;Tamil\n" "Language_te;Telugu\n" "Language_tg;Tajik\n" "Language_th;Thai\n" "Language_ti;Tigrinya\n" "Language_tk;Turkmen\n" "Language_tl;Tagalog\n" "Language_tn;Tswana\n" "Language_to;Tonga\n" "Language_tr;Turkish\n" "Language_ts;Tsonga\n" "Language_tt;Tatar\n" "Language_tw;Twi\n" "Language_ty;Tahitian\n" "Language_ug;Uighur\n" "Language_uk;Ukrainian\n" "Language_ur;Urdu\n" "Language_uz;Uzbek\n" "Language_ve;Venda\n" "Language_vi;Vietnamese\n" "Language_vo;Volapuk\n" "Language_wa;Walloon\n" "Language_wo;Wolof\n" "Language_xh;Xhosa\n" "Language_yi;Yiddish\n" "Language_yo;Yoruba\n" "Language_za;Zhuang\n" "Language_zh;Chinese\n" "Language_zh-cn;Chinese (China)\n" "Language_zh-tw;Chinese (Taiwan)\n" "Language_zu;Zulu\n" "LawRating;Law rating\n" "LCCN;LCCN\n" "Library;Muxing library\n" "Lightness;Lightness\n" "LineUpStart;Line Up Start\n" "List;List\n" "Loudness_Anchor;Anchor loudness\n" "Loudness_Anchor_Album;Anchor loudness (album)\n" "Loudness_Count;Loudness info count\n" "Loudness_Count_Album;Loudness info count (album)\n" "Loudness_MaximumMomentary;Maximum momentary loudness\n" "Loudness_MaximumMomentary_Album;Maximum momentary loudness (album)\n" "Loudness_MaximumOfRange;Maximum of the range\n" "Loudness_MaximumOfRange_Album;Maximum of the range (album)\n" "Loudness_MaximumShortTerm;Maximum short-term loudness\n" "Loudness_MaximumShortTerm_Album;Maximum short-term loudness (album)\n" "Loudness_ProductionMixingLevel;Production mixing level\n" "Loudness_ProductionMixingLevel_Album;Production mixing level (album)\n" "Loudness_Program;Program loudness\n" "Loudness_Program_Album;Program loudness (album)\n" "Loudness_Range;Loudness range\n" "Loudness_Range_Album;Loudness range (album)\n" "Loudness_RoomType;Production room type\n" "Loudness_RoomType_Album;Production room type (album)\n" "Lyricist;Lyricist\n" "Lyrics;Lyrics\n" "Mastered_Date;Mastered date\n" "MasteredBy;Mastered by\n" "MasteringDisplay_ColorPrimaries;Mastering display color primaries\n" "MasteringDisplay_Luminance;Mastering display luminance\n" "Matrix_Channel(s);Matrix encoding, Channel(s)\n" "Matrix_ChannelPositions;Matrix encoding, channel positions\n" "matrix_coefficients;Matrix coefficients\n" "Matrix_Format;Matrix encoding, format\n" "MaxCLL;Maximum Content Light Level\n" "MaxFALL;Maximum Frame-Average Light Level\n" "MediaInfo_About;MediaInfo provides easy access to technical and tag information about video and audio files.\r\nExcept the Mac App Store graphical user interface, it is open-source software, which means that it is free of charge to the end user and developers have freedom to study, to improve and to redistribute the program (BSD license)\n" "Menu;Menu\n" "Menu stream(s);Menu streams\n" "Menu_Codec_List;Menu codecs\n" "Menu_Hint;More possibilities\n" "Menu_No;No menu\n" "MenuCount;Count of menu streams\n" "MenuID;Menu ID\n" "mn; min\n" "Mood;Mood\n" "More;More\n" "Movie;Movie name\n" "ms; ms\n" "MSDI;MSDI\n" "MusicBy;Music by\n" "MuxingMode;Muxing mode\n" "MuxingMode_MoreInfo;Muxing mode, more info\n" "MuxingMode_PackedBitstream;Packed bitstream\n" "Name;Name\n" "Nationality;Nationality\n" "NetworkName;Network name\n" "New;New\n" "Newest version;Check for new versions (requires Internet connection)\n" "NewVersion_Menu;A new version is available\n" "NewVersion_Question_Content;A new version (v%Version%) is available, would you like to download it?\n" "NewVersion_Question_Title;A new version was released!\n" "No;No\n" "Not yet;Not yet\n" "NumberOfDynamicObjects;Number of dynamic objects\n" "NumColors;Number of colors\n" "OK;OK\n" "One output file per input file;One output file per input file\n" "Open;Open\n" "OpenCandy_01;Downloading ________\n" "OpenCandy_02;__% Complete\n" "OpenCandy_03;Internet connection interrupted\n" "OpenCandy_04;________ download complete\n" "OpenCandy_05;Click to install ________\n" "OpenCandy_06;Are you sure you wish to cancel the install?\r\nIf you wish to postpone the install until later, select 'No'.\r\nNote: You may select Exit from the menu to defer installation until after the next time you reboot.\n" "OpenCandy_07;Download of ________ has been paused.\r\nClick on the tray icon to resume downloading.\n" "OpenCandy_08;A critical error has occurred. Installation of _________ will be aborted.\n" "OpenCandy_09;Pause download\n" "OpenCandy_10;Cancel install\n" "OpenCandy_11;Resume download\n" "OpenCandy_12;Exit Installer\n" "OpenCandy_13;___________ - Recommended by ____________\n" "OpenCandy_14;Downloading _________\n" "OpenCandy_15;___________, the software recommended to you by ___________, is now downloading at your requestWe will let you know when it is ready to be installed.\n" "OpenCandy_16;___________ is ready for installation\n" "OpenCandy_17;___________ is now fully downloaded. Please click on 'Install' to proceed.\n" "OpenCandy_18;___________ of ___________ downloaded\n" "OpenCandy_19;Powered by OpenCandy\n" "OpenCandy_20;Learn more at OpenCandy.com\n" "OpenCandy_21;Install\n" "OpenCandy_22;Installation of ___________\n" "OpenCandy_23;This will cancel the installation of ___________\r\nAre you sure you wish to exit?\n" "OpenCandy_24;Pause\n" "OpenCandy_25;Your download has been paused. Click 'Resume' when you are ready to continue.\n" "OpenCandy_26;Resume\n" "OpenCandy_27;Install Now\n" "OpenCandy_28;Pause Download\n" "OpenCandy_29;Resume Download\n" "OpenCandy_30;Cancel Install\n" "OpenCandy_31;Please choose an installation option\n" "OpenCandy_32;Install ___________\n" "OpenCandy_33;Don't Install\n" "OpenCandy_34;Please select an install option\n" "OpenCandy_35;______ recommends this software\n" "OpenCandy_36;Your current installation will not be interrupted\n" "OpenCaptionsLanguage;Open Captions Language\n" "OpenCaptionsPresent;Open Captions Present\n" "OpenCaptionsType;Open Captions Type\n" "Options;Options\n" "Options_Hint;Preferences\n" "Original;Original\n" "OriginalNetworkName;Original network name\n" "OriginalSourceForm;Original source form\n" "OriginalSourceMedium;Original source medium\n" "OriginalSourceMedium_ID;ID in the original source medium\n" "Originator;Originator\n" "Other;Other\n" "OtherIdentifier;Other Identifier\n" "OtherIdentifierType;Other Identifier Type\n" "Output;Output\n" "Output format;Output format\n" "OverallBitRate;Overall bit rate\n" "OverallBitRate_Maximum;Maximum Overall bit rate\n" "OverallBitRate_Minimum;Minimum Overall bit rate\n" "OverallBitRate_Mode;Overall bit rate mode\n" "OverallBitRate_Nominal;Nominal Overall bit rate\n" "PackageName;Package name\n" "Part;Part\n" "Part_Count;Total count\n" "PartNumber;Part Number\n" "PartTotal;Part Total\n" "Performer;Performer\n" "Period;Period\n" "Phone;Phone\n" "PictureRatio;Picture Ratio\n" "PixelAspectRatio;Pixel aspect ratio\n" "PixelAspectRatio_CleanAperture;Clean aperture pixel aspect ratio\n" "PixelAspectRatio_Original;Original pixel aspect ratio\n" "PlayCounter;PlayCounter\n" "Played_Count;Times played\n" "Played_First_Date;First played\n" "Played_Last_Date;Last played\n" "PlayTime;PlayTime\n" "PodcastCategory;Podcast category\n" "Position;Position\n" "Position_Total;Total\n" "Preferences;Preferences\n" "PrimaryAudioLanguage;Primary Audio Language\n" "Producer;Producer\n" "ProductionDesigner;Production designer\n" "ProductionNumber;Production Number\n" "ProductionStudio;Production studio\n" "ProductPlacement;Product Placement\n" "ProgrammeHasText;Programme Has Text\n" "ProgrammeTextLanguage;Programme Text Language\n" "ProgrammeTitle;Programme Title\n" "Publisher;Publisher\n" "Purchased_Date;purchased date\n" "Quote character;Quote character\n" "RadioStation;Radio station\n" "Rating;Rating\n" "Recorded_Date;Recorded date\n" "Recorded_Location;Recorded location\n" "Released_Date;Released date\n" "RemixedBy;Remixed by\n" "ReplayGain_Gain;Replay gain\n" "ReplayGain_Peak;Replay gain peak\n" "Resolution;Resolution\n" "s; s\n" "SamplePeakLevel;Sample peak level\n" "SamplePeakLevel_Album;Sample peak level (album)\n" "SamplesPerFrame;Samples per frame\n" "SamplingCount;Samples count\n" "SamplingRate;Sampling rate\n" "Save;Save\n" "ScanOrder;Scan order\n" "ScanOrder_Original;Original scan order\n" "ScanOrder_Stored;Stored scan order\n" "ScanOrder_StoredDisplayedInverted;Scan order, stored/displayed order inverted\n" "ScanOrder_StoreMethod;Scan order, store method\n" "ScanType;Scan type\n" "ScanType_Original;Original scan type\n" "ScanType_StoreMethod;Scan type, store method\n" "ScreenplayBy;Screenplay by\n" "Season;Season\n" "SecondaryAudioLanguage;Secondary Audio Language\n" "see below;see below\n" "Send HeaderFile;Please send me the Header file here : http://sourceforge.net/projects/mediainfo/ (Bug section)\n" "Separator_Columns;columns separator\n" "Separator_Lines;lines separator\n" "SeriesTitle;Series Title\n" "ServiceChannel;Service channel number\n" "ServiceKind;Service kind\n" "ServiceName;Service name\n" "ServiceProvider;Service provider\n" "ServiceType;Service type\n" "Set;Set\n" "Set_Count;Set count\n" "Setup;Setup\n" "Sharpness;Sharpness\n" "Sheet;Sheet\n" "Sheet (Complete);Sheet (Complete)\n" "Shell extension;Explorer extension (in Windows Explorer, right click on a file, there will be a MediaInfo option)\n" "Shell extension, folder;For folders too\n" "Shell InfoTip;Explorer Tooltip (in Windows Explorer, move the mouse over the file, info will be displayed)\n" "ShimName;Shim Name\n" "ShimVersion;Shim Version\n" "Show menu;Show menu\n" "Show toolbar;Show toolbar\n" "SigningPresent;Signing Present\n" "SignLanguage;Sign Language\n" "Sort;Sorted by\n" "SoundEngineer;Sound engineer\n" "Source;Source\n" "Source_Duration;Source duration\n" "Source_FrameCount;Source frame count\n" "Source_SamplingCount;Source sample count\n" "Source_StreamSize;Source stream size\n" "Source_StreamSize_Encoded;Source encoded stream size\n" "Standard;Standard\n" "StoreMethod_InterleavedFields;Interleaved fields\n" "StoreMethod_SeparatedFields;Separated fields\n" "StoreMethod_SeparatedFields_1;Separated fields (1 field per block)\n" "StoreMethod_SeparatedFields_2;Separated fields (2 fields per block)\n" "Stream;Stream\n" "Stream_MoreInfo;More information about the stream\n" "StreamCount;Count of stream of this kind\n" "StreamID;Stream ID\n" "streamIdentifier;Stream identifier\n" "StreamKind;Kind of stream\n" "StreamKindID;Stream identifier\n" "StreamKindPos;Stream identifier\n" "StreamSize;Stream size\n" "StreamSize_Demuxed;Stream size when demuxed\n" "StreamSize_Encoded;Encoded stream size\n" "StreamSize_Proportion;Proportion of this stream\n" "Subject;Subject\n" "SubTrack;SubTrack\n" "Summary;Summary\n" "Supported formats;Supported formats\n" "Supported?;Supported?\n" "Synopsis;Synopsis\n" "SystemId;Id\n" "Tagged_Application;Tagging application\n" "Tagged_Date;Tagged date\n" "Technician;Technician\n" "TermsOfUse;Terms of use\n" "TertiaryAudioLanguage;Tertiary Audio Language\n" "Text;Text\n" "Text - Custom;Text - Custom\n" "Text (HTML);Text (HTML)\n" "Text stream(s);Text streams\n" "Text streams;Text streams\n" "Text_Codec_List;Text codecs\n" "Text_No;No text\n" "Text1;First text stream\n" "Text2;Second text stream\n" "Text3;Third text stream\n" "TextCount;Count of text streams\n" "TextlessElementsExist;Textless Elements Exist\n" "ThanksTo;Thanks to\n" "Thousands separator;Thousands separator\n" "TimeCode;Time code\n" "TimeCode_FirstFrame;Time code of first frame\n" "TimeCode_Settings;Time code settings\n" "TimeCode_Source;Time code source\n" "TimeCode_Striped;Time code, striped\n" "TimeStamp;Time stamp\n" "TimeZone;Timezone\n" "Title;Title\n" "Title_More;Title, more info\n" "Total;Total\n" "TotalNumberOfParts;Total Number Of Parts\n" "TotalProgrammeDuration;Total Programme Duration\n" "Track;Track name\n" "Track_Count;Track count\n" "transfer_characteristics;Transfer characteristics\n" "Translator;Translator\n" "Tree;Tree\n" "Tree & Text;Tree & Text\n" "TruePeakLevel;True peak level\n" "TruePeakLevel_Album;True peak level (album)\n" "Type;Type\n" "UniqueID;Unique ID\n" "UniversalAdID;Universal Ad ID\n" "UniversalAdID_Registry;Universal Ad ID registry\n" "UniversalAdID_Value;Universal Ad ID value\n" "Unknown;Unknown\n" "Url;Url\n" "Video;Video\n" "Video stream(s);Video stream(s)\n" "Video_Codec_List;Codecs Video\n" "Video_Delay;Delay relative to video\n" "Video_No;No video\n" "Video0_Delay;Video0 delay\n" "Video1;First video stream\n" "VideoComments;Video Comments\n" "VideoCount;Count of video streams\n" "View;View\n" "View_Hint;Change the means of viewing information\n" "Warning : more streams in the files;Warning : there are more streams in the files\n" "Web;Web\n" "WebSite_Audio;Go to the web site of this audio codec\n" "WebSite_Audio_More;Go to the web site (%Url%) to find this audio codec\n" "WebSite_General;Go to the web site of a player for this file\n" "WebSite_General_More;Go to the web site of a player for this file\n" "WebSite_Text;Go to the web site of this text codec\n" "WebSite_Text_More;Go to the web site (%Url%) to find this text codec\n" "WebSite_Url;http://MediaArea.net/MediaInfo\n" "WebSite_Video;Go to the web site of this video codec\n" "WebSite_Video_More;Go to the web site (%Url%) to find this video codec\n" "Width;Width\n" "Width_CleanAperture;Clean aperture width\n" "Width_Original;Original width\n" "WriteMe;Write mail to author\n" "WriteToTranslator;Write to translator\n" "Written_Date;Written date\n" "Written_Location;Written location\n" "WrittenBy;Written by\n" "Yes;Yes\n" "Your system;Your system\n" "ZZ_Automatic_Percent;100\n" "ZZ_AutomaticLanguage_Percent;100\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Format (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "AAF;;;M;Aaf;;aaf;;\n" "AIFF;;;M;Riff;Apple/SGI;aiff aifc aif;audio/x-aiff;\n" "AMV;;;M;Riff;Chinese hack of AVI;amv;;http://en.wikipedia.org/wiki/AMV_video_format\n" "AVI;;;M;Riff;Audio Video Interleave;avi;video/vnd.avi;\n" "BDAV;;;M;Bdav;Blu-ray Video;m2ts mts ssif;;\n" "Blu-ray Clip info;;;M;Bdmv;;clpi;;\n" "Blu-ray Index;;;M;Bdmv;;bdmv bdm;;\n" "Blu-ray Movie object;;;M;Bdmv;;bdmv bdm;;\n" "Blu-ray Playlist;;;M;Bdmv;;mpls;;\n" "CDDA;;;M;Riff;;cda;;\n" "CDXA;;;M;Cdxa;;dat;;\n" "DASH MPD;;;M;DashMpd;;mpd;application/dash+xml;;Lossy\n" "DV;;;M;DvdDif;;dv dif;video/DV;;Lossy\n" "DivX;;;M;Riff;Hack of AVI;divx;video/vnd.avi;http://www.divx.com\n" "DPG;;;M;Dpg;Nintendo DS;dpg;;\n" "DVD Video;;;M;Dvdv;;ifo;;\n" "Flash Video;;;M;Flv;;flv;video/x-flv;http://www.macromedia.com/go/getflashplayer\n" "GXF;;;M;Gxf;SMPTE 360M;gxf;;\n" "HDS F4M;Flash Media Manifest;;M;HdsF4m;;f4m\n" "HEIF;;;M;Mpeg4;;heif avci avcs heic heics avif avis;\n" "HLS;;;M;Hls;;m3u8;\n" "Google Video;;;M;Riff;Hack of AVI;gvi;;http://video.google.com/playerdownload.html\n" "ISM;Internet Streaming Media;;M;Ism;;ism;;\n" "IVF;;;M;Ivf;;ivf;;\n" "LXF;;;M;Lxf;;lxf;video/lxf;\n" "Matroska;;;M;Mk;;mkv mk3d mka mks;;https://matroska.org/downloads/windows.html\n" "MPEG-PS;;;M;MpegPs;;mpeg mpg m2p vob vro pss evo;video/MP2P;\n" "MPEG-TS;;;M;MpegTs;;ts m2t m2s m4t m4s tmf ts tp trp ty;video/MP2T;\n" "MPEG-4;;;M;Mpeg4;;braw mov mp4 m4v m4a m4b m4p m4r 3ga 3gpa 3gpp 3gp 3gpp2 3g2 k3g jpm jpx mqv ismv isma ismt f4a f4b f4v;video/mp4;\n" "MTV;;;M;Other;Chinese hack of MPEG-1 layer 3;mtv;;http://en.wikipedia.org/wiki/Chinese_MP4/MTV_Player\n" "MXF;;;M;Mxf;;mxf;application/mxf;\n" "NSV;;;M;Nsv;Nullsoft Streaming Video;nsv;;http://winamp.com\n" "NUT;;;M;Nut;;nut;\n" "Ogg;;;M;Ogg;;oga ogg ogm ogv ogx opus spx;;https://en.wikipedia.org/wiki/Ogg\n" "PMP;;;M;Pmp;Playstation Portable;pmp;;\n" "PTX;;;M;Ptx;;ptx;;\n" "QuickTime;;;M;Mpeg4;Original Apple specifications;braw mov qt;video/quicktime;http://www.apple.com/quicktime/download/standalone.html\n" "RealMedia;;;M;Rm;;rm rmvb ra;application/vnd.rn-realmedia;\n" "RIFF-MMP;;;M;Riff;RIFF Multimedia Movie;;;\n" "ShockWave;;;M;Swf;;swf;application/x-shockwave;http://www.macromedia.com/go/getflashplayer\n" "SKM;;;M;Skm;Sky Korean Mobilephone;skm;;http://www.isky.co.kr/html/cs/download.jsp\n" "WebM;;;M;Mkv;;webm;video/webm;http://www.webmproject.org/\n" "Windows Media;;;M;Wm;;asf dvr-ms wma wmv;video/x-ms-wmv;\n" "WTV;;;M;Wtv;;wtv;;\n" "AV1;;;V;Av1;AOMedia Video 1;;;http://aomedia.org/\n" "AVC;;;V;Avc;Advanced Video Codec;avc h264 264;video/H264;http://developers.videolan.org/x264.html\n" "AVS Video;;;V;AvsV;Audio Video Standard, Video part;;;http://www.avs.org.cn/;Lossy\n" "Dirac;;;V;Dirac;;drc;;http://diracvideo.org/;Lossy\n" "FFV1;;;V;;;;;;Lossless\n" "FFV2;;;V;;;;;;Lossless\n" "FLC;;;V;Flic;;fli flc;;http://www.chem.nott.ac.uk/flc.html;Lossy\n" "FLI;;;V;Flic;;fli flc;;http://www.chem.nott.ac.uk/flc.html;Lossy\n" "FLIC;;;V;Flic;;fli flc;;http://www.chem.nott.ac.uk/flc.html;Lossy\n" "H.261;;;V;;;h261;video/H261;;Lossy\n" "H.263;;;V;;;h263;video/H263;;Lossy\n" "HEVC;;;V;Hevc;High Efficiency Video Coding;hevc h265 265;video/H265;http://www.itu.int\n" "MPEG Video;;;V;Mpegv;;mpgv mpv mp1v m1v mp2v m2v;video/MPV;;Lossy\n" "MPEG-4 Visual;;;V;Mpeg4;;m4v mp4v;video/MP4V-ES;;Lossy\n" "Theora;;;V;;;;;http://www.theora.org/;Lossy\n" "VC-1;;;V;Vc1;;vc1;video/vc1;;Lossy\n" "YUV4MPEG2;;;V;Y4m;;y4m;;;Lossless\n" "VP8;;;V;;;;;http://www.webmproject.org/;Lossy\n" "YUV;;;V;;;;;;Lossless\n" "AAC;;;A;;Advanced Audio Codec;;;;Lossy\n" "AC-3;;;A;Ac3;Audio Coding 3;ac3;;https://en.wikipedia.org/wiki/AC3;Lossy\n" "ADIF;;;A;Adif;Audio Data Interchange Format;;;\n" "ADTS;;;A;Adts;Audio Data Transport Stream;aac aacp adts;;\n" "ALS;;;A;Als;MPEG-4 Audio Lossless Coding;als;;http://www.nue.tu-berlin.de/forschung/projekte/lossless/mp4als.html#downloads;Lossless\n" "AMR;;;A;Amr;Adaptive Multi-Rate;amr;audio/AMR;http://www.apple.com/quicktime/download/standalone.html\n" "Atrac;;;A;;Adaptive Transform Acoustic Coding;;audio/ATRAC;;Lossy\n" "Atrac3;;;A;;Adaptive Transform Acoustic Coding 3;;audio/ATRAC3;;Lossy\n" "Atrac9;;;A;;Adaptive Transform Acoustic Coding 9;;audio/ATRAC9;https://en.wikipedia.org/wiki/Adaptive_Transform_Acoustic_Coding;Lossy\n" "AU;;;A;Au;uLaw/AU Audio File;au;audio/basic;\n" "CAF;;;A;Caf;Core Audio Format;caf;audio/x-caf;https://developer.apple.com/library/content/documentation/MusicAudio/Reference/CAFSpec/CAF_overview/CAF_overview.html\n" "DolbyE;;;A;Aes3;;dde\n" "DSDIFF;;;A;Dsdiff;Direct Stream Digital Interchange File Format;dff;;;Lossy\n" "DSD;;;A;;Direct Stream Digital;;;;Lossless\n" "DSF;;;A;Dsf;Direct Stream Digital Stream File;dsf;;\n" "DST;;;A;;Direct Stream Transfer;;;;Lossless\n" "DTS;;;A;Dts;Digital Theater Systems;dts dtshd;;https://en.wikipedia.org/wiki/DTS_(sound_system)\n" "DTS-HD;;;A;Dts;Digital Theater Systems;dts dtshd;;;Lossy\n" "E-AC-3;;;A;Ac3;Enhanced AC-3;dd+ ec3 eac3;audio/eac3;https://en.wikipedia.org/wiki/Dolby_Digital_Plus;Lossy\n" "Extended Module;;;A;ExtendedModule;;xm;;\n" "FLAC;;;A;Flac;Free Lossless Audio Codec;fla flac;audio/x-flac;https://xiph.org/flac/;Lossless\n" "G.719;;;A;;;;audio/G719;;Lossy\n" "G.722;;;A;;;;audio/G722;;Lossy\n" "G.722.1;;;A;;;;audio/G7221;;Lossy\n" "G.723;;;A;;;;audio/G723;;Lossy\n" "G.729;;;A;;;;audio/G729;;Lossy\n" "G.729.1;;;A;;;;audio/G7291;;Lossy\n" "Impulse Tracker;;;A;ImpulseTracker;;it;;\n" "LA;;;A;La;Lossless Audio Codec;la;;http://www.lossless-audio.com/;Lossless\n" "MIDI;;;A;Riff;RIFF Musical Instrument Digital Interface;midi mid kar;audio/midi;\n" "Module;;;A;Module;;mod;;\n" "Monkey's Audio;;;A;Ape;;ape mac;;http://www.monkeysaudio.com/;Lossless\n" "MPEG Audio;;;A;Mpega;;m1a mpa mpa1 mp1 m2a mpa2 mp2 mp3;audio/mpeg;;Lossy\n" "OpenMG;;;A;OpenMG;;oma omg aa3 at3;;;Lossy\n" "Musepack SV7;;;A;Mpc;;mpc;;http://www.musepack.net;Lossy\n" "Musepack SV8;;;A;MpcSv8;;mp+;;http://www.musepack.net;Lossy\n" "QCELP;;;A;;;;audio/QCELP;\n" "QLCM;;;A;Riff;;qcp;;https://tools.ietf.org/html/rfc3625;Lossy\n" "RIFF-MIDI;;;A;Riff;RIFF Musical Instrument Digital Interface;;;\n" "RKAU;RK Audio;;A;Rkau;;rka;;http://www.msoftware.co.nz\n" "Scream Tracker 3;;;A;S3m;;s3m;;\n" "Shorten;;;A;;;shn;;http://etree.org/shnutils/shorten/;Lossless\n" "SLS;;;A;;MPEG-4 Scalable Lossless Coding;sls;;http://www.chiariglione.org/mpeg/technologies/mp04-sls/index.htm;Lossless\n" "S/PDIF;;;A;Spdif;Sony/Philips Digital Interface;spdif;;https://en.wikipedia.org/wiki/S/PDIF\n" "Speex;;;A;;;spx;audio/speex;http://www.speex.org/;Lossy\n" "USAC;;;A;;Unified Speech and Audio Coding;;audio/usac;http://en.wikipedia.org/wiki/Unified_Speech_and_Audio_Coding;Lossy\n" "Opus;;;A;;;;audio/opus;http://opus-codec.org/;Lossy\n" "TAK;;;A;;;tak;;http://thbeck.de/Tak/Tak.html;Lossless\n" "TrueHD;;;A;Ac3;;mlp thd vr;;;Lossless\n" "TwinVQ;;;A;TwinVQ;Transform domain Weighted INterleave Vector Quantization;vqf;;http://www.twinvq.org/english/index_en.html\n" "Vorbis;;;A;;;;audio/vorbis;http://www.vorbis.com/;Lossy\n" "Wave;;;A;Riff;;act at9 wav;audio/vnd.wave;\n" "Wave64;;;A;Riff;;w64;;\n" "WavPack;;;A;Wvpk;;wv wvc;;http://www.wavpack.com\n" "Arri Raw;;;I;ArriRaw;;ari;;\n" "Bitmap;;;I;Bmp;;bmp bms;image/bmp;;Lossless\n" "BPG;;;I;Bpg;Better Portable Graphics;bpg;image/bpg;http://bellard.org/bpg/\n" "DDS;;;I;Dds;DirectDraw Surface;dds;;\n" "DPX;;;I;Dpx;;dpx cin;;;Lossless\n" "EXR;;;I;Exr;;exr;;;Lossless\n" "DIB;;;I;Riff;RIFF Device Independent Bitmap;;;;Lossless\n" "GIF;;;I;Gif;Graphics Interchange Format;gif gis;image/gif;;Lossless\n" "ICO;;;I;Ico;;ico;image/vnd.microsoft.icon;;Lossless\n" "JNG;;;I;Jng;JPEG Network Graphic;jng;;;Lossy\n" "JPEG;;;I;Jpeg;;h3d jpeg jpg jpe jps mpo;image/jpeg;;Lossy\n" "JPEG 2000;;;I;Jpeg;;jp2;image/jp2;http://www.morgan-multimedia.com/JPEG 2000/\n" "LZ77;;;I;;;;;\n" "MNG;;;I;Mng;Multiple-Image Network Graphic;mng;;;Lossless\n" "PCX;;;I;pcx;Personal Computer eXchange;pcx;image/pcx;;Lossless\n" "PNG;;;I;Png;Portable Network Graphic;png pns;image/png;;Lossless\n" "PSD;;;I;Psd;Photoshop File Format;psd;image/psd;http://www.adobe.com/;Lossless\n" "RIFF Palette;;;I;Riff;RIFF Palette;;;\n" "RLE;;;I;;Run-length encoding;rle;;\n" "TIFF;;;I;Tiff;;tiff tif;image/tiff;\n" "TGA;;;I;Tga;;tga;image/tga;\n" "7-Zip;;;C;7z;;7z;;http://7-zip.org\n" "ACE;;;C;Ace;;ace;;http://winace.com\n" "ELF;;;C;Elf;;so;;\n" "ISO 9660;;;C;Iso9660;;iso;;\n" "MZ;;;C;Mz;;exe dll;;\n" "RAR;;;C;Rar;From Rarlabs;rar;application/x-rar-compressed;http://rarlabs.com\n" "ZIP;;;C;Zip;;zip docx odt xlsx ods;application/zip;http://winzip.com\n" "Adobe encore DVD;;;T;Other;;txt;;http://www.adobe.fr/products/encore/;Lossless\n" "AQTitle;;;T;Other;;aqt;;http://www.volny.cz/aberka/czech/aqt.html;Lossless\n" "ASS;;;T;Other;;ssa;;http://ffdshow.sourceforge.net/tikiwiki/tiki-index.php?page=Getting+ffdshow;Lossless\n" "Captions 32;;;T;Other;;txt;;;Lossless\n" "Captions Inc;;;T;Other;;txt;;;Lossless\n" "CPC Captioning;;;T;Other;;txt;;http://www.cpcweb.com/Captioning/cap_software.htm;Lossless\n" "Cheeta;;;T;Other;;asc;;;Lossless\n" "N19;;;T;N19;;stl;;;Lossless\n" "PDF;;;T;Pdf;;pdf;;\n" "SAMI;;;T;Sami;;smi sami;;;Lossless\n" "SCC;;;T;SCC;;scc sc2;;;Lossless\n" "SubRip;;;T;SubRip;;srt;;http://ffdshow.sourceforge.net/tikiwiki/tiki-index.php?page=Getting+ffdshow;Lossless\n" "TTML;;;T;TTML;Timed Text Markup Language;dfxp ttml;;https://en.wikipedia.org/wiki/Timed_Text_Markup_Language;Lossless\n" "SSA;;;T;Other;;ssa;;http://ffdshow.sourceforge.net/tikiwiki/tiki-index.php?page=Getting+ffdshow;Lossless\n" "WebVTT;;;T;WebVTT;;vtt;;;Lossless\n" "Blender;;;O;Other;;blenders;;http://www.blender3d.com\n" "AutoCAD;;;O;Other;;;;http://www.autodesk.com\n" "PlayLater Video;;;V;Other;;;;http://www.playon.tv/playlater\n" "WTV;;;M;WTV;Windows Recorded TV Show;wtv;video/wtv;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_General_Mpeg4 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "M4V ;MPEG-4;;;\n" "isom;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Base Media\n" "iso2;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Base Media\n" "iso4;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Base Media\n" "iso5;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Base Media\n" "mp41;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Base Media / Version 1\n" "mp42;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Base Media / Version 2\n" "avc1;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;JVT\n" "3gp1;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 1\n" "3gp2;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 2\n" "3gp3;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 3\n" "3gp4;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 4\n" "3gp5;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 5\n" "3gp6;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 6 Basic\n" "3gp6;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 6 Progressive Download\n" "3gp6;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 6 Streaming Servers\n" "3gp7;MPEG-4;;;http://www.3gpp.org/;3GPP Media Release 7 Streaming Servers\n" "3g2a;MPEG-4;;;http://www.3gpp2.org/;3GPP2 Media\n" "3ge6;MPEG-4;;;http://www.3gpp.org/;3GPP Release 6 MBMS Extended Presentation\n" "3ge7;MPEG-4;;;http://www.3gpp.org/;3GPP Release 7 MBMS Extended Presentation\n" "3gg6;MPEG-4;;;http://www.3gpp.org/;3GPP Release 6 General\n" "3gp8;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html\n" "3gp9;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html\n" "CAQV;MPEG-4;;;http://world.casio.com/;Casio\n" "dby1;MPEG-4;Dolby Extensions;\n" "FACE;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Facebook\n" "isml;MPEG-4;IIS Smooth Streaming file format;;http://www.apple.com/quicktime/download/standalone.html;ISML\n" "JP20;MPEG-4;;;http://gpac.sourceforge.net/;JPEG 2000\n" "JPM ;MPEG-4;;;http://www.iso.org/;JPEG 2000 Compound Image\n" "JPX ;MPEG-4;;;http://www.iso.org/;JPEG 2000 w/ extensions\n" "KDDI;MPEG-4;;;http://www.3gpp2.org/;3GPP2 EZMovie for KDDI 3G Cellphones\n" "mif1;HEIF;;\n" "msf1;MPEG-4;;;;HEIF Sequence\n" "MJ2S;MPEG-4;;;http://www.iso.org/;Motion JPEG 2000 Simple Profile\n" "MJP2;MPEG-4;;;http://www.iso.org/;Motion JPEG 2000 General Profile\n" "MQT ;MPEG-4;;;http://www.sony.com/;Sony/Mobile QuickTime\n" "MSNV;MPEG-4;;;http://www.sony.com/;Sony PSP\n" "ndas;MPEG-4;;;http://www.nerodigital.com;Nero Digital AAC Audio\n" "ndsc;MPEG-4;;;http://www.nerodigital.com;Nero Digital Cinema Profile\n" "ndsh;MPEG-4;;;http://www.nerodigital.com;Nero Digital HDTV Profile\n" "ndsm;MPEG-4;;;http://www.nerodigital.com;Nero Digital Mobile Profile\n" "ndsp;MPEG-4;;;http://www.nerodigital.com;Nero Digital Portable Profile\n" "ndss;MPEG-4;;;http://www.nerodigital.com;Nero Digital Standard Profile\n" "ndxc;MPEG-4;;;http://www.nerodigital.com;Nero Digital AVC Cinema Profile\n" "ndxh;MPEG-4;;;http://www.nerodigital.com;Nero Digital AVC HDTV Profile\n" "ndxm;MPEG-4;;;http://www.nerodigital.com;Nero Digital AVC Mobile Profile\n" "ndxp;MPEG-4;;;http://www.nerodigital.com;Nero Digital AVC Portable Profile\n" "ndxs;MPEG-4;;;http://www.nerodigital.com;Nero Digital AVC Standard Profile\n" "mmp4;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Mobile version\n" "mp71;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;ISO 14496-12 MPEG-7 meta data\n" "mp7b;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;ISO 14496-12 MPEG-7 meta data\n" "piff;MPEG-4;Protected Interoperable File Format;;http://www.apple.com/quicktime/download/standalone.html;PIFF\n" "qt ;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;QuickTime\n" "SDV ;MPEG-4;;;http://www.sdcard.org/;SD Memory Card Video\n" "M4A ;MPEG-4;;;http://www.apple.com/itunes/;Apple audio with iTunes info\n" "M4B ;MPEG-4;;;http://www.apple.com/itunes/;Apple audio with iTunes position\n" "M4P ;MPEG-4;;;http://www.apple.com/itunes/;AES encrypted audio\n" "M4VP;MPEG-4;;;http://www.apple.com/iphone/;Apple iPhone\n" "iphE;MPEG-4;;;http://www.apple.com/iphone/;Apple iPhone (Cellular)\n" "M4VH;MPEG-4;;;http://www.apple.com/appletv/;Apple TV\n" "QTCA;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Quicktime compressed archive\n" "CAQV;MPEG-4;;;;Casio Digital Camera\n" "QTI ;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;QuickTime Image\n" "f4v ;MPEG-4;;;http://www.apple.com/quicktime/download/standalone.html;Adobe Flash\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Video_Matroska (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "V_UNCOMPRESSED;RGB;;Raw uncompressed video frames\n" "V_AV1;AV1;;;http://aomedia.org/\n" "V_DIRAC;Dirac;;;http://diracvideo.org/\n" "V_FFV1;FFV1;;\n" "V_MPEG4/IS0/SP;MPEG-4 Visual;;There is a zero instead of a O, may be a problem;http://www.divx.com\n" "V_MPEG4/IS0/ASP;MPEG-4 Visual;;There is a zero instead of a O, may be a problem;http://www.xvid.org/Downloads.15.0.html\n" "V_MPEG4/IS0/AP;MPEG-4 Visual;;There is a zero instead of a O, may be a problem;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/IS0/AVC;AVC;;There is a zero instead of a O, may be a problem;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/ISO/SP;MPEG-4 Visual;;Simple Profile;http://www.divx.com\n" "V_MPEG4/ISO/ASP;MPEG-4 Visual;;Advanced Simple Profile;http://www.xvid.org/Downloads.15.0.html\n" "V_MPEG4/ISO/AP;MPEG-4 Visual;;Advanced Profile;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/ISO/AVC;AVC;;;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEGH/ISO/HEVC;HEVC;;\n" "V_MPEG4/MS/V2;MPEG-4 Visual;MS MPEG-4 v2;MS MPEG-4 v2;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/MS/V3;MPEG-4 Visual;MS MPEG-4 v3;MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG1;MPEG Video;;MPEG 1 or 2 Video;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG2;MPEG Video;;MPEG 1 or 2 Video;http://ffdshow-tryout.sourceforge.net/\n" "V_PRORES;ProRes;;;http://www.apple.com/quicktime/download/standalone.html\n" "V_REAL/RV10;RealVideo 1;;RealVideo 1.0 aka RealVideo 5;http://www.real.com\n" "V_REAL/RV20;RealVideo 2;;RealVideo 2.0 aka G2 and RealVideo G2+SVT;http://www.real.com\n" "V_REAL/RV30;RealVideo 3;;RealVideo 3.0 aka RealVideo 8;http://www.real.com\n" "V_REAL/RV40;RealVideo 4;;RealVideo 4.0 aka RealVideo 9;http://www.real.com\n" "V_THEORA;Theora;;;http://www.theora.org\n" "V_VP8;VP8;;;http://www.webmproject.org/\n" "V_VP9;VP9;;;http://www.webmproject.org/\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Video_Mpeg4 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "2vuy;YUV;;;;;;YUV;4:2:2\n" "2Vuy;YUV;;;;;;YUV;4:2:2\n" "8BPS;RGB;;;;;;RGB;8:8:8\n" "ac16;YUV;;;;;;YUV;4:2:2\n" "ac32;YUV;;;;;;YUV;4:2:2\n" "acBG;YUV;;;;;;YUV;4:2:2\n" "apch;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422 HQ;;YUV;4:2:2\n" "apcn;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422;;YUV;4:2:2\n" "apcs;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422 LT;;YUV;4:2:2\n" "apco;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;422 Proxy;;YUV;4:2:2\n" "ap4c;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;4444;;;4:4:4\n" "ap4h;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;4444;;;4:4:4\n" "ap4x;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;4444 XQ;;;4:4:4\n" "aprh;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;RAW HQ;;\n" "aprn;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;RAW;;\n" "apro;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "aprs;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "aprx;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "ai12;AVC;;Advanced Video Coding;;;\n" "ai13;AVC;;Advanced Video Coding;;;\n" "ai15;AVC;;Advanced Video Coding;;;\n" "ai16;AVC;;Advanced Video Coding;;;\n" "ai1p;AVC;;Advanced Video Coding;;;\n" "ai1q;AVC;;Advanced Video Coding;;;\n" "ai22;AVC;;Advanced Video Coding;;;\n" "ai23;AVC;;Advanced Video Coding;;;\n" "ai25;AVC;;Advanced Video Coding;;;\n" "ai26;AVC;;Advanced Video Coding;;;\n" "ai2p;AVC;;Advanced Video Coding;;;\n" "ai2q;AVC;;Advanced Video Coding;;;\n" "ai52;AVC;;Advanced Video Coding;;;\n" "ai53;AVC;;Advanced Video Coding;;;\n" "ai55;AVC;;Advanced Video Coding;;;\n" "ai56;AVC;;Advanced Video Coding;;;\n" "ai5p;AVC;;Advanced Video Coding;;;\n" "ai5q;AVC;;Advanced Video Coding;;;\n" "AV01;AV1;;;;;\n" "AV1x;YUV;;;;;;YUV;4:2:2\n" "avc1;AVC;;Advanced Video Coding;;;;\n" "avc2;AVC;;Advanced Video Coding;;;;\n" "avc3;AVC;;Advanced Video Coding;;;;\n" "avc4;AVC;;Advanced Video Coding;;;;\n" "avcp;AVC;;Advanced Video Coding Parameters;;;\n" "AVDJ;JPEG;;Avid\n" "AVdv;DV;;Avid;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "AVd1;DV;;Avid;http://www.apple.com/quicktime/download/standalone.html;;\n" "AVdh;VC-3;;Avid DNxHR;http://www.apple.com/quicktime/download/standalone.html;;;\n" "AVdn;VC-3;;Avid DNxHD;http://www.apple.com/quicktime/download/standalone.html;;;\n" "AVin;AVC;;Advanced Video Coding;;;;\n" "AVJI;Avid Meridien Compressed;;;;;\n" "AVmp;MPEG Video;Avid IMX;;;;Version 2;;\n" "AVUI;Avid Meridien Uncompressed;;;;;\n" "avr ;JPEG;;;;;;\n" "AVrp;RGB;Avid;;;;;RGB\n" "b16g;Gray;;;;;;Y;16\n" "b32a;Gray/Alpha;;;;;;YA;16:16\n" "b48r;RGB;;;;;;RGB;16:16:16\n" "b64a;RGBA;;;;;;RGBA;16:16:16:16\n" "base;RGBA;;;;;;RGBA;16:16:16:16\n" "blit;RGBA;;;;;;RGBA;16:16:16:16\n" "blnd;Alpha Compositor;;;;;;\n" "blur;Blur;;;;;;CMYK\n" "brlt;Blackmagic RAW;;;https://www.blackmagicdesign.com/products/blackmagicraw;LT;;\n" "brxq;Blackmagic RAW;;;https://www.blackmagicdesign.com/products/blackmagicraw;XQ;;\n" "CFHD;CineForm;;CineForm High-Definition (HD) wavelet codec;http://www.cineform.com/;;;\n" "CHQX;Canopus HQX;;;;;;\n" "CLLC;Canopus Lossless;;;;;;\n" "CUVC;Canopus HQ;;;;;;\n" "cmyk;CMYK;;;;;;\n" "cvid;Cinepak;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "drac;Dirac;;Dirac Video Coder;http://www.bbc.co.uk/rd/projects/dirac/index.shtml;;;\n" "dslv;Cross Fade;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "DV10;Digital Voodoo;;Digital Voodoo 10 bit Uncompressed 4:2:2 codec;http://www.digitalvoodoo.net/;;;\n" "dv5n;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dv5p;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvav;AVC;;Advanced Video Coding with Dolby Vision;;;;\n" "dva1;AVC;;Advanced Video Coding with Dolby Vision;;;;\n" "dvc ;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvcp;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvhe;AVC;;High Efficiency Video Coding with Dolby Vision;;;;\n" "dvh1;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvh2;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvh3;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvh4;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvh5;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvh6;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvhp;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "dvhq;DV;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "DVOO;Digital Voodoo;;Digital Voodoo 8 bit Uncompressed 4:2:2 codec;http://www.digitalvoodoo.net/;;;\n" "DVOR;Digital Voodoo;;Digital Voodoo intermediate raw;http://www.digitalvoodoo.net/;;;\n" "dvpp;DV;DVCPRO;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "DVTV;Digital Voodoo;;Digital Voodoo intermediate 2vuy;http://www.digitalvoodoo.net/;;;\n" "DVVT;Digital Voodoo;;Digital Voodoo intermediate v210;http://www.digitalvoodoo.net/;;;\n" "DXD3;DXV;;Resolume;https://resolume.com/software/codec;;Version 3;\n" "encv;(Encrypted);;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "FFV1;FFV1;;;;;;\n" "gif ;M-GIF;;;;;;\n" "Hap1;Hap;;Hap Video Codec;https://github.com/Vidvox/hap;;;\n" "Hap5;Hap Alpha;;Hap Video Codec;https://github.com/Vidvox/hap;;;\n" "HapY;Hap Q;;Hap Video Codec;https://github.com/Vidvox/hap;;;\n" "h261;H.261;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "h263;H.263;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "H263;H.263;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "h264;H.264;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "hcpa;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;High;;YUV;4:2:2\n" "HD10;Digital Voodoo;;Digital Voodoo 10 bit Uncompressed 4:2:2 HD codec;http://www.digitalvoodoo.net/;;;\n" "hdv1;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv2;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv3;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv4;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv5;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv6;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv7;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv8;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdv9;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdva;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdvb;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdvc;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdvd;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdve;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hdvf;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "hvc1;HEVC;;High Efficiency Video Coding;http://www.itu.int/;;;\n" "hev1;HEVC;;High Efficiency Video Coding;http://www.itu.int/;;;\n" "icod;AIC;;Apple Intermediate Codec;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:0\n" "j420;YUV;;;;;;YUV;4:2:0\n" "jpeg;JPEG;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "kpcd;Photo CD;;;;;;\n" "LMP2;MPEG Video;;;;;;YUV\n" "M105;Matrox;;;http://www.matrox.com/;;;\n" "m1v ;MPEG Video;;;;;;\n" "m2v1;MPEG Video;;;;;;\n" "MMES;MPEG Video;;;;;;YUV\n" "mmes;MPEG Video;;;;;;YUV\n" "mjp2;JPEG 2000;;;;;;\n" "mjpa;JPEG;;;;;;\n" "mjpb;JPEG;;;;;;\n" "mp4v;MPEG-4 Visual;;;;;;\n" "mpeg;MPEG Video;;;;;;\n" "mx3n;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "mx3p;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "mx4n;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "mx4p;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "mx5n;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "mx5p;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "myuv;YUV;;;;;;YUV;4:2:0\n" "ncpa;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;Normal;;YUV;4:2:2\n" "ovc1;VC-1;;Smooth Streaming Media Video;http://alexzambelli.com/blog/2009/02/10/smooth-streaming-architecture/;;;\n" "png ;PNG;;;;;;\n" "PIM1;MPEG Video;;;;;;YUV\n" "PIM2;MPEG Video;;;;;;YUV\n" "PNTG;MacPaint;;Apple MacPaint image format;http://www.apple.com/quicktime/download/standalone.html;;;\n" "r210;RGB;Blackmagic Design;;;;;RGB\n" "R210;RGB;Blackmagic Design;;;;;RGB\n" "raw ;RGB;;;http://www.apple.com/quicktime/download/standalone.html;;;RGB\n" "rle ;RLE;;;http://www.apple.com/quicktime/download/standalone.html;;;RGB\n" "rpza;Road Pizza;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "s263;H.263;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "Shr0;SheerVideo;;Generic SheerVideo codec;http://www.bitjazz.com/;;;\n" "Shr1;SheerVideo;;SheerVideo RGB;http://www.bitjazz.com/;;;\n" "Shr2;SheerVideo;;SheerVideo Y'CbCr[A] 4:4:4;http://www.bitjazz.com/;;;\n" "Shr3;SheerVideo;;SheerVideo Y'CbCr 4:2:2;http://www.bitjazz.com/;;;\n" "Shr4;SheerVideo;;SheerVideo Y'CbCr 4:2:2;http://www.bitjazz.com/;;;\n" "SJDS;SoftImage DS Compressed;;;;;\n" "SUDS;SoftImage DS Uncompressed;;;;;\n" "SV10;Sorenson;;Sorenson Media Video R1;http://www.apple.com/quicktime/download/standalone.html;;;\n" "SVQ1;Sorenson 1;;Sorenson Media Video 1 (Apple QuickTime 3);http://www.apple.com/quicktime/download/standalone.html;;;\n" "SVQ2;Sorenson 2;;Sorenson Media Video 2 (Apple QuickTime 4);http://www.apple.com/quicktime/download/standalone.html;;;\n" "SVQ3;Sorenson 3;;Sorenson Media Video 3 (Apple QuickTime 5);http://www.apple.com/quicktime/download/standalone.html;;;\n" "v210;YUV;AJA Video Systems Xena;;;;;YUV;4:2:2\n" "V210;YUV;AJA Video Systems Xena;;;;;YUV;4:2:2\n" "vc-1;VC-1;;SMPTE VC-1;http://www.smpte.org/;;;YUV\n" "WMV3;VC-1;WMV3;Windows Media Video 9;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;;\n" "WRLE;Bitmap;;Windows BMP image format;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd50;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd51;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd52;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd53;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd54;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd55;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd56;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd57;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd58;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd59;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd5a;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd5b;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd5c;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd5d;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd5e;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xd5f;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdhd;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdh2;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv0;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv1;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv2;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv3;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv4;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv5;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv6;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv7;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv8;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdv9;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdva;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdvb;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdvc;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdvd;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdve;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "xdvf;MPEG Video;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "yuv2;YUV;;;;;;YUV;4:2:2\n" "yuvs;YUV;;;;;;YUV;4:2:2\n" "yuvu;YUV;;;;;;YUV;4:2:2\n" "yuvx;YUV;;;;;;YUV;4:2:2\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Video_Real (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "RV10;RealVideo 1;;Based on H.263, Real Player 5;http://www.real.com\n" "RV13;RealVideo 1.3;;Based on H.263, Real Player 5;http://www.real.com\n" "RV20;RealVideo 2;;Based on H.263, Real Player 6;http://www.real.com\n" "RV30;RealVideo 3;;Between H.263 and AVC (H.264), Real Player 8;http://www.real.com\n" "RV40;RealVideo 4;;Based on AVC (H.264), Real Player 9;http://www.real.com\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Video_Riff (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "0x00000000;RGB;;Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain raw RGB samples;http://www.fourcc.org/indexrgb.htm;;;;\n" "0x01000000;RLE;;Run length encoded 8bpp RGB image;http://www.fourcc.org/indexrgb.htm;;;;\n" "0x02000010;MPEG Video;;;;;;YUV;4:2:0\n" "0x02000000;RLE;;Run length encoded 4bpp RGB image;http://www.fourcc.org/indexrgb.htm;;;;\n" "0x03000000;RGB;;Raw RGB with arbitrary sample packing within a pixel. Packing and precision of R, G and B components is determined by bit masks for each;http://www.fourcc.org/indexrgb.htm;;;;\n" "1978;RGB;A.M.Paredes predictor;;http://www.pegasusimaging.com/cgi-bin/download2.cgi?LVIDB;;;RGB;\n" " BIT;RGB;;;;;;RGB;\n" " JPG;JPEG;;;;;;YUV\n" " PNG;PNG;;;;;;RGB;\n" " RAW;RGB;;;http://www.fourcc.org/indexrgb.htm;;;RGB;\n" " raw;RGB;;;http://www.fourcc.org/indexrgb.htm;;;RGB;\n" " RGB;RGB;;;http://www.fourcc.org/indexrgb.htm;;;RGB;\n" " RL4;RLE;;;http://www.fourcc.org/indexrgb.htm;;;RGB;;4\n" " RL8;RLE;;;http://www.fourcc.org/indexrgb.htm;;;RGB;;8\n" "2VUY;YUV;Optibase VideoPump;;;;;YUV;4:2:2\n" "3IV0;MPEG-4 Visual;3ivX;3ivX pre-1.0;http://www.3ivx.com/download/;;;YUV;4:2:0\n" "3IV1;MPEG-4 Visual;3ivX;3ivX 1.0-3.5;http://www.3ivx.com/download/;;;YUV;4:2:0\n" "3IV2;MPEG-4 Visual;3ivX;3ivX 4.0;http://www.3ivx.com/download/;;;YUV;4:2:0\n" "3IVD;MPEG-4 Visual;3ivX;;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "3IVX;MPEG-4 Visual;3ivX;;http://www.3ivx.com/download/;;;YUV;4:2:0\n" "3VID;MPEG-4 Visual;3ivX;;http://www.3ivx.com/download/;;;YUV;4:2:0\n" "8BPS;RGB;Apple;;http://ffdshow-tryout.sourceforge.net/;;;RGBA\n" "AAS4;RLE;Autodesk;;http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe;;;RGB\n" "AASC;RLE;Autodesk;;http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe;;;RGB\n" "ABYR;Kensigton low;Kensington;Low resolution, low frame rate (6fps) for digital cameras;;;;\n" "ACTL;ACT-L2;Streambox;;http://www.streambox.com/products/act-L2_codec.htm;;;\n" "ADV1;WaveCodec;Loronix;;http://www.loronix.com/products/video_clips/wavecodec.asp;;;\n" "ADVJ;JPEG;Avid;;;;;YUV\n" "AEIK;Indeo 3.2;;Vector Quantization;;;;\n" "AEMI;MPEG Video;VideoONE;MPEG-1-I Capture;http://www.array.com;;;YUV;4:2:0\n" "AFLC;FLC;Autodesk;;http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe;;;\n" "AFLI;FLI;Autodesk;;http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe;;;\n" "AHDV;CineForm;CineForm HD;;http://www.cineform.com/products/ConnectHD.htm;;;\n" "AJPG;JPEG;;22fps for digital cameras;;;;YUV\n" "ALPH;Ziracom;;Ziracom Digital Communications Inc.;;;;\n" "AMM2;AMV2 MT;AMV2 MT Video Codec Version 2;;http://amamaman.hp.infoseek.co.jp/english/amv2_e.html;;;\n" "AMPG;MPEG-1;VideoONE;;http://www.array.com;;;YUV;4:2:0\n" "AMR ;AMR;;Speech codec;;;;\n" "AMV3;AMV3;AMV3 Video Codec Version 3;;http://amamaman.hp.infoseek.co.jp/english/amv2_e.html;;;YUV;4:2:0\n" "ANIM;RDX;Intel;;;;;\n" "AP41;MPEG-4 Visual;AngelPotion;Hack of MS MPEG-4 v3;http://www.divxity.com/download/ap4v1-702.exe;;;YUV;4:2:0\n" "AP42;MPEG-4 Visual;AngelPotion;Hack of MS MPEG-4 v3;http://www.divxity.com/download/ap4v1-702.exe;;;YUV;4:2:0\n" "apch;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;High;;YUV;4:2:2\n" "apcn;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV;4:2:2\n" "apcs;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;LT;;YUV;4:2:2\n" "apco;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;Proxy;;YUV;4:2:2\n" "ap4c;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;;4:4:4\n" "ap4h;ProRes;;;http://www.apple.com/quicktime/download/standalone.html;;;;4:4:4\n" "ASLC;AlparySoft Lossless;;;http://www.free-codecs.com/download/Alparysoft_Lossless_Video_Codec.htm;;;\n" "ASV1;Asus 1;;;ftp://ftp.asuscom.de/pub/asuscom/treiber/vga/ASUS_VGA_TOOLS/asv2dec.zip;;;\n" "ASV2;Asus 2;;;ftp://ftp.asuscom.de/pub/asuscom/treiber/vga/ASUS_VGA_TOOLS/asv2dec.zip;;;\n" "ASVX;Asus X;;;ftp://ftp.asuscom.de/pub/asuscom/treiber/vga/ASUS_VGA_TOOLS/asv2dec.zip;;;\n" "ATM4;MPEG-4 Visual;Nero;;http://www.nero.com;;;YUV;4:2:0\n" "AUR2;YUV;;Auravision Aura 2;;;;YUV;4:2:2\n" "AURA;YUV;;Auravision Aura 1;;;;YUV;4:1:1\n" "AUVX;AUVX;;USH GmbH;;;;\n" "AV01;AV1;;;;;\n" "AV1X;Avid 1:1;;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;\n" "AVC1;AVC;;;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "avc1;AVC;;;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "AVD1;DV;Avid;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;YUV;\n" "AVDJ;JPEG;Avid;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;YUV\n" "AVDN;Avid HD;;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;;\n" "AVDV;DV;Avid;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;YUV;\n" "AVI1;JPEG;MainConcept;;;;;YUV\n" "AVI2;JPEG;MainConcept;;;;;YUV\n" "AVID;JPEG;Avid;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;YUV\n" "AVIS;AviSynth;;Wrapper for AviSynth (Dummy);http://ffdshow-tryout.sourceforge.net/;;;;\n" "AVMP;Avid IMX;;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;;\n" "AVR ;JPEG;Avid NuVista;Avid ABVB/NuVista JPEG with Alpha-channel;;;;YUV\n" "AVRn;JPEG;Avid JPEG;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;YUV\n" "AVRN;JPEG;Avid JPEG;;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;YUV\n" "AVUI;Avid;;Avid Meridien Uncompressed with Alpha-channel;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;;\n" "AVUP;Avid;;Avid 10bit Packed (Quick Time);http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe;;;;\n" "AYUV;YUV;YUV;;;;;YUVA;4:4:4;8\n" "AZPR;QuickTime;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "AZRP;QuickTime;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "BGR ;RGB;RGB;;;;;RGB\n" "BHIV;BeHere iVideo;;;;;;\n" "BINK;Bink;;;;;;\n" "BIT ;RGB;RGB;;;;;RGB\n" "BITM;H.261;Microsoft;;;;;YUV\n" "BLOX;MPEG Video;Blox;;http://www.ii.uj.edu.pl/~jezabek/blox/blox-0.1.0b.zip;;;YUV;4:2:0\n" "BLZ0;MPEG-4 Visual;DivX;DivX for Blizzard Decoder Filter;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "BT20;MediaStream;;Conexant ProSummer MediaStream;;;;\n" "BTCV;Composite;;Conexant Composite Video;;;;\n" "BTVC;Composite;;Conexant Composite Video;;;;\n" "BW00;Wavelet;BergWave;;;;;\n" "BW10;MPEG-1;Broadway;Data Translation Broadway MPEG Capture/Compression;;;;YUV\n" "BXBG;RGB;Boxx;;;;;RGB\n" "BXRG;RGB;Boxx;;;;;RGB\n" "BXY2;YUV;Boxx;10-bit;;;;YUV\n" "BXYV;YUV;Boxx;;;;;YUV\n" "CC12;YUV;Intel;;;;;YUV\n" "CDV5;DV;Canopus;Canopus SD50/DVHD;http://www.cineform.com/products/ConnectHD.htm;;;YUV\n" "CDVC;DV;Canopus;Canopus DV (DV);http://www.cineform.com/products/ConnectHD.htm;;;YUV\n" "CDVH;DV;Canopus;Canopus SD50/DVHD;http://www.cineform.com/products/ConnectHD.htm;;;YUV\n" "CFCC;JPEG;DPS Perception;Dummy format - only AVI header;;;;YUV\n" "CFHD;CineForm;;CineForm 10-bit Visually Perfect HD (Wavelet);;;;\n" "CGDI;Camcorder;;Camcorder Video (MS Office 97);;;;\n" "CHAM;Champagne;;Winnov Caviara Champagne;;;;\n" "CHQX;Canopus HQX;;;;;;\n" "CJPG;JPEG;Creative;Creative Video Blaster Webcam Go JPEG;;;;YUV\n" "CLJR;YUV;Cirrus Logic;Less than 8 bits per Y, U and V sample.;http://www.fourcc.org/indexyuv.htm;;;YUV;4:1:1\n" "CLLC;Canopus Lossless;;;;;;\n" "CLPL;YUV;;Format similar to YV12 but including a level of indirection.;;;;YUV\n" "CM10;MediaShow;;CyberLink Corporation;http://www.cyberlink.com;;;\n" "CMYK;CMYK;;Common Data Format in Printing;;;;\n" "COL0;MPEG-4 Visual;;Hacked MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "COL1;MPEG-4 Visual;;Hacked MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "CPLA;YUV;Weitek;;;;;YUV;4:2:0\n" "CRAM;MS Video;;Microsoft Video 1;;;;\n" "CSCD;CamStudio;;RenderSoft CamStudio lossless (LZO & GZIP compression);;;;\n" "CT10;TalkingShow;;CyberLink Corporation;http://www.cyberlink.com;;;\n" "CTRX;Citrix;;Citrix Scalable Video;;;;\n" "CUVC;Canopus HQ;;;;;;\n" "CVID;Cinepak;;;http://www.cinepak.com/text.html;;;\n" "cvid;Cinepak;;;http://www.cinepak.com/text.html;;;\n" "CWLT;WLT;;Microsoft Color WLT DIB;;;;\n" "CYUV;YUV;Creative Labs;;http://www.fourcc.org/indexyuv.htm;;;YUV;4:2:2\n" "cyuv;YUV;;;http://www.fourcc.org/indexyuv.htm;;;YUV;4:2:2\n" "CYUY;YUV;ATI;;http://www.fourcc.org/indexyuv.htm;;;YUV;4:2:2\n" "D261;H.261;DEC;;;;;\n" "D263;H.263;DEC;;;;;\n" "DAVC;AVC;Dicas;;;;;YUV;4:2:0\n" "DC25;DV;MainConcept;;;;;YUV\n" "DCAP;DV;Pinnacle;;;;;YUV\n" "DCL1;Data Connextion;;Conferencing;;;;\n" "DCT0;WniWni;;;;;;\n" "DFSC;VFW;;DebugMode FrameServer VFW;;;;\n" "DIB ;RGB;;;;;;RGB\n" "DIV1;MPEG-4 Visual;FFMpeg;Hacked MS MPEG-4 V1;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "DIV2;MPEG-4 Visual;MS MPEG-4 1/2;;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "DIV3;MPEG-4 Visual;DivX 3 Low;;http://www.divx.com;;;YUV;4:2:0\n" "DIV4;MPEG-4 Visual;DivX 3 Fast;;http://www.divx.com;;;YUV;4:2:0\n" "DIV5;MPEG-4 Visual;DivX 5;;http://www.divx.com;;;YUV;4:2:0\n" "DIV6;MPEG-4 Visual;MS MPEG-4 v3;;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "DIVX;MPEG-4 Visual;DivX 4;Project Mayo;http://mediaarea.net/DIVX;;;YUV;4:2:0\n" "divx;MPEG-4 Visual;DivX;Mainly used by Google;http://www.divx.com;;;YUV;4:2:0\n" "DJPG;JPEG;Broadway 101;Data Translation, Inc.;;;;YUV\n" "DM4V;MPEG-4 Visual;Dicas;;;;;YUV;4:2:0\n" "DMB1;JPEG;Rainbow;Matrox Rainbow Runner hardware compression;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.MJPG.v2.10.27.codec.exe;;;YUV\n" "DMB2;JPEG;Paradigm;;;;;YUV\n" "DMK2;V36 PDA;;ViewSonic V36 PDA Video;;;;\n" "DP02;MPEG-4 Visual;DynaPel;;;;;YUV;4:2:0\n" "DP16;YUV;Matsushita;With DPCM 6-bit compression;;;;YUV;4:1:1\n" "DP18;YUV;Matsushita;With DPCM 8-bit compression;;;;YUV;4:1:1\n" "DP26;YUV;Matsushita;With DPCM 6-bit compression;;;;YUV;4:2:2\n" "DP28;YUV;Matsushita;With DPCM 8-bit compression;;;;YUV;4:2:2\n" "DP96;YUV;Matsushita;With DPCM 6-bit compression;;;;YUV\n" "DP98;YUV;Matsushita;With DPCM 8-bit compression;;;;YUV\n" "DP9L;YUV;Matsushita;With DPCM 6-bit compression;;;;YUV\n" "DPS0;JPEG;DPS Reality;Dummy format - only AVI header;;;;YUV\n" "DPSC;JPEG;DPS PAR;Dummy format - only AVI header;;;;YUV\n" "DRWX;DV;Pinnacle;;;;;YUV\n" "DSVD;DV;Microsoft;;;;;YUV\n" "DTMT;Media-100;;;;;\n" "DTNT;Media-100;;;;;\n" "DUCK;TrueMotion S;Duck Corporation;;;;\n" "DV10;RGB;BlueFish;BlueFish444 (lossless RGBA, YUV 10-bit);;;;RGB\n" "DV25;DV;DVCPro;;;;;YUV\n" "dv25;DV;DVCPro;;;;;YUV\n" "DV50;DV;DVCPro5;;;;;YUV\n" "dv50;DV;DVCPro5;;;;;YUV\n" "DVAN;DV;Pinnacle DV300;;;;;YUV\n" "DVC ;DV;Apple;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "DVCP;DV;Apple;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "DVCS;DV;MainConcept;;;;;YUV\n" "DVE2;DV;Insoft DVE-2;InSoft DVE-2 Videoconferencing;;;;YUV\n" "DVH1;DV;Pinnacle;;;;;YUV\n" "dvhd;DV;HD;;;;;YUV\n" "DVIS;DV;DualMoon;;;;;YUV\n" "DVL ;DV;Radius;;;;;YUV\n" "DVLP;DV;Radius;;;;;YUV\n" "DVMA;DV;Darim;;;;;YUV\n" "DVNM;DVNM;;Matsushita Electric Industrial Co., Ltd.;;;;\n" "DVOR;RGB;BlueFish;BlueFish444 (lossless RGBA, YUV 10-bit);;;;RGB\n" "DVPN;DV;Apple;;;;;YUV\n" "DVPP;DV;Apple;;;;;YUV\n" "DVR ;MPEG Video;ASF;;;;;YUV;4:2:0\n" "DVR1;Targa2000;;;;;;\n" "DVRS;DV;DualMoon;;;;;YUV\n" "dvsd;DV;Sony;;;;;YUV\n" "dvsl;DV;Sony;;;;;YUV\n" "DVSL;DV;;;;;;YUV\n" "DVX1;DVX 1 SP;;Lucent DVX1000SP Video Decoder;;;;\n" "DVX2;DVX 2 S;;Lucent DVX2000S Video Decoder;;;;\n" "DVX3;DVX 3 S;;Lucent DVX3000S Video Decoder;;;;\n" "DX50;MPEG-4 Visual;DivX 5;;http://mediaarea.net/DX50;;;YUV;4:2:0\n" "DXGM;EA GameVideo;;;;;;\n" "DXT1;DirectX TC;;DirectX Compressed Texture (1bit alpha channel)\n" "DXT2;DirectX TC;;DirectX Compressed Texture\n" "DXT3;DirectX TC;;DirectX Compressed Texture (4bit alpha channel)\n" "DXT4;DirectX TC;;DirectX Compressed Texture\n" "DXT5;DirectX TC;;DirectX Compressed Texture (3bit alpha channel with interpolation)\n" "DXTC;DirectX TC;;DirectX Texture Compression\n" "DXTn;DirectX TC;;Microsoft Compressed Texture\n" "DXTN;DirectX TC;;Microsoft DirectX Compressed Texture (DXTn)\n" "EKQ0;Elsa KQ;;Elsa graphics card quick\n" "ELK0;Elsa LK;;Elsa graphics card\n" "EM2V;Elymonyx MPEG-2;;Etymonix MPEG-2 I-frame\n" "EQK0;Elsa;;Elsa graphics card quick\n" "ESCP;Escape;;Eidos Escape\n" "ETV1;eTreppid 1;;eTreppid Video 1\n" "ETV2;eTreppid 2;;eTreppid Video 2\n" "ETVC;eTreppid C;;eTreppid Video C\n" "FFDS;FFDS;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "FFV1;FFV1;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "FFV2;FFV2;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "FFVH;HuffYUV;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "FLIC;FLI/FLC;Autodesk;;;;;\n" "FLJP;DField JPEG;;D-Vision Field Encoded JPEG with LSI (or Targa emulation);;;;\n" "FLV1;Sorenson Spark;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "FLV4;VP6;On2;;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe;Heightened Sharpness;;\n" "FMJP;JPEG;D-Vision;;;;;YUV\n" "FMP4;MPEG-4 Visual;;;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "FPS1;Fraps;;;http://www.fraps.com/;;;\n" "FRLE;JPEG;SoftLab-Nsk;SoftLab-NSK Y16 + Alpha RLE;;;;YUV\n" "FRWA;JPEG;SoftLab-Nsk;SoftLab-NSK Vision Forward JPEG with Alpha-channel;;;;YUV\n" "FRWD;JPEG;SoftLab-Nsk;SoftLab-NSK Vision Forward JPEG;;;;YUV\n" "FRWT;JPEG;SoftLab-Nsk;SoftLab-NSK Vision Forward JPEG with Alpha-channel;;;;YUV\n" "FRWU;JPEG;SoftLab-Nsk;SoftLab-NSK Vision Forward Uncompressed;;;;YUV\n" "FVF1;Itered Fractal;;;;;;\n" "FVFW;FVFW;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "FXT1;3DFX;;;;;;\n" "G2M2;GoToMeeting2;;Citrix Systems, Inc.;http://www.gotomeeting.com/;;;\n" "G2M3;GoToMeeting3;;Citrix Systems, Inc.;http://www.gotomeeting.com/;;;\n" "GEPJ;JPEG;White Pine;;;;;YUV\n" "GJPG;Grand Tech GT891x;;;;;;\n" "GLCC;GigaLink;;;;;;\n" "GLZW;LZW;Gabest;;http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84358;;;\n" "GMP4;GeoVision Advanced MPEG-4;;;http://www.geovision.com.tw/;;;\n" "GM40;GeoVision Advanced MPEG-4;;;http://www.geovision.com.tw/;;;\n" "GPEG;JPEG;Gabest;;http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84358;;;YUV\n" "GPJM;JPEG;Pinnacle;;;;;YUV\n" "GREY;YUV;;Simple grayscale video;http://www.fourcc.org/indexyuv.htm;;;YUV\n" "GWLT;MS GWLT;;Microsoft Greyscale WLT DIB;;;;\n" "GXVE;ViVD V2;SoftMedia;;;;;\n" "H260;H.260;;;;;;\n" "H261;H.261;;;;;;\n" "H262;MPEG Video;;;;;;YUV;4:2:0\n" "H263;H.263;;;;;;\n" "h263;H.263;;;http://www.apple.com/quicktime/download/standalone.html;;;\n" "H264;AVC;;;;;;YUV;4:2:0\n" "h264;AVC;;;;;;YUV;4:2:0\n" "H265;H.265;;;;;;\n" "H266;H.266;;;;;;\n" "H267;H.267;;;;;;\n" "H268;H.268;;;;;;\n" "H269;H.263;;;;;;\n" "HD10;RGB;BlueFish;BlueFish444 (lossless RGBA, YUV 10-bit);;;;RGB\n" "HDX4;Jomigo HDX4;;;;;;\n" "HFYU;HuffYUV;;;;;;\n" "HMCR;Rendition;;Rendition Motion Compensation Format;;;;\n" "HMRR;Rendition;;Rendition Motion Compensation Format;;;;\n" "i263;H.263;;;;;;\n" "I420;YUV;;8 bit Y plane followed by 8 bit 2x2 subsampled U and V planes.;;;;\n" "IAN ;Indeo 4;;;;;;\n" "ICLB;CellB;;InSoft CellB Videoconferencing;;;;\n" "IDM0;Wavelets 2;;IDM Motion Wavelets 2.0;;;;\n" "IF09;H.261;Microsoft;;;;;\n" "IFO9;YUV;Intel;;;;;YUV\n" "IGOR;PowerDVD;;;;;;\n" "IJPG;JPEG;Intergraph;;;;;YUV\n" "ILVC;Layered Video;Intel;;;;;\n" "ILVR;H.263+;;;;;;\n" "IMAC;MotionComp;;Intel hardware motion compensation.;;;;\n" "IMC1;YUV;;As YV12, except the U and V planes each have the same stride as the Y plane;;;;YUV\n" "IMC2;YUV;;Similar to IMC1, except that the U and V lines are interleaved at half stride boundaries;;;;YUV\n" "IMC3;YUV;;As IMC1, except that U and V are swapped;;;;YUV\n" "IMC4;YUV;;As IMC2, except that U and V are swapped;;;;YUV\n" "IMG ;YUV;;;;;;YUV\n" "IMJG;Accom JPEG;;Accom SphereOUS JPEG with Alpha-channel;;;;\n" "IPDV;I-O DV;;I-O Data Device Giga AVI DV;;;\n" "IPJ2;JPEG 2000;;Image Power JPEG 2000;;;\n" "IR21;Indeo 2.1;;;;;\n" "IRAW;YUV;;;http://www.fourcc.org/indexyuv.htm;;;YUV\n" "ISME;ISME;;Intel;;;\n" "IUYV;YUV;;Lead 16bpp. Interlaced version of UYVY (line order 0, 2, 4,....,1, 3, 5....);;;;YUV\n" "IV30;Indeo 3;;Intel Indeo Video 3;;;\n" "IV31;Indeo 3;;Intel Indeo Video 3.1;;;\n" "IV32;Indeo 3;;Intel Indeo Video 3.2;;;\n" "IV33;Indeo 3;;Intel Indeo Video 3.3;;;\n" "IV34;Indeo 3;;Intel Indeo Video 3.4;;;\n" "IV35;Indeo 3;;Intel Indeo Video 3.5;;;\n" "IV36;Indeo 3;;Intel Indeo Video 3.6;;;\n" "IV37;Indeo 3;;Intel Indeo Video 3.7;;;\n" "IV38;Indeo 3;;Intel Indeo Video 3.8;;;\n" "IV39;Indeo 3;;Intel Indeo Video 3.9;;;\n" "IV40;Indeo 4;;Intel Indeo Video 4.0;;;\n" "IV41;Indeo 4;;Intel Indeo Video 4.1;;;\n" "IV42;Indeo 4;;Intel Indeo Video 4.2;;;\n" "IV43;Indeo 4;;Intel Indeo Video 4.3;;;\n" "IV44;Indeo 4;;Intel Indeo Video 4.4;;;\n" "IV45;Indeo 4;;Intel Indeo Video 4.5;;;\n" "IV46;Indeo 4;;Intel Indeo Video 4.6;;;\n" "IV47;Indeo 4;;Intel Indeo Video 4.7;;;\n" "IV48;Indeo 4;;Intel Indeo Video 4.8;;;\n" "IV49;Indeo 4;;Intel Indeo Video 4.9;;;\n" "IV50;Indeo 4;;Intel Indeo Video 5.0 Wavelet;http://www.fourcc.org/indexyuv.htm;;\n" "IY41;YUV;;Lead 16bpp. Interlaced version of Y41P (line order 0, 2, 4,....,1, 3, 5....);http://www.fourcc.org/indexyuv.htm;;;YUV\n" "IYU1;YUV;;IEEE1394 12bpp. 12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec;http://www.fourcc.org/indexyuv.htm;;;YUV\n" "IYU2;YUV;;IEEE1394 24bpp. 24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec;;;;YUV\n" "IYUV;YUV;;Intel Indeo iYUV 4:2:0;;;;YUV\n" "JBYR;Kensington;;Kensington Video;http://ffdshow-tryout.sourceforge.net/;;\n" "JFIF;JPEG;;;;;;YUV\n" "JPEG;JPEG;;;http://www.apple.com/quicktime/download/standalone.html;;;YUV\n" "JPG;JPEG;;;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe;;;YUV\n" "JPGL;JPEG;Pegasus;DIVIO JPEG Light for WebCams (Pegasus Lossless JPEG);;;;YUV\n" "KMVC;Karl;;Karl Morton's Video (presumably);http://www.apple.com/quicktime/download/standalone.html;;;\n" "kpcd;Photo CD;;Kodak Photo CD;;;;\n" "L261;H.261;Lead Technologies;;;;;\n" "L263;H.263+;Lead Technologies;;;;;\n" "LAGS;Lagarith;;;;;;\n" "LBYR;Creative WebCam;;;;;;\n" "LCMW;Lead CMW;;Lead Technologies Motion CMW;;;;\n" "LCW2;Lead MCMW;;LEADTools MCMW 9Motion Wavelet;http://mirror01.iptelecom.net.ua/~video/codecs/LEAD.MCMP-JPEG.v1.016.codec.exe;;;\n" "LEAD;Lead Video;;;;;;\n" "LGRY;Lead GrayScale;;;;;;\n" "LIA1;Liafail;;Liafail, Inc.;;;;\n" "LJ2K;JPEG 2000;Lead;;http://mirror01.iptelecom.net.ua/~video/codecs/LEAD.MCMP-JPEG.v1.016.codec.exe;;;\n" "LJPG;JPEG;Lead;;http://mirror01.iptelecom.net.ua/~video/codecs/LEAD.MCMP-JPEG.v1.016.codec.exe;;;YUV\n" "Ljpg;JPEG;Lead;;;;;YUV\n" "LMP2;MPEG-PS;Lead;;;;;\n" "LOCO;LOCO;;Lossless;;;;\n" "LSCR;Lead Screen capture;;;;;;\n" "LSV0;LSV0;;Infinop Inc.;;;;\n" "LSVC;Vmail;;Vianet Lighting Strike Vmail (Streaming);;;;\n" "LSVM;Vmail;;Vianet Lighting Strike Vmail (Streaming);;;;\n" "LSVW;Infinop;;Infinop Lightning Strike multiple bit rate video codec.;;;;\n" "LSVX;Vmail;;Vianet Lightning Strike Video Codec;;;;\n" "LZO1;LZO;;LZO compressed (lossless);;;;\n" "M101;YUV;Matrox;;;;;YUV\n" "M261;H.261;Microsoft;;;;;\n" "M263;H.263;Microsoft;;;;;\n" "M4CC;MPEG-4 Visual;ESS Divo;;;;;YUV;4:2:0\n" "M4S2;MPEG-4 Visual;Microsoft;;;;;YUV;4:2:0\n" "MC12;ATI Motion;;ATI Motion Compensation Format;;;;\n" "MC24;JPEG;MainConcept;;;;;YUV\n" "MCAM;ATI Motion;;ATI Motion Compensation Format;;;;\n" "MCZM;RGB;;Theory MicroCosm Lossless 64bit RGB with Alpha-channel;;;;RGB\n" "MDVD;MicroDVD;;Alex MicroDVD Video (hacked MS MPEG-4);;;;\n" "MDVF;DV;Pinnacle;Pinnacle DV/DV50/DVHD100;;;;YUV\n" "MHFY;YUV;;A.M.Paredes mhuffyYUV (LossLess);http://mirror01.iptelecom.net.ua/~video/codecs/Pinnacle.ReelTime.v2.5.software.only.codec.exe;;;YUV\n" "MJ2C;JPEG 2000;;Morgan Multimedia JPEG 2000 Compression;http://mirror01.iptelecom.net.ua/~video/codecs/Pinnacle.ReelTime.v2.5.software.only.codec.exe;;;\n" "MJPA;JPEG;Pinacle;Pinnacle ReelTime MJPG hardware;http://mediaxw.sourceforge.net;;;YUV\n" "mjp2;JPEG 2000;;;;;\n" "MJPB;JPEG;Pinacle B;;;;;YUV\n" "MJPG;JPEG;;;;;;YUV\n" "mJPG;JPEG;IBM;Including Huffman Tables;;;;YUV\n" "MJPX;JPEG;Pegasus;Pegasus PICVideo JPEG;;;;YUV\n" "ML20;Webcam;;Mimic MSN Messenger Webcam;;;;\n" "MLCY;MLC;;MLC Lossless Codec;http://www.linek.sk/mlc/;;;;;;Lossless\n" "MMES;MPEG Video;Matrox;I-frame;;;;YUV;4:2:0\n" "MMIF;MPEG Video;Matrox;I-frame;;;;YUV;4:2:0\n" "MNVD;MindVid;;MindBend MindVid LossLess;;;;\n" "MP2V;MPEG Video;;Media Excel MPEG-2 Video;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "MP2v;MPEG Video;;MPEG-2 Video;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "MP41;MPEG-4 Visual;Microsoft;Microsoft MPEG-4 v1 (pre-standard);http://ffdshow-tryout.sourceforge.net/;;;\n" "MP42;MPEG-4 Visual;Microsoft;Microsoft MPEG-4 v2 (pre-standard);http://www.apple.com/quicktime/download/standalone.html;;;\n" "MP43;MPEG-4 Visual;Microsoft;Microsoft MPEG-4 v3 (pre-standard);;;;\n" "MP4S;MPEG-4 Visual;MS MPEG-4 v3;Microsoft MPEG-4 (Windows Media 7.0);;;;YUV;4:2:0\n" "MP4V;MPEG-4 Visual;;Apple QuickTime MPEG-4 native;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "MPEG;MPEG Video;;Chromatic MPEG 1 Video I Frame;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "mpeg;MPEG Video;;MPEG-1 Video;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "MPG1;MPEG Video;Ffmpeg;(MPEG-1/2) FFmpeg;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "mpg1;MPEG Video;Ffmpeg;(MPEG-1/2) FFmpeg;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "MPG2;MPEG Video;Ffmpeg;(MPEG-1/2) FFmpeg;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "mpg2;MPEG Video;Ffmpeg;(MPEG-1/2) FFmpeg;http://ffdshow-tryout.sourceforge.net/;;;YUV;4:2:0\n" "MPG3;MPEG-4 Visual;FFmpeg DivX 3;(MPEG-4) MS MPEG-4 v3;;;;YUV;4:2:0\n" "MPG4;MPEG-4 Visual;MS MPEG-4 v1;Microsoft MPEG-4 v1;;;;YUV;4:2:0\n" "MPGI;MPEG Video;Sigma;Sigma Design MPEG-1 I-frame;;;;YUV;4:2:0\n" "MPNG;PNG;;Motion PNG;;;;\n" "MRCA;Mrcodec;;FAST Multimedia;;;;\n" "MRLE;RLE;;Microsoft RLE;;;;RGB\n" "MSS1;Screen Video;Windows;Windows Screen Video;;;;\n" "MSS2;Windows Media;;Windows Media 9;;;;\n" "MSUC;MSU;;MSU LossLess;;;;\n" "MSUD;MSU;;MSU LossLess;;;;\n" "MSV1;Microsoft Video 1;;Microsoft Video 1;;;;\n" "MSVC;Microsoft Video 1;;Microsoft Video 1;;;;\n" "MSZH;AVImszh;;Lossless (ZIP compression);;;;\n" "MTGA;TGA;;Motion TGA images (24, 32 bpp);;;;\n" "MTX1;JPEG;Matrox;;;;;YUV\n" "MTX2;JPEG;Matrox;;;;;YUV\n" "MTX3;JPEG;Matrox;;;;;YUV\n" "MTX4;JPEG;Matrox;;;;;YUV\n" "MTX5;JPEG;Matrox;;;;;YUV\n" "MTX6;JPEG;Matrox;;;;;YUV\n" "MTX7;JPEG;Matrox;;;;;YUV\n" "MTX8;JPEG;Matrox;;;;;YUV\n" "MTX9;JPEG;Matrox;;;;;YUV\n" "MV10;Nokia;;Nokia Mobile Phones;;;;\n" "MV11;Nokia;;Nokia Mobile Phones;;;;\n" "MV12;MVI;;Motion Pixels (old);;;;\n" "MV99;Nokia;;Nokia Mobile Phones;;;;\n" "MVC1;Nokia;;Nokia Mobile Phones;;;;\n" "MVC2;Nokia;;Nokia Mobile Phones;;;;\n" "MVC9;Nokia;;Nokia Mobile Phones;;;;\n" "MVI1;MVI;;Motion Pixels MVI;;;;\n" "MVI2;MVI;;Motion Pixels MVI;;;;\n" "MWV1;Aware Motion Wavelets;;Aware Motion Wavelets;;;;\n" "MYUV;RGB;;Media-100 844/X Uncompressed;;;;RGB\n" "NAVI;MPEG-4 Visual;;nAVI video (hacked MS MPEG-4);;;;YUV;4:2:0\n" "NDIG;MPEG-4 Visual;Ahead;Ahead Nero Digital MPEG-4;;;;YUV;4:2:0\n" "NHVU;Nvidia Texture;;Nvidia Texture Format (GEForce 3);;;;\n" "NO16;RGB;;Theory None16 64bit uncompressed Uncompressed;;;;RGB\n" "NT00;YUV;LightWave;NewTek LightWave HDTV YUV with Alpha-channel;;;;YUV\n" "NTN1;NogaTech Video 1;;Nogatech Video Compression 1;;;;\n" "NTN2;NogaTech Video 2;;Nogatech Video Compression 2 (GrabBee hardware coder);;;;\n" "NUV1;Nuppel;;NuppelVideo;;;;\n" "NV12;YUV;;8-bit Y plane followed by an interleaved U/V plane with 2x2 subsampling;;;;YUV\n" "NV21;YUV;;As NV12 with U and V reversed in the interleaved plane;;;;YUV\n" "NVDS;Nvidia Texture;;Nvidia Texture Format;;;;\n" "NVHS;Nvidia Texture;;Nvidia Texture Format (GeForce 3);;;;\n" "NVHU;Nvidia Texture;;Nvidia Texture Format;;;;\n" "NVS0;Nvidia Texture;;Nvidia Texture Compression Format;;;;\n" "NVS1;Nvidia Texture;;Nvidia Texture Compression Format;;;;\n" "NVS2;Nvidia Texture;;Nvidia Texture Compression Format;;;;\n" "NVS3;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVS4;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVS5;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVS6;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVS7;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVS8;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVS9;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT0;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT1;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT2;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT3;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT4;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT5;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT6;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT7;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT8;Nvidia Texture;;Nvidia Texture Compression Format\n" "NVT9;Nvidia Texture;;Nvidia Texture Compression Format;;;;\n" "NY12;YUV;Nogatech;;;;;YUV\n" "NYUV;YUV;Nogatech;;;;;YUV\n" "ONYX;VP7;On2;;http://www.on2.com/vp7.php3;;;\n" "PCLE;Studio400;Pinnacle;;;;;\n" "PDVC;DV;Panasonic;;;;;YUV\n" "PGVV;Radius Video Vision;;;;;;\n" "PHMO;Photomotion;IBM;;;;;\n" "PIM1;JPEG;Pegasus;Pinnacle DC1000 hardware (MPEG compression);http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe;;;YUV\n" "PIM2;JPEG;Pegasus;Pegasus Imaging;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe;;;YUV\n" "PIMJ;JPEG;Pegasus;Pegasus Imaging PICvideo Lossless JPEG;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe;;;YUV\n" "PIXL;JPEG;Miro;MiroVideo XL (JPEG);;;;YUV\n" "PNG;PNG;;;;;;\n" "PNG1;PNG;;Corecodec.org CorePNG;;;;\n" "PVEZ;PowerEZ;;Horizons Technology PowerEZ;;;;\n" "PVMM;MPEG-4 Visual;Pegasus;PacketVideo Corporation MPEG-4;;;;YUV;4:2:0\n" "PVW2;Wavelet;Pegasus;Pegasus Imaging Wavelet 2000;;;;\n" "PVWV;Wavelet;Pegasus;Pegasus Imaging Wavelet 2000;;;;\n" "PXLT;Pixlet;;Apple Pixlet (Wavelet);;;;\n" "Q1.0;QPEG 1.0;;Q-Team QPEG 1.0;http://www.q-team.de;;;\n" "Q1.1;QPEG 1.1;;Q-Team QPEG 1.1;http://www.q-team.de;;;\n" "QDGX;Apple GX;;Apple QuickDUncompressed GX;;;;\n" "QDRW;Palettized Video;;Apple;;;;\n" "QPEG;QPEG 1.1;;Q-Team QPEG 1.1;;;;\n" "QPEQ;QPEG 1.1;;Q-Team QPEG 1.1;;;;\n" "R210;YUV;;BlackMagic YUV (Quick Time);;;;YUV\n" "R411;DV;Radius;Radius DV NTSC YUV;;;;YUV\n" "R420;DV;Radius;Radius DV PAL YUV;;;;YUV\n" "RAV_;MPEG-1;GroupTron;GroupTRON ReferenceAVI (dummy for MPEG compressor);;;;YUV;4:2:0\n" "RAVI;MPEG-1;GroupTron;GroupTRON ReferenceAVI (dummy for MPEG compressor);;;;YUV;4:2:0\n" "RAW ;RGB;;Full Frames (Uncompressed);;;;RGB\n" "raw ;RGB;;Full Frames (Uncompressed);http://www.apple.com/quicktime/download/standalone.html;;;RGB\n" "RGB ;RGB;;;;;;RGB;8:8:8\n" "RGB1;RGB;;;;;;RGB 3:3:2;3:3:2\n" "RGB2;RGB;;;;;;RGB 3:3:2;3:3:2\n" "RGBA;RGB;;;http://www.fourcc.org/indexrgb.htm;;;RGB\n" "RGBO;RGB;;Little Endian;;;;RGB 5:5:5;5:5:5\n" "RGBP;RGB;;Little Endian;;;;RGB 5:6:5;5:6:5\n" "RGBQ;RGB;;Big Endian;;;;RGB 5:5:5;5:5:5\n" "RGBR;RGB;;Big Endian;;;;RGB 5:6:5;5:6:5\n" "RGBT;RGBA;;;http://www.fourcc.org/indexrgb.htm;;;RGBA\n" "RIVA;Swizzled texture;;Nvidia;;;;\n" "RL4;RLE;;RLE 4bpp RGB;;;;RGB\n" "RL8;RLE;;RLE 8bpp RGB;;;;RGB\n" "RLE ;RLE;;RLE RGB with arbitrary sample packing within a pixel;http://www.fourcc.org/indexrgb.htm;;;RGB\n" "RLE4;RLE;;RLE 4bpp RGB;http://www.fourcc.org/indexrgb.htm;;;RGB\n" "RLE8;RLE;;RLE 8bpp RGB;http://www.fourcc.org/indexrgb.htm;;;RGB\n" "RLND;Roland;;Roland Corporation;;;;\n" "RMP4;MPEG-4 Visual;RealMagic;REALmagic MPEG-4 Video (Sigma Design, built on XviD);;;;YUV;4:2:0\n" "ROQV;Id RoQ;;Id RoQ File Video Decoder;;;;\n" "RT21;Intel Video 2.1;;Intel Real Time Video 2.1;;;;\n" "RTV0;NewTek VideoToaster;;NewTek VideoToaster (dummy format - only AVI header);;;;\n" "RUD0;Rududu;;Rududu video;;;;\n" "RV10;RealVideo 1;;H263, RealVideo 5;http://www.real.com;;;\n" "RV13;RealVideo 1;;H263, RealVideo 5;http://www.real.com;;;\n" "RV20;RealVideo 2;;H263, RealVideo 6;http://www.real.com;;;\n" "RV30;RealVideo 3;;Between H263 and H264, RealVideo 8;http://www.real.com;;;\n" "RV40;RealVideo 4;;H264, RealVideo 9;http://www.real.com;;;\n" "RVX ;RDX;;Intel RDX;;;;\n" "S263;H.263;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "S422;YUV;VideoCap C210;VideoCap C210;;;;YUV\n" "SAN3;MPEG-4 Visual;;Direct copy of DivX 3.11;;;;YUV;4:2:0\n" "SANM;Smush v2;;LucasArts;http://www.lucasarts.com/;;;\n" "SCCD;SoftCam;;;;;;\n" "SDCC;DV;Sun;Sun Digital Camera;;;;YUV;4:1:1\n" "SEDG;MPEG-4 Visual;Samsung;Samsung MPEG-4;;;;YUV;4:2:0\n" "SEG4;Cinepak;;;http://www.sega.com/;;;\n" "SEGA;Cinepak;;;http://www.sega.com/;;;\n" "SFMC;CrystalNet;;CrystalNet Surface Fitting Method;;;;\n" "SHR0;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR1;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR2;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR3;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR4;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR5;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR6;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SHR7;BitJazz SheerVideo;;BitJazz SheerVideo (realtime lossless);;;;\n" "SIF1;SIF1;;;http://mysif.ru/SIF1_dd_Eng.htm;;;\n" "SJPG;JPEG;CuSeeMe;CuSeeMe;http://mirror01.iptelecom.net.ua/~video/codecs/CUseeMe.JPEG.CODEC.v1.17.exe;;;YUV\n" "SL25;DV;SoftLab DVCPro;SoftLab-NSK DVCPRO;;;;YUV;4:1:1\n" "SL50;DV;SoftLab DVCPro5;SoftLab-NSK ;;;;YUV;4:1:1\n" "SLDV;DV;SoftLab;SoftLab-NSK Forward DV Draw;;;;YUV;4:1:1\n" "SLIF;MPEG Video;SoftLab;SoftLab-NSK MPEG-2 I-frames;;;;YUV;4:2:0\n" "SLMJ;JPEG;SoftLab;SoftLab-NSK Forward JPEG;;;;YUV\n" "smc ;SMC;;Apple Graphics (SMC);http://www.apple.com/quicktime/download/standalone.html;;;\n" "SMSC;Radius;;;;;;\n" "SMSD;Radius;;;;;;\n" "SMSV;Wavelet Video;;WorldConnect Wavelet Streaming Video;;;;\n" "SNOW;Snow;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "SP40;YUV;SunPlus;SunPlus YUV;;;;YUV\n" "SP44;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP53;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP54;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP55;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP56;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP57;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP58;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SP61;MegaCam;;SunPlus Aiptek MegaCam;;;;\n" "SPIG;Spigot;;Radius Spigot;;;;\n" "SPLC;ACM audio;;Splash Studios ACM Audio;;;;\n" "SPRK;Spark;;;;;;\n" "SQZ2;VXTreme 2;;Microsoft VXTreme Video V2;;;;\n" "STVA;ST Imager;;ST Microelectronics CMOS Imager Data (Bayer);;;;\n" "STVB;ST Imager;;ST Microelectronics CMOS Imager Data (Nudged Bayer);;;;\n" "STVC;ST Imager;;ST Microelectronics CMOS Imager Data (Bunched);;;;\n" "STVX;ST Imager;;ST Microelectronics CMOS Imager Data (Extended Data Format);;;;\n" "STVY;ST Imager;;ST Microelectronics CMOS Imager Data (Extended Data Format with Correction Data);;;;\n" "SV10;Sorenson;;Sorenson Media Video R1;;;;\n" "SVQ1;AVC;Sorenson 1;Sorenson Media Video 1 (Apple QuickTime 3);;;;\n" "SVQ2;AVC;Sorenson 2;Sorenson Media Video 2 (Apple QuickTime 4);;;;\n" "SVQ3;AVC;Sorenson 3;Sorenson Media Video 3 (Apple QuickTime 5);;;;\n" "SWC1;JPEG;MainConcept;MainConcept JPEG;;;;YUV\n" "T420;YUV;Toshiba;Toshiba YUV 4:2:0;;;;YUV\n" "TGA ;TGA;Apple;Apple TGA (with Alpha-channel)\n" "THEO;Theora;;FFVFW Supported\n" "TIFF;Apple TIFF;;Apple TIFF (with Alpha-channel)\n" "TIM2;Pinnacle DVI;;Pinnacle RAL DVI\n" "TLMS;TeraLogic;;TeraLogic Motion Intraframe\n" "TLST;TeraLogic;;TeraLogic Motion Intraframe\n" "TM10;Duck;;Duck TrueMotion\n" "TM20;Duck 2;;Duck TrueMotion 2.0\n" "TM2A;Duck Archiver 2;;Duck TrueMotion Archiver 2.0\n" "TM2X;Duck 2;;Duck TrueMotion 2X\n" "TMIC;TeraLogic;;TeraLogic Motion Intraframe\n" "TMOT;Horizons TM S;;Horizons Technology TrueMotion Video\n" "TR20;Duck TM RT2;;Duck TrueMotion RT 2.0\n" "TRLE;Akula;;Akula Alpha Pro Custom AVI (LossLess)\n" "TSCC;TechSmith;;TechSmith Screen Capture\n" "tscc;TechSmith;;TechSmith Screen Capture\n" "TV10;Tecomac;;Tecomac Low-Bit Rate;;;;\n" "TVJP;Pinnacle/Truevision;;TrueVision Field Encoded JPEG (Targa emulation);;;;\n" "TVMJ;Pinnacle/Truevision;;Truevision TARGA JPEG Hardware (or Targa emulation);;;;\n" "TY0N;Trident;;Trident Decompression Driver;;;;\n" "TY2C;Trident;;Trident Decompression Driver;;;;\n" "TY2N;Trident;;Trident Decompression Driver;;;;\n" "U<Y ;YUV;Discreet;Discreet UC YUV 4:2:2:4 10 bit;;;;YUV\n" "U<YA;YUV;Discreet;Discreet UC YUV 4:2:2:4 10 bit (with Alpha-channel);;;;YUV\n" "U263;H.263;UB;UB Video H.263/H.263+/H.263++ Decoder;http://eMajix.com;;;\n" "UCOD;ClearVideo;;ClearVideo (fractal compression-based);;;;\n" "ULH0;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:0\n" "ULH2;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:2\n" "ULRA;RGBA;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;RGBA;4:4:4:4\n" "ULRG;RGB;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;RGB;4:4:4\n" "ULTI;Ultimotion;;IBM Ultimotion;;;;\n" "ULY0;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:0\n" "ULY2;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:2\n" "UMP4;MPEG-4 Visual;UB;UB Video MPEG 4;http://www.fourcc.org/indexyuv.htm;;;YUV;4:2:0\n" "UYNV;YUV;;Nvidia 16bpp. A direct copy of UYVY registered by Nvidia to work around problems in some olds which did not like hardware which offered more than 2 UYVY surfaces.;http://www.fourcc.org/indexyuv.htm;;;YUV\n" "UYVP;YUV;;Evans & Sutherland 24bpp. YUV 4:2:2 extended precision 10-bits per component in U0Y0V0Y1 order;;;;YUV\n" "UYVU;YUV;SoftLab;SoftLab-NSK Forward YUV;http://www.fourcc.org/indexyuv.htm;;;YUV\n" "UYVY;YUV;;Uncompressed 16bpp. YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32.;;;;YUV;4:2:2\n" "V210;YUV;;Optibase VideoPump 10-bit 4:2:2 Component YUV;;;;\n" "v210;YUV;AJA Video Systems Xena;;;;;YUV;4:2:2\n" "V261;VX3000S;;Lucent VX3000S;;;;\n" "V422;YUV;Vitec;;;;;YUV;4:2:2\n" "V655;YUV;Vitec;Vitec Multimedia 16 bit YUV 4:2:2 (6:5:5) format;;;;YUV\n" "VBLE;MarcFD VBLE;;MarcFD VBLE Lossless;;;;\n" "VCR1;ATI Video 1;;ATI VCR 1.0;;;;\n" "VCR2;ATI Video 2;;ATI VCR 2.0 (MPEG YV12);;;;\n" "VCR3;ATI Video 3;;ATI VCR 3.0;;;;\n" "VCR4;ATI Video 4;;ATI VCR 4.0;;;;\n" "VCR5;ATI Video 5;;ATI VCR 5.0;;;;\n" "VCR6;ATI Video 6;;ATI VCR 6.0;;;;\n" "VCR7;ATI Video 7;;ATI VCR 7.0;;;;\n" "VCR8;ATI Video 8;;ATI VCR 8.0;;;;\n" "VCR9;ATI Video 9;;ATI VCR 9.0;;;;\n" "VCWV;Wavelet;;VideoCon;;;;\n" "VDCT;RGB;VideoMaker;Video Maker Pro DIB;;;;RGB\n" "VDOM;VDOWave;;VDONet Wave;;;;\n" "VDOW;VDOLive;;VDONet Live (H,263);;;;\n" "VDST;VirtualDub;;VirtualDub remote frameclient ICM driver;;;;\n" "VDTZ;YUV;;VideoTizer / Darim Vision YUV;;;;YUV;4:2:2\n" "VGPX;VGP;;Alaris VideoGramPixel;;;;\n" "VIDM;MPEG-4 Visual;DivX 5 Pro;DivX 5.0 Pro Supported;;;;YUV;4:2:0\n" "VIDS;Vitec;;Vitec Multimedia YUV 4:2:2;www.yks.ne.jp/~hori/;;;\n" "VIFP;VFAPI;;Virtual Frame API (VFAPI dummy format);;;;\n" "VIV1;H.263;Vivo;;;;;\n" "VIV2;H.263;Vivo;;;;;\n" "VIVO;H.263;Vivo;;;;;\n" "VIXL;JPEG;Miro XL;Miro Video XL;http://mirror01.iptelecom.net.ua/~video/codecs/miroVIDEO-XL.codec.v2.2.exe;;;YUV\n" "VJPG;JPEG;;;;;;YUV\n" "VLV1;Videologic;;;;;;\n" "VMNC;Vmware;;;http://www.vmware.com/;;;\n" "VP30;VP3;On2;;;;;\n" "VP31;VP3;On2;;;;;\n" "VP32;VP3;On2;;;;;\n" "VP40;VP4;On2;;;;;\n" "VP50;VP5;On2;;;;;\n" "VP60;VP6;On2;;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe;Simple;;\n" "VP61;VP6;On2;;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe;Advanced;;\n" "VP62;VP6;On2;;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe;Heightened Sharpness;;\n" "VP6A;VP6;On2;;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe;Alpha;;\n" "VP6F;VP6;On2;;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe;Heightened Sharpness;;\n" "VP70;VP7;On2;;;General;;\n" "VP71;VP7;On2;;;Error Resilient;;\n" "VP72;VP7;On2;;;;;\n" "VP80;VP8;;;http://www.webmproject.org;;;YUV;4:2:0\n" "VQC1;Vector 1;;Vector-quantised 1 (high compression) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf;;;;\n" "VQC2;Vector 2;;Vector-quantised 2 (high robustness against channel errors) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf;;;;\n" "VQJP;VQ630;;Dual-mode digital camera;;;;\n" "VQS4;VQ110;;DV camera;;;;\n" "VR21;YUV;BlckMagic;BlackMagic YUV (Quick Time);;;;YUV\n" "VSSH;AVC;Vanguard VSS;;;;;YUV;4:2:0\n" "VSSV;Vanguard Video;Vanguard VSS;;;;;\n" "VSSW;AVC;Vanguard VSS;;;;;YUV;4:2:0\n" "VTLP;GGP;;Alaris VideoGramPixel;;;;\n" "VX1K;DVX 1 S;;Lucent VX1000S Video;;;;\n" "VX2K;DVX 2 S;;Lucent VX2000S Video;;;;\n" "VXSP;DVX 1 SP;;Lucent VX1000SP Video;;;;\n" "VYU9;YUV;ATI;;;;;YUV\n" "VYUY;YUV;ATI;;;;;YUV\n" "WBVC;W9960;;Winbond Electronics W9960;;;;\n" "WHAM;Microsoft Video 1;;;;;;\n" "WINX;Winnov;;;;;;\n" "WJPG;JPEG;Winbond ;Winbond JPEG (AverMedia USB devices);;;;YUV\n" "WMV1;WMV1;;Windows Media Video 7;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;;\n" "WMV2;WMV2;;Windows Media Video 8;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;;\n" "WMV3;VC-1;WMV3;Windows Media Video 9;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;;\n" "WMVA;VC-1;WMV;Windows Media Video;http://ffdshow-tryout.sourceforge.net/;;;\n" "WMVP;WMV3;;Windows Media Video V9;;;;\n" "WNIX;WniWni;;WniWni;;;;\n" "WNV1;WinNov;;WinNov Videum Hardware Compression;http://www.winnov.com/;;;\n" "WNVA;WinNov;;WinNov Videum Hardware Compression;http://www.winnov.com/;;;\n" "WRLE;RGB;Apple;Apple QuickTime BMP;;;;RGB\n" "WRPR;AVideoTools;;VideoTools VideoServer Client (wrapper for AviSynth);;;;\n" "WV1F;;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "WVC1;VC-1;Microsoft;;;;;\n" "WVLT;IllusionHope Wavelet 9/7;;IllusionHope Wavelet 9/7;;;;\n" "WVP2;;;;http://ffdshow-tryout.sourceforge.net/;;;\n" "WZCD;iScan;;CORE Co. Ltd.;;;;\n" "WZDC;iSnap;;CORE Co. Ltd.;;;;\n" "X263;H.263;Xirlink;;;;;\n" "X264;AVC;;XiWave GNU GPL x264 MPEG-4;;;;\n" "XJPG;JPEG;Xirlink;;;;;YUV\n" "XLV0;NetXL Video;;NetXL Inc. XL Video Decoder;;;;\n" "XMPG;MPEG Video;Xing;XING MPEG (I frame only);;;;YUV;4:2:0\n" "XVID;MPEG-4 Visual;XviD;;http://mediaarea.net/XVID;;;YUV;4:2:0\n" "XVIX;MPEG-4 Visual;XviD;Based on XviD MPEG-4;http://www.xvid.org/Downloads.15.0.html;;;YUV;4:2:0\n" "XWV0;XiWave Video;;;;;;\n" "XWV1;XiWave Video;;;;;;\n" "XWV2;XiWave Video;;;;;;\n" "XWV3;XiWave Video;;;;;;\n" "XWV4;XiWave Video;;;;;;\n" "XWV5;XiWave Video;;;;;;\n" "XWV6;XiWave Video;;;;;;\n" "XWV7;XiWave Video;;;;;;\n" "XWV8;XiWave Video;;;;;;\n" "XWV9;XiWave Video;;;;;;\n" "XXAN;Origin VideoGame;;Used in Wing Commander 3 and 4;;;;\n" "XYZP;YUV;;Extended PAL format XYZ palette;;;;YUV\n" "Y211;YUV;;Packed YUV format with Y sampled at every second pixel across each line and U and V sampled at every fourth pixel;;;;YUV\n" "Y216;YUV;Targa;Pinnacle TARGA CineWave YUV (Quick Time);;;;YUV\n" "Y411;YUV;;YUV 4:1:1 Packed;;;;YUV;4:1:1\n" "Y41B;YUV;;YUV 4:1:1 Planar;;;;YUV;4:1:1\n" "Y41P;YUV;;Conexant (ex Brooktree) YUV 4:1:1 Raw;http://www.fourcc.org/indexyuv.htm;;;YUV;4:1:1\n" "Y41T;YUV;;Format as for Y41P, but the lsb of each Y component is used to signal pixel transparency;;;;YUVA;4:1:1\n" "Y422;YUV;;Direct copy of UYVY as used by ADS Technologies Pyro WebCam firewire camera;;;;YUV;4:2:2\n" "Y42B;YUV;;YUV 4:2:2 Planar;;;;YUV;4:2:2\n" "Y42T;YUV;;Format as for UYVY, but the lsb of each Y component is used to signal pixel transparency;;;;YUVA;4:2:2\n" "Y444;YUV;;IYU2 (iRez Stealth Fire camera);;;;YUV\n" "Y8 ;GrayScale;;Simple grayscale video;;;;Y\n" "Y800;GrayScale;;Simple grayscale video;;;;Y\n" "YC12;YUV;;Intel YUV12;http://www.fourcc.org/indexyuv.htm;;;YUV\n" "YCCK;YUV;;;;;;YUV\n" "YMPG;MPEG-PS;;YMPEG Alpha (dummy for MPEG-2 compressor);;;;\n" "YU12;YUV;;ATI YV12 4:2:0 Planar;;;;YUV;4:2:0\n" "YU92;YUV;;Intel - YUV;;;;YUV\n" "YUNV;YUV;;A direct copy of YUY2 registered by Nvidia to work around problems in some olds which did not like hardware that offered more than 2 YUY2 surfaces;;;;YUV\n" "YUV2;YUV;;Apple Component Video (YUV 4:2:2);http://www.apple.com/quicktime/download/standalone.html;;;YUV;\n" "YUV8;YUV;;Winnov Caviar YUV8 ;http://www.fourcc.org/indexyuv.htm;;;YUV;\n" "YUV9;YUV;;Intel YUV9;;;;YUV;\n" "YUVP;YUV;;YUV 4:2:2 extended precision 10-bits per component in Y0U0Y1V0 order;;;;YUV;4:2:2;10\n" "YUY2;YUV;;YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel;http://www.fourcc.org/indexyuv.htm;;;YUV;4:2:2\n" "YUYP;YUV;;Evans & Sutherland;;;;YUV;\n" "YUYV;YUV;;Canopus YUV format;http://www.fourcc.org/indexyuv.htm;;;YUV;\n" "YV12;YUV;;ATI YVU12 4:2:0 Planar;http://www.fourcc.org/indexyuv.htm;;;YUV;4:2:0\n" "YV16;YUV;;Elecard YUV 4:2:2 Planar;;;;YUV;4:2:2\n" "YV92;YUV;;Intel Smart Video Recorder YVU9;;;;YUV;\n" "YVU9;YUV;;Brooktree YVU9 Raw (YVU9 Planar);http://www.fourcc.org/indexyuv.htm;;;YUV;\n" "YVYU;YUV;;YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel;;;;YUV;4:2:2\n" "ZLIB;AVIzlib;;Lossless (ZIP compression);;;;;\n" "ZMBV;Zip;;Zip Motion Blocks Video;;;;;\n" "ZPEG;Video Zipper;;Metheus Video Zipper;;;;;\n" "ZYGO;ZyGo;;ZyGo Video;;;;;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Audio_Matroska (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "A_MPEG/L1;MPEG Audio;MP1;;http://www.iis.fraunhofer.de/amm/index.html\n" "A_MPEG/L2;MPEG Audio;MP2;;http://www.iis.fraunhofer.de/amm/index.html\n" "A_MPEG/L3;MPEG Audio;MP3;;http://www.iis.fraunhofer.de/amm/index.html\n" "A_PCM/INT/BIG;PCM;;\n" "A_PCM/INT/LIT;PCM;;\n" "A_PCM/FLOAT/IEEE;PCM;;\n" "A_AC3;AC-3;;\n" "A_AC3/BSID9;AC-3;;\n" "A_AC3/BSID10;AC-3;;\n" "A_DTS;DTS;;\n" "A_EAC3;E-AC-3;;\n" "A_FLAC;Flac;;;https://xiph.org/flac\n" "A_OPUS;Opus;;;http://opus-codec.org\n" "A_TTA1;TTA;;The True Audio Lossless Codec;http://true-audio.com\n" "A_VORBIS;Vorbis;;;http://www.vorbis.com\n" "A_WAVPACK4;WavPack;;;http://www.wavpack.com\n" "A_REAL/14_4;VSELP;;Real Audio 1 (14.4);http://www.real.com\n" "A_REAL/28_8;G.728;;Real Audio 2 (28.8);http://www.real.com\n" "A_REAL/COOK;Cooker;;Real Audio Cook Codec (codename: Gecko);http://www.real.com\n" "A_REAL/SIPR;G.729;;Real & Sipro Voice Codec;http://www.real.com\n" "A_REAL/RALF;RealAudio Lossless;;Real Audio Lossless Format;http://www.real.com\n" "A_REAL/ATRC;Atrac;;Real & Sony Atrac3 Codec;http://www.real.com\n" "A_TRUEHD;TrueHD;;;http://www.dolby.com/consumer/technology/trueHD.html\n" "A_MLP;MLP;;Meridian Lossless Packing;http://www.meridian-audio.com\n" "A_AAC;AAC;;\n" "A_AAC/MPEG2/MAIN;AAC;;\n" "A_AAC/MPEG2/LC;AAC;;\n" "A_AAC/MPEG2/LC/SBR;AAC;;\n" "A_AAC/MPEG2/SSR;AAC;;\n" "A_AAC/MPEG4/MAIN;AAC;;\n" "A_AAC/MPEG4/LC;AAC;;\n" "A_AAC/MPEG4/LC/SBR;AAC;;\n" "A_AAC/MPEG4/LC/SBR/PS;AAC;;\n" "A_AAC/MPEG4/SSR;AAC\n" "A_AAC/MPEG4/LTP;AAC\n" "A_ALAC;ALAC;;Apple Lossless Audio Codec;http://www.apple.com/quicktime/download/standalone.html\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Audio_Mpeg4 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( ".mp3;MPEG Audio;;;\n" "A104;AMR;;;http://www.apple.com/quicktime/download/standalone.html;Wide band\n" "aac ;AAC;;\n" "ac-3;AC-3;;;\n" "alac;ALAC;;Apple Lossless Audio Codec;http://www.apple.com/quicktime/download/standalone.html\n" "alaw;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "dtsc;DTS;;Digital Theater Systems;http://www.dts.com\n" "dtsh;DTS;HRA;Digital Theater Systems High Res;http://www.dts.com\n" "dtsl;DTS;MA;Digital Theater Systems Master Audio;http://www.dts.com\n" "dtse;DTS;Express;;Digital Theater Systems Low Bitrate;http://www.dts.com\n" "dvca;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "ec-3;E-AC-3;;;\n" "enca;(Encrypted);;;\n" "fl32;PCM ; ;;http://www.apple.com/quicktime/download/standalone.html\n" "fl64;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "ima4;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "in24;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "in32;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "lpcm;PCM;;;\n" "MAC3;MACE 3;;;\n" "MAC6;MACE 6;;;\n" "nmos;Nellymoser;;;http://www.nellymoser.com/\n" "NONE;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "owma;WMA Pro;;Smooth Streaming Media Audio;http://alexzambelli.com/blog/2009/02/10/smooth-streaming-architecture/\n" "Qclp;QCELP;;Qualcomm PureVoice;\n" "QDM1;QDesign 1;;QDesign Music 1;http://www.apple.com/quicktime/download/standalone.html\n" "QDM2;Qdesign 2;;QDesign Music 2;http://www.apple.com/quicktime/download/standalone.html\n" "QDMC;Qdesign 2;(Old);QDesign Music 2 (old version, rare);http://www.apple.com/quicktime/download/standalone.html\n" "raw ;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "sac3;AC-3;;Made by Nero;http://www.nerodigital.com\n" "samr;AMR;;;http://www.apple.com/quicktime/download/standalone.html;Narrow band\n" "sawb;AMR;;;http://www.apple.com/quicktime/download/standalone.html;Wide band\n" "sevc;EVRC;;;http://www.apple.com/quicktime/download/standalone.html\n" "sowt;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "twos;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "ulaw;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "vdva;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "WMA2;WMA;;Windows Media Audio;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;Version 2\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Audio_Real (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "14.4;VSELP;;Real Player 1;http://www.real.com\n" "14_4;VSELP;;Real Player 1;http://www.real.com\n" "28.8;G.728;;Real Player 2;http://www.real.com\n" "28_8;G.728;;Real Player 2;http://www.real.com\n" "atrc;Atrac;;Real Player 8;http://www.real.com\n" "audio/X-MP3-draft-00;MPEG Audio;;\n" "audio/x-ralf-mpeg4;RealAudio Lossless;;Real Audio Lossless Format, Real Player 10;http://www.real.com;;;;;;Lossless\n" "audio/x-ralf-mpeg4-generic;RealAudio Lossless;;Real Audio Lossless Format, Real Player 10;http://www.real.com;;;;;;Lossless\n" "cook;Cooker;;Based on G.722.1, Real Player 6;http://www.real.com\n" "dnet;AC-3;;Real Player 3;http://www.real.com\n" "lpcJ;VSELP;;Real Player 1;http://www.real.com\n" "raac;AAC;;Real Player 9;http://www.real.com;LC\n" "racp;AAC;;Real Player 10;http://www.real.com;HE-AAC\n" "rtrc;RealAudio 8;;;http://www.real.com\n" "sipr;ACELP;;Real Player 4;http://www.real.com\n" "whrl;RealAudio Multi-Channel;;Real Audio Multi-Channel;http://www.real.com\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Audio_Riff (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "0;;;;\n" "1;PCM;;;http://www.microsoft.com/windows/\n" "2;ADPCM;;;http://www.microsoft.com/windows/\n" "3;PCM;IEEE ;;http://www.microsoft.com/windows/;Float\n" "4;VSELP;Compaq;;\n" "5;CVSD;IBM;;\n" "6;ADPCM;CCITT;;http://www.microsoft.com/windows/;A-Law\n" "7;ADPCM;CCITT;;http://www.microsoft.com/windows/;U-Law\n" "8;DTS;;Digital Theater Systems;\n" "9;DRM;Microsoft;;\n" "A;WMA;;Windows Media Audio;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;Voice\n" "C;MPEG Audio;;;;MPEG-2 5.1\n" "10;ADPCM;OKI;;\n" "11;ADPCM;Intel;;\n" "12;ADPCM;Mediaspace;;\n" "13;ADPCM;Sierra;;\n" "14;ADPCM;Antex;G.723\n" "15;STD;DSP solutions;\n" "16;FIX;DSP solutions;\n" "17;ADPCM;Dialogic-OKI;;http://www.microsoft.com/windows/\n" "18;ADPCM;;\n" "19;CU;HP;\n" "1A;Dynamic Voice;HP;\n" "20;ADPCM;Yamaha;\n" "21;SONARC;Speech Compression;\n" "22;Truespeech;DSP Group;;http://www.microsoft.com/windows/\n" "23;SC1;Echo Speech;\n" "24;AudioFile 36;Virtual Music ;\n" "25;APTX;;Audio Processing Technology X\n" "26;AudioFile 10;Virtual Music;\n" "27;Prosody 1612;Aculab plc;\n" "28;LRC;Merging Technologies;\n" "30;AC-2;Dolby Laboratories;\n" "31;GSM 6.10;Microsoft;;http://www.microsoft.com/windows/\n" "32;Microsoft Audio;;\n" "33;ADPCM;Antex;\n" "34;VQLPC;Control Resources;\n" "35;REAL;DSP Solutions;\n" "36;ADPCM;DSP Solutions;\n" "37;CR10;;Control Resources 10\n" "38;ADPCM;Natural MicroSystems VBX;\n" "39;ADPCM;Crystal Semiconductor IMA;\n" "3A;SC3;Echo Speech;\n" "3B;ADPCM;Rockwell;\n" "3C;DigiTalk;Rockwell DigiTalk;\n" "3D;Xebec;;Xebec Multimedia Solutions\n" "40;ADPCM;Antex Electronics;G.721\n" "41;CELP;Antex Electronics;G.728\n" "42;G.723.1;Microsoft;;http://www.microsoft.com/windows/;\n" "42;ADPCM;;IBM;;\n" "42;G.729;Microsoft;;;\n" "45;ADPCM;Microsoft;G.726;http://www.microsoft.com/windows/;\n" "50;MPEG Audio;;;http://www.iis.fraunhofer.de/amm/index.html;;Version 1\n" "51;MPEG Audio;;;http://www.iis.fraunhofer.de/amm/index.html;;Version 2\n" "52;RT24;InSoft, Inc.;;;\n" "53;PAC;InSoft, Inc.;;;\n" "55;MPEG Audio;MP3;;http://www.iis.fraunhofer.de/amm/index.html;\n" "59;G.723;Lucent;G.723;;\n" "60;Cirrus;;Cirrus Logic;;\n" "61;PCM;ESS Technology;;;\n" "62;Voxware;;;;\n" "63;Atrac;Canopus;;;\n" "64;ADPCM;APICOM;G.726;;\n" "65;ADPCM;APICOM;G.722;;\n" "66;DSAT;Microsoft;\n" "67;DSAT Display;Microsoft;\n" "69;BYTE_ALIGNED;Voxware;;http://www.voxware.com/\n" "70;AC8;Voxware;;http://www.voxware.com/\n" "71;AC10;Voxware;;http://www.voxware.com/\n" "72;AC16;Voxware;;http://www.voxware.com/\n" "73;AC20;Voxware;;http://www.voxware.com/\n" "74;RT24;Voxware;MetaVoice;http://www.voxware.com/\n" "75;RT29;Voxware;MetaSound;http://www.voxware.com/\n" "76;RT29HW;Voxware;;http://www.voxware.com/\n" "77;VR12;Voxware;;http://www.voxware.com/\n" "78;VR18;Voxware;;http://www.voxware.com/\n" "79;TQ40;Voxware;;http://www.voxware.com/\n" "7A;SC3;Voxware;\n" "7B;SC3;Voxware;\n" "80;Softsound;;\n" "81;TQ60;Voxware;;http://www.voxware.com/\n" "82;MSRT24;Microsoft;\n" "83;G.729a;AT&T;\n" "84;MVI_MVI2;Motion Pixels;\n" "85;ADPCM;DataFusion Systems;G.726\n" "86;GSM 6.10;DataFusion Systems;\n" "88;ISI AUDIO;;Iterated Systems AUDIO\n" "89;Onlive;;OnLive! Technologies\n" "8A;SX20;Multitude;\n" "8B;ADPCM;Infocom ITS A/S;\n" "8C;G.729;Convedia Corporation;\n" "91;SBC24;;Siemens Business Communications Sys 24\n" "92;AC-3;Sonic Foundry;\n" "93;G.723;MediaSonic;\n" "94;Prosody 8KBPS;Aculab plc;\n" "97;ADPCM;ZyXEL Communications;\n" "98;LPCBB;Philips Speech Processing;;\n" "99;Packed;;Studer Professional Audio AG Packed;\n" "A0;PHONYTALK;Malden Electronics;;\n" "A1;GSM;Racal Recorders;;\n" "A2;G.720a;Racal Recorders;;\n" "A3;G.723.1;Racal Recorders;;\n" "A4;ACELP;Racal Recorders;;\n" "B0;AAC;NEC Corporation;;\n" "FF;AAC;;;\n" "100;ADPCM;;;\n" "101;IRAT;BeCubed;;\n" "102;ADPCM;IBM;;;A-law\n" "103;ADPCM;IBM AVC;;\n" "111;G.723;Vivo;;\n" "112;SIREN;Vivo;;\n" "120;CELP;Philips Speech Processing;;\n" "121;Grundig;Philips Speech Processing;;\n" "123;G.723;Digital Equipment Corporation;;\n" "125;ADPCM;;;\n" "130;ACELP;Sipro;;http://dividix.host.sk;.net\n" "131;ACELP;Sipro;;;4800\n" "132;ACELP;Sipro;;;8V3\n" "133;G.729;Sipro;;\n" "134;G.729a;Sipro;;\n" "135;KELVIN;Sipro;;\n" "135;AMR;VoiceAge Corporation;;\n" "140;ADPCM;Dictaphone Corporation;G.726;\n" "140;CELP68;Dictaphone Corporation;;\n" "140;CELP54;Dictaphone Corporation;;\n" "150;PureVoice;Qualcomm;;\n" "151;HalfRate;Qualcomm;;\n" "155;TUBGSM;Ring Zero Systems;;\n" "160;WMA;;Windows Media Audio;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;Version 1\n" "161;WMA;;Windows Media Audio;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;;Version 2\n" "162;WMA;;Windows Media Audio;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;Pro\n" "163;WMA;;Windows Media Audio;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx;Lossless\n" "170;ADPCM;Unisys Nap;;;\n" "171;ADPCM;Unisys Nap;;;U-law\n" "172;ADPCM;Unisys Nap;;;A-law\n" "173;16K;Unisys Nap;;;\n" "174;G.700;SyCom Technologies;;;\n" "175;ADPCM;SyCom Technologies;;;\n" "176;CELP54;SyCom Technologies;;;\n" "177;CELP68;SyCom Technologies;;;\n" "178;ADPCM;Knowledge Adventure, Inc.;;;\n" "180;AAC;Fraunhofer IIS;;;\n" "190;DTS;;Digital Theater Systems;;\n" "19D;FLAC;;\n" "200;ADPCM;Creative Labs;;;\n" "202;Fast Speech 8;Creative Labs\n" "203;Fast Speech 10;Creative Labs\n" "210;ADPCM;UHER informatic GmbH\n" "215;ACM;Ulead\n" "216;ACM;Ulead\n" "220;QuaterDeck;\n" "230;VC;;I-link VC\n" "240;RAW_SPORT;;Aureal\n" "241;AC-3;ESST\n" "250;HSX;Interactive Products, Inc.\n" "251;RPELP;Interactive Products, Inc.\n" "260;CS2;Consistent Software\n" "270;Atrac3;Sony\n" "271;SCY;Sony\n" "272;Atrac3;Sony\n" "273;SPC;Sony\n" "280;Telum;;\n" "281;TelumIA;;\n" "285;ADPCM;Norcom Voice Systems;\n" "300;FM_TOWNS_SND;Fujitsu;\n" "350;Dev;Micronas Semiconductors, Inc.;\n" "351;CELP833;Micronas Semiconductors, Inc.;\n" "400;DIGITAL;Brooktree;\n" "401;Music Coder;Intel;;http://www.intel.com/\n" "402;IAC2;Ligos;;http://www.ligos.com\n" "450;Qdesign;;QDesign Music\n" "500;VP7;;On2\n" "501;VP6;;On2\n" "680;VM;;AT&T VME_VMPCM\n" "681;TPC;;AT&T TPC\n" "700;YMPEG;;YMPEG Alpha\n" "8AE;LiteWave;;ClearJump LiteWave\n" "AAC;AAC;;;\n" "1000;GSM;Ing C. Olivetti & C., S.p.A.;;\n" "1001;ADPCM;Ing C. Olivetti & C., S.p.A.;;\n" "1002;CELP;Ing C. Olivetti & C., S.p.A.;;\n" "1003;SBC;Ing C. Olivetti & C., S.p.A.;;\n" "1004;OPR;Ing C. Olivetti & C., S.p.A.;;\n" "1100;LH_CODEC;Lernout & Hauspie; Codec;\n" "1101;CELP;Lernout & Hauspie;;http://www.microsoft.com/windows/;4.8 kb/s\n" "1102;SBC;Lernout & Hauspie;;http://www.microsoft.com/windows/;8 kb/s\n" "1103;SBC;Lernout & Hauspie;;http://www.microsoft.com/windows/;12 kb/s\n" "1104;SBC;Lernout & Hauspie;;http://www.microsoft.com/windows/;16 kb/s\n" "1400;Norris;;Norris Communications, Inc.;\n" "1401;ISIAudio;;;\n" "1500;MUSICOMPRESS;;Soundspace Music Compression;\n" "181C;RT24;VoxWare;;\n" "181E;AX24000P;Lucent elemedia;;\n" "1971;SonicFoundry;;Lossless\n" "1C03;ADPCM;Lucent;G.723\n" "1C07;SX8300P;Lucent\n" "1C0C;ADPCM;Lucent;G.723\n" "1F03;DigiTalk;;CUseeMe (ex-Rocwell)\n" "1FC4;ALF2CD;NCT Soft\n" "2000;AC-3;\n" "2001;DTS;;Digital Theater Systems\n" "2002;VSELP;;RealAudio 1/2 14.4\n" "2003;VSELP;;RealAudio 1/2 28.8\n" "2004;Cooker;;RealAudio G2/8 Cook (low bitrate)\n" "2005;DNET;;RealAudio 3/4/5 Music (DNET)\n" "2006;AAC;;RealAudio 10 AAC (RAAC)\n" "2007;AAC;;RealAudio 10 AAC+ (RACP)\n" "2048;Sonic;\n" "3313;AviSynth;;makeAVIS (fake AVI sound from AviSynth scripts)\n" "4143;AAC;;Divio MPEG-4 AAC audio;;\n" "4201;Nokia;;;;\n" "4243;ADPCM;;G.726;;\n" "43AC;Speex;;;;\n" "564C;Vorbis;;;;\n" "566F;Vorbis;;;http://www.vorbis.com;\n" "5756;WavPack;;;http://www.wavpack.com/;\n" "674F;Vorbis;;;http://www.vorbis.com;;Mode 1\n" "6750;Vorbis;;;http://www.vorbis.com;;Mode 2\n" "6751;Vorbis;;;http://www.vorbis.com;;Mode 3\n" "676F;Vorbis;;;http://www.vorbis.com;;Mode 1+\n" "6770;Vorbis;;;http://www.vorbis.com;;Mode 2+\n" "6771;Vorbis;;;http://www.vorbis.com;;Mode 3+\n" "8180;AAC\n" "7A21;AMR;;GSM-AMR (CBR, no SID);http://www.microsoft.com;\n" "7A22;AMR;;GSM-AMR (VBR, including SID);http://www.microsoft.com;\n" "A100;G.723.1;;;;\n" "A101;AVQSBC;;\n" "A102;ODSBC;;\n" "A103;G729A;;\n" "A104;AMR;;\n" "A105;ADPCM;;G.726\n" "A106;AAC;;\n" "A107;ADPCM;;G.726\n" "A109;Speex;;;http://www.speex.org/\n" "DFAC;FrameServer;;DebugMode SonicFoundry Vegas FrameServer ACM Codec\n" "F1AC;FLAC;;Free Lossless Audio Codec\n" "FFFE;Extensible;;\n" "FFFF;In Development;;\n" "E923AABF-CB58-4471-A119-FFFA01E4CE62;Atrac3;;\n" "47E142D2-36BA-4D8D-88FC-61654F8C836C;Atrac9;;\n" "AD98D184-AAC3-11D0-A41C-00A0C9223196;VC;;\n" "05589F81-C356-11CE-BF01-00AA0055595A;WaveFormatEx;;\n" "518590A2-A184-11D0-8522-00C04FD9BAF3;DSound;;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Text_Matroska (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "S_ASS;ASS;;Advanced Sub Station Alpha\n" "S_DVBSUB;DVB Subtitle;;Picture based subtitle format used on DVBs\n" "S_KATE;KATE;;Karaoke And Text Encapsulation\n" "S_IMAGE/BMP;Bitmap;;Basic image based subtitle format\n" "S_SSA;SSA;;Sub Station Alpha\n" "S_TEXT/ASS;ASS;;Advanced Sub Station Alpha\n" "S_TEXT/SSA;SSA;;Sub Station Alpha\n" "S_TEXT/USF;USF;;Universal Subtitle Format\n" "S_TEXT/UTF8;UTF-8;;UTF-8 Plain Text\n" "S_USF;USF;;Universal Subtitle Format\n" "S_UTF8;UTF-8;;UTF-8 Plain Text\n" "S_VOBSUB;VobSub;;Picture based subtitle format used on DVDs\n" "S_HDMV/PGS;PGS;;Picture based subtitle format used on BDs/HD-DVDs\n" "S_HDMV/TEXTST;TEXTST;;Text based subtitle format used on BDs\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Text_Mpeg4 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "c608;EIA-608\n" "c708;EIA-708\n" "subp;VobSub;;The same subtitle format used on DVDs\n" "text;Apple text;;;http://www.apple.com/quicktime/download/standalone.html\n" "sbtl;Apple text;(iPhone);;http://www.apple.com/quicktime/download/standalone.html\n" "dfxp;TTML\n" "tx3g;Timed text;;;http://www.apple.com/quicktime/download/standalone.html\n" "enct;(Encrypted);;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Text_Riff (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "DXSB;DivX Subtitle;;Subtitle in AVI from DivX networks;http://www.divx.com\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_CodecID_Other_Mpeg4 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "rtp ;RTP\n" "Ovbi;Omneon VBI\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Codec (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( " BIT;RGB;4CC;V;RGB;;Uncompressed\n" " JPG;JPEG;4CC;V;JPEG;;\n" " PNG;PNG;4CC;V;RGB;;\n" " RAW;RGB;4CC;V;RGB;;Uncompressed;http://www.fourcc.org/indexrgb.htm\n" " RGB;RGB;4CC;V;RGB;;Uncompressed. Basic Windows bitmap format. 1, 4 and 8 bpp versions are palettised. 16, 24 and 32bpp contain Uncompressed RGB samples.;http://www.fourcc.org/indexrgb.htm\n" " RL4;RGB;4CC;V;RGB;;RLE 4bpp;http://www.fourcc.org/indexrgb.htm\n" " RL8;RGB;4CC;V;RGB;;RLE 8bpp;http://www.fourcc.org/indexrgb.htm\n" "1978;RGB;4CC;V;JPEG;;A.M.Paredes predictor;http://www.pegasusimaging.com/cgi-bin/download2.cgi?LVIDB\n" "2VUY;YUV;4CC;V;YUV;;Optibase VideoPump 8-bit 4:2:2 Component YCbCr\n" "3IV0;3ivX;4CC;V;MPEG-4V;;3ivX pre-1.0;http://www.3ivx.com/download/\n" "3IV1;3ivX;4CC;V;MPEG-4V;;3ivX 1.0-3.5;http://www.3ivx.com/download/\n" "3IV2;3ivX;4CC;V;MPEG-4V;;3ivX 4.0;http://www.3ivx.com/download/\n" "3IVD;3ivX;4CC;V;MPEG-4V;;;http://ffdshow-tryout.sourceforge.net/\n" "3IVX;3ivX;4CC;V;MPEG-4V;;;http://www.3ivx.com/download/\n" "3VID;3ivX;4CC;V;MPEG-4V;;;http://www.3ivx.com/download/\n" "8BPS;QuickTime 8bps;4CC;V;RGB;;Apple QuickTime Planar RGB with Alpha-channel;http://ffdshow-tryout.sourceforge.net/\n" "AAS4;Autodesk;4CC;V;RGB;;Autodesk Animator Studio RLE (warning: this is a discoutinued product);http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe\n" "AASC;Autodesk;4CC;V;RGB;;Autodesk Animator Studio RLE (warning: this is a discoutinued product);http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe\n" "ABYR;Kensigton low;4CC;V;;;Kensington (low resolution, low frame rate (6fps) for digital cameras)\n" "ACTL;ACT-L2;4CC;V;;;Streambox ACT-L2;http://www.streambox.com/products/act-L2_codec.htm\n" "ADV1;WaveCodec;4CC;V;Wavelet;;Loronix WaveCodec;http://www.loronix.com/products/video_clips/wavecodec.asp\n" "ADVJ;Avid;4CC;V;JPEG;;Avid JPEG. Aka AVRn\n" "AEIK;Indeo 3.2;4CC;V;;;Intel Indeo Video 3.2 (Vector Quantization)\n" "AEMI;VideoONE;4CC;V;MPEG-V;;Array VideoONE MPEG-1-I Capture. Array's used for I frame only MPEG-1 AVI files;http://www.array.com\n" "AFLC;Autodesk;4CC;V;;;Autodesk Animator Studio FLI (256 color) (warning: this is a discoutinued product);http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe\n" "AFLI;Autodesk;4CC;V;;;Autodesk Animator Studio FLI (256 color) (warning: this is a discoutinued product);http://mirror01.iptelecom.net.ua/~video/codecs/Autodesk.Animator.v1.11.Codec.exe\n" "AHDV;CineForm;4CC;V;Wavelet;;CineForm 10-bit Visually Perfect HD (Wavelet);http://www.cineform.com/products/ConnectHD.htm\n" "AJPG;JPEG;4CC;V;JPEG;;22fps JPEG-based for digital cameras\n" "ALPH;Ziracom;4CC;V;;;Ziracom Digital Communications Inc.\n" "AMPG;VideoONE;4CC;V;MPEG-1;;Array VideoONE MPEG;http://www.array.com\n" "AMR ;AMR;4CC;V;;;Speech codec\n" "ANIM;RDX;4CC;V;;;Intel RDX\n" "AP41;AngelPotion;4CC;V;MPEG-4V;;AngelPotion Definitive 1 (hack of MS MPEG-4 v3);http://www.divxity.com/download/ap4v1-702.exe\n" "AP42;AngelPotion;4CC;V;MPEG-4V;;AngelPotion Definitive 2 (hack of MS MPEG-4 v3);http://www.divxity.com/download/ap4v1-702.exe\n" "ASLC;AlparySoft Lossless;4CC;V;;;AlparySoft Lossless;http://www.free-codecs.com/download/Alparysoft_Lossless_Video_Codec.htm\n" "ASV1;Asus 1;4CC;V;;;Asus Video 1;ftp://ftp.asuscom.de/pub/asuscom/treiber/vga/ASUS_VGA_TOOLS/asv2dec.zip\n" "ASV2;Asus 2;4CC;V;;;Asus Video 2;ftp://ftp.asuscom.de/pub/asuscom/treiber/vga/ASUS_VGA_TOOLS/asv2dec.zip\n" "ASVX;Asus X;4CC;V;;;Asus Video X;ftp://ftp.asuscom.de/pub/asuscom/treiber/vga/ASUS_VGA_TOOLS/asv2dec.zip\n" "ATM4;Nero MPEG-4;4CC;V;MPEG-4V;;Ahead Nero Digital MPEG-4;http://www.nero.com\n" "AUR2;YUV;4CC;V;YUV;;Auravision Aura 2 - YUV 422\n" "AURA;YUV;4CC;V;YUV;;Auravision Aura 1 - YUV 411\n" "AUVX;AUVX;4CC;V;;;USH GmbH\n" "AV1X;Avid 1:1;4CC;V;;;Avid 1:1x (Quick Time);http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVC1;AVC;4CC;V;AVC;;Advanced Video Codec;http://ffdshow-tryout.sourceforge.net/\n" "AVD1;Avid DV;4CC;V;DV;;Avid DV (Quick Time);http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVDJ;Avid JFIF;4CC;V;JPEG;;Avid Meridien JFIF with Alpha-channel;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVDN;Avid HD;4CC;V;;;Avid DNxHD (Quick Time);http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVDV;Avid DV;4CC;V;DV;;Avid DV;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVI1;MainConcept;4CC;V;JPEG;;MainConcept JPEG\n" "AVI2;MainConcept;4CC;V;JPEG;;MainConcept JPEG\n" "AVID;Avid JPEG;4CC;V;JPEG;;Avid JPEG;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVIS;AviSynth;4CC;V;;;Wrapper for AviSynth (Dummy);http://ffdshow-tryout.sourceforge.net/\n" "AVMP;Avid IMX;4CC;V;;;Avid IMX (Quick Time);http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVR ;Avid NuVista;4CC;V;JPEG;;Avid ABVB/NuVista JPEG with Alpha-channel\n" "AVRn;Avid JPEG;4CC;V;JPEG;;Avid JPEG;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVRN;Avid JPEG;4CC;V;JPEG;;Avid JPEG;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVUI;Avid;4CC;V;;;Avid Meridien Uncompressed with Alpha-channel;http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AVUP;Avid;4CC;V;;;Avid 10bit Packed (Quick Time);http://mirror01.iptelecom.net.ua/~video/codecs/Avid.VfW.codec.v2.0d2.exe\n" "AYUV;YUV;4CC;V;YUV;;4:4:4 YUV (AYUV)\n" "AZPR;QuickTime;4CC;V;;;Quicktime Apple Video;http://www.apple.com/quicktime/download/standalone.html\n" "AZRP;QuickTime;4CC;V;;;Quicktime Apple Video;http://www.apple.com/quicktime/download/standalone.html\n" "BGR ;RGB;4CC;V;RGB;;Uncompressed RGB32\n" "BHIV;BeHere iVideo;4CC;V;;;BeHere iVideo\n" "BINK;Bink;4CC;V;;;RAD Game Tools Bink Video\n" "BIT ;RGB;4CC;V;RGB;;Uncompressed. BI_BITFIELDS\n" "BITM;H.261;4CC;V;;;Microsoft H.261\n" "BLOX;Blox;4CC;V;;;Jan Jezabek BLOX MPEG;http://www.ii.uj.edu.pl/~jezabek/blox/blox-0.1.0b.zip\n" "BLZ0;DivX;4CC;V;MPEG-4V;;DivX for Blizzard Decoder Filter;http://ffdshow-tryout.sourceforge.net/\n" "BT20;MediaStream;4CC;V;;;Conexant ProSummer MediaStream\n" "BTCV;Composite;4CC;V;;;Conexant Composite Video\n" "BTVC;Composite;4CC;V;;;Conexant Composite Video\n" "BW00;BergWave;4CC;V;Wavelet;;BergWave (Wavelet)\n" "BW10;Broadway;4CC;V;MPEG-1;;Data Translation Broadway MPEG Capture/Compression\n" "BXBG;Boxx RGB;4CC;V;;;BOXX BGR\n" "BXRG;Boxx RGB;4CC;V;;;BOXX RGB\n" "BXY2;Boxx YUV;4CC;V;;;BOXX 10-bit YUV\n" "BXYV;Boxx YUV;4CC;V;;;BOXX YUV\n" "CC12;Intel YUV;4CC;V;YUV;;Intel YUV12\n" "CDV5;Canopus DV;4CC;V;DV;;Canopus SD50/DVHD;http://www.cineform.com/products/ConnectHD.htm\n" "CDVC;Canopus DV;4CC;V;DV;;Canopus DV (DV);http://www.cineform.com/products/ConnectHD.htm\n" "CDVH;Canopus DV;4CC;V;DV;;Canopus SD50/DVHD;http://www.cineform.com/products/ConnectHD.htm\n" "CFCC;Perception;4CC;V;;;DPS Perception JPEG (dummy format - only AVI header)\n" "CFHD;CineForm;4CC;V;;;CineForm 10-bit Visually Perfect HD (Wavelet)\n" "CGDI;Camcorder;4CC;V;;;Camcorder Video (MS Office 97)\n" "CHAM;Champagne;4CC;V;;;Winnov Caviara Champagne\n" "CJPG;Creative JPEG;4CC;V;JPEG;;Creative Video Blaster Webcam Go JPEG\n" "CLJR;YUV;4CC;V;YUV;;Cirrus Logic YUV 4:1:1;http://www.fourcc.org/indexyuv.htm\n" "CLLC;Canopus;4CC;V;;;Canopus LossLess\n" "CLPL;YUV;4CC;V;YUV;;Format similar to YV12 but including a level of indirection.\n" "CM10;MediaShow;4CC;V;;;CyberLink Corporation;http://www.cyberlink.com\n" "CMYK;CMYK;4CC;V;;;Common Data Format in Printing\n" "COL0;MS MPEG-4 v3;4CC;V;MPEG-4V;;Hacked MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/\n" "COL1;MS MPEG-4 v3;4CC;V;MPEG-4V;;Hacked MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/\n" "CPLA;YUV;4CC;V;YUV;;Weitek YUV 4:2:0 Planar\n" "CRAM;MS Video;4CC;V;;;Microsoft Video 1\n" "CSCD;CamStudio;4CC;V;;;RenderSoft CamStudio lossless (LZO & GZIP compression)\n" "CT10;TalkingShow;4CC;V;;;CyberLink Corporation;http://www.cyberlink.com\n" "CTRX;Citrix;4CC;V;;;Citrix Scalable Video\n" "CUVC;Canopus HQ;4CC;V;;;Canopus HQ\n" "CVID;Cinepak;4CC;V;;;Cinepak by CTi (ex. Radius) Vector Quantization;http://www.cinepak.com/text.html\n" "cvid;Cinepak;4CC;V;;;Cinepak by CTi (ex. Radius) Vector Quantization;http://www.apple.com/quicktime/download/standalone.html\n" "CWLT;WLT;4CC;V;;;Microsoft Color WLT DIB\n" "CYUV;YUV;4CC;V;YUV;;Creative Labs YUV 4:2:2;http://www.fourcc.org/indexyuv.htm\n" "CYUY;YUV;4CC;V;YUV;;ATI Technologies YUV;http://www.fourcc.org/indexyuv.htm\n" "D261;H.261;4CC;V;;;DEC H.261\n" "D263;H.263;4CC;V;;;DEC H.263\n" "DAVC;AVC;4CC;V;AVC;;Dicas MPEGable H.264/MPEG-4 AVC base profile\n" "DC25;MainConcept DV;4CC;V;DV;;MainConcept ProDV\n" "DCAP;Pinnacle DV25;4CC;V;DV;;Pinnacle DV25\n" "DCL1;Data Connextion;4CC;V;;;Data Connection Conferencing\n" "DCT0;WniWni;4CC;V;;;WniWni\n" "DFSC;VFW;4CC;V;;;DebugMode FrameServer VFW\n" "DIB ;RGB;4CC;V;RGB;;Device Independent Bitmap\n" "DIV1;FFMpeg;4CC;V;MPEG-4V;;FFmpeg-4 V1 (hacked MS MPEG-4 V1);http://ffdshow-tryout.sourceforge.net/\n" "DIV2;MS MPEG-4 1/2;4CC;V;MPEG-4V;;;http://ffdshow-tryout.sourceforge.net/\n" "DIV3;DivX 3 Low;4CC;V;MPEG-4V;;;http://www.divx.com\n" "DIV4;DivX 3 Fast;4CC;V;MPEG-4V;;;http://www.divx.com\n" "DIV5;DivX 5;4CC;V;MPEG-4V;;;http://www.divx.com\n" "DIV6;MS MPEG-4 v3;4CC;V;MPEG-4V;;MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/\n" "DIVX;DivX 4;4CC;V;MPEG-4V;;Project Mayo DivX 4;http://www.divx.com\n" "divx;DivX;4CC;V;MPEG-4V;;Mainly used by Google;http://www.divx.com\n" "DJPG;Broadway 101;4CC;V;JPEG;;Data Translation, Inc.\n" "DM4V;Dicas;4CC;V;MPEG-4V;;Dicas MPEGable MPEG-4\n" "DMB1;Rainbow;4CC;V;JPEG;;Matrox Rainbow Runner hardware compression;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.MJPG.v2.10.27.codec.exe\n" "DMB2;Paradigm JPEG;4CC;V;JPEG;;JPEG used by Paradigm\n" "DMK2;V36 PDA;4CC;V;;;ViewSonic V36 PDA Video\n" "DP02;DynaPel;4CC;V;MPEG-4V;;DynaPel MPEG-4\n" "DP16;YUV411;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 6-bit compression)\n" "DP18;YUV411;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 8-bit compression)\n" "DP26;YUV422;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 6-bit compression)\n" "DP28;YUV422;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 8-bit compression)\n" "DP96;YVU9;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 6-bit compression)\n" "DP98;YVU9;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 8-bit compression)\n" "DP9L;YVU9;4CC;V;YUV;;Matsushita Electric Industrial Co., Ltd. (With DPCM 6-bit compression)\n" "DPS0;DPS Reality;4CC;V;JPEG;;DPS Reality JPEG (dummy format - only AVI header)\n" "DPSC;DPS PAR;4CC;V;JPEG;;DPS PAR JPEG (dummy format - only AVI header)\n" "DRWX;Pinnacle DV25;4CC;V;DV;;Pinnacle DV25\n" "DSVD;DV;4CC;V;DV;;Microsoft DirectShow DV\n" "DTMT;Media-100;4CC;V;;;Media-100\n" "DTNT;Media-100;4CC;V;;;Media-100\n" "DUCK;TrueMotion S;4CC;V;;;Duck Corporation True Motion S\n" "DV10;BlueFish;4CC;V;;;BlueFish444 (lossless RGBA, YUV 10-bit)\n" "DV25;DVCPro;4CC;V;DV;;Matrox DVCPRO\n" "DV50;DVCPro5;4CC;V;DV;;Matrox\n" "DVAN;Pinnacle DV300;4CC;V;DV;;Pinnacle miroVideo DV300 SW only\n" "DVC ;Apple DV NTSC;4CC;V;DV;;Apple QuickTime DV (DVCPRO NTSC);http://www.apple.com/quicktime/download/standalone.html\n" "dvc ;Apple DV NTSC;4CC;V;DV;;Apple QuickTime DV (DVCPRO NTSC);http://www.apple.com/quicktime/download/standalone.html\n" "DVCP;Apple DV PAL;4CC;V;DV;;Apple QuickTime DV (DVCPRO PAL);http://www.apple.com/quicktime/download/standalone.html\n" "dvcp;Apple DV PAL;4CC;V;DV;;Apple QuickTime DV (DVCPRO PAL);http://www.apple.com/quicktime/download/standalone.html\n" "DVCS;MainConcept DV;4CC;V;DV;;MainConcept DV\n" "DVE2;Insoft DVE-2;4CC;V;DV;;InSoft DVE-2 Videoconferencing\n" "DVH1;Pinnacle DV;4CC;V;DV;;Pinnacle DVHD100\n" "dvhd;DV HD;4CC;V;DV;;DV 1125 lines at 30.00 Hz or 1250 lines at 25.00 Hz\n" "dvhd;DV HD;4CC;A;DV;;Sony DV (DV), audio part\n" "DVIS;DualMoon DV;4CC;V;DV;;VSYNC DualMoon Iris DV\n" "DVL ;Radius DV NTSC;4CC;V;DV;;Radius SoftDV 16:9 NTSC\n" "DVLP;Radius DV PAL;4CC;V;DV;;Radius SoftDV 16:9 PAL\n" "DVMA;Darim DV;4CC;V;DV;;Darim Vision DVMPEG (dummy for MPEG compressor)\n" "DVNM;DVNM;4CC;V;;;Matsushita Electric Industrial Co., Ltd.\n" "DVOR;BlueFish;4CC;V;;;BlueFish444 (lossless RGBA, YUV 10-bit)\n" "DVPN;Apple DV NTSC;4CC;V;DV;;Apple QuickTime DV (DV NTSC)\n" "DVPP;Apple DV PAL;4CC;V;DV;;Apple QuickTime DV (DV PAL)\n" "DVR ;MPEG-2 Video;4CC;V;MPEG-2;;MPEG-2 Video in a ASF container\n" "DVR1;Targa2000;4CC;V;;;TARGA2000\n" "DVRS;DualMoon DV;4CC;V;DV;;VSYNC DualMoon Iris DV\n" "DVSD;DV;4CC;V;DV;;IEC 61834 and SMPTE 314M\n" "dvsd;Sony DV;4CC;V;DV;;Sony DV (DV) 525 lines at 29.97 Hz or 625 lines at 25.00 Hz\n" "dvsd;Sony DV;4CC;A;DV;;Sony DV (DV), audio part\n" "dvsl;Sony DV;4CC;V;DV;;Sony DV (DV) 525 lines at 29.97 Hz or 625 lines at 25.00 Hz\n" "dvsl;Sony DV;4CC;A;DV;;Sony DV (DV), audio part\n" "DVSL;DSL DV;4CC;V;DV;;DV compressed in SD (SDL)\n" "DVX1;DVX 1 SP;4CC;V;;;Lucent DVX1000SP Video Decoder\n" "DVX2;DVX 2 S;4CC;V;;;Lucent DVX2000S Video Decoder\n" "DVX3;DVX 3 S;4CC;V;;;Lucent DVX3000S Video Decoder\n" "DX50;DivX 5;4CC;V;MPEG-4V;;;http://www.divx.com\n" "DXGM;EA GameVideo;4CC;V;;;Electronic Arts Game Video\n" "DXSB;DivX.com Subtitle;4CC;T;;;Subtitle in AVI from DivX networks;http://www.divx.com\n" "DXT1;DirectX TC;4CC;V;;;DirectX Compressed Texture (1bit alpha channel)\n" "DXT2;DirectX TC;4CC;V;;;DirectX Compressed Texture\n" "DXT3;DirectX TC;4CC;V;;;DirectX Compressed Texture (4bit alpha channel)\n" "DXT4;DirectX TC;4CC;V;;;DirectX Compressed Texture\n" "DXT5;DirectX TC;4CC;V;;;DirectX Compressed Texture (3bit alpha channel with interpolation)\n" "DXTC;DirectX TC;4CC;V;;;DirectX Texture Compression\n" "DXTn;DirectX TC;4CC;V;;;Microsoft Compressed Texture\n" "DXTN;DirectX TC;4CC;V;;;Microsoft DirectX Compressed Texture (DXTn)\n" "EKQ0;Elsa KQ;4CC;V;;;Elsa graphics card quick\n" "ELK0;Elsa LK;4CC;V;;;Elsa graphics card\n" "EM2V;Elymonyx MPEG-2;4CC;V;;;Etymonix MPEG-2 I-frame\n" "EMWC;WMA;;A;;;EverAd, Inc.\n" "EQK0;Elsa;4CC;V;;;Elsa graphics card quick\n" "ESCP;Escape;4CC;V;;;Eidos Escape\n" "ETV1;eTreppid 1;4CC;V;;;eTreppid Video 1\n" "ETV2;eTreppid 2;4CC;V;;;eTreppid Video 2\n" "ETVC;eTreppid C;4CC;V;;;eTreppid Video C\n" "FFDS;FFDS;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "FFV1;FFV1;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "FFVH;FFVH;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "FLIC;FLI/FLC;4CC;V;;;Autodesk FLI/FLC Animation\n" "FLJP;DField JPEG;4CC;V;;;D-Vision Field Encoded JPEG with LSI (or Targa emulation)\n" "FLV1;H.263;;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "FLV4;VP6;4CC;V;;;Flash, On2 Technologies;http://www.on2.com\n" "FMJP;D-Vision JPEG;4CC;V;;;D-Vision fieldbased ISO JPEG\n" "FMP4;MPEG-4 Visual;4CC;V;MPEG-4V;;;http://ffdshow-tryout.sourceforge.net/\n" "FPS1;FRAPS;4CC;V;;;;http://www.fraps.com/\n" "FRLE;SoftLab-Nsk JPEG;4CC;V;;;SoftLab-NSK Y16 + Alpha RLE\n" "FRWA;SoftLab-Nsk JPEG (w Alpha);4CC;V;;;SoftLab-NSK Vision Forward JPEG with Alpha-channel\n" "FRWD;SoftLab-Nsk JPEG;4CC;V;;;SoftLab-NSK Vision Forward JPEG\n" "FRWT;SoftLab-Nsk JPEG;4CC;V;;;SoftLab-NSK Vision Forward JPEG with Alpha-channel\n" "FRWU;SoftLab-Nsk JPEG;4CC;V;;;SoftLab-NSK Vision Forward Uncompressed\n" "FVF1;Itered Fractal;4CC;V;;;Iterated Systems Fractal Video Frame\n" "FVFW;FVFW;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "FXT1;3DFX;4CC;V;;;3dfx Interactive, Inc.\n" "G2M2;GoToMeeting2;4CC;V;;;Citrix Systems, Inc.;http://www.gotomeeting.com/\n" "G2M3;GoToMeeting3;4CC;V;;;Citrix Systems, Inc.;http://www.gotomeeting.com/\n" "GEPJ;White Pine JPEG;4CC;V;;;White Pine JPEG\n" "GJPG;Grand Tech GT891x;4CC;V;;;Grand Tech GT891x\n" "GLCC;GigaLink;4CC;V;;;GigaLink AV Capture\n" "GLZW;Gabest;4CC;V;;;Motion LZW by Gabest;http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84358\n" "GPEG;Gabest;4CC;V;JPEG;;JPEG by Gabest (with floating point);http://sourceforge.net/project/showfiles.php?group_id=82303&package_id=84358\n" "GPJM;Pinnacle JPEG;4CC;V;JPEG;;Pinnacle ReelTime JPEG\n" "GREY;YUV;4CC;V;YUV;;Simple grayscale video;http://www.fourcc.org/indexyuv.htm\n" "GWLT;MS GWLT;4CC;V;;;Microsoft Greyscale WLT DIB\n" "GXVE;ViVD V2;4CC;V;;;SoftMedia\n" "H260;Intel H.260;4CC;V;;;Intel H.260\n" "H261;Intel H.261;4CC;V;;;Intel H.261\n" "H262;Intel H.262;4CC;V;;;Intel H.262\n" "H263;Intel H.263;4CC;V;;;Intel H.263\n" "H264;AVC;4CC;V;AVC;;Intel H.264\n" "h264;AVC;4CC;V;AVC;;Intel H.264\n" "H265;Intel H.265;4CC;V;;;Intel H.265\n" "H266;Intel H.266;4CC;V;;;Intel H.266\n" "H267;Intel H.267;4CC;V;;;Intel H.267\n" "H268;Intel H.268;4CC;V;;;Intel H.268\n" "H269;Intel H.263;4CC;V;;;Intel H.263 for POTS-based videoconferencing\n" "HD10;BlueFish;4CC;V;;;BlueFish444 (lossless RGBA, YUV 10-bit)\n" "HDX4;Jomigo;4CC;V;;;Jomigo HDX4\n" "HFYU;Huffman;4CC;V;;;Huffman Lossless YUV and RGB formats (with Alpha-channel)\n" "HMCR;Rendition;4CC;V;;;Rendition Motion Compensation Format\n" "HMRR;Rendition;4CC;V;;;Rendition Motion Compensation Format\n" "i263;Intel H.263;4CC;V;;;Intel H.263\n" "I420;YUV;4CC;V;;\n" "IAN ;Indeo 4;4CC;V;;;Intel Indeo 4\n" "ICLB;CellB;4CC;V;;;InSoft CellB Videoconferencing\n" "IDM0;Wavelets 2;4CC;V;;;IDM Motion Wavelets 2.0\n" "IF09;H.261;4CC;V;;;Microsoft H.261\n" "IFO9;YUV9;4CC;V;YUV;;Intel\n" "IGOR;PowerDVD;4CC;V;;;Power DVD\n" "IJPG;Intergraph JPEG;4CC;V;JPEG;;Intergraph\n" "ILVC;Layered Video;4CC;V;;;Intel Layered Video\n" "ILVR;H.263+;4CC;V;;;Intel H.263+\n" "IMAC;MotionComp;4CC;V;;;Intel hardware motion compensation.\n" "IMC1;YUV;4CC;V;YUV;;As YV12, except the U and V planes each have the same stride as the Y plane\n" "IMC2;YUV;4CC;V;YUV;;Similar to IMC1, except that the U and V lines are interleaved at half stride boundaries\n" "IMC3;YUV;4CC;V;YUV;;As IMC1, except that U and V are swapped\n" "IMC4;YUV;4CC;V;YUV;;As IMC2, except that U and V are swapped\n" "IMG ;YUV;4CC;V;YUV;\n" "IMJG;Accom JPEG;4CC;V;;;Accom SphereOUS JPEG with Alpha-channel\n" "IPDV;I-O DV;4CC;V;;;I-O Data Device Giga AVI DV\n" "IPJ2;JPEG 2000;4CC;V;;;Image Power JPEG 2000\n" "IR21;Indeo 2.1;4CC;V;;;Intel Indeo 2.1\n" "IRAW;YUV;4CC;V;YUV;;Intel YUV Uncompressed;http://www.fourcc.org/indexyuv.htm\n" "ISME;ISME;4CC;V;;;Intel\n" "IUYV;YUV;4CC;V;YUV;;Lead 16bpp. Interlaced version of UYVY (line order 0, 2, 4,....,1, 3, 5....)\n" "IV30;Indeo 3;4CC;V;;;Intel Indeo Video 3\n" "IV31;Indeo 3;4CC;V;;;Intel Indeo Video 3.1\n" "IV32;Indeo 3;4CC;V;;;Intel Indeo Video 3.2\n" "IV33;Indeo 3;4CC;V;;;Intel Indeo Video 3.3\n" "IV34;Indeo 3;4CC;V;;;Intel Indeo Video 3.4\n" "IV35;Indeo 3;4CC;V;;;Intel Indeo Video 3.5\n" "IV36;Indeo 3;4CC;V;;;Intel Indeo Video 3.6\n" "IV37;Indeo 3;4CC;V;;;Intel Indeo Video 3.7\n" "IV38;Indeo 3;4CC;V;;;Intel Indeo Video 3.8\n" "IV39;Indeo 3;4CC;V;;;Intel Indeo Video 3.9\n" "IV40;Indeo 4;4CC;V;;;Intel Indeo Video 4.0\n" "IV41;Indeo 4;4CC;V;;;Intel Indeo Video 4.1\n" "IV42;Indeo 4;4CC;V;;;Intel Indeo Video 4.2\n" "IV43;Indeo 4;4CC;V;;;Intel Indeo Video 4.3\n" "IV44;Indeo 4;4CC;V;;;Intel Indeo Video 4.4\n" "IV45;Indeo 4;4CC;V;;;Intel Indeo Video 4.5\n" "IV46;Indeo 4;4CC;V;;;Intel Indeo Video 4.6\n" "IV47;Indeo 4;4CC;V;;;Intel Indeo Video 4.7\n" "IV48;Indeo 4;4CC;V;;;Intel Indeo Video 4.8\n" "IV49;Indeo 4;4CC;V;;;Intel Indeo Video 4.9\n" "IV50;Indeo 4;4CC;V;;;Intel Indeo Video 5.0 Wavelet;http://www.fourcc.org/indexyuv.htm\n" "IY41;YUV;4CC;V;YUV;;Lead 16bpp. Interlaced version of Y41P (line order 0, 2, 4,....,1, 3, 5....);http://www.fourcc.org/indexyuv.htm\n" "IYU1;YUV;4CC;V;YUV;;IEEE1394 12bpp. 12 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec;http://www.fourcc.org/indexyuv.htm\n" "IYU2;YUV;4CC;V;YUV;;IEEE1394 24bpp. 24 bit format used in mode 2 of the IEEE 1394 Digital Camera 1.04 spec\n" "IYUV;YUV;4CC;V;YUV;;Intel Indeo iYUV 4:2:0\n" "JBYR;Kensington;4CC;V;;;Kensington Video;http://ffdshow-tryout.sourceforge.net/\n" "JFIF;JPEG;4CC;V;JPEG;;\n" "JPEG;JPEG;4CC;V;JPEG;;JPEG compressed;http://www.apple.com/quicktime/download/standalone.html\n" "jpeg;JPEG;4CC;V;JPEG;;JPEG compressed\n" "JPG;JPEG;4CC;V;JPEG;;JPEG compressed;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe\n" "JPGL;Pegasus JPEG;4CC;V;;;DIVIO JPEG Light for WebCams (Pegasus Lossless JPEG)\n" "KMVC;Karl;4CC;V;;;Karl Morton's Video (presumably);http://www.apple.com/quicktime/download/standalone.html\n" "kpcd;Photo CD;4CC;V;;;Kodak Photo CD\n" "L261;H.261;4CC;V;;;Lead Technologies H.261\n" "L263;H.263+;4CC;V;;;Lead Technologies H.263\n" "LAGS;Lagarith;4CC;V;;;Lagarith LossLess\n" "LBYR;Creative WebCam;4CC;V;;;Creative WebCam\n" "LCMW;Lead CMW;4CC;V;;;Lead Technologies Motion CMW\n" "LCW2;Lead MCMW;4CC;V;;;LEADTools MCMW 9Motion Wavelet;http://mirror01.iptelecom.net.ua/~video/codecs/LEAD.MCMP-JPEG.v1.016.codec.exe\n" "LEAD;Lead Video;4CC;V;;;LEAD Video\n" "LGRY;Lead GrayScale;4CC;V;;;Lead Technologies Grayscale Image\n" "LIA1;Liafail;4CC;V;;;Liafail, Inc.\n" "LJ2K;Lead JPEG 2000;4CC;V;;;LEADTools JPEG 2000;http://mirror01.iptelecom.net.ua/~video/codecs/LEAD.MCMP-JPEG.v1.016.codec.exe\n" "LJPG;Lead JPEG;4CC;V;JPEG;;LEAD JPEG;http://mirror01.iptelecom.net.ua/~video/codecs/LEAD.MCMP-JPEG.v1.016.codec.exe\n" "Ljpg;Lead JPEG;4CC;V;JPEG;;LEAD JPEG\n" "LMP2;Lead MPEG-2;4CC;V;;;LEADTools MPEG-2\n" "LOCO;LOCO;4CC;V;;;LOCO Lossless\n" "LSCR;Lead Screen capture;4CC;V;;;LEAD Screen Capture\n" "LSV0;LSV0;4CC;V;;;Infinop Inc.\n" "LSVC;Vmail;4CC;V;;;Vianet Lighting Strike Vmail (Streaming)\n" "LSVM;Vmail;4CC;V;;;Vianet Lighting Strike Vmail (Streaming)\n" "LSVW;Infinop;4CC;V;;;Infinop Lightning Strike multiple bit rate video codec.\n" "LSVX;Vmail;4CC;V;;;Vianet Lightning Strike Video Codec\n" "LZO1;LZO;4CC;V;;;LZO compressed (lossless)\n" "M101;YUV;4CC;V;YUV;;Matrox\n" "M261;H.261;4CC;V;;;Microsoft H.261\n" "M263;H.263;4CC;V;;;Microsoft H.263\n" "M4CC;ESS Divo;4CC;V;MPEG-4V;;ESS MPEG-4 Divio\n" "M4S2;FFmpeg MPEG-4;4CC;V;;;Microsoft MPEG-4 (hacked MS MPEG-4)\n" "MC12;ATI Motion;4CC;V;;;ATI Motion Compensation Format\n" "MC24;MainConcept JPEG;4CC;V;JPEG;;MainConcept JPEG\n" "MCAM;ATI Motion;4CC;V;;;ATI Motion Compensation Format\n" "MCZM;RGB;4CC;V;RGB;;Theory MicroCosm Lossless 64bit RGB with Alpha-channel\n" "MDVD;MicroDVD;4CC;V;;;Alex MicroDVD Video (hacked MS MPEG-4)\n" "MDVF;Pinnacle DV;4CC;V;DV;;Pinnacle DV/DV50/DVHD100\n" "MHFY;YUB;4CC;V;YUV;;A.M.Paredes mhuffyYUV (LossLess);http://mirror01.iptelecom.net.ua/~video/codecs/Pinnacle.ReelTime.v2.5.software.only.codec.exe\n" "MJ2C;JPEG 2000;4CC;V;;;Morgan Multimedia JPEG 2000 Compression;http://mirror01.iptelecom.net.ua/~video/codecs/Pinnacle.ReelTime.v2.5.software.only.codec.exe\n" "MJPA;Pinacle JPEG A;4CC;V;;;Pinnacle ReelTime MJPG hardware;http://mediaxw.sourceforge.net\n" "MJPB;Pinacle JPEG B;4CC;V;JPEG;;JPEG\n" "MJPG;JPEG;4CC;V;JPEG;;JPEG including Huffman Tables\n" "mJPG;IBM JPEG (w Huffman);4CC;V;JPEG;;IBM JPEG including Huffman Tables\n" "MJPX;Pegasus JPEG;4CC;V;;;Pegasus PICVideo JPEG\n" "ML20;Webcam;4CC;V;;;Mimic MSN Messenger Webcam\n" "MMES;Matrox MPEG-2;4CC;V;MPEG-V;;Matrox MPEG-2 I-frame\n" "MMIF;Matrox MPEG-2;4CC;V;MPEG-V;;Matrox MPEG-2 I-frame\n" "MNVD;MindVid;4CC;V;;;MindBend MindVid LossLess\n" "MP2A;MPEG-2 Audio;4CC;A;MPEG-A;;Media Excel MPEG-2 Audio\n" "MP2T;MPEG-2 TS;4CC;M;MPEG-TS;;Media Excel MPEG-2 Transport Stream\n" "MP2V;MPEG-2 Video;4CC;V;MPEG-V;;Media Excel MPEG-2 Video;http://ffdshow-tryout.sourceforge.net/\n" "MP2v;MPEG-2 Video;4CC;V;MPEG-V;;MPEG-2 Video;http://ffdshow-tryout.sourceforge.net/\n" "MP41;S-Mpeg 4 v1;4CC;V;;;Microsoft MPEG-4 V1 (enhansed H263);http://ffdshow-tryout.sourceforge.net/\n" "MP42;S-Mpeg 4 v2;4CC;V;;;Microsoft MPEG-4 V2;http://www.apple.com/quicktime/download/standalone.html\n" "MP43;S-Mpeg 4 v3;4CC;V;;;Microsoft MPEG-4 V3\n" "mp4a;AAC;4CC;A;AAC;;AAC;http://ffdshow-tryout.sourceforge.net/\n" "MP4A;MPEG-4 Audio;4CC;A;AAC;;Media Excel MPEG-4 Audio;http://www.apple.com/quicktime/download/standalone.html\n" "MP4S;MS MPEG-4 v3;4CC;V;MPEG-4V;;Microsoft MPEG-4 (Windows Media 7.0)\n" "mp4s;MPEG-4 TS;4CC;M;MPEG-TS;;(MPEG-4) Apple MPEG-4 Transport Stream;http://ffdshow-tryout.sourceforge.net/\n" "MP4T;MPEG-4 TS;4CC;M;MPEG-TS;;Media Excel MPEG-4 Transport Stream;http://www.apple.com/quicktime/download/standalone.html\n" "MP4V;MPEG-4 Video;4CC;V;MPEG-4V;;Apple QuickTime MPEG-4 native;http://ffdshow-tryout.sourceforge.net/\n" "mp4v;MPEG-4 Video;4CC;V;MPEG-4V;;(MPEG-4) Apple MPEG-4 Video;http://www.apple.com/quicktime/download/standalone.html\n" "MPEG;MPEG;4CC;V;MPEG-V;;Chromatic MPEG 1 Video I Frame;http://ffdshow-tryout.sourceforge.net/\n" "mpeg;MPEG;4CC;V;MPEG-V;;MPEG-1 Video;http://ffdshow-tryout.sourceforge.net/\n" "MPG1;FFmpeg MPEG 1/2;4CC;V;MPEG-V;;(MPEG-1/2) FFmpeg;http://ffdshow-tryout.sourceforge.net/\n" "MPG2;FFmpeg MPEG 1/2;4CC;V;MPEG-V;;(MPEG-1/2) FFmpeg;http://ffdshow-tryout.sourceforge.net/\n" "MPG3;FFmpeg DivX 3;4CC;V;MPEG-4V;;(MPEG-4) MS MPEG-4 v3\n" "MPG4;MS MPEG-4 v1;4CC;V;MPEG-4V;;Microsoft MPEG-4 v1\n" "MPGI;Sigma MPEG;4CC;V;MPEG-V;;Sigma Design MPEG-1 I-frame\n" "MPNG;PNG;4CC;V;RGB;;Motion PNG\n" "MRCA;Mrcodec;4CC;V;;;FAST Multimedia\n" "MRLE;RLE;4CC;V;RGB;;Microsoft RLE\n" "MSS1;Windows Screen Video;4CC;V;;;Windows Screen Video\n" "MSS2;Windows Media;4CC;V;;;Windows Media 9\n" "MSUC;MSU;4CC;V;;;MSU LossLess\n" "MSUD;MSU;4CC;V;;;MSU LossLess\n" "MSV1;Microsoft Video 1;4CC;V;;;Microsoft Video 1\n" "MSVC;Microsoft Video 1;4CC;V;;;Microsoft Video 1\n" "MSZH;AVImszh;4CC;V;;;Lossless (ZIP compression)\n" "MTGA;TGA;4CC;V;RGB;;Motion TGA images (24, 32 bpp)\n" "MTX1;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX2;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX3;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX4;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX5;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX6;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX7;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX8;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MTX9;Matrox JPEG;4CC;V;JPEG;;Matrox JPEG\n" "MV10;Nokia;4CC;V;;;Nokia Mobile Phones\n" "MV11;Nokia;4CC;V;;;Nokia Mobile Phones\n" "MV12;MVI;4CC;V;;;Motion Pixels (old)\n" "MV99;Nokia;4CC;V;;;Nokia Mobile Phones\n" "MVC1;Nokia;4CC;V;;;Nokia Mobile Phones\n" "MVC2;Nokia;4CC;V;;;Nokia Mobile Phones\n" "MVC9;Nokia;4CC;V;;;Nokia Mobile Phones\n" "MVI1;MVI;4CC;V;;;Motion Pixels MVI\n" "MVI2;MVI;4CC;V;;;Motion Pixels MVI\n" "MWV1;Aware Motion Wavelets;4CC;V;;;Aware Motion Wavelets\n" "MYUV;RGB;4CC;V;RGB;;Media-100 844/X Uncompressed\n" "NAVI;MS MPEG-4;4CC;V;MPEG-4V;;nAVI video (hacked MS MPEG-4)\n" "NDIG;Ahead MPEG-4;4CC;V;MPEG-4V;;Ahead Nero Digital MPEG-4\n" "NHVU;Nvidia Texture;4CC;V;;;Nvidia Texture Format (GEForce 3)\n" "NO16;RGB;4CC;V;RGB;;Theory None16 64bit uncompressed Uncompressed\n" "NT00;LightWave;4CC;V;YUV;;NewTek LightWave HDTV YUV with Alpha-channel\n" "NTN1;NogaTech Video 1;4CC;V;;;Nogatech Video Compression 1\n" "NTN2;NogaTech Video 2;4CC;V;;;Nogatech Video Compression 2 (GrabBee hardware coder)\n" "NUV1;Nuppel;4CC;V;;;NuppelVideo\n" "NV12;YUV;4CC;V;YUV;;8-bit Y plane followed by an interleaved U/V plane with 2x2 subsampling\n" "NV21;YUV;4CC;V;YUV;;As NV12 with U and V reversed in the interleaved plane\n" "NVDS;Nvidia Texture;4CC;V;;;Nvidia Texture Format\n" "NVHS;Nvidia Texture;4CC;V;;;Nvidia Texture Format (GeForce 3)\n" "NVHU;Nvidia Texture;4CC;V;;;Nvidia Texture Format\n" "NVS0;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS1;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS2;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS3;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS4;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS5;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS6;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS7;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS8;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVS9;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT0;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT1;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT2;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT3;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT4;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT5;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT6;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT7;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT8;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NVT9;Nvidia Texture;4CC;V;;;Nvidia Texture Compression Format\n" "NY12;YUV;4CC;V;YUV;;Nogatech Ltd.\n" "NYUV;YUV;4CC;V;YUV;;Nogatech Ltd.\n" "ONYX;VP7;4CC;V;;;On2 VP7;http://www.on2.com/vp7.php3\n" "PCLE;Studio400;4CC;V;;;Pinnacle Systems, Inc.\n" "PDVC;Panasonic DV;4CC;V;DV;;Panasonic DV\n" "PGVV;Radius Video Vision;4CC;V;;;Radius Video Vision Telecast (adaptive JPEG)\n" "PHMO;Photomotion;4CC;V;;;IBM Photomotion\n" "PIM1;Pegasus JPEG;4CC;V;JPEG;;Pinnacle DC1000 hardware (MPEG compression);http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe\n" "PIM2;Pegasus JPEG;4CC;V;JPEG;;Pegasus Imaging;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe\n" "PIMJ;Pegasus JPEG;4CC;V;JPEG;;Pegasus Imaging PICvideo Lossless JPEG;http://mirror01.iptelecom.net.ua/~video/codecs/PICVideo.Lossless.JPEG.codec.v2.10.27.exe\n" "PIXL;Miro JPEG;4CC;V;JPEG;;MiroVideo XL (JPEG)\n" "PNG;PNG;4CC;V;RGB;;\n" "PNG1;PNG;4CC;V;RGB;;Corecodec.org CorePNG\n" "PVEZ;PowerEZ;4CC;V;;;Horizons Technology PowerEZ\n" "PVMM;Pegasus MPEG-4;4CC;V;MPEG-4V;;PacketVideo Corporation MPEG-4\n" "PVW2;Pegasus Wavelet;4CC;V;;;Pegasus Imaging Wavelet 2000\n" "PVWV;Pegasus Wavelet;4CC;V;;;Pegasus Imaging Wavelet 2000\n" "PXLT;Pixlet;4CC;V;;;Apple Pixlet (Wavelet)\n" "Q1.0;QPEG 1.0;4CC;V;;;Q-Team QPEG 1.0;http://www.q-team.de\n" "Q1.1;QPEG 1.1;4CC;V;;;Q-Team QPEG 1.1;http://www.q-team.de\n" "Qclp;QCLP;4CC;A;;;\n" "QDGX;Apple GX;4CC;V;;;Apple QuickDUncompressed GX\n" "QDM1;QDesign 1;4CC;A;;;QDesign Music 1\n" "QDM2;Qdesign 2;4CC;A;;;QDesign Music 2\n" "QDRW;Palettized Video;4CC;V;;;Apple\n" "QPEG;QPEG 1.1;4CC;V;;;Q-Team QPEG 1.1\n" "QPEQ;QPEG 1.1;4CC;V;;;Q-Team QPEG 1.1\n" "R210;YUV;4CC;V;YUV;;BlackMagic YUV (Quick Time)\n" "R411;Radius DV;4CC;V;DV;;Radius DV NTSC YUV\n" "R420;Radius DV;4CC;V;DV;;Radius DV PAL YUV\n" "RAV_;GroupTron;4CC;V;MPEG-1;;GroupTRON ReferenceAVI (dummy for MPEG compressor)\n" "RAVI;GroupTron;4CC;V;MPEG-1;;GroupTRON ReferenceAVI (dummy for MPEG compressor)\n" "RAW ;RGB;4CC;V;RGB;;Full Frames (Uncompressed)\n" "raw ;RGB;4CC;V;RGB;;Full Frames (Uncompressed);http://www.apple.com/quicktime/download/standalone.html\n" "RGB ;RGB;4CC;V;RGB;;Uncompressed RGB32\n" "RGB1;RGB;4CC;V;RGB;;Uncompressed RGB332 3:3:2\n" "RGBA;RGB;4CC;V;RGB;;Uncompressed w/ Alpha. Uncompressed RGB with alpha. Sample precision and packing is arbitrary and determined using bit masks for each component, as for BI_BITFIELDS.;http://www.fourcc.org/indexrgb.htm\n" "RGBO;RGB;4CC;V;RGB;;Uncompressed RGB555 5:5:5\n" "RGBP;RGB;4CC;V;RGB;;Uncompressed RGB565 5:6:5\n" "RGBQ;RGB;4CC;V;RGB;;Uncompressed RGB555X 5:5:5 BE\n" "RGBR;RGB;4CC;V;RGB;;Uncompressed RGB565X 5:6:5 BE\n" "RGBT;RGB;4CC;V;RGB;;Uncompressed RGB with transparency;http://www.fourcc.org/indexrgb.htm\n" "RIVA;Swizzled texture;4CC;V;;;Nvidia\n" "RL4;RLE;4CC;V;RGB;;RLE 4bpp RGB\n" "RL8;RLE;4CC;V;RGB;;RLE 8bpp RGB\n" "RLE ;RLE;4CC;V;RGB;;RLE RGB with arbitrary sample packing within a pixel;http://www.fourcc.org/indexrgb.htm\n" "rle ;Animation;4CC;V;RGB;;;http://www.apple.com/quicktime/download/standalone.html\n" "RLE4;RLE;4CC;V;RGB;;RLE 4bpp RGB;http://www.fourcc.org/indexrgb.htm\n" "RLE8;RLE;4CC;V;RGB;;RLE 8bpp RGB;http://www.fourcc.org/indexrgb.htm\n" "RLND;Roland;4CC;V;;;Roland Corporation\n" "RMP4;RealMagic MPEG-4;4CC;V;MPEG-4V;;REALmagic MPEG-4 Video (Sigma Design, built on XviD)\n" "ROQV;Id RoQ;4CC;V;;;Id RoQ File Video Decoder\n" "rpza;Road Pizza;4CC;V;;;Apple Video 16 bit road pizza;http://www.apple.com/quicktime/download/standalone.html\n" "RT21;Intel Video 2.1;4CC;V;;;Intel Real Time Video 2.1\n" "RTV0;NewTek VideoToaster;4CC;V;;;NewTek VideoToaster (dummy format - only AVI header)\n" "RUD0;Rududu;4CC;V;;;Rududu video\n" "RV10;RealVideo 1;4CC;V;;;H263, RealVideo 5;http://www.real.com\n" "rv10;RealVideo 1;Real;V;;;H263, RealVideo 5;http://www.real.com\n" "RV13;RealVideo 1;4CC;V;;;H263, RealVideo 5;http://www.real.com\n" "rv20;RealVideo 2;Real;V;;;H263, RealVideo 6;http://www.real.com\n" "RV20;RealVideo 2;4CC;V;;;H263, RealVideo 6;http://www.real.com\n" "rv30;RealVideo 3;Real;V;;;Between H263 and H264, RealVideo 8;http://www.real.com\n" "RV30;RealVideo 3;4CC;V;;;Between H263 and H264, RealVideo 8;http://www.real.com\n" "rv40;RealVideo 4;Real;V;;;H264, RealVideo 9;http://www.real.com\n" "RV40;RealVideo 4;4CC;V;;;H264, RealVideo 9;http://www.real.com\n" "RVX ;RDX;4CC;V;;;Intel RDX\n" "S263;S263;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "S422;VideoCap C210;4CC;V;YUV;;VideoCap C210\n" "s422;VideoCap C210;4CC;V;YUV;;VideoCap C210\n" "SAMR;AMR;4CC;A;;;\n" "SAN3;SAN3;4CC;V;MPEG-4V;;Direct copy of DivX 3.11\n" "SANM;Smush v2;4CC;V;;;LucasArts;http://www.lucasarts.com/\n" "SCCD;SoftCam;4CC;V;;;\n" "SDCC;Sun DV;4CC;V;DV;;Sun Digital Camera\n" "SEDG;Samsung MPEG-4;4CC;V;MPEG-4V;;Samsung MPEG-4\n" "SEG4;Cinepak;4CC;V;;;;http://www.sega.com/\n" "SEGA;Cinepak;4CC;V;;;;http://www.sega.com/\n" "SFMC;CrystalNet;4CC;V;;;CrystalNet Surface Fitting Method\n" "SHR0;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR1;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR2;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR3;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR4;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR5;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR6;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SHR7;BitJazz SheerVideo;4CC;V;;;BitJazz SheerVideo (realtime lossless)\n" "SJPG;CuSeeMe;4CC;V;JPEG;;CuSeeMe;http://mirror01.iptelecom.net.ua/~video/codecs/CUseeMe.JPEG.CODEC.v1.17.exe\n" "SL25;SoftLab DVCPro;4CC;V;;;SoftLab-NSK DVCPRO\n" "SL50;SoftLab DVCPro5;4CC;V;;;SoftLab-NSK \n" "SLDV;SoftLab DV;4CC;V;;;SoftLab-NSK Forward DV Draw\n" "SLIF;SoftLab MPEG-2;4CC;V;MPEG-V;;SoftLab-NSK MPEG-2 I-frames\n" "SLMJ;SoftLab JPEG;4CC;V;JPEG;;SoftLab-NSK Forward JPEG\n" "smc ;SMC;4CC;V;;;Apple Graphics (SMC);http://www.apple.com/quicktime/download/standalone.html\n" "SMSC;Radius;4CC;V;;;\n" "SMSD;Radius;4CC;V;;;\n" "SMSV;Wavelet Video;4CC;V;;;WorldConnect Wavelet Streaming Video\n" "smsv;Wavelet Video;4CC;V;;;WorldConnect Wavelet Video\n" "SNOW;Snow;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "SP40;SunPlus YUV;4CC;V;YUV;;SunPlus YUV\n" "SP44;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP53;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP54;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP55;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP56;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP57;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP58;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SP61;MegaCam;4CC;V;;;SunPlus Aiptek MegaCam\n" "SPIG;Spigot;4CC;V;;;Radius Spigot\n" "SPLC;ACM audio;4CC;V;;;Splash Studios ACM Audio\n" "SPRK;Spark;4CC;V;;\n" "SQZ2;VXTreme 2;4CC;V;;;Microsoft VXTreme Video V2\n" "STVA;ST Imager;4CC;V;;;ST Microelectronics CMOS Imager Data (Bayer)\n" "STVB;ST Imager;4CC;V;;;ST Microelectronics CMOS Imager Data (Nudged Bayer)\n" "STVC;ST Imager;4CC;V;;;ST Microelectronics CMOS Imager Data (Bunched)\n" "STVX;ST Imager;4CC;V;;;ST Microelectronics CMOS Imager Data (Extended Data Format)\n" "STVY;ST Imager;4CC;V;;;ST Microelectronics CMOS Imager Data (Extended Data Format with Correction Data)\n" "subp;VobSub;4CC;T;;;The same subtitle format used on DVDs\n" "SV10;Sorenson;4CC;V;;;Sorenson Media Video R1\n" "SVQ1;Sorenson 1;4CC;V;;;Sorenson Media Video 1 (Apple QuickTime 3)\n" "SVQ2;Sorenson 2;4CC;V;;;Sorenson Media Video 2 (Apple QuickTime 4)\n" "SVQ3;Sorenson 3;4CC;V;;;Sorenson Media Video 3 (Apple QuickTime 5)\n" "SWC1;MainConcept JPEG;4CC;V;JPEG;;MainConcept JPEG\n" "T420;Toshiba YUV;4CC;V;YUV;;Toshiba YUV 4:2:0\n" "TGA ;Apple TGA;4CC;V;;;Apple TGA (with Alpha-channel)\n" "THEO;Theora;4CC;V;;;FFVFW Supported\n" "TIFF;Apple TIFF;4CC;V;;;Apple TIFF (with Alpha-channel)\n" "TIM2;Pinnacle DVI;4CC;V;;;Pinnacle RAL DVI\n" "TLMS;TeraLogic;4CC;V;;;TeraLogic Motion Intraframe\n" "TLST;TeraLogic;4CC;V;;;TeraLogic Motion Intraframe\n" "TM10;Duck;4CC;V;;;Duck TrueMotion\n" "TM20;Duck 2;4CC;V;;;Duck TrueMotion 2.0\n" "TM2A;Duck Archiver 2;4CC;V;;;Duck TrueMotion Archiver 2.0\n" "TM2X;Duck 2;4CC;V;;;Duck TrueMotion 2X\n" "TMIC;TeraLogic;4CC;V;;;TeraLogic Motion Intraframe\n" "TMOT;Horizons TM S;4CC;V;;;Horizons Technology TrueMotion Video\n" "TR20;Duck TM RT2;4CC;V;;;Duck TrueMotion RT 2.0\n" "TRLE;Akula;4CC;V;;;Akula Alpha Pro Custom AVI (LossLess)\n" "TSCC;TechSmith;4CC;V;;;TechSmith Screen Capture\n" "TV10;Tecomac;4CC;V;;;Tecomac Low-Bit Rate\n" "TVJP;Pinnacle/Truevision;4CC;V;;;TrueVision Field Encoded JPEG (Targa emulation)\n" "TVMJ;Pinnacle/Truevision;4CC;V;;;Truevision TARGA JPEG Hardware (or Targa emulation)\n" "TY0N;Trident;4CC;V;;;Trident Decompression Driver\n" "TY2C;Trident;4CC;V;;;Trident Decompression Driver\n" "TY2N;Trident;4CC;V;;;Trident Decompression Driver\n" "U<Y ;Discreet YUV;4CC;V;YUV;;Discreet UC YUV 4:2:2:4 10 bit\n" "U<YA;Discreet YUV;4CC;V;;;Discreet UC YUV 4:2:2:4 10 bit (with Alpha-channel)\n" "U263;UB H.263;4CC;V;;;UB Video H.263/H.263+/H.263++ Decoder;http://eMajix.com\n" "UCOD;ClearVideo;4CC;V;;;ClearVideo (fractal compression-based)\n" "ULH0;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:0\n" "ULH2;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:2\n" "ULRA;RGBA;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;RGBA;4:4:4:4\n" "ULRG;RGB;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;RGB;4:4:4\n" "ULTI;Ultimotion;4CC;V;;;IBM Ultimotion\n" "ULY0;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:2\n" "ULY2;YUV;Ut Video;Ut Video Lossless Codec;http://umezawa.dyndns.info/archive/utvideo;;;YUV;4:2:0\n" "UMP4;UB MPEG-4;4CC;V;MPEG-4V;;UB Video MPEG 4;http://www.fourcc.org/indexyuv.htm\n" "UYNV;YUV;4CC;V;YUV;;Nvidia 16bpp. A direct copy of UYVY registered by Nvidia to work around problems in some olds which did not like hardware which offered more than 2 UYVY surfaces.;http://www.fourcc.org/indexyuv.htm\n" "UYVP;YUV;4CC;V;YUV;;Evans & Sutherland 24bpp. YCbCr 4:2:2 extended precision 10-bits per component in U0Y0V0Y1 order\n" "UYVU;SoftLab YUV;4CC;V;YUV;;SoftLab-NSK Forward YUV;http://www.fourcc.org/indexyuv.htm\n" "UYVY;YUV;4CC;V;YUV;;Uncompressed 16bpp. YUV 4:2:2 (Y sample at every pixel, U and V sampled at every second pixel horizontally on each line). A macropixel contains 2 pixels in 1 u_int32.\n" "V210;Optibase;4CC;V;;;Optibase VideoPump 10-bit 4:2:2 Component YCbCr\n" "V261;VX3000S;4CC;V;;;Lucent VX3000S\n" "V422;Vitec YUV;4CC;V;YUV;;Vitec Multimedia YUV 4:2:2 as for UYVY, but with different component ordering within the u_int32 macropixel\n" "V655;Vitec YUV;4CC;V;YUV;;Vitec Multimedia 16 bit YUV 4:2:2 (6:5:5) format\n" "VBLE;MarcFD VBLE;4CC;V;;;MarcFD VBLE Lossless\n" "VCR1;ATI Video 1;4CC;V;;;ATI VCR 1.0\n" "VCR2;ATI Video 2;4CC;V;;;ATI VCR 2.0 (MPEG YV12)\n" "VCR3;ATI Video 3;4CC;V;;;ATI VCR 3.0\n" "VCR4;ATI Video 4;4CC;V;;;ATI VCR 4.0\n" "VCR5;ATI Video 5;4CC;V;;;ATI VCR 5.0\n" "VCR6;ATI Video 6;4CC;V;;;ATI VCR 6.0\n" "VCR7;ATI Video 7;4CC;V;;;ATI VCR 7.0\n" "VCR8;ATI Video 8;4CC;V;;;ATI VCR 8.0\n" "VCR9;ATI Video 9;4CC;V;;;ATI VCR 9.0\n" "VCWV;Wavelet;4CC;V;;;VideoCon\n" "VDCT;VideoMaker RGB;4CC;V;RGB;;Video Maker Pro DIB\n" "VDOM;VDOWave;4CC;V;;;VDONet Wave\n" "VDOW;VDOLive;4CC;V;;;VDONet Live (H,263)\n" "VDST;VirtualDub;4CC;V;;;VirtualDub remote frameclient ICM driver\n" "VDTZ;YUV;4CC;V;YUV;;VideoTizer / Darim Vision YUV\n" "VGPX;VGP;4CC;V;;;Alaris VideoGramPixel\n" "VIDM;DivX 5 pro;4CC;V;MPEG-4V;;DivX 5.0 Pro Supported\n" "VIDS;Vitec;4CC;V;;;Vitec Multimedia YUV 4:2:2;www.yks.ne.jp/~hori/\n" "VIFP;VFAPI;4CC;V;;;Virtual Frame API (VFAPI dummy format)\n" "VIV1;H.263;4CC;V;;;Vivo H.263\n" "VIV2;H.263;4CC;V;;;Vivo H.263\n" "VIVO;H.263;4CC;V;;;Vivo H.263\n" "VIXL;Miro XL;4CC;V;JPEG;;Miro Video XL;http://mirror01.iptelecom.net.ua/~video/codecs/miroVIDEO-XL.codec.v2.2.exe\n" "VJPG;JPEG;4CC;V;JPEG;;\n" "VLV1;Videologic;4CC;V;;;\n" "VMNC;Vmware;4CC;V;;;;http://www.vmware.com/\n" "VP30;VP3;4CC;V;;;On2 VP3\n" "VP31;VP3;4CC;V;;;On2 VP3\n" "VP32;VP3;4CC;V;;;On2 VP3\n" "VP40;VP4;4CC;V;;;On2 TrueCast VP4\n" "VP50;VP5;4CC;V;;;On2 TrueCast VP5\n" "VP60;VP6;4CC;V;;;On2 TrueCast VP6\n" "VP61;VP6;4CC;V;;;On2 TrueCast VP6.1\n" "VP62;VP6;4CC;V;;;On2 TrueCast VP6.2;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe\n" "VP6A;VP6;4CC;V;;;On2 TrueCast VP6.2;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe\n" "VP6F;VP6;4CC;V;;;On2 TrueCast VP6.2;http://ftp.pub.cri74.org/pub/win9x/video/codecs/VP6/vp6_vfw_codec.exe\n" "VP70;VP7;4CC;V;;;On2 TrueMotion VP7\n" "VP71;VP7;4CC;V;;;On2 TrueMotion VP7\n" "VP72;VP7;4CC;V;;;On2 TrueMotion VP7\n" "VQC1;Vector 1;4CC;V;;;Vector-quantised 1 (high compression) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf\n" "VQC2;Vector 2;4CC;V;;;Vector-quantised 2 (high robustness against channel errors) http://eprints.ecs.soton.ac.uk/archive/00001310/01/VTC97-js.pdf\n" "VQJP;VQ630;4CC;V;;;Dual-mode digital camera\n" "VQS4;VQ110;4CC;V;;;DV camera\n" "VR21;BlckMagic YUV;4CC;V;YUV;;BlackMagic YUV (Quick Time)\n" "VSSH;AVC;4CC;V;AVC;;Vanguard VSS H.264\n" "VSSV;Vanguard Video;4CC;V;;;Vanguard Software Solutions Video\n" "VSSW;AVC;4CC;V;AVC;;Vanguard VSS H.264\n" "VTLP;GGP;4CC;V;;;Alaris VideoGramPixel\n" "VX1K;DVX 1 S;4CC;V;;;Lucent VX1000S Video\n" "VX2K;DVX 2 S;4CC;V;;;Lucent VX2000S Video\n" "VXSP;DVX 1 SP;4CC;V;;;Lucent VX1000SP Video\n" "VYU9;YUV;4CC;V;YUV;;ATI YUV\n" "VYUY;YUV;4CC;V;YUV;;ATI Packed YUV Data\n" "WBVC;W9960;4CC;V;;;Winbond Electronics W9960\n" "WHAM;Microsoft Video 1;4CC;V;;;\n" "WINX;Winnov;4CC;V;;;\n" "WJPG;Winbond JPEG;4CC;V;JPEG;;Winbond JPEG (AverMedia USB devices)\n" "WMV1;WMV1;4CC;V;;;Windows Media Video 7;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "WMV2;WMV2;4CC;V;;;Windows Media Video 8;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "WMV3;WMV3;4CC;V;VC-1;;Windows Media Video 9;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "WMVA;WMV;4CC;V;VC-1;;Windows Media Video;http://ffdshow-tryout.sourceforge.net/\n" "WMVP;WMV3;4CC;V;;;Windows Media Video V9\n" "WNIX;WniWni;4CC;V;;;WniWni\n" "WNV1;WinNov;4CC;V;;;WinNov Videum Hardware Compression;http://www.winnov.com/\n" "WNVA;WinNov;4CC;V;;;WinNov Videum Hardware Compression;http://www.winnov.com/\n" "WRLE;Apple BMP;4CC;V;RGB;;Apple QuickTime BMP\n" "WRPR;AVideoTools;4CC;V;;;VideoTools VideoServer Client (wrapper for AviSynth)\n" "WV1F;WV1F;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "WVC1;VC-1;4CC;V;VC-1;;Microsoft\n" "WVLT;IllusionHope Wavelet 9/7;4CC;V;;;IllusionHope Wavelet 9/7\n" "WVP2;WVP2;4CC;V;;;;http://ffdshow-tryout.sourceforge.net/\n" "WZCD;iScan;4CC;V;;;CORE Co. Ltd.\n" "WZDC;iSnap;4CC;V;;;CORE Co. Ltd.\n" "X263;H.263;4CC;V;;;Xirlink H.263\n" "x263;Xirlink;4CC;V;;;\n" "X264;AVC;4CC;V;AVC;;XiWave GNU GPL x264 MPEG-4\n" "x264;AVC;4CC;V;AVC;;XiWave GNU GPL x264 MPEG-4\n" "XJPG;Xirlink;4CC;V;JPEG;;Xirlink, Inc.\n" "XLV0;NetXL Video;4CC;V;;;NetXL Inc. XL Video Decoder\n" "XMPG;Xing MPEG;4CC;V;MPEG-V;;XING MPEG (I frame only)\n" "XVID;XviD;4CC;V;MPEG-4V;;XviD project;http://www.xvid.org/Downloads.15.0.html\n" "XVIX;XviD;4CC;V;MPEG-4V;;Based on XviD MPEG-4;http://www.xvid.org/Downloads.15.0.html\n" "XWV0;XiWave Video;4CC;V;;;XiWave Video\n" "XWV1;XiWave Video;4CC;V;;;XiWave Video\n" "XWV2;XiWave Video;4CC;V;;;XiWave Video\n" "XWV3;XiWave Video;4CC;V;;;XiWave Video (Xi-3 Video)\n" "XWV4;XiWave Video;4CC;V;;;XiWave Video\n" "XWV5;XiWave Video;4CC;V;;;XiWave Video\n" "XWV6;XiWave Video;4CC;V;;;XiWave Video\n" "XWV7;XiWave Video;4CC;V;;;XiWave Video\n" "XWV8;XiWave Video;4CC;V;;;XiWave Video\n" "XWV9;XiWave Video;4CC;V;;;XiWave Video\n" "XXAN;Origin VideoGame;4CC;V;;;Origin Video (used in Wing Commander 3 and 4)\n" "XYZP;PAL;4CC;V;;;Extended PAL format XYZ palette\n" "Y211;YUV;4CC;V;YUV;;Packed YUV format with Y sampled at every second pixel across each line and U and V sampled at every fourth pixel\n" "Y216;Targa YUV;4CC;V;YUV;;Pinnacle TARGA CineWave YUV (Quick Time)\n" "Y411;YUV;4CC;V;YUV;;YUV 4:1:1 Packed\n" "Y41B;YUV;4CC;V;YUV;;YUV 4:1:1 Planar\n" "Y41P;YUV;4CC;V;YUV;;Conexant (ex Brooktree) YUV 4:1:1 Raw;http://www.fourcc.org/indexyuv.htm\n" "Y41T;YUV;4CC;V;YUV;;Format as for Y41P, but the lsb of each Y component is used to signal pixel transparency\n" "Y422;YUV;4CC;V;YUV;;Direct copy of UYVY as used by ADS Technologies Pyro WebCam firewire camera\n" "Y42B;YUV;4CC;V;YUV;;YUV 4:2:2 Planar\n" "Y42T;YUV;4CC;V;YUV;;Format as for UYVY, but the lsb of each Y component is used to signal pixel transparency\n" "Y444;YUV;4CC;V;YUV;;IYU2 (iRez Stealth Fire camera)\n" "Y8 ;GrayScale;4CC;V;;;Simple grayscale video\n" "Y800;GrayScale;4CC;V;;;Simple grayscale video\n" "YC12;YUV;4CC;V;YUV;;Intel YUV12;http://www.fourcc.org/indexyuv.htm\n" "YCCK;YUV;4CC;V;YUV;;\n" "YMPG;MPEG-2;4CC;V;MPEG-2;;YMPEG Alpha (dummy for MPEG-2 compressor)\n" "YU12;YUV;4CC;V;YUV;;ATI YV12 4:2:0 Planar\n" "YU92;YUV;4CC;V;YUV;;Intel - YUV\n" "YUNV;YUV;4CC;V;YUV;;A direct copy of YUY2 registered by Nvidia to work around problems in some olds which did not like hardware that offered more than 2 YUY2 surfaces\n" "YUV2;YUV;4CC;V;YUV;;Apple Component Video (YUV 4:2:2);http://www.apple.com/quicktime/download/standalone.html\n" "YUV8;YUV;4CC;V;YUV;;Winnov Caviar YUV8 ;http://www.fourcc.org/indexyuv.htm\n" "YUV9;YUV;4CC;V;YUV;;Intel YUV9\n" "YUVP;YUV;4CC;V;YUV;;YCbCr 4:2:2 extended precision 10-bits per component in Y0U0Y1V0 order\n" "YUY2;YUV;4CC;V;YUV;;YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel;http://www.fourcc.org/indexyuv.htm\n" "YUYP;YUV;4CC;V;YUV;;Evans & Sutherland\n" "YUYV;YUV;4CC;V;YUV;;Canopus YUV format;http://www.fourcc.org/indexyuv.htm\n" "YV12;YUV;4CC;V;YUV;;ATI YVU12 4:2:0 Planar;http://www.fourcc.org/indexyuv.htm\n" "YV16;YUV;4CC;V;YUV;;Elecard YUV 4:2:2 Planar\n" "YV92;YUV;4CC;V;YUV;;Intel Smart Video Recorder YVU9\n" "YVU9;YUV;4CC;V;YUV;;Brooktree YVU9 Raw (YVU9 Planar);http://www.fourcc.org/indexyuv.htm\n" "YVYU;YUV;4CC;V;YUV;;YUV 4:2:2 as for UYVY but with different component ordering within the u_int32 macropixel\n" "ZLIB;AVIzlib;4CC;V;RGB;;Lossless (ZIP compression)\n" "ZMBV;Zip;4CC;V;;;Zip Motion Blocks Video\n" "ZPEG;Video Zipper;4CC;V;RGB;;Metheus Video Zipper\n" "ZYGO;ZyGo;4CC;V;;;ZyGo Video\n" "V_UNCOMPRESSED;Raw;Mk;V;;;Raw uncompressed video frames\n" "V_DIRAC;Dirac;Mk;V;;;;http://diracvideo.org/\n" "V_MPEG4/ISO/SP;MPEG-4 Visual SP;Mk;V;MPEG-4V;;Simple Profile;http://www.divx.com\n" "V_MPEG4/ISO/ASP;MPEG-4 Visual ASP;Mk;V;MPEG-4V;;Advanced Simple Profile;http://www.xvid.org/Downloads.15.0.html\n" "V_MPEG4/ISO/AP;MPEG-4 Visual AP;Mk;V;MPEG-4V;;Advanced Profile;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/ISO/AVC;AVC;Mk;V;AVC;;Advanced Video Codec;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/MS/V2;MS MPEG-4 v2;Mk;V;MPEG-4V;;MS MPEG-4 v2;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG4/MS/V3;MS MPEG-4 v3;Mk;V;MPEG-4V;;MS MPEG-4 v3;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG1;MPEG-1 Video;Mk;V;MPEG-V;;MPEG 1 or 2 Video;http://ffdshow-tryout.sourceforge.net/\n" "V_MPEG2;MPEG-2 Video;Mk;V;MPEG-V;;MPEG 1 or 2 Video;http://ffdshow-tryout.sourceforge.net/\n" "V_REAL/RV10;Real 1;Mk;V;;;RealVideo 1.0 aka RealVideo 5;http://www.real.com\n" "V_REAL/RV20;Real 2;Mk;V;;;RealVideo 2.0 aka G2 and RealVideo G2+SVT;http://www.real.com\n" "V_REAL/RV30;Real 3;Mk;V;;;RealVideo 3.0 aka RealVideo 8;http://www.real.com\n" "V_REAL/RV40;Real 4;Mk;V;;;RealVideo 4.0 aka RealVideo 9;http://www.real.com\n" "V_THEORA;Theora;Mk;V;;;;http://www.theora.org\n" "A_MPEG/L1;MPEG1/2 L1;Mk;A;MPEG-A;;MPEG1 or 2 Audio layer 1;http://www.iis.fraunhofer.de/amm/index.html\n" "A_MPEG/L2;MPEG1/2 L2;Mk;A;MPEG-A;;MPEG1 or 2 Audio layer 2;http://www.iis.fraunhofer.de/amm/index.html\n" "A_MPEG/L3;MPEG1/2 L3;Mk;A;MPEG-A;;MPEG1 or 2 Audio Layer 3;http://www.iis.fraunhofer.de/amm/index.html\n" "A_PCM/INT/BIG;PCM;Mk;A;PCM;;Linear PCM (Big Endian)\n" "A_PCM/INT/LIT;PCM;Mk;A;PCM;;Linear PCM (Little Endian)\n" "A_PCM/FLOAT/IEEE;PCM;Mk;A;PCM;;Microsoft Linear PCM, Float;http://www.microsoft.com/windows/\n" "A_AC3;AC3;Mk;A;AC3;;Dolby AC3\n" "A_AC3/BSID9;AC3;Mk;A;AC3;;Dolby AC3\n" "A_AC3/BSID10;AC3;Mk;A;AC3;;Dolby AC3\n" "A_DTS;DTS;Mk;A;DTS;;\n" "A_EAC3;EAC3;Mk;A;EAC3;;Dolby Enhanced AC3\n" "A_FLAC;Flac;Mk;A;Flac;;;https://xiph.org/flac\n" "A_OPUS;Opus;;;http://opus-codec.org\n" "A_TTA1;TTA;Mk;A;TTA;;The True Audio Lossless Codec;http://true-audio.com\n" "A_VORBIS;Vorbis;Mk;A;Vorbis;VBR;;http://www.vorbis.com\n" "A_WAVPACK4;WavPack;Mk;A;Real;VBR;;http://www.wavpack.com\n" "A_REAL/14_4;RealAudio 1;Mk;A;Real;;Real Audio 1 (14.4);http://www.real.com\n" "A_REAL/28_8;RealAudio 2;Mk;A;Real;;Real Audio 2 (28.8);http://www.real.com\n" "A_REAL/COOK;RealAudio 7;Mk;A;Real;;Real Audio Cook Codec (codename: Gecko);http://www.real.com\n" "A_REAL/SIPR;RealAudio 4;Mk;A;Real;;Real & Sipro Voice Codec;http://www.real.com\n" "A_REAL/RALF;RealAudio Lossless;Mk;A;Real;;Real Audio Lossless Format;http://www.real.com\n" "A_REAL/ATRC;RealAudio Atrac3;Mk;A;Real;;Real & Sony Atrac3 Codec;http://www.real.com\n" "A_AAC;AAC;Mk;A;AAC;;\n" "A_AAC/MPEG2/MAIN;AAC Main;Mk;A;AAC;;AAC Main\n" "A_AAC/MPEG2/LC;AAC LC;Mk;A;AAC;;AAC Low Complexity\n" "A_AAC/MPEG2/LC/SBR;AAC LC-SBR;Mk;A;AAC;;AAC Low Complexity with Spectral Band Replication\n" "A_AAC/MPEG2/SSR;AAC SSR;Mk;A;AAC;;AAC Scalable Sampling Rate\n" "A_AAC/MPEG4/MAIN;AAC Main;Mk;A;AAC;;AAC Low Complexity\n" "A_AAC/MPEG4/MAIN/SBR;AAC Main;Mk;A;AAC;;AAC Low Complexity with Spectral Band Replication\n" "A_AAC/MPEG4/MAIN/SBR/PS;AAC Main;Mk;A;AAC;;AAC Low Complexity with Spectral Band Replication and Parametric Stereo\n" "A_AAC/MPEG4/MAIN/PS;AAC Main;Mk;A;AAC;;AAC Low Complexity with Parametric Stereo\n" "A_AAC/MPEG4/LC;AAC LC;Mk;A;AAC;;AAC Low Complexity\n" "A_AAC/MPEG4/LC/SBR;AAC LC-SBR;Mk;A;AAC;;AAC Low Complexity with Spectral Band Replication\n" "A_AAC/MPEG4/LC/SBR/PS;AAC LC-SBR-PS;Mk;A;AAC;;AAC Low Complexity with Spectral Band Replication and Parametric Stereo\n" "A_AAC/MPEG4/LC/PS;AAC LC-PS;Mk;A;AAC;;AAC Low Complexity with Parametric Stereo\n" "A_AAC/MPEG4/SSR;AAC SSR;Mk;A;AAC;;AAC Scalable Sampling Rate\n" "A_AAC/MPEG4/LTP;AAC LTP;Mk;A;AAC;;AAC Long Term Prediction\n" "14_4;VSELP;Real;A;;;EIA/TIA IS-54 VSELP, Real Audio 1 (for streaming 14.4 Kbps);http://www.real.com\n" "14.4;VSELP;Real;A;;;EIA/TIA IS-54 VSELP, Real Audio 1 (for streaming 14.4 Kbps);http://www.real.com\n" "lpcJ;VSELP;Real;A;;;EIA/TIA IS-54 VSELP, Real Audio 1 (for streaming 14.4 Kbps);http://www.real.com\n" "28_8;G.728;Real;A;;;ITU-T G.728, Real Audio 2 (for streaming 28.8 Kbps);http://www.real.com\n" "28.8;G.728;Real;A;;;ITU-T G.728, Real Audio 2 (for streaming 28.8 Kbps);http://www.real.com\n" "cook;Cooker;Real;A;;;Real Audio G2/7 Cook (low bitrate);http://www.real.com\n" "dnet;AC3;Real;A;AC3;;A52/AC3, Real Audio 2;http://www.real.com\n" "sipr;G.729;Real;A;;;G.729, Real Audio 2;http://www.real.com\n" "rtrc;RealAudio 8;Real;A;;;Real Audio 8 (RTRC);http://www.real.com\n" "ralf;Lossless;Real;A;;;Real Audio Lossless Format;http://www.real.com\n" "whrl;Multi-Channel;Real;A;;;Real Audio Multi-Channel;http://www.real.com\n" "atrc;Atrac;Real;A;;;Real & Sony Atrac3;http://www.real.com\n" "raac;AAC-LC;Real;A;AAC;;Real Audio 10 AAC LC;http://www.real.com\n" "racp;AAC-HE;Real;A;AAC;;Real Audio 10 AAC-HE;http://www.real.com\n" "OPUS;Opus;Ogg;A;OPUS;;;http://opus-codec.org\n" "Vorbis;Vorbis;Ogg;A;Vorbis;;;http://www.vorbis.com\n" "Theora;Theora;Ogg;V;Theora;;;http://www.theora.com\n" "mp4a;AAC;4CC;A;AAC;;AAC (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "mp4v;MPEG-4;4CC;V;MPEG-4V;;MPEG-4 Video (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "avc1;AVC;4CC;V;AVC;;Advanced Video Codec;http://www.apple.com/quicktime/download/standalone.html\n" "h263;H.263;4CC;V;;;H.263 (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "s263;H.263;4CC;V;;;H.263 (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "samr;AMR-NB;4CC;A;;;AMR narrow band (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "sawb;AMR-WB;4CC;A;;;AMR wide band (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "sevc;EVRC;4CC;A;;;;http://www.apple.com/quicktime/download/standalone.html\n" "tx3g;Timed;4CC;T;;;Timed text (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "encv;Encrypted;4CC;V;;;Encrypted Video (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "enca;Encrypted;4CC;A;;;Encrypted Audio (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "enct;Encrypted;4CC;T;;;Encrypted Text (3GPP);http://www.apple.com/quicktime/download/standalone.html\n" "ima4;ADPCM;4CC;A;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "raw ;PCM;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "twos;PCM;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "sowt;PCM;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "alac;Lossless;4CC;A;;;Apple Lossless Format (similar to FLAC);http://www.apple.com/quicktime/download/standalone.html\n" "sac3;AC3;4CC;A;AC3;;AC3 in MP4 (made in Nero);http://www.nerodigital.com\n" "in24;PCM;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "in32;PCM;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "fl32;PCM ;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "fl64;PCM;4CC;A;PCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "alaw;A-Law;4CC;A;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n" "ulaw;U-Law;4CC;A;ADPCM;;;http://www.apple.com/quicktime/download/standalone.html\n" ".mp3;MPEG-1/2 L3;2CC;A;MPEG-A;;MPEG-1 or 2 layer 3;http://www.iis.fraunhofer.de/amm/index.html\n" "MPEG-4 AAC main;AAC Main;Mp4v2;A;AAC;;\n" "MPEG-4 AAC LC;AAC LC;Mp4v2;A;AAC;;\n" "MPEG-4 AAC SSR;AAC SSR;Mp4v2;A;AAC;;\n" "MPEG-4 AAC LTP;AAC LTP;Mp4v2;A;AAC;;\n" "AVC;AVC;MediaInfo;V;AVC;;Advanced Video Codec;http://developers.videolan.org/x264.html\n" "MPEG-1V;MPEG-1 Video;MediaInfo;V;MPEG-V;;\n" "MPEG-2V;MPEG-2 Video;MediaInfo;V;MPEG-V;;\n" "MPEG-4V;MPEG-4 Visual;MediaInfo;V;MPEG-4V;;\n" "MPEG-1A;MPEG-1 Audio;MediaInfo;A;MPEG-A;;\n" "MPEG-1A L1;MPEG-1 Audio Layer 1;MediaInfo;A;MPEG-A;;\n" "MPEG-1A L2;MPEG-1 Audio Layer 2;MediaInfo;A;MPEG-A;;\n" "MPEG-1A L3;MPEG-1 Audio Layer 3;MediaInfo;A;MPEG-A;;\n" "MPEG-2A;MPEG-2 Audio;MediaInfo;A;MPEG-A;;\n" "MPEG-2A L1;MPEG-2 Audio Layer 1;MediaInfo;A;MPEG-A;;\n" "MPEG-2A L2;MPEG-2 Audio Layer 2;MediaInfo;A;MPEG-A;;\n" "MPEG-2A L3;MPEG-2 Audio Layer 3;MediaInfo;A;MPEG-A;;\n" "MPEG-2.5A;MPEG-2.5 Audio;MediaInfo;A;MPEG-A;;;\n" "MPEG-2.5A L1;MPEG-2.5 Audio Layer 1;MediaInfo;A;MPEG-A;;;\n" "MPEG-2.5A L2;MPEG-2.5 Audio Layer 2;MediaInfo;A;MPEG-A;;;\n" "MPEG-2.5A L3;MPEG-2.5 Audio Layer 3;MediaInfo;A;MPEG-A;;;\n" "APE;Monkey's Audio;MediaInfo;A;;;;http://www.monkeysaudio.com/\n" "ALS;ALS;MediaInfo;A;;;MPEG-4 Audio Lossless Coding;http://www.nue.tu-berlin.de/forschung/projekte/lossless/mp4als.html#downloads\n" "Vodei;Vodei MP;MediaInfo;V;;;Video On Demand Exploration Interface;http://www.vodei.com\n" "SWF ADPCM;ADPCM;MediaInfo;A;ADPCM;;ADPCM found in SWF/FLV files;http://www.adobe.com\n" "AC3+;AC3+;MediaInfo;A;AC3;;Dolby Ehanced AC3;\n" "TrueHD;TrueHD;MediaInfo;A;AC3;;Dolby TrueHD (AC3 based);\n" "VC-1;VC-1;MediaInfo;V;VC-1;;;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "LA;LA;MediaInfo;A;;;Lossless Audio Codec;la;http://www.lossless-audio.com/\n" "0;Unknown;2CC;A;;;;\n" "1;PCM;2CC;A;PCM;;Microsoft PCM;http://www.microsoft.com/windows/\n" "2;ADPCM;2CC;A;ADPCM;;Microsoft ADPCM;http://www.microsoft.com/windows/\n" "3;PCM;2CC;A;PCM;;IEEE FLOAT;http://www.microsoft.com/windows/\n" "4;VSELP;2CC;A;;;Compaq VSELP\n" "5;CVSD;2CC;A;;;IBM CVSD\n" "6;A-Law;2CC;A;ADPCM;;CCITT A-Law;http://www.microsoft.com/windows/\n" "7;U-Law;2CC;A;ADPCM;;CCITT U-Law;http://www.microsoft.com/windows/\n" "8;DTS;2CC;A;DTS;;\n" "9;DRM;2CC;A;;;Microsoft\n" "A;WMSpeech;2CC;A;;;\n" "C;MPEG2 5.1;2CC;A;;;MPEG2 5.1\n" "10;ADPCM;2CC;A;ADPCM;;OKI ADPCM\n" "11;ADPCM;2CC;A;ADPCM;;Intel ADPCM\n" "12;ADPCM;2CC;A;ADPCM;;Mediaspace (Videologic) ADPCM\n" "13;ADPCM;2CC;A;ADPCM;;Sierra ADPCM\n" "14;ADPCM;2CC;A;ADPCM;;Antex G723 ADPCM\n" "15;STD;2CC;A;;;DSP solutions Digi-STD\n" "16;FIX;2CC;A;;;DSP solutions Digi-FIX\n" "17;ADPCM;2CC;A;ADPCM;;Dialogic-OKI ADPCM;http://www.microsoft.com/windows/\n" "18;ADPCM;2CC;A;ADPCM;;\n" "19;CU;2CC;A;;;HP CU_CODEC\n" "1A;Dynamic Voice;2CC;A;;;HP\n" "20;ADPCM;2CC;A;ADPCM;;Yamaha ADPCM\n" "21;SONARC;2CC;A;;;Speech Compression SONARC\n" "22;Truespeech;2CC;A;;;DSP Group TrueSpeech;http://www.microsoft.com/windows/\n" "23;SC1;2CC;A;;;Echo Speech SC1\n" "24;AF36;2CC;A;;;Virtual Music AudioFile 36\n" "25;APTX;2CC;A;;;Audio Processing Technology X\n" "26;AF10;2CC;A;;;Virtual Music AudioFile 10\n" "27;Prosody 1612;2CC;A;;;Aculab plc Prosody 1612\n" "28;LRC;2CC;A;;;Merging Technologies LRC\n" "30;AC2;2CC;A;;;Dolby Laboratories AC2\n" "31;GSM 6.10;2CC;A;;;Microsoft GSM 6.10;http://www.microsoft.com/windows/\n" "32;MSAUDIO;2CC;A;;;Microsoft Audio\n" "33;ADPCM;2CC;A;ADPCM;;Antex ADPCM\n" "34;VQLPC;2CC;A;;;Control Resources VQLPC\n" "35;REAL;2CC;A;;;DSP Solutions Digi-REAL\n" "36;ADPCM;2CC;A;ADPCM;;DSP Solutions Digi-ADPCM\n" "37;CR10;2CC;A;;;Control Resources 10\n" "38;ADPCM;2CC;A;ADPCM;;Natural MicroSystems VBX ADPCM\n" "39;ADPCM;2CC;A;ADPCM;;Crystal Semiconductor IMA ADPCM\n" "3A;SC3;2CC;A;;;Echo Speech SC3\n" "3B;ADPCM;2CC;A;;;Rockwell ADPCM\n" "3C;DigiTalk;2CC;A;;;Rockwell DigiTalk\n" "3D;Xebec;2CC;A;;;Xebec Multimedia Solutions\n" "40;ADPCM;2CC;A;ADPCM;;Antex Electronics G721 ADPCM\n" "41;CELP;2CC;A;;;Antex Electronics G728 CELP\n" "42;G.723.1;2CC;A;;;Microsoft G.723.1;http://www.microsoft.com/windows/\n" "42;ADPCM;2CC;A;;;IBM\n" "42;MSG729;2CC;A;;;Microsoft\n" "45;ADPCM;2CC;A;ADPCM;;Microsoft G.726;http://www.microsoft.com/windows/\n" "50;MPEG-1/2 L1;2CC;A;MPEG-1;;;http://www.iis.fraunhofer.de/amm/index.html\n" "51;MPEG-1/2 L2;2CC;A;MPEG-1;;;http://www.iis.fraunhofer.de/amm/index.html\n" "52;RT24;2CC;A;;;InSoft, Inc.\n" "53;PAC;2CC;A;;;InSoft, Inc.\n" "55;MPEG-1/2 L3;2CC;A;MPEG-1;;MPEG-1 or 2 layer 3;http://www.iis.fraunhofer.de/amm/index.html\n" "59;G723;2CC;A;;;Lucent G723\n" "60;Cirrus;2CC;A;;;Cirrus Logic\n" "61;PCM;2CC;A;;;ESS Technology PCM\n" "62;Voxware;2CC;A;;;\n" "63;ATRAC;2CC;A;;;Canopus ATRAC\n" "64;ADPCM;2CC;A;ADPCM;;APICOM G726 ADPCM\n" "65;ADPCM;2CC;A;ADPCM;;APICOM G722 ADPCM\n" "66;DSAT;2CC;A;;;Microsoft DSAT\n" "67;DSAT Display;2CC;A;;;Microsoft DSAT DISPLAY\n" "69;BYTE_ALIGNED;2CC;A;;;Voxware BYTE_ALIGNED;http://www.voxware.com/\n" "70;AC8;2CC;A;;;Voxware AC8;http://www.voxware.com/\n" "71;AC10;2CC;A;;;Voxware AC10;http://www.voxware.com/\n" "72;AC16;2CC;A;;;Voxware AC16;http://www.voxware.com/\n" "73;AC20;2CC;A;;;Voxware AC20;http://www.voxware.com/\n" "74;RT24;2CC;A;;;Voxware RT24 (MetaVoice);http://www.voxware.com/\n" "75;RT29;2CC;A;;;Voxware RT29 (MetaSound);http://www.voxware.com/\n" "76;RT29HW;2CC;A;;;Voxware RT29HW;http://www.voxware.com/\n" "77;VR12;2CC;A;;;Voxware VR12;http://www.voxware.com/\n" "78;VR18;2CC;A;;;Voxware VR18;http://www.voxware.com/\n" "79;TQ40;2CC;A;;;Voxware TQ40;http://www.voxware.com/\n" "7A;SC3;2CC;A;;;Voxware\n" "7B;SC3;2CC;A;;;Voxware\n" "80;Softsound;2CC;A;;;\n" "81;TQ60;2CC;A;;;Voxware TQ60;http://www.voxware.com/\n" "82;MSRT24;2CC;A;;;Microsoft MSRT24\n" "83;G729A;2CC;A;;;AT&T G729A\n" "84;MVI_MVI2;2CC;A;;;Motion Pixels MVI_MVI2\n" "85;ADPCM;2CC;A;ADPCM;;DataFusion Systems (Pty) G726\n" "86;GSM6.10;2CC;A;;;DataFusion Systems (Pty) GSM6.10\n" "88;ISI AUDIO;2CC;A;;;Iterated Systems AUDIO\n" "89;Onlive;2CC;A;;;OnLive! Technologies\n" "8A;SX20;2CC;A;;;Multitude\n" "8B;ADPCM;2CC;A;ADPCM;;Infocom ITS A/S\n" "8C;G.729;2CC;A;;;Convedia Corporation\n" "91;SBC24;2CC;A;;;Siemens Business Communications Sys 24\n" "92;AC3 SPDIF;2CC;A;;;Sonic Foundry AC3 SPDIF\n" "93;G723;2CC;A;;;MediaSonic G723\n" "94;Prosody 8KBPS;2CC;A;;;Aculab plc Prosody 8KBPS\n" "97;ADPCM;2CC;A;ADPCM;;ZyXEL Communications ADPCM\n" "98;LPCBB;2CC;A;;;Philips Speech Processing LPCBB\n" "99;Packed;2CC;A;;;Studer Professional Audio AG Packed\n" "A0;PHONYTALK;2CC;A;;;Malden Electronics PHONYTALK\n" "A1;GSM;2CC;A;;;Racal Recorders\n" "A2;G.720a;2CC;A;;;Racal Recorders\n" "A3;G.723.1;2CC;A;;;Racal Recorders\n" "A4;ACELP;2CC;A;;;Racal Recorders\n" "B0;AAC;2CC;A;AAC;;NEC Corporation\n" "FF;AAC;2CC;A;AAC;;\n" "100;ADPCM;2CC;A;ADPCM;;\n" "101;IRAT;2CC;A;;;BeCubed IRAT\n" "102;;2CC;A;;;IBM A-law\n" "103;;2CC;A;;;IBM AVC ADPCM\n" "111;G723;2CC;A;;;Vivo G723\n" "112;SIREN;2CC;A;;;Vivo SIREN\n" "120;CELP;2CC;A;;;Philips Speech Processing\n" "121;Grundig;2CC;A;;;Philips Speech Processing\n" "123;G723;2CC;A;;;Digital Equipment Corporation (DEC) G723\n" "125;ADPCM;2CC;A;ADPCM;;\n" "130;ACELP;2CC;A;;;Sipro ACELP.net;http://dividix.host.sk\n" "131;ACELP4800;2CC;A;;;Sipro ACELP4800\n" "132;ACELP8V3;2CC;A;;;Sipro ACELP8V3\n" "133;G729;2CC;A;;;Sipro G729\n" "134;G729;2CC;A;;;Sipro G729A\n" "135;KELVIN;2CC;A;;;Sipro KELVIN\n" "135;AMR;2CC;A;;;VoiceAge Corporation\n" "140;ADPCM;2CC;A;ADPCM;;Dictaphone Corporation G726 ADPCM\n" "140;CELP68;2CC;A;;;Dictaphone Corporation\n" "140;CELP54;2CC;A;;;Dictaphone Corporation\n" "150;PureVoice;2CC;A;;;Qualcomm PUREVOICE\n" "151;HalfRate;2CC;A;;;Qualcomm HALFRATE\n" "155;TUBGSM;2CC;A;;;Ring Zero Systems TUBGSM\n" "160;WMA1;2CC;A;;;Windows Media Audio 1;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "161;WMA2;2CC;A;;;Windows Media Audio 2;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "162;WMA3;2CC;A;;;Windows Media Audio 3;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "163;WMA Lossless;2CC;A;;;Windows Media Audio 3;http://www.microsoft.com/windows/windowsmedia/format/codecdownload.aspx\n" "163;WMA Pro;2CC;A;;;WMA Pro over S/PDIF\n" "170;ADPCM;2CC;A;ADPCM;;Unisys Nap ADPCM\n" "171;U-Law;2CC;A;ADPCM;;Unisys Nap U-law\n" "172;A-Law;2CC;A;ADPCM;;Unisys Nap A-law\n" "173;16K;2CC;A;;;Unisys Nap 16K\n" "174;G.700;2CC;A;;;SyCom Technologies\n" "175;ADPCM;2CC;A;ADPCM;;SyCom Technologies\n" "176;CELP54;2CC;A;;;SyCom Technologies\n" "177;CELP68;2CC;A;;;SyCom Technologies\n" "178;ADPCM;2CC;A;ADPCM;;Knowledge Adventure, Inc.\n" "180;AAC;2CC;A;;;Fraunhofer IIS\n" "190;DTS;2CC;A;;\n" "200;ADPCM;2CC;A;ADPCM;;Creative Labs ADPCM\n" "202;FastSpeech8;2CC;A;;;Creative Labs Fast Speech 8\n" "203;FastSpeech10;2CC;A;;;Creative Labs Fast Speech 10\n" "210;ADPCM;2CC;A;ADPCM;;UHER informatic GmbH ADPCM\n" "215;;2CC;A;;;Ulead DV ACM\n" "216;;2CC;A;;;Ulead DV ACM\n" "220;QuaterDeck;2CC;A;;;Quarterdeck\n" "230;VC;2CC;A;;;I-link VC\n" "240;RAW_SPORT;2CC;A;;;Aureal RAW_SPORT\n" "241;AC3;2CC;A;;;ESST AC3\n" "250;HSX;2CC;A;;;Interactive Products, Inc. (IPI) HSX\n" "251;RPELP;2CC;A;;;Interactive Products, Inc. (IPI) RPELP\n" "260;CS2;2CC;A;;;Consistent Software CS2\n" "270;SCX;2CC;A;;;Sony\n" "271;SCY;2CC;A;;;Sony\n" "272;Atrac3;2CC;A;;;Sony\n" "273;SPC;2CC;A;;;Sony\n" "280;Telum;2CC;A;;\n" "281;TelumIA;2CC;A;;\n" "285;ADPCM;2CC;A;ADPCM;;Norcom Voice Systems\n" "300;FM_TOWNS_SND;2CC;A;;;Fujitsu FM_TOWNS_SND\n" "350;Dev;2CC;A;;;Micronas Semiconductors, Inc.\n" "351;CELP833;2CC;A;;;Micronas Semiconductors, Inc.\n" "400;BTV_DIGITAL;2CC;A;;;Brooktree (BTV) DIGITAL\n" "401;Music Coder;2CC;A;;;Intel Music Coder;http://www.intel.com/\n" "402;IAC2;2CC;A;;;Ligos IAC2;http://www.ligos.com\n" "450;Qdesign;2CC;A;;;QDesign Music\n" "500;VP7;2CC;A;;;On2\n" "501;VP6;2CC;A;;;On2\n" "680;VMPCM;2CC;A;;;AT&T VME_VMPCM\n" "681;TPC;2CC;A;;;AT&T TPC\n" "700;YMPEG;2CC;A;;;YMPEG Alpha\n" "8AE;LiteWave;2CC;A;;;ClearJump LiteWave\n" "AAC;AAC;2CC;A;AAC;;\n" "1000;GSM;2CC;A;;;Ing C. Olivetti & C., S.p.A. GSM\n" "1001;ADPCM;2CC;A;ADPCM;;Ing C. Olivetti & C., S.p.A. ADPCM\n" "1002;CELP;2CC;A;;;Ing C. Olivetti & C., S.p.A. CELP\n" "1003;SBC;2CC;A;;;Ing C. Olivetti & C., S.p.A. SBC\n" "1004;OPR;2CC;A;;;Ing C. Olivetti & C., S.p.A. OPR\n" "1100;LH_CODEC;2CC;A;;;Lernout & Hauspie Codec\n" "1101;CELP;2CC;A;;;Lernout & Hauspie CELP 4.8 kb/s;http://www.microsoft.com/windows/\n" "1102;SBC;2CC;A;;;Lernout & Hauspie SBC 8 kb/s;http://www.microsoft.com/windows/\n" "1103;SBC;2CC;A;;;Lernout & Hauspie SBC 12 kb/s;http://www.microsoft.com/windows/\n" "1104;SBC;2CC;A;;;Lernout & Hauspie SBC 16 kb/s;http://www.microsoft.com/windows/\n" "1400;NORRIS;2CC;A;;;Norris Communications, Inc.\n" "1401;ISIAUDIO;2CC;A;;;ISIAudio\n" "1500;MUSICOMPRESS;2CC;A;;;Soundspace Music Compression\n" "181C;RT24;2CC;A;;;VoxWare RT24 speech codec\n" "181E;AX24000P;2CC;A;;;Lucent elemedia AX24000P Music codec\n" "1971;SonicFoundry;2CC;A;;;Lossless\n" "1C03;ADPCM;2CC;A;ADPCM;;Lucent SX5363S G.723 compliant codec\n" "1C07;SX8300P;2CC;A;;;Lucent SX8300P speech codec\n" "1C0C;ADPCM;2CC;A;ADPCM;;Lucent SX5363S G.723 compliant codec\n" "1F03;DigiTalk;2CC;A;;;CUseeMe DigiTalk (ex-Rocwell)\n" "1FC4;ALF2CD;2CC;A;;;NCT Soft ALF2CD ACM\n" "2000;AC3;2CC;A;AC3;CBR;Dolby AC3\n" "2001;DTS;2CC;A;DTS;;Digital Theater Systems\n" "2002;Real Audio 1;2CC;A;;;RealAudio 1/2 14.4\n" "2003;Real Audio 1;2CC;A;;;RealAudio 1/2 28.8\n" "2004;Real Audio 2;2CC;A;;;RealAudio G2/8 Cook (low bitrate)\n" "2005;Real Audio 3;2CC;A;;;RealAudio 3/4/5 Music (DNET)\n" "2006;AAC;2CC;A;AAC;;RealAudio 10 AAC (RAAC)\n" "2007;AAC+;2CC;A;AAC;;RealAudio 10 AAC+ (RACP)\n" "3313;AviSynth;2CC;A;;;makeAVIS (fake AVI sound from AviSynth scripts)\n" "4143;AAC;2CC;A;AAC;;Divio MPEG-4 AAC audio\n" "4201;Nokia;2CC;A;;\n" "4243;ADPCM;2CC;A;ADPCM;;G726\n" "43AC;Lead Speech;2CC;A;;\n" "564C;Lead Vorbis;2CC;A;;;\n" "566F;Vorbis;2CC;A;Vorbis;;;http://www.vorbis.com\n" "5756;WavPack;2CC;A;;;;http://www.wavpack.com/\n" "674F;Vorbis;2CC;A;Vorbis;;Mode 1;http://www.vorbis.com\n" "6750;Vorbis;2CC;A;Vorbis;;Mode 2;http://www.vorbis.com\n" "6751;Vorbis;2CC;A;Vorbis;;Mode 3;http://www.vorbis.com\n" "676F;Vorbis;2CC;A;Vorbis;;Mode 1+;http://www.vorbis.com\n" "6770;Vorbis;2CC;A;Vorbis;;Mode 2+;http://www.vorbis.com\n" "6771;Vorbis;2CC;A;Vorbis;;Mode 2+;http://www.vorbis.com\n" "7A21;AMR;2CC;A;;CBR;GSM-AMR (CBR, no SID);http://www.microsoft.com\n" "7A22;AMR;2CC;A;;VBR;GSM-AMR (VBR, including SID);http://www.microsoft.com\n" "A100;G723.1;2CC;A;;;\n" "A101;AVQSBC;2CC;A;;;\n" "A102;ODSBC;2CC;A;;;\n" "A103;G729A;2CC;A;;;\n" "A104;AMR-WB;2CC;A;;;\n" "A105;ADPCM;2CC;A;ADPCM;;G726\n" "A106;AAC;2CC;A;;;\n" "A107;ADPCM;2CC;A;ADPCM;;G726\n" "A109;Speex;2CC;A;;;;http://www.speex.org/\n" "DFAC;FrameServer;2CC;A;;;DebugMode SonicFoundry Vegas FrameServer ACM Codec\n" "F1AC;FLAC;2CC;A;;;Free Lossless Audio Codec FLAC\n" "FFFE;PCM;2CC;A;PCM;;Extensible wave format\n" "FFFF;In Development;2CC;A;;;In Development / Unregistered\n" "S_TEXT/UTF8;UTF-8;Mk;T;;;UTF-8 Plain Text\n" "S_TEXT/SSA;SSA;Mk;T;;;Sub Station Alpha\n" "S_TEXT/ASS;ASS;Mk;T;;;Advanced Sub Station Alpha\n" "S_TEXT/USF;USF;Mk;T;;;Universal Subtitle Format\n" "S_KATE;KATE;Mk;T;;;Karaoke And Text Encapsulation\n" "S_DVBSUB;DVB Subtitle;Mk;T;;;Picture based subtitle format used on DVBs\n" "S_IMAGE/BMP;Bitmap;Mk;T;;;Basic image based subtitle format\n" "S_VOBSUB;VobSub;Mk;T;;;Picture based subtitle format used on DVDs\n" "S_HDMV/PGS;PGS;Mk;T;;;Picture based subtitle format used on BDs/HD-DVDs\n" "S_HDMV/TEXTST;TEXTST;Mk;T;;;Text based subtitle format used on BDs\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Generic (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Format\n" "Format/String\n" "Format/Info\n" "Format/Url\n" "Format_Commercial\n" "Format_Commercial_IfAny\n" "Format_Version\n" "Format_Profile\n" "Format_Level\n" "Format_Tier\n" "Format_Compression\n" "Format_Settings\n" "Format_AdditionalFeatures\n" "InternetMediaType\n" "CodecID\n" "CodecID/Info\n" "CodecID/Hint\n" "CodecID/Url\n" "CodecID_Description\n" "Codec\n" "Codec/String\n" "Codec/Info\n" "Codec/Url\n" "Codec/CC\n" "Duration\n" "Duration/String\n" "Duration/String1\n" "Duration/String2\n" "Duration/String3\n" "Duration/String4\n" "Duration/String5\n" "Source_Duration\n" "Source_Duration/String\n" "Source_Duration/String1\n" "Source_Duration/String2\n" "Source_Duration/String3\n" "Source_Duration/String4\n" "Source_Duration/String5\n" "BitRate_Mode\n" "BitRate_Mode/String\n" "BitRate\n" "BitRate/String\n" "BitRate_Minimum\n" "BitRate_Minimum/String\n" "BitRate_Nominal\n" "BitRate_Nominal/String\n" "BitRate_Maximum\n" "BitRate_Maximum/String\n" "BitRate_Encoded\n" "BitRate_Encoded/String\n" "FrameRate\n" "FrameRate/String\n" "FrameRate_Num\n" "FrameRate_Den\n" "FrameCount\n" "Source_FrameCount\n" "ColorSpace\n" "ChromaSubsampling\n" "Resolution\n" "Resolution/String\n" "BitDepth\n" "BitDepth/String\n" "Compression_Mode\n" "Compression_Mode/String\n" "Compression_Ratio\n" "Delay\n" "Delay/String\n" "Delay/String1\n" "Delay/String2\n" "Delay/String3\n" "Delay/String4\n" "Delay/String5\n" "Delay_Settings\n" "Delay_DropFrame\n" "Delay_Source\n" "Delay_Source/String\n" "Delay_Original\n" "Delay_Original/String\n" "Delay_Original/String1\n" "Delay_Original/String2\n" "Delay_Original/String3\n" "Delay_Original/String4\n" "Delay_Original/String5\n" "Delay_Original_Settings\n" "Delay_Original_DropFrame\n" "Delay_Original_Source\n" "Video_Delay\n" "Video_Delay/String\n" "Video_Delay/String1\n" "Video_Delay/String2\n" "Video_Delay/String3\n" "Video_Delay/String4\n" "Video_Delay/String5\n" "StreamSize\n" "StreamSize/String\n" "StreamSize/String1\n" "StreamSize/String2\n" "StreamSize/String3\n" "StreamSize/String4\n" "StreamSize/String5\n" "StreamSize_Proportion\n" "Source_StreamSize\n" "Source_StreamSize/String\n" "Source_StreamSize/String1\n" "Source_StreamSize/String2\n" "Source_StreamSize/String3\n" "Source_StreamSize/String4\n" "Source_StreamSize/String5\n" "Source_StreamSize_Proportion\n" "StreamSize_Encoded\n" "StreamSize_Encoded/String\n" "StreamSize_Encoded/String1\n" "StreamSize_Encoded/String2\n" "StreamSize_Encoded/String3\n" "StreamSize_Encoded/String4\n" "StreamSize_Encoded/String5\n" "StreamSize_Encoded_Proportion\n" "Source_StreamSize_Encoded\n" "Source_StreamSize_Encoded/String\n" "Source_StreamSize_Encoded/String1\n" "Source_StreamSize_Encoded/String2\n" "Source_StreamSize_Encoded/String3\n" "Source_StreamSize_Encoded/String4\n" "Source_StreamSize_Encoded/String5\n" "Source_StreamSize_Encoded_Proportion\n" "Language\n" "ServiceName\n" "ServiceProvider\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_General (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;Status of bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of this kind available (base=1)\n" "StreamKind;General;;N NT;;;Stream type name\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Stream number (base=0)\n" "StreamKindPos;;;N NI;;;Number of the stream, when multiple (base=1)\n" "StreamOrder;;;N YI;;;Stream order in the file for type of stream (base=0)\n" "FirstPacketOrder;;;N YI;;;Order of the first fully decodable packet met in the file for stream type (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "GeneralCount;1;;N NIY;;;Number of general streams\n" "VideoCount;;;N NIY;;;Number of video streams\n" "AudioCount;;;N NIY;;;Number of audio streams\n" "TextCount;;;N NIY;;;Number of text streams\n" "OtherCount;;;N NIY;;;Number of other streams\n" "ImageCount;;;N NIY;;;Number of image streams\n" "MenuCount;;;N NIY;;;Number of menu streams\n" "Video_Format_List;;;N NT;;;Video Codecs in this file, separated by /\n" "Video_Format_WithHint_List;;;N NT;;;Video Codecs in this file with popular name (hint), separated by /\n" "Video_Codec_List;;;N NT;;;Deprecated, do not use in new projects\n" "Video_Language_List;;;N NT;;;Video languages in this file, full names, separated by /\n" "Audio_Format_List;;;N NT;;;Audio Codecs in this file,separated by /\n" "Audio_Format_WithHint_List;;;N NT;;;Audio Codecs in this file with popular name (hint), separated by /\n" "Audio_Codec_List;;;N NT;;;Deprecated, do not use in new projects\n" "Audio_Language_List;;;N NT;;;Audio languages in this file separated by /\n" "Text_Format_List;;;N NT;;;Text Codecs in this file, separated by /\n" "Text_Format_WithHint_List;;;N NT;;;Text Codecs in this file with popular name (hint),separated by /\n" "Text_Codec_List;;;N NT;;;Deprecated, do not use in new projects\n" "Text_Language_List;;;N NT;;;Text languages in this file, separated by /\n" "Other_Format_List;;;N NT;;;Other formats in this file, separated by /\n" "Other_Format_WithHint_List;;;N NT;;;Other formats in this file with popular name (hint), separated by /\n" "Other_Codec_List;;;N NT;;;Deprecated, do not use in new projects\n" "Other_Language_List;;;N NT;;;Chapters languages in this file, separated by /\n" "Image_Format_List;;;N NT;;;Image Codecs in this file, separated by /\n" "Image_Format_WithHint_List;;;N NT;;;Image Codecs in this file with popular name (hint), separated by /\n" "Image_Codec_List;;;N NT;;;Deprecated, do not use in new projects\n" "Image_Language_List;;;N NT;;;Image languages in this file, separated by /\n" "Menu_Format_List;;;N NT;;;Menu Codecs in this file, separated by /\n" "Menu_Format_WithHint_List;;;N NT;;;Menu Codecs in this file with popular name (hint),separated by /\n" "Menu_Codec_List;;;N NT;;;Deprecated, do not use in new projects\n" "Menu_Language_List;;;N NT;;;Menu languages in this file, separated by /\n" "CompleteName;;;Y YT;;;Complete name (Folder+Name+Extension)\n" "FolderName;;;N NT;;;Folder name only\n" "FileNameExtension;;;N NT;;;File name and extension\n" "FileName;;;N NT;;;File name only\n" "FileExtension;;;N NTY;;;File extension only\n" "CompleteName_Last;;;Y YTY;;;Complete name (Folder+Name+Extension) of the last file (in the case of a sequence of files)\n" "FolderName_Last;;;N NT;;;Folder name only of the last file (in the case of a sequence of files)\n" "FileNameExtension_Last;;;N NT;;;File name and extension of the last file (in the case of a sequence of files)\n" "FileName_Last;;;N NT;;;File name only of the last file (in the case of a sequence of files)\n" "FileExtension_Last;;;N NT;;;File extension only of the last file (in the case of a sequence of files)\n" "Format;;;N YTY;;;Format used\n" "Format/String;;;Y NT;;;Format used + additional features\n" "Format/Info;;;Y NT;;;Info about this Format\n" "Format/Url;;;N NT;;;Link to a description of this format\n" "Format/Extensions;;;N NT;;;Known extensions of this format\n" "Format_Commercial;;;N NT;;;Commercial name used by vendor for these settings or Format field if there is no difference\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for these settings if there is one\n" "Format_Version;;;Y YTY;;;Version of this format\n" "Format_Profile;;;Y YTY;;;Profile of the Format (old XML: 'Profile@Level' format; MIXML: 'Profile' only)\n" "Format_Level;;;Y YTY;;;Level of the Format (only MIXML)\n" "Format_Compression;;;Y YTY;;;Compression method used;\n" "Format_Settings;;;Y YTY;;;Settings needed for decoder used\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "InternetMediaType;;;N YT;;;Internet Media Type (aka MIME Type, Content-Type)\n" "CodecID;;;N YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info about this Codec\n" "CodecID/Hint;;;Y NT;;;A hint/popular name for this Codec\n" "CodecID/Url;;;N NT;;;A link to more details about this Codec ID\n" "CodecID_Description;;;Y YTY;;;Manual description given by the container\n" "CodecID_Version;;;N YTY;;;Version of the CodecID\n" "CodecID_Compatible;;;N YTY;;;Compatible CodecIDs\n" "Interleaved;;;N YTY;;;If Audio and video are muxed\n" "Codec;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/String;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Info;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Url;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Extensions;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_Automatic;;;N NT;;;Deprecated, do not use in new projects\n" "FileSize;; byte;N YTY;;;File size in bytes\n" "FileSize/String;;;Y NT;;;File size (with measure)\n" "FileSize/String1;;;N NT;;;File size (with measure, 1 digit mini)\n" "FileSize/String2;;;N NT;;;File size (with measure, 2 digit mini)\n" "FileSize/String3;;;N NT;;;File size (with measure, 3 digit mini)\n" "FileSize/String4;;;N NT;;;File size (with measure, 4 digit mini)\n" "Duration;; ms;N YFY;;;Play time of the stream (in ms)\n" "Duration/String;;;Y NT;;;Play time in format : XXx YYy only, YYy omitted if zero\n" "Duration/String1;;;N NT;;;Play time in format : HHh MMmn SSs MMMms, XX omitted if zero\n" "Duration/String2;;;N NT;;;Play time in format : XXx YYy only, YYy omitted if zero\n" "Duration/String3;;;N NT;;;Play time in format : HH:MM:SS.MMM\n" "Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_Start;;;Y YTY;;\n" "Duration_End;;;Y YTY;;\n" "OverallBitRate_Mode;;;N YTY;;;Bit rate mode of all streams (VBR, CBR)\n" "OverallBitRate_Mode/String;;;Y NT;;;Bit rate mode of all streams (Variable, Constant)\n" "OverallBitRate;; bps;N YFY;;;Bit rate of all streams (in bps)\n" "OverallBitRate/String;;;Y NT;;;Bit rate of all streams (with measure)\n" "OverallBitRate_Minimum;; bps;N YFY;;;Minimum bit rate (in bps)\n" "OverallBitRate_Minimum/String;;;Y NT;;;Minimum bit rate (with measurement)\n" "OverallBitRate_Nominal;; bps;N YFY;;;Nominal bit rate (in bps)\n" "OverallBitRate_Nominal/String;;;Y NT;;;Nominal bit rate (with measurement)\n" "OverallBitRate_Maximum;; bps;N YFY;;;Maximum bit rate (in bps)\n" "OverallBitRate_Maximum/String;;;Y NT;;;Maximum bit rate (with measurement)\n" "FrameRate;; fps;N YFY;;;Frames per second\n" "FrameRate/String;;;N NT;;;Frames per second (with measurement)\n" "FrameRate_Num;;;N NFN;;;Frames per second, numerator\n" "FrameRate_Den;;;N NFN;;;Frames per second, denominator\n" "FrameCount;;;N NIY;;;Frame count (if a frame contains a count of samples);\n" "Delay;; ms;N YI;;;Delay fixed in the stream (relative) (in ms)\n" "Delay/String;;;N NT;;;Delay with measurement\n" "Delay/String1;;;N NT;;;Delay with measurement\n" "Delay/String2;;;N NT;;;Delay with measurement\n" "Delay/String3;;;N NT;;;format : HH:MM:SS.MMM\n" "Delay/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Settings;;;N NTY;;;Delay settings (in case of timecode, for example)\n" "Delay_DropFrame;;;N NTY;;;Delay drop frame\n" "Delay_Source;;;N NTY;;;Delay source (Container, Stream, empty)\n" "Delay_Source/String;;;N NT;;;Delay source (Container, Stream, empty)\n" "StreamSize;; byte;N YIY;;;Stream size (in bytes)\n" "StreamSize/String;;;N NT;;\n" "StreamSize/String1;;;N NT;;\n" "StreamSize/String2;;;N NT;;\n" "StreamSize/String3;;;N NT;;\n" "StreamSize/String4;;;N NT;;\n" "StreamSize/String5;;;N NT;;;Stream size with proportion\n" "StreamSize_Proportion;;;N NT;;;Stream size divided by file size\n" "StreamSize_Demuxed;; byte;N YIN;;;StreamSize after demux (in bytes);\n" "StreamSize_Demuxed/String;;;N NT;;;StreamSize_Demuxed with percentage value;\n" "StreamSize_Demuxed/String1;;;N NT;;;;\n" "StreamSize_Demuxed/String2;;;N NT;;;;\n" "StreamSize_Demuxed/String3;;;N NT;;;;\n" "StreamSize_Demuxed/String4;;;N NT;;;;\n" "StreamSize_Demuxed/String5;;;N NT;;;StreamSize_Demuxed with percentage value (note: theoretical value, not for real use);\n" "HeaderSize;;;N YIY;;\n" "DataSize;;;N YIY;;\n" "FooterSize;;;N YIY;;\n" "IsStreamable;;;N YTY;;\n" "Album_ReplayGain_Gain;; dB;N YTY;;;The gain to apply to reach 89dB SPL on playback\n" "Album_ReplayGain_Gain/String;;;Y YT;;\n" "Album_ReplayGain_Peak;;;Y YTY;;;The maximum absolute peak value of the item;\n" "Encryption;;;Y YT;;;;\n" "Encryption_Format;;;N YTY;;;;\n" "Encryption_Length;;;N YTY;;;;\n" "Encryption_Method;;;N YTY;;;;\n" "Encryption_Mode;;;N YTY;;;;\n" "Encryption_Padding;;;N YTY;;;;\n" "Encryption_InitializationVector;;;N YTY;;;;\n" "UniversalAdID/String;;;Y NT;;;Universal Ad-ID, see https://ad-id.org\n" "UniversalAdID_Registry;;;N YTY;;;Universal Ad-ID registry\n" "UniversalAdID_Value;;;N YTY;;;Universal Ad-ID value\n" "Title;;;N NTY;;;(Generic)Title of file;;Title\n" "Title_More;;;N NTY;;;(Generic)More info about the title of file;;Title\n" "Title/Url;;;N NT;;;(Generic)Url;;Title\n" "Domain;;;Y YTY;;;Universe movies belong to, e.g. Star Wars, Stargate, Buffy, Dragonball;;Title\n" "Collection;;;Y YTY;;;Name of the series, e.g. Star Wars movies, Stargate SG-1, Stargate Atlantis, Buffy, Angel;;Title\n" "Season;;;Y YTY;;;Name of the season, e.g. Star Wars first Trilogy, Season 1;;Title\n" "Season_Position;;;Y YIY;;;Number of the Season;;Title\n" "Season_Position_Total;;;Y YIY;;;Place of the season, e.g. 2 of 7;;Title\n" "Movie;;;Y YTY;;;Name of the movie. Eg : Star Wars, A New Hope;;Title\n" "Movie_More;;;Y YTY;;;More info about the movie;;Title\n" "Movie/Country;;;Y YTY;;;Country, where the movie was produced;;Title\n" "Movie/Url;;;Y YT;;;Homepage for the movie;;Title\n" "Album;;;Y YTY;;;Name of an audio-album. Eg : The Joshua Tree;;Title\n" "Album_More;;;Y YTY;;;More info about the album;;Title\n" "Album/Sort;;;Y YTY;;;;;Title\n" "Album/Performer;;;Y YTY;;;Album performer/artist of this file;;Entity\n" "Album/Performer/Sort;;;Y YTY;;;;;Entity\n" "Album/Performer/Url;;;Y YT;;;Homepage of the album performer/artist;;Entity\n" "Comic;;;Y YTY;;;Name of the comic.;;Title\n" "Comic_More;;;Y YTY;;;More info about the comic;;Title\n" "Comic/Position_Total;;;Y YIY;;;Place of the comic, e.g. 1 of 10;;Title\n" "Part;;;Y YTY;;;Name of the part. e.g. CD1, CD2;;Title\n" "Part/Position;;;Y YIY;;;Number of the part;;Title\n" "Part/Position_Total;;;Y YIY;;;Place of the part e.g. 2 of 3;;Title\n" "Track;;;Y YTY;;;Name of the track. e.g. track 1, track 2;;Title\n" "Track_More;;;Y YTY;;;More info about the track;;Title\n" "Track/Url;;;Y YT;;;Link to a site about this track;;Title\n" "Track/Sort;;;Y YTY;;;;;Title\n" "Track/Position;;;Y YIY;;;Number of this track;;Title\n" "Track/Position_Total;;;Y YIY;;;Place of this track, e.g. 3 of 15;;Title\n" "PackageName;;;Y YTY;;;Package name i.e. technical flavor of the content\n" "Grouping;;;Y YTY;;;iTunes grouping;;Title\n" "Chapter;;;Y YTY;;;Name of the chapter;;Title\n" "SubTrack;;;Y YTY;;;Name of the subtrack;;Title\n" "Original/Album;;;Y YTY;;;Original name of the album;;Title\n" "Original/Movie;;;Y YTY;;;Original name of the movie;;Title\n" "Original/Part;;;Y YTY;;;Original name of the part;;Title\n" "Original/Track;;;Y YTY;;;Original name of the track;;Title\n" "Compilation;;Yes;N YTY;;;iTunes compilation;;Title\n" "Compilation/String;;;Y NT;;;iTunes compilation;;Title\n" "Performer;;;Y YTY;;;Main performer(s)/artist(s);;Entity\n" "Performer/Sort;;;Y YTY;;;;;Entity\n" "Performer/Url;;;Y YT;;;Homepage of the performer/artist;;Entity\n" "Original/Performer;;;Y YTY;;;Original artist(s)/performer(s);;Entity\n" "Accompaniment;;;Y YTY;;;Band/orchestra/accompaniment/musician;;Entity\n" "Composer;;;Y YTY;;;Name of the original composer;;Entity\n" "Composer/Nationality;;;Y YTY;;;Nationality of the primary composer of the piece (mostly for classical music);;Entity\n" "Composer/Sort;;;Y YTY;;;;;Entity\n" "Arranger;;;Y YTY;;;The person who arranged the piece (e.g. Ravel);;Entity\n" "Lyricist;;;Y YTY;;;The person who wrote the lyrics for the piece;;Entity\n" "Original/Lyricist;;;Y YTY;;;Original lyricist(s)/text writer(s).;;Entity\n" "Conductor;;;Y YTY;;;The artist(s) who performed the work. In classical music this would be the conductor, orchestra, soloists, etc.;;Entity\n" "Director;;;Y YTY;;;Name of the director;;Entity\n" "CoDirector;;;Y YTY;;;Name of the codirector;;Entity\n" "AssistantDirector;;;Y YTY;;;Name of the assistant director;;Entity\n" "DirectorOfPhotography;;;Y YTY;;;Name of the director of photography, also known as cinematographer;;Entity\n" "SoundEngineer;;;Y YTY;;;Name of the sound engineer or sound recordist;;Entity\n" "ArtDirector;;;Y YTY;;;Name of the person who oversees the artists and craftspeople who build the sets;;Entity\n" "ProductionDesigner;;;Y YTY;;;Name of the person responsible for designing the overall visual appearance of a movie;;Entity\n" "Choreographer;;;Y YTY;;;Name of the choreographer;;Entity\n" "CostumeDesigner;;;Y YTY;;;Name of the costume designer;;Entity\n" "Actor;;;Y YTY;;;Real name of an actor/actress playing a role in the movie;;Entity\n" "Actor_Character;;;Y YTY;;;Name of the character an actor or actress plays in this movie;;Entity\n" "WrittenBy;;;Y YTY;;;Author of the story or script;;Entity\n" "ScreenplayBy;;;Y YTY;;;Author of the screenplay or scenario (used for movies and TV shows);;Entity\n" "EditedBy;;;Y YTY;;;Editors name;;Entity\n" "CommissionedBy;;;Y YTY;;;Name of the person or organization that commissioned the subject of the file;;Entity\n" "Producer;;;Y YTY;;;Name of the producer of the movie;;Entity\n" "CoProducer;;;Y YTY;;;Name of a co-producer;;Entity\n" "ExecutiveProducer;;;Y YTY;;;Name of an executive producer;;Entity\n" "MusicBy;;;Y YTY;;;Main musical artist for a movie;;Entity\n" "DistributedBy;;;Y YTY;;;Company responsible for distribution of the content;;Entity\n" "OriginalSourceForm/DistributedBy;;;Y YTY;;;Name of the person or organization who supplied the original subject;;Entity\n" "MasteredBy;;;Y YTY;;;The engineer who mastered the content for a physical medium or for digital distribution;;Entity\n" "EncodedBy;;;Y YTY;;;Name of the person/organisation that encoded/ripped the audio file.;;Entity\n" "RemixedBy;;;Y YTY;;;Name of the artist(s) that interpreted, remixed, or otherwise modified the content;;Entity\n" "ProductionStudio;;;Y YTY;;;Main production studio;;Entity\n" "ThanksTo;;;Y YTY;;;A very general tag for everyone else that wants to be listed;;Entity\n" "Publisher;;;Y YTY;;;Name of the organization publishing the album (i.e. the 'record label') or movie;;Entity\n" "Publisher/URL;;;Y YTY;;;Publisher's official webpage;;Entity\n" "Label;;;Y YTY;;;Brand or trademark associated with the marketing of music recordings and music videos;;Entity\n" "Genre;;;Y YTY;;;Main genre of the audio or video. e.g. classical, ambient-house, synthpop, sci-fi, drama, etc.;;Classification\n" "PodcastCategory;;;Y YTY;;;Podcast category;;Classification\n" "Mood;;;Y YTY;;;Intended to reflect the mood of the item with a few keywords, e.g. Romantic, Sad, Uplifting, etc.;;Classification\n" "ContentType;;;Y YTY;;;The type or genre of the content. e.g. Documentary, Feature Film, Cartoon, Music Video, Music, Sound FX, etc.;;Classification\n" "Subject;;;Y YTY;;;Describes the topic of the file, such as 'Aerial view of Seattle.';;Classification\n" "Description;;;Y YTY;;;A short description of the contents, such as 'Two birds flying.';;Classification\n" "Keywords;;;Y YTY;;;Keywords for the content separated by a comma, used for searching;;Classification\n" "Summary;;;Y YTY;;;Plot outline or a summary of the story;;Classification\n" "Synopsis;;;Y YTY;;;Description of the story line of the item;;Classification\n" "Period;;;Y YTY;;;Describes the period that the piece is from or about. e.g. Renaissance.;;Classification\n" "LawRating;;;Y YTY;;;Legal rating of a movie. Format depends on country of origin (e.g. PG or R in the USA, an age in other countries or a URI defining a logo);;Classification\n" "LawRating_Reason;;;Y YTY;;;Reason for the law rating;;Classification\n" "ICRA;;;Y YTY;;;The ICRA rating (previously RSACi);;Classification\n" "Released_Date;;;Y YTY;;;Date/year that the content was released;;Temporal\n" "Original/Released_Date;;;Y YTY;;;Date/year that the content was originally released;;Temporal\n" "Recorded_Date;;;Y YTY;;;Time/date/year that the recording began;;Temporal\n" "Encoded_Date;;;Y YTY;;;Time/date/year that the encoding of this content was completed;;Temporal\n" "Tagged_Date;;;Y YTY;;;Time/date/year that the tags were added to this content;;Temporal\n" "Written_Date;;;Y YTY;;;Time/date/year that the composition of the music/script began;;Temporal\n" "Mastered_Date;;;Y YTY;;;Time/date/year that the content was transferred to a digital medium.;;Temporal\n" "File_Created_Date;;;N NTY;;;Time that the file was created on the file system;;Temporal\n" "File_Created_Date_Local;;;N NTY;;;Time that the file was created on the file system (Warning: this field depends of local configuration, do not use it in an international database);;Temporal\n" "File_Modified_Date;;;N NTY;;;Time that the file was last modified on the file system;;Temporal\n" "File_Modified_Date_Local;;;N NTY;;;Time that the file was last modified on the file system (Warning: this field depends of local configuration, do not use it in an international database);;Temporal\n" "Recorded_Location;;;Y YTY;;;Location where track was recorded (See COMPOSITION_LOCATION for format);;Spatial\n" "Written_Location;;;Y YTY;;;Location that the item was originally designed/written. Information should be stored in the following format: country code, state/province, city where the country code is the same 2 octets as in Internet domains, or possibly ISO-3166. e.g. US, Texas, Austin or US, , Austin.;;Spatial\n" "Archival_Location;;;Y YTY;;;Location where an item is archived (e.g. Louvre, Paris, France);;Spatial\n" "Encoded_Application;;;N YTY;;;Name of the software package used to create the file, such as Microsoft WaveEdiTY;;Technical\n" "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Application_CompanyName;;;N YTY;;;Name of the company of the encoding application;;Technical\n" "Encoded_Application_Name;;;N YTY;;;Name of the encoding product;;Technical\n" "Encoded_Application_Version;;;N YTY;;;Version of the encoding product;;Technical\n" "Encoded_Application_Url;;;N YTY;;;URL associated with the encoding software;;Technical\n" "Encoded_Library;;;N YTY;;;Software used to create the file;;Technical\n" "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Library_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Library_Name;;;N NTY;;;Name of the the encoding library;;Technical\n" "Encoded_Library_Version;;;N NTY;;;Version of encoding library;;Technical\n" "Encoded_Library_Date;;;N NTY;;;Release date of encoding library;;Technical\n" "Encoded_Library_Settings;;;Y YTY;;;Parameters used by the encoding library;;Technical\n" "Encoded_OperatingSystem;;;N YTY;;;Operating System used by encoding application;;Technical\n" "Cropped;;;Y YTY;;;Describes whether an image has been cropped and, if so, how it was cropped;;Technical\n" "Dimensions;;;Y YTY;;;Specifies the size of the original subject of the file (e.g. 8.5 in h, 11 in w);;Technical\n" "DotsPerInch;;;Y YTY;;;Stores dots per inch setting of the digitization mechanism used to produce the file;;Technical\n" "Lightness;;;Y YTY;;;Describes the changes in lightness settings on the digitization mechanism made during the production of the file;;Technical\n" "OriginalSourceMedium;;;Y YTY;;;Original medium of the material (e.g. vinyl, Audio-CD, Super8 or BetaMax);;Technical\n" "OriginalSourceForm;;;Y YTY;;;Original form of the material (e.g. slide, paper, map);;Technical\n" "OriginalSourceForm/NumColors;;;Y YTY;;;Number of colors requested when digitizing (e.g. 256 for images or 32 bit RGB for video);;Technical\n" "OriginalSourceForm/Name;;;Y YTY;;;Name of the product the file was originally intended for;;Technical\n" "OriginalSourceForm/Cropped;;;Y YTY;;;Describes whether the original image has been cropped and, if so, how it was cropped (e.g. 16:9 to 4:3, top and bottom);;Technical\n" "OriginalSourceForm/Sharpness;;;Y YTY;;;Identifies changes in sharpness the digitization mechanism made during the production of the file;;Technical\n" "Tagged_Application;;;Y YTY;;;Software used to tag the file;;Technical\n" "BPM;;;Y YTY;;;Average number of beats per minute;;Technical\n" "ISRC;;;Y YTY;;;International Standard Recording Code, excluding the ISRC prefix and including hyphens;;Identifier\n" "ISBN;;;Y YTY;;;International Standard Book Number.;;Identifier\n" "BarCode;;;Y YTY;;;EAN-13 (13-digit European Article Numbering) or UPC-A (12-digit Universal Product Code) bar code identifier;;Identifier\n" "LCCN;;;Y YTY;;;Library of Congress Control Number;;Identifier\n" "CatalogNumber;;;Y YTY;;;A label-specific catalogue number used to identify the release. e.g. TIC 01;;Identifier\n" "LabelCode;;;Y YTY;;;A 4-digit or 5-digit number to identify the record label, typically printed as (LC) xxxx or (LC) 0xxxx on CDs medias or covers, with only the number being stored;;Identifier\n" "Owner;;;Y YTY;;;Owner of the file;;Legal\n" "Copyright;;;Y YTY;;;Copyright attribution;;Legal\n" "Copyright/Url;;;Y YTY;;;Link to a site with copyright/legal information;;Legal\n" "Producer_Copyright;;;Y YTY;;;Copyright information as per the production copyright holder;;Legal\n" "TermsOfUse;;;Y YTY;;;License information (e.g. All Rights Reserved, Any Use Permitted);;Legal\n" "ServiceName;;;Y YTY;;;;;Legal\n" "ServiceChannel;;;Y YTY;;;;;Legal\n" "Service/Url;;;Y YTY;;;;;Legal\n" "ServiceProvider;;;Y YTY;;;;;Legal\n" "ServiceProvider/Url;;;Y YTN;;;;;Legal\n" "ServiceType;;;Y YTY;;;;;Legal\n" "NetworkName;;;Y YTY;;;;;Legal\n" "OriginalNetworkName;;;Y YTY;;;;;Legal\n" "Country;;;Y YTY;;;;;Legal\n" "TimeZone;;;Y YTY;;;;;Legal\n" "Cover;;;Y YTY;;;Is there a cover;;Info\n" "Cover_Description;;;Y YTY;;;Short description (e.g. Earth in space);;Info\n" "Cover_Type;;;Y YTY;;;;;Info\n" "Cover_Mime;;;Y YTY;;;Mime type of cover file;;Info\n" "Cover_Data;;;N YTY;;;Cover, in binary format, encoded as BASE64;;Info\n" "Lyrics;;;Y YTY;;;Text of a song;;Info\n" "Comment;;;Y YTY;;;Any comment related to the content;;Personal\n" "Rating;;;Y YTY;;;A numeric value defining how much a person likes the song/movie. The number is between 0 and 5 with decimal values possible (e.g. 2.7), 5(.0) being the highest possible rating.;;Personal\n" "Added_Date;;;Y YTY;;;Date/year the item was added to the owners collection;;Personal\n" "Played_First_Date;;;Y YTY;;;Date the owner first played an item;;Personal\n" "Played_Last_Date;;;Y YTY;;;Date the owner last played an item;;Personal\n" "Played_Count;;;Y YIY;;;Number of times an item was played;;Personal\n" "EPG_Positions_Begin;;;N YIY;;;;\n" "EPG_Positions_End;;;N YIY;;;;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Video (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of that kind available\n" "StreamKind;Video;;N NT;;;Stream type name\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Number of the stream (base=0)\n" "StreamKindPos;;;N NI;;;When multiple streams, number of the stream (base=1)\n" "StreamOrder;;;N YIY;;;Stream order in the file, whatever is the kind of stream (base=0)\n" "FirstPacketOrder;;;N YIY;;;Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "Format;;;N YTY;;;Format used\n" "Format/String;;;Y NT;;;Format used + additional features\n" "Format/Info;;;Y NT;;;Info about Format\n" "Format/Url;;;N NT;;;Link\n" "Format_Commercial;;;N NT;;;Commercial name used by vendor for theses setings or Format field if there is no difference\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for theses setings if there is one\n" "Format_Version;;;Y YTY;;;Version of this format\n" "Format_Profile;;;Y YTY;;;Profile of the Format (old XML: 'Profile@Level@Tier' format; MIXML: 'Profile' only)\n" "Format_Level;;;Y YTY;;;Level of the Format (only MIXML)\n" "Format_Tier;;;Y YTY;;;Tier of the Format (only MIXML)\n" "Format_Compression;;;Y YTY;;;Compression method used\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "MultiView_BaseProfile;;;Y YTY;;;Multiview, profile of the base stream\n" "MultiView_Count;;;Y YTY;;;Multiview, count of views\n" "MultiView_Layout;;;Y YTY;;;Multiview, how views are muxed in the container in case of it is not muxing in the stream\n" "HDR_Format;;;N YTY;;;Format used\n" "HDR_Format/String;;;Y NT;;;Format used + version + profile + level + layers + settings + compatibility\n" "HDR_Format_Commercial;;;N NT;;;Commercial name used by vendor for theses HDR settings or HDR Format field if there is no difference\n" "HDR_Format_Version;;;N YTY;;;Version of this format\n" "HDR_Format_Profile;;;N YTY;;;Profile of the Format\n" "HDR_Format_Level;;;N YTY;;;Level of the Format\n" "HDR_Format_Settings;;;N YTY;;;Settings of the Format\n" "HDR_Format_Compatibility;;;N YTY;;;Compatibility with some commercial namings\n" "Format_Settings;;;Y NT;;;Settings needed for decoder used, summary\n" "Format_Settings_BVOP;;Yes;N YTY;;;Settings needed for decoder used, detailled\n" "Format_Settings_BVOP/String;;;Y NT;;;Settings needed for decoder used, detailled\n" "Format_Settings_QPel;;Yes;N YTY;;;Settings needed for decoder used, detailled\n" "Format_Settings_QPel/String;;;Y NT;;;Settings needed for decoder used, detailled\n" "Format_Settings_GMC;; warppoint;N YIY;;;Settings needed for decoder used, detailled\n" "Format_Settings_GMC/String;;;Y NT;;\n" "Format_Settings_Matrix;;;N YTY;;;Settings needed for decoder used, detailled\n" "Format_Settings_Matrix/String;;;Y NT;;;Settings needed for decoder used, detailled\n" "Format_Settings_Matrix_Data;;;N NTY;;;Matrix, in binary format encoded BASE64. Order = intra, non-intra, gray intra, gray non-intra\n" "Format_Settings_CABAC;;Yes;N YTY;;;Settings needed for decoder used, detailled\n" "Format_Settings_CABAC/String;;;Y NT;;;Settings needed for decoder used, detailled\n" "Format_Settings_RefFrames;; frame;N YIY;;;Settings needed for decoder used, detailled\n" "Format_Settings_RefFrames/String;;;Y NT;;;Settings needed for decoder used, detailled\n" "Format_Settings_Pulldown;;;Y YTY;;;Settings needed for decoder used, detailled\n" "Format_Settings_Endianness;;;N YTY;;;;\n" "Format_Settings_Packing;;;N YTY;;;;\n" "Format_Settings_FrameMode;;;Y YTY;;;Settings needed for decoder used, detailled\n" "Format_Settings_GOP;;;Y YTY;;;Settings needed for decoder used, detailled (M=x N=y)\n" "Format_Settings_PictureStructure;;;Y YTY;;;Settings needed for decoder used, detailled (Type of frame, and field/frame info)\n" "Format_Settings_Wrapping;;;Y YTY;;;Wrapping mode (Frame wrapped or Clip wrapped)\n" "InternetMediaType;;;N YT;;;Internet Media Type (aka MIME Type, Content-Type)\n" "MuxingMode;;;Y YTY;;;How this file is muxed in the container\n" "CodecID;;;Y YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info on the codec\n" "CodecID/Hint;;;Y NT;;;Hint/popular name for this codec\n" "CodecID/Url;;;N NT;;;Homepage for more details about this codec\n" "CodecID_Description;;;Y YT;;;Manual description given by the container\n" "Codec;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/String;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Family;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Info;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Url;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/CC;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Profile;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Description;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_PacketBitStream;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_BVOP;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_QPel;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_GMC;; warppoint;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_GMC/String;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_Matrix;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_Matrix_Data;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_CABAC;;;N NT;;;Deprecated, do not use in new projects\n" "Codec_Settings_RefFrames;;;N NT;;;Deprecated, do not use in new projects\n" "Duration;; ms;N YFY;;;Play time of the stream in ms\n" "Duration/String;;;Y NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String1;;;N NT;;;Play time in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration/String2;;;N NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String3;;;N NT;;;Play time in format : HH:MM:SS.MMM\n" "Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_FirstFrame;; ms;N YFY;;;Duration of the first frame if it is longer than others, in ms\n" "Duration_FirstFrame/String;;;Y NT;;;Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_FirstFrame/String1;;;N NT;;;Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration_FirstFrame/String2;;;N NT;;;Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_FirstFrame/String3;;;N NT;;;Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Duration_FirstFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration_FirstFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_LastFrame;; ms;N YFY;;;Duration of the last frame if it is longer than others, in ms\n" "Duration_LastFrame/String;;;Y NT;;;Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_LastFrame/String1;;;N NT;;;Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration_LastFrame/String2;;;N NT;;;Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_LastFrame/String3;;;N NT;;;Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Duration_LastFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration_LastFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration;; ms;N YFY;;;Source Play time of the stream, in ms;\n" "Source_Duration/String;;;Y NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String1;;;N NT;;;Source Play time in format : HHh MMmn SSs MMMms, XX omited if zero;\n" "Source_Duration/String2;;;N NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String3;;;N NT;;;Source Play time in format : HH:MM:SS.MMM;\n" "Source_Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_FirstFrame;; ms;N YFY;;;Source Duration of the first frame if it is longer than others, in ms\n" "Source_Duration_FirstFrame/String;;;Y NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String1;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_FirstFrame/String2;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String3;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_FirstFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_FirstFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_LastFrame;; ms;N YFY;;;Source Duration of the last frame if it is longer than others, in ms\n" "Source_Duration_LastFrame/String;;;Y NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String1;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_LastFrame/String2;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String3;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_LastFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_LastFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "BitRate_Mode;;;N YTY;;;Bit rate mode (VBR, CBR)\n" "BitRate_Mode/String;;;Y NT;;;Bit rate mode (Variable, Cconstant)\n" "BitRate;; bps;N YFY;;;Bit rate in bps\n" "BitRate/String;;;Y NT;;;Bit rate (with measurement)\n" "BitRate_Minimum;; bps;N YFY;;;Minimum Bit rate in bps\n" "BitRate_Minimum/String;;;Y NT;;;Minimum Bit rate (with measurement)\n" "BitRate_Nominal;; bps;N YFY;;;Nominal Bit rate in bps\n" "BitRate_Nominal/String;;;Y NT;;;Nominal Bit rate (with measurement)\n" "BitRate_Maximum;; bps;N YFY;;;Maximum Bit rate in bps\n" "BitRate_Maximum/String;;;Y NT;;;Maximum Bit rate (with measurement)\n" "BitRate_Encoded;; bps;N YFY;;;Encoded (with forced padding) bit rate in bps, if some container padding is present\n" "BitRate_Encoded/String;;;N NT;;;Encoded (with forced padding) bit rate (with measurement), if some container padding is present\n" "Width;; pixel;N YIY;;;Width (aperture size if present) in pixel\n" "Width/String;;;Y NT;;;Width (aperture size if present) with measurement (pixel)\n" "Width_Offset;; pixel;N YIY;;;Offset between original width and displayed width in pixel\n" "Width_Offset/String;;;N NT;;;Offset between original width and displayed width in pixel\n" "Width_Original;; pixel;N YIY;;;Original (in the raw stream) width in pixel\n" "Width_Original/String;;;Y NT;;;Original (in the raw stream) width with measurement (pixel)\n" "Width_CleanAperture;; pixel;N YIY;;;Clean Aperture width in pixel\n" "Width_CleanAperture/String;;;Y NT;;;Clean Aperture width with measurement (pixel)\n" "Height;; pixel;N YIY;;;Height in pixel\n" "Height/String;;;Y NT;;;Height with measurement (pixel)\n" "Height_Offset;; pixel;N YIY;;;Offset between original height and displayed height in pixel\n" "Height_Offset/String;;;N NT;;;Offset between original height and displayed height in pixel\n" "Height_Original;; pixel;N YIY;;;Original (in the raw stream) height in pixel\n" "Height_Original/String;;;Y NT;;;Original (in the raw stream) height with measurement (pixel)\n" "Height_CleanAperture;; pixel;N YI;;;Clean Aperture height in pixel\n" "Height_CleanAperture/String;;;Y NT;;;Clean Aperture height with measurement (pixel)\n" "Stored_Width;;;N YIY;;;Stored width\n" "Stored_Height;;;N YIY;;;Stored height\n" "Sampled_Width;;;N YIY;;;Sampled width\n" "Sampled_Height;;;N YIY;;;Sampled height\n" "PixelAspectRatio;;;N YFY;;;Pixel Aspect ratio\n" "PixelAspectRatio/String;;;N NT;;;Pixel Aspect ratio\n" "PixelAspectRatio_Original;;;N YFY;;;Original (in the raw stream) Pixel Aspect ratio\n" "PixelAspectRatio_Original/String;;;N NT;;;Original (in the raw stream) Pixel Aspect ratio\n" "PixelAspectRatio_CleanAperture;;;N YF;;;Clean Aperture Pixel Aspect ratio\n" "PixelAspectRatio_CleanAperture/String;;;N NT;;;Clean Aperture Pixel Aspect ratio\n" "DisplayAspectRatio;;;N YFY;;;Display Aspect ratio\n" "DisplayAspectRatio/String;;;Y NT;;;Display Aspect ratio\n" "DisplayAspectRatio_Original;;;N YFY;;;Original (in the raw stream) Display Aspect ratio\n" "DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio\n" "DisplayAspectRatio_CleanAperture;;;N YF;;;Clean Aperture Display Aspect ratio\n" "DisplayAspectRatio_CleanAperture/String;;;Y NT;;;Clean Aperture Display Aspect ratio\n" "ActiveFormatDescription;;;N YNY;;;Active Format Description (AFD value)\n" "ActiveFormatDescription/String;;;Y NT;;;Active Format Description (text)\n" "ActiveFormatDescription_MuxingMode;;;N YT;;;Active Format Description (AFD value) muxing mode (Ancillary or Raw stream)\n" "Rotation;;;N YTY;;;Rotation\n" "Rotation/String;;;Y NT;;;Rotation (if not horizontal)\n" "FrameRate_Mode;;;N YTY;;;Frame rate mode (CFR, VFR)\n" "FrameRate_Mode/String;;;Y NT;;;Frame rate mode (Constant, Variable)\n" "FrameRate_Mode_Original;;;N YTY;;;Original frame rate mode (CFR, VFR)\n" "FrameRate_Mode_Original/String;;;Y NT;;;Original frame rate mode (Constant, Variable)\n" "FrameRate;; fps;N YFY;;;Frames per second\n" "FrameRate/String;;;Y NT;;;Frames per second (with measurement)\n" "FrameRate_Num;;;N NFN;;;Frames per second, numerator\n" "FrameRate_Den;;;N NFN;;;Frames per second, denominator\n" "FrameRate_Minimum;; fps;N YFY;;;Minimum Frames per second\n" "FrameRate_Minimum/String;;;Y NT;;;Minimum Frames per second (with measurement)\n" "FrameRate_Nominal;; fps;N YFY;;;Nominal Frames per second\n" "FrameRate_Nominal/String;;;Y NT;;;Nominal Frames per second (with measurement)\n" "FrameRate_Maximum;; fps;N YFY;;;Maximum Frames per second\n" "FrameRate_Maximum/String;;;Y NT;;;Maximum Frames per second (with measurement)\n" "FrameRate_Original;; fps;N YFY;;;Original (in the raw stream) frames per second\n" "FrameRate_Original/String;;;Y NT;;;Original (in the raw stream) frames per second (with measurement)\n" "FrameRate_Original_Num;;;N NFN;;;Frames per second, numerator\n" "FrameRate_Original_Den;;;N NFN;;;Frames per second, denominator\n" "FrameCount;;;N NIY;;;Number of frames\n" "Source_FrameCount;;;N NI;;;Source Number of frames\n" "Standard;;;Y NTY;;;NTSC or PAL\n" "Resolution;; bit;N NI;;;Deprecated, do not use in new projects\n" "Resolution/String;;;N NT;;;Deprecated, do not use in new projects\n" "Colorimetry;;;N NT;;;Deprecated, do not use in new projects\n" "ColorSpace;;;Y YTY;;\n" "ChromaSubsampling;;;N YTY;;\n" "ChromaSubsampling/String;;;Y NT;;\n" "ChromaSubsampling_Position;;;N YTY;;\n" "BitDepth;; bit;N YIY;;;16/24/32\n" "BitDepth/String;;;Y NT;;;16/24/32 bits\n" "ScanType;;;N YTY;;\n" "ScanType/String;;;Y NT;;\n" "ScanType_Original;;;N YTY;;\n" "ScanType_Original/String;;;Y NT;;\n" "ScanType_StoreMethod;;;N YT;;;;Separated fields or Interleaved fields\n" "ScanType_StoreMethod_FieldsPerBlock;;;N YT;;;;Count of fields per container block\n" "ScanType_StoreMethod/String;;;Y NT;;;;Separated fields or Interleaved fields\n" "ScanOrder;;;N YTY;;;\n" "ScanOrder/String;;;Y NT;;;\n" "ScanOrder_Stored;;;N YTY;;;;In case the stored order is not same as the display order\n" "ScanOrder_Stored/String;;;Y NT;;;;In case the stored order is not same as the display order\n" "ScanOrder_StoredDisplayedInverted;;;N NT;;;\n" "ScanOrder_Original;;;N YTY;;;\n" "ScanOrder_Original/String;;;Y NT;;;\n" "Interlacement;;;N NT;;;Deprecated, do not use in new projects\n" "Interlacement/String;;;N NT;;;Deprecated, do not use in new projects\n" "Compression_Mode;;;N YTY;;;Compression mode (Lossy or Lossless)\n" "Compression_Mode/String;;;Y NT;;;Compression mode (Lossy or Lossless)\n" "Compression_Ratio;;;Y YFY;;;Current stream size divided by uncompressed stream size;\n" "Bits-(Pixel*Frame);;;Y NFN;;;bits/(Pixel*Frame) (like Gordian Knot)\n" "Delay;; ms;N NFY;;;Delay fixed in the stream (relative) IN MS\n" "Delay/String;;;N NT;;;Delay with measurement\n" "Delay/String1;;;N NT;;;Delay with measurement\n" "Delay/String2;;;N NT;;;Delay with measurement\n" "Delay/String3;;;N NT;;;Delay in format : HH:MM:SS.MMM\n" "Delay/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n" "Delay_DropFrame;;;N NT;;;Delay drop frame\n" "Delay_Source;;;N NT;;;Delay source (Container or Stream or empty)\n" "Delay_Source/String;;;N NT;;;Delay source (Container or Stream or empty)\n" "Delay_Original;; ms;N NIY;;;Delay fixed in the raw stream (relative) IN MS\n" "Delay_Original/String;;;N NT;;;Delay with measurement\n" "Delay_Original/String1;;;N NT;;;Delay with measurement\n" "Delay_Original/String2;;;N NT;;;Delay with measurement\n" "Delay_Original/String3;;;N NT;;;Delay in format: HH:MM:SS.MMM;\n" "Delay_Original/String4;;;N NT;;;Delay in format: HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay_Original/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example);\n" "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n" "Delay_Original_Source;;;N NT;;;Delay source (Stream or empty)\n" "TimeStamp_FirstFrame;; ms;N YFY;;;TimeStamp fixed in the stream (relative) IN MS\n" "TimeStamp_FirstFrame/String;;;Y NT;;;TimeStamp with measurement\n" "TimeStamp_FirstFrame/String1;;;N NT;;;TimeStamp with measurement\n" "TimeStamp_FirstFrame/String2;;;N NT;;;TimeStamp with measurement\n" "TimeStamp_FirstFrame/String3;;;N NT;;;TimeStamp in format : HH:MM:SS.MMM\n" "TimeStamp_FirstFrame/String4;;;N NT;;;TimeStamp in format: HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "TimeStamp_FirstFrame/String5;;;N NT;;;TimeStamp in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "TimeCode_FirstFrame;;;Y YCY;;;Time code in HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available format\n" "TimeCode_Settings;;;Y YTY;;;Time code settings\n" "TimeCode_Source;;;Y YTY;;;Time code source (Container, Stream, SystemScheme1, SDTI, ANC...)\n" "Gop_OpenClosed;; ;N YTY;;;Time code information about Open/Closed\n" "Gop_OpenClosed/String;;;Y NT;;;Time code information about Open/Closed\n" "Gop_OpenClosed_FirstFrame;; ;N YTY;;;Time code information about Open/Closed of first frame if GOP is Open for the other GOPs\n" "Gop_OpenClosed_FirstFrame/String;;;Y NT;;;Time code information about Open/Closed of first frame if GOP is Open for the other GOPs\n" "StreamSize;; byte;N YIY;;;Streamsize in bytes;\n" "StreamSize/String;;;Y NT;;;Streamsize in with percentage value;\n" "StreamSize/String1;;;N NT;;;;\n" "StreamSize/String2;;;N NT;;;;\n" "StreamSize/String3;;;N NT;;;;\n" "StreamSize/String4;;;N NT;;;;\n" "StreamSize/String5;;;N NT;;;Streamsize in with percentage value;\n" "StreamSize_Proportion;;;N NT;;;Stream size divided by file size;\n" "StreamSize_Demuxed;; byte;N YIN;;;StreamSize in bytes of hte stream after demux;\n" "StreamSize_Demuxed/String;;;N NT;;;StreamSize_Demuxed in with percentage value;\n" "StreamSize_Demuxed/String1;;;N NT;;;;\n" "StreamSize_Demuxed/String2;;;N NT;;;;\n" "StreamSize_Demuxed/String3;;;N NT;;;;\n" "StreamSize_Demuxed/String4;;;N NT;;;;\n" "StreamSize_Demuxed/String5;;;N NT;;;StreamSize_Demuxed in with percentage value (note: theoritical value, not for real use);\n" "Source_StreamSize;; byte;N YIY;;;Source Streamsize in bytes;\n" "Source_StreamSize/String;;;Y NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize/String1;;;N NT;;;;\n" "Source_StreamSize/String2;;;N NT;;;;\n" "Source_StreamSize/String3;;;N NT;;;;\n" "Source_StreamSize/String4;;;N NT;;;;\n" "Source_StreamSize/String5;;;N NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize_Proportion;;;N NT;;;Source Stream size divided by file size;\n" "StreamSize_Encoded;; byte;N YIY;;;Encoded Streamsize in bytes;\n" "StreamSize_Encoded/String;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded/String1;;;N NT;;;;\n" "StreamSize_Encoded/String2;;;N NT;;;;\n" "StreamSize_Encoded/String3;;;N NT;;;;\n" "StreamSize_Encoded/String4;;;N NT;;;;\n" "StreamSize_Encoded/String5;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded_Proportion;;;N NT;;;Encoded Stream size divided by file size;\n" "Source_StreamSize_Encoded;; byte;N YIY;;;Source Encoded Streamsize in bytes;\n" "Source_StreamSize_Encoded/String;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded/String1;;;N NT;;;;\n" "Source_StreamSize_Encoded/String2;;;N NT;;;;\n" "Source_StreamSize_Encoded/String3;;;N NT;;;;\n" "Source_StreamSize_Encoded/String4;;;N NT;;;;\n" "Source_StreamSize_Encoded/String5;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded_Proportion;;;N NT;;;Source Encoded Stream size divided by file size;\n" "Alignment;;;Y NTY;;;How this stream file is aligned in the container;\n" "Alignment/String;;;N YT;;;;\n" "Title;;;Y YTY;;;Name of the track;\n" "Encoded_Application;;;N YTY;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n" "Encoded_Application/String;;;Y NTY;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Application_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Application_Name;;;N YTY;;;Name of the product;;Technical\n" "Encoded_Application_Version;;;N YTY;;;Version of the product;;Technical\n" "Encoded_Application_Url;;;N YTY;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n" "Encoded_Library;;;N YTY;;;Software used to create the file;;Technical\n" "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Library_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Library_Name;;;N NTY;;;Name of the the encoding-software;;Technical\n" "Encoded_Library_Version;;;N NTY;;;Version of encoding-software;;Technical\n" "Encoded_Library_Date;;;N NTY;;;Release date of software;;Technical\n" "Encoded_Library_Settings;;;Y YTY;;;Parameters used by the software;;Technical\n" "Encoded_OperatingSystem;;;N YTY;;;Operating System of encoding-software;;Technical\n" "Language;;;N YTY;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn);\n" "Language/String;;;Y NT;;;Language (full);\n" "Language/String1;;;N NT;;;Language (full);\n" "Language/String2;;;N NT;;;Language (2-letter ISO 639-1 if exists, else empty);\n" "Language/String3;;;N NT;;;Language (3-letter ISO 639-2 if exists, else empty);\n" "Language/String4;;;N NT;;;Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty);\n" "Language_More;;;Y YTY;;;More info about Language (e.g. Director's Comment);\n" "ServiceKind;;;N YTY;;;Service kind, e.g. visually impaired, commentary, voice over;\n" "ServiceKind/String;;;Y NT;;;Service kind (full);\n" "Disabled;;Yes;N YTY;;;Set if that track should not be used\n" "Disabled/String;;;Y NT;;;Set if that track should not be used\n" "Default;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Default/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "Forced;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Forced/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "AlternateGroup;;Yes;N YTY;;;Number of a group in order to provide versions of the same track\n" "AlternateGroup/String;;;Y NT;;;Number of a group in order to provide versions of the same track\n" "Encoded_Date;;;Y YTY;;;UTC time that the encoding of this item was completed began.;;Temporal\n" "Tagged_Date;;;Y YTY;;;UTC time that the tags were done for this item.;;Temporal\n" "Encryption;;;Y YTY;;;;\n" "BufferSize;;;N YTY;;;Defines the size of the buffer needed to decode the sequence.\n" "colour_description_present;;;N YTY;;;Presence of colour description\n" "colour_description_present_Source;;;N YTY;;;Presence of colour description (source)\n" "colour_description_present_Original;;;N YTY;;;Presence of colour description (if incoherencies)\n" "colour_description_present_Original_Source;;;N YTY;;;Presence of colour description (source if incoherencies)\n" "colour_range;;;Y YTY;;;Colour range for YUV colour space\n" "colour_range_Source;;;N YTY;;;Colour range for YUV colour space (source)\n" "colour_range_Original;;;Y YTY;;;Colour range for YUV colour space (if incoherencies)\n" "colour_range_Original_Source;;;N YTY;;;Colour range for YUV colour space (source if incoherencies)\n" "colour_primaries;;;Y YTY;;;Chromaticity coordinates of the source primaries\n" "colour_primaries_Source;;;N YTY;;;Chromaticity coordinates of the source primaries (source)\n" "colour_primaries_Original;;;Y YTY;;;Chromaticity coordinates of the source primaries (if incoherencies)\n" "colour_primaries_Original_Source;;;N YTY;;;Chromaticity coordinates of the source primaries (source if incoherencies)\n" "transfer_characteristics;;;Y YTY;;;Opto-electronic transfer characteristic of the source picture\n" "transfer_characteristics_Source;;;N YTY;;;Opto-electronic transfer characteristic of the source picture (source)\n" "transfer_characteristics_Original;;;Y YTY;;;Opto-electronic transfer characteristic of the source picture (if incoherencies)\n" "transfer_characteristics_Original_Source;;;N YTY;;;Opto-electronic transfer characteristic of the source picture (source if incoherencies)\n" "matrix_coefficients;;;Y YTY;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries\n" "matrix_coefficients_Source;;;N YTY;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries (source)\n" "matrix_coefficients_Original;;;Y YTY;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries (if incoherencies)\n" "matrix_coefficients_Original_Source;;;N YTY;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries (source if incoherencies)\n" "MasteringDisplay_ColorPrimaries;;;Y YTY;;;Chromaticity coordinates of the source primaries of the mastering display\n" "MasteringDisplay_ColorPrimaries_Source;;;N YTY;;;Chromaticity coordinates of the source primaries of the mastering display (source)\n" "MasteringDisplay_ColorPrimaries_Original;;;Y YTY;;;Chromaticity coordinates of the source primaries of the mastering display (if incoherencies)\n" "MasteringDisplay_ColorPrimaries_Original_Source;;;N YTY;;;Chromaticity coordinates of the source primaries of the mastering display (source if incoherencies)\n" "MasteringDisplay_Luminance;;;Y YTY;;;Luminance of the mastering display\n" "MasteringDisplay_Luminance_Source;;;N YTY;;;Luminance of the mastering display (source)\n" "MasteringDisplay_Luminance_Original;;;Y YTY;;;Luminance of the mastering display (if incoherencies)\n" "MasteringDisplay_Luminance_Original_Source;;;N YTY;;;Luminance of the mastering display (source if incoherencies)\n" "MaxCLL;;;Y YTY;;;Maximum content light level\n" "MaxCLL_Source;;;N YTY;;;Maximum content light level (source)\n" "MaxCLL_Original;;;Y YTY;;;Maximum content light level (if incoherencies)\n" "MaxCLL_Original_Source;;;N YTY;;;Maximum content light level (source if incoherencies)\n" "MaxFALL;;;Y YTY;;;Maximum frame average light level\n" "MaxFALL_Source;;;N YTY;;;Maximum frame average light level (source)\n" "MaxFALL_Original;;;Y YTY;;;Maximum frame average light level (if incoherencies)\n" "MaxFALL_Original_Source;;;N YTY;;;Maximum frame average light level (source if incoherencies)\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Audio (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of that kind available\n" "StreamKind;Audio;;N NT;;;Stream type name;\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Number of the stream (base=0)\n" "StreamKindPos;;;N NI;;;When multiple streams, number of the stream (base=1)\n" "StreamOrder;;;N YIY;;;Stream order in the file, whatever is the kind of stream (base=0)\n" "FirstPacketOrder;;;N YIY;;;Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "Format;;;N YTY;;;Format used;\n" "Format/String;;;Y NT;;;Format used + additional features\n" "Format/Info;;;Y NT;;;Info about the format;\n" "Format/Url;;;N NT;;;Homepage of this format;\n" "Format_Commercial;;;N YT;;;Commercial name used by vendor for theses setings or Format field if there is no difference;\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for theses setings if there is one;\n" "Format_Version;;;Y YTY;;;Version of this format;\n" "Format_Profile;;;Y YTY;;;Profile of the Format (old XML: 'Profile@Level' format; MIXML: 'Profile' only)\n" "Format_Level;;;Y YTY;;;Level of the Format (only MIXML)\n" "Format_Compression;;;Y YTY;;;Compression method used;\n" "Format_Settings;;;Y NT;;;Settings needed for decoder used, summary;\n" "Format_Settings_SBR;;Yes;N YTY;;;;\n" "Format_Settings_SBR/String;;;N NT;;;;\n" "Format_Settings_PS;;Yes;N YTY;;;;\n" "Format_Settings_PS/String;;;N NT;;;;\n" "Format_Settings_Mode;;;N YTY;;;;\n" "Format_Settings_ModeExtension;;;N YTY;;;;\n" "Format_Settings_Emphasis;;;N YTY;;;;\n" "Format_Settings_Floor;;;Y YTY;;;;\n" "Format_Settings_Firm;;;N YTY;;;;\n" "Format_Settings_Endianness;;;N YTY;;;;\n" "Format_Settings_Sign;;;N YTY;;;;\n" "Format_Settings_Law;;;Y YTY;;;;\n" "Format_Settings_ITU;;;N YTY;;;;\n" "Format_Settings_Wrapping;;;Y YTY;;;Wrapping mode (Frame wrapped or Clip wrapped)\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "Matrix_Format;;;Y YTY;;;Matrix format (e.g. DTS Neural);\n" "InternetMediaType;;;N YT;;;Internet Media Type (aka MIME Type, Content-Type);\n" "MuxingMode;;;Y YTY;;;How this stream is muxed in the container;\n" "MuxingMode_MoreInfo;;;Y NT;;;More info (text) about the muxing mode;\n" "CodecID;;;Y YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info about codec ID;\n" "CodecID/Hint;;;Y NT;;;Hint/popular name for this codec ID;\n" "CodecID/Url;;;N NT;;;Homepage for more details about this codec ID;\n" "CodecID_Description;;;Y YT;;;Manual description given by the container;\n" "Codec;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec/String;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec/Family;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec/Info;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec/Url;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec/CC;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Description;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Profile;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_Automatic;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_Floor;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_Firm;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_Endianness;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_Sign;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_Law;;;N NT;;;Deprecated, do not use in new projects;\n" "Codec_Settings_ITU;;;N NT;;;Deprecated, do not use in new projects;\n" "Duration;; ms;N YFY;;;Play time of the stream, in ms;\n" "Duration/String;;;Y NT;;;Play time in format : XXx YYy only, YYy omited if zero;\n" "Duration/String1;;;N NT;;;Play time in format : HHh MMmn SSs MMMms, XX omited if zero;\n" "Duration/String2;;;N NT;;;Play time in format : XXx YYy only, YYy omited if zero;\n" "Duration/String3;;;N NT;;;Play time in format : HH:MM:SS.MMM;\n" "Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_FirstFrame;; ms;N YFY;;;Duration of the first frame if it is longer than others, in ms\n" "Duration_FirstFrame/String;;;Y NT;;;Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_FirstFrame/String1;;;N NT;;;Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration_FirstFrame/String2;;;N NT;;;Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_FirstFrame/String3;;;N NT;;;Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Duration_FirstFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration_FirstFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_LastFrame;; ms;N YFY;;;Duration of the last frame if it is longer than others, in ms\n" "Duration_LastFrame/String;;;Y NT;;;Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_LastFrame/String1;;;N NT;;;Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration_LastFrame/String2;;;N NT;;;Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_LastFrame/String3;;;N NT;;;Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Duration_LastFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration_LastFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration;; ms;N YFY;;;Source Play time of the stream, in ms;\n" "Source_Duration/String;;;Y NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String1;;;N NT;;;Source Play time in format : HHh MMmn SSs MMMms, XX omited if zero;\n" "Source_Duration/String2;;;N NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String3;;;N NT;;;Source Play time in format : HH:MM:SS.MMM;\n" "Source_Duration/String4;;;N NT;;;Source Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration/String5;;;N NT;;;Source Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_FirstFrame;; ms;N YFY;;;Source Duration of the first frame if it is longer than others, in ms\n" "Source_Duration_FirstFrame/String;;;Y NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String1;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_FirstFrame/String2;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String3;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_FirstFrame/String4;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_FirstFrame/String5;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_LastFrame;; ms;N YFY;;;Source Duration of the last frame if it is longer than others, in ms\n" "Source_Duration_LastFrame/String;;;Y NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String1;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_LastFrame/String2;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String3;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_LastFrame/String4;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_LastFrame/String5;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "BitRate_Mode;;;N YTY;;;Bit rate mode (VBR, CBR);\n" "BitRate_Mode/String;;;Y NT;;;Bit rate mode (Constant, Variable);\n" "BitRate;; bps;N YFY;;;Bit rate in bps;\n" "BitRate/String;;;Y NT;;;Bit rate (with measurement);\n" "BitRate_Minimum;; bps;N YFY;;;Minimum Bit rate in bps;\n" "BitRate_Minimum/String;;;Y NT;;;Minimum Bit rate (with measurement);\n" "BitRate_Nominal;; bps;N YFY;;;Nominal Bit rate in bps;\n" "BitRate_Nominal/String;;;Y NT;;;Nominal Bit rate (with measurement);\n" "BitRate_Maximum;; bps;N YFY;;;Maximum Bit rate in bps;\n" "BitRate_Maximum/String;;;Y NT;;;Maximum Bit rate (with measurement);\n" "BitRate_Encoded;; bps;N YFY;;;Encoded (with forced padding) bit rate in bps, if some container padding is present\n" "BitRate_Encoded/String;;;N NT;;;Encoded (with forced padding) bit rate (with measurement), if some container padding is present\n" "Channel(s);; channel;N YIY;;;Number of channels;\n" "Channel(s)/String;;;Y NT;;;Number of channels (with measurement);\n" "Channel(s)_Original;; channel;N YIY;;;Number of channels;\n" "Channel(s)_Original/String;;;Y NT;;;Number of channels (with measurement);\n" "Matrix_Channel(s);; channel;N YIY;;;Number of channels after matrix decoding;\n" "Matrix_Channel(s)/String;;;Y NT;;;Number of channels after matrix decoding (with measurement);\n" "ChannelPositions;;;N YTY;;;Position of channels;\n" "ChannelPositions_Original;;;N YTY;;;Position of channels;\n" "ChannelPositions/String2;;;N NT;;;Position of channels (x/y.z format);\n" "ChannelPositions_Original/String2;;;N NT;;;Position of channels (x/y.z format);\n" "Matrix_ChannelPositions;;;Y YTY;;;Position of channels after matrix decoding;\n" "Matrix_ChannelPositions/String2;;;N NT;;;Position of channels after matrix decoding (x/y.z format);\n" "ChannelLayout;;;Y YTY;;;Layout of channels (in the stream);\n" "ChannelLayout_Original;;;Y YTY;;;Layout of channels (in the stream);\n" "ChannelLayoutID;;;N YT;;;ID of layout of channels (e.g. MXF descriptor channel assignment). Warning, sometimes this is not enough for uniquely identifying a layout (e.g. MXF descriptor channel assignment is SMPTE 377-4). For AC-3, the form is x,y with x=acmod and y=lfeon.;\n" "SamplesPerFrame;;;N YFY;;;Sampling rate;\n" "SamplingRate;; Hz;N YFY;;;Sampling rate;\n" "SamplingRate/String;;;Y NT;;;in KHz;\n" "SamplingCount;;;N NIY;;;Sample count (based on sampling rate);\n" "Source_SamplingCount;;;N NIY;;;Source Sample count (based on sampling rate);\n" "FrameRate;; fps;N YFY;;;Frames per second\n" "FrameRate/String;;;Y NT;;;Frames per second (with measurement)\n" "FrameRate_Num;;;N NFN;;;Frames per second, numerator\n" "FrameRate_Den;;;N NFN;;;Frames per second, denominator\n" "FrameCount;;;N NIY;;;Frame count (a frame contains a count of samples depends of the format);\n" "Source_FrameCount;;;N NIY;;;Source Frame count (a frame contains a count of samples depends of the format);\n" "Resolution;; bit;N NI;;;Deprecated, do not use in new projects;\n" "Resolution/String;;;N NT;;;Deprecated, do not use in new projects;\n" "BitDepth;; bit;N YIY;;;Resolution in bits (8, 16, 20, 24). Note: significant bits in case the stored bit depth is different;\n" "BitDepth/String;;;Y NT;;;Resolution in bits (8, 16, 20, 24). Note: significant bits in case the stored bit depth is different;\n" "BitDepth_Detected;; bit;N YIY;;;Detected (during scan of the input by the muxer) resolution in bits;\n" "BitDepth_Detected/String;;;Y NT;;;Detected (during scan of the input by the muxer) resolution in bits;\n" "BitDepth_Stored;; bit;N YIY;;;Stored Resolution in bits (8, 16, 20, 24);\n" "BitDepth_Stored/String;;;Y NT;;;Stored Resolution in bits (8, 16, 20, 24);\n" "Compression_Mode;;;N YTY;;;Compression mode (Lossy or Lossless)\n" "Compression_Mode/String;;;Y NT;;;Compression mode (Lossy or Lossless)\n" "Compression_Ratio;;;Y YF;;;Current stream size divided by uncompressed stream size;\n" "Delay;; ms;N NFY;;;Delay fixed in the stream (relative) IN MS\n" "Delay/String;;;N NT;;;Delay with measurement\n" "Delay/String1;;;N NT;;;Delay with measurement\n" "Delay/String2;;;N NT;;;Delay with measurement\n" "Delay/String3;;;N NT;;;Delay in format : HH:MM:SS.MMM\n" "Delay/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Settings;;;N NTY;;;Delay settings (in case of timecode for example)\n" "Delay_DropFrame;;;N NTY;;;Delay drop frame\n" "Delay_Source;;;N NTY;;;Delay source (Container or Stream or empty)\n" "Delay_Source/String;;;N NT;;;Delay source (Container or Stream or empty)\n" "Delay_Original;; ms;N NIY;;;Delay fixed in the raw stream (relative) IN MS\n" "Delay_Original/String;;;N NT;;;Delay with measurement\n" "Delay_Original/String1;;;N NT;;;Delay with measurement\n" "Delay_Original/String2;;;N NT;;;Delay with measurement\n" "Delay_Original/String3;;;N NT;;;Delay in format: HH:MM:SS.MMM;\n" "Delay_Original/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay_Original/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example);\n" "Delay_Original_DropFrame;;;N NTY;;;Delay drop frame info\n" "Delay_Original_Source;;;N NTY;;;Delay source (Stream or empty)\n" "Video_Delay;; ms;N NI;;;Delay fixed in the stream (absolute / video)\n" "Video_Delay/String;;;Y NT;;\n" "Video_Delay/String1;;;N NT;;\n" "Video_Delay/String2;;;N NT;;\n" "Video_Delay/String3;;;N NT;;\n" "Video_Delay/String4;;;N NT;;\n" "Video_Delay/String5;;;N NT;;\n" "Video0_Delay;; ms;N NI;;;Deprecated, do not use in new projects\n" "Video0_Delay/String;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String1;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String2;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String3;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String4;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String5;;;N NT;;;Deprecated, do not use in new projects\n" "ReplayGain_Gain;; dB;N YTY;;;The gain to apply to reach 89dB SPL on playback;\n" "ReplayGain_Gain/String;;;Y YT;;;;\n" "ReplayGain_Peak;;;Y YTY;;;The maximum absolute peak value of the item;\n" "StreamSize;; byte;N YIY;;;Streamsize in bytes;\n" "StreamSize/String;;;Y NT;;;Streamsize in with percentage value;\n" "StreamSize/String1;;;N NT;;;;\n" "StreamSize/String2;;;N NT;;;;\n" "StreamSize/String3;;;N NT;;;;\n" "StreamSize/String4;;;N NT;;;;\n" "StreamSize/String5;;;N NT;;;Streamsize in with percentage value;\n" "StreamSize_Proportion;;;N NTY;;;Stream size divided by file size;\n" "StreamSize_Demuxed;; byte;N YIN;;;StreamSize in bytes of hte stream after demux;\n" "StreamSize_Demuxed/String;;;N NT;;;StreamSize_Demuxed in with percentage value;\n" "StreamSize_Demuxed/String1;;;N NT;;;;\n" "StreamSize_Demuxed/String2;;;N NT;;;;\n" "StreamSize_Demuxed/String3;;;N NT;;;;\n" "StreamSize_Demuxed/String4;;;N NT;;;;\n" "StreamSize_Demuxed/String5;;;N NT;;;StreamSize_Demuxed in with percentage value (note: theoritical value, not for real use);\n" "Source_StreamSize;; byte;N YIY;;;Source Streamsize in bytes;\n" "Source_StreamSize/String;;;Y NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize/String1;;;N NT;;;;\n" "Source_StreamSize/String2;;;N NT;;;;\n" "Source_StreamSize/String3;;;N NT;;;;\n" "Source_StreamSize/String4;;;N NT;;;;\n" "Source_StreamSize/String5;;;N NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize_Proportion;;;N NTY;;;Source Stream size divided by file size;\n" "StreamSize_Encoded;; byte;N YIY;;;Encoded Streamsize in bytes;\n" "StreamSize_Encoded/String;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded/String1;;;N NT;;;;\n" "StreamSize_Encoded/String2;;;N NT;;;;\n" "StreamSize_Encoded/String3;;;N NT;;;;\n" "StreamSize_Encoded/String4;;;N NT;;;;\n" "StreamSize_Encoded/String5;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded_Proportion;;;N NT;;;Encoded Stream size divided by file size;\n" "Source_StreamSize_Encoded;; byte;N YIY;;;Source Encoded Streamsize in bytes;\n" "Source_StreamSize_Encoded/String;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded/String1;;;N NT;;;;\n" "Source_StreamSize_Encoded/String2;;;N NT;;;;\n" "Source_StreamSize_Encoded/String3;;;N NT;;;;\n" "Source_StreamSize_Encoded/String4;;;N NT;;;;\n" "Source_StreamSize_Encoded/String5;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded_Proportion;;;N NT;;;Source Encoded Stream size divided by file size;\n" "Alignment;;;N YTY;;;How this stream file is aligned in the container;\n" "Alignment/String;;;Y NT;;;Where this stream file is aligned in the container;\n" "Interleave_VideoFrames;;;N YFY;;;Between how many video frames the stream is inserted;\n" "Interleave_Duration;; ms;N YFY;;;Between how much time (ms) the stream is inserted;\n" "Interleave_Duration/String;;;Y NT;;;Between how much time and video frames the stream is inserted (with measurement);\n" "Interleave_Preload;; ms;N YFY;;;How much time is buffered before the first video frame;\n" "Interleave_Preload/String;;;Y NT;;;How much time is buffered before the first video frame (with measurement);\n" "Title;;;Y YTY;;;Name of the track;\n" "Encoded_Application;;;N YTY;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n" "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Application_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Application_Name;;;N YTY;;;Name of the product;;Technical\n" "Encoded_Application_Version;;;N YTY;;;Version of the product;;Technical\n" "Encoded_Application_Url;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n" "Encoded_Library;;;N YTY;;;Software used to create the file;;Technical\n" "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Library_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Library_Name;;;N NTY;;;Name of the the encoding-software;;Technical\n" "Encoded_Library_Version;;;N NTY;;;Version of encoding-software;;Technical\n" "Encoded_Library_Date;;;N NTY;;;Release date of software;;Technical\n" "Encoded_Library_Settings;;;Y YTY;;;Parameters used by the software;;Technical\n" "Encoded_OperatingSystem;;;N YTY;;;Operating System of encoding-software;;Technical\n" "Language;;;N YTY;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn);\n" "Language/String;;;Y NT;;;Language (full);\n" "Language/String1;;;N NT;;;Language (full);\n" "Language/String2;;;N NT;;;Language (2-letter ISO 639-1 if exists, else empty);\n" "Language/String3;;;N NT;;;Language (3-letter ISO 639-2 if exists, else empty);\n" "Language/String4;;;N NT;;;Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty);\n" "Language_More;;;Y YTY;;;More info about Language (e.g. Director's Comment);\n" "ServiceKind;;;N YTY;;;Service kind, e.g. visually impaired, commentary, voice over;\n" "ServiceKind/String;;;Y NT;;;Service kind (full);\n" "Disabled;;Yes;N YTY;;;Set if that track should not be used\n" "Disabled/String;;;Y NT;;;Set if that track should not be used\n" "Default;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Default/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "Forced;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Forced/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "AlternateGroup;;Yes;N YTY;;;Number of a group in order to provide versions of the same track\n" "AlternateGroup/String;;;Y NT;;;Number of a group in order to provide versions of the same track\n" "Encoded_Date;;;Y YTY;;;UTC time that the encoding of this item was completed began.;;Temporal\n" "Tagged_Date;;;Y YTY;;;UTC time that the tags were done for this item.;;Temporal\n" "Encryption;;;Y YTY;;;;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Text (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of that kind available\n" "StreamKind;Text;;N NT;;;Stream type name\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Number of the stream (base=0)\n" "StreamKindPos;;;N NI;;;When multiple streams, number of the stream (base=1)\n" "StreamOrder;;;N YI;;;Stream order in the file, whatever is the kind of stream (base=0)\n" "FirstPacketOrder;;;N YI;;;Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "Format;;;N YTY;;;Format used\n" "Format/String;;;Y NT;;;Format used + additional features\n" "Format/Info;;;Y NT;;;Info about Format\n" "Format/Url;;;N NT;;;Link\n" "Format_Commercial;;;N NT;;;Commercial name used by vendor for theses setings or Format field if there is no difference\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for theses setings if there is one\n" "Format_Version;;;Y NTY;;;Version of this format\n" "Format_Profile;;;Y NTY;;;Profile of the Format\n" "Format_Compression;;;Y NTY;;;Compression method used;\n" "Format_Settings;;;Y NTY;;;Settings needed for decoder used\n" "Format_Settings_Wrapping;;;Y YTY;;;Wrapping mode (Frame wrapped or Clip wrapped)\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "InternetMediaType;;;N YT;;;Internet Media Type (aka MIME Type, Content-Type)\n" "MuxingMode;;;Y YTY;;;How this stream is muxed in the container\n" "MuxingMode_MoreInfo;;;Y NTY;;;More info (text) about the muxing mode\n" "CodecID;;;Y YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info about codec ID\n" "CodecID/Hint;;;Y NT;;;A hint for this codec ID\n" "CodecID/Url;;;N NT;;;A link for more details about this codec ID\n" "CodecID_Description;;;Y YT;;;Manual description given by the container\n" "Codec;;;N YT;;;Deprecated\n" "Codec/String;;;N NT;;;Deprecated\n" "Codec/Info;;;N NT;;;Deprecated\n" "Codec/Url;;;N NT;;;Deprecated\n" "Codec/CC;;;N NT;;;Deprecated\n" "Duration;; ms;N YFY;;;Play time of the stream, in ms\n" "Duration/String;;;Y NT;;;Play time (formated)\n" "Duration/String1;;;N NT;;;Play time in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration/String2;;;N NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String3;;;N NT;;;Play time in format : HH:MM:SS.MMM\n" "Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_FirstFrame;; ms;N YFY;;;Duration of the first frame if it is longer than others, in ms\n" "Duration_FirstFrame/String;;;Y NT;;;Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_FirstFrame/String1;;;N NT;;;Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration_FirstFrame/String2;;;N NT;;;Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_FirstFrame/String3;;;N NT;;;Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Duration_FirstFrame/String4;;;N NT;;;Duration of the first frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration_FirstFrame/String5;;;N NT;;;Duration of the first frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_LastFrame;; ms;N YFY;;;Duration of the last frame if it is longer than others, in ms\n" "Duration_LastFrame/String;;;Y NT;;;Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_LastFrame/String1;;;N NT;;;Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration_LastFrame/String2;;;N NT;;;Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Duration_LastFrame/String3;;;N NT;;;Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Duration_LastFrame/String4;;;N NT;;;Duration of the last frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration_LastFrame/String5;;;N NT;;;Duration of the last frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration;; ms;N YFY;;;Source Play time of the stream, in ms;\n" "Source_Duration/String;;;Y NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String1;;;N NT;;;Source Play time in format : HHh MMmn SSs MMMms, XX omited if zero;\n" "Source_Duration/String2;;;N NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String3;;;N NT;;;Source Play time in format : HH:MM:SS.MMM;\n" "Source_Duration/String4;;;N NT;;;Source Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration/String5;;;N NT;;;Source Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_FirstFrame;; ms;N YFY;;;Source Duration of the first frame if it is longer than others, in ms\n" "Source_Duration_FirstFrame/String;;;Y NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String1;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_FirstFrame/String2;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String3;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_FirstFrame/String4;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_FirstFrame/String5;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_LastFrame;; ms;N YFY;;;Source Duration of the last frame if it is longer than others, in ms\n" "Source_Duration_LastFrame/String;;;Y NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String1;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_LastFrame/String2;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String3;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_LastFrame/String4;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_LastFrame/String5;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "BitRate_Mode;;;N YTY;;;Bit rate mode (VBR, CBR)\n" "BitRate_Mode/String;;;Y NT;;;Bit rate mode (Constant, Variable)\n" "BitRate;; bps;N YFY;;;Bit rate in bps\n" "BitRate/String;;;Y NT;;;Bit rate (with measurement)\n" "BitRate_Minimum;; bps;N YFY;;;Minimum Bit rate in bps\n" "BitRate_Minimum/String;;;Y NT;;;Minimum Bit rate (with measurement)\n" "BitRate_Nominal;; bps;N YFY;;;Nominal Bit rate in bps\n" "BitRate_Nominal/String;;;Y NT;;;Nominal Bit rate (with measurement)\n" "BitRate_Maximum;; bps;N YFY;;;Maximum Bit rate in bps\n" "BitRate_Maximum/String;;;Y NT;;;Maximum Bit rate (with measurement)\n" "BitRate_Encoded;; bps;N YFY;;;Encoded (with forced padding) bit rate in bps, if some container padding is present\n" "BitRate_Encoded/String;;;N NT;;;Encoded (with forced padding) bit rate (with measurement), if some container padding is present\n" "Width;; character;N YIY;;;Width\n" "Width/String;;;Y NT;;\n" "Height;; character;N YIY;;;Height\n" "Height/String;;;Y NT;;\n" "FrameRate_Mode;;;N YTY;;;Frame rate mode (CFR, VFR)\n" "FrameRate_Mode/String;;;N NT;;;Frame rate mode (Constant, Variable)\n" "FrameRate;; fps;N YFY;;;Frames per second\n" "FrameRate/String;;;N NT;;;Frames per second (with measurement)\n" "FrameRate_Num;;;N NFN;;;Frames per second, numerator\n" "FrameRate_Den;;;N NFN;;;Frames per second, denominator\n" "FrameRate_Minimum;; fps;N YFY;;;Minimum Frames per second\n" "FrameRate_Minimum/String;;;N NT;;;Minimum Frames per second (with measurement)\n" "FrameRate_Nominal;; fps;N YFY;;;Nominal Frames per second\n" "FrameRate_Nominal/String;;;N NT;;;Nominal Frames per second (with measurement)\n" "FrameRate_Maximum;; fps;N YFY;;;Maximum Frames per second\n" "FrameRate_Maximum/String;;;N NT;;;Maximum Frames per second (with measurement)\n" "FrameRate_Original;; fps;N YFY;;;Original (in the raw stream) Frames per second\n" "FrameRate_Original/String;;;N NT;;;Original (in the raw stream) Frames per second (with measurement)\n" "FrameCount;;;N NIY;;;Number of frames\n" "ElementCount;;;Y NIY;;;Number of displayed elements\n" "Source_FrameCount;;;N NIY;;;Source Number of frames\n" "ColorSpace;;;Y YTY;;\n" "ChromaSubsampling;;;Y YTY;;\n" "Resolution;; bit;N NI;;;Deprecated, do not use in new projects\n" "Resolution/String;;;N NT;;;Deprecated, do not use in new projects\n" "BitDepth;; bit;N YIY;;\n" "BitDepth/String;;;Y NT;;\n" "Compression_Mode;;;N YTY;;;Compression mode (Lossy or Lossless)\n" "Compression_Mode/String;;;Y NT;;;Compression mode (Lossy or Lossless)\n" "Compression_Ratio;;;Y YF;;;Current stream size divided by uncompressed stream size;\n" "Delay;; ms;N NFY;;;Delay fixed in the stream (relative) IN MS\n" "Delay/String;;;N NT;;;Delay with measurement\n" "Delay/String1;;;N NT;;;Delay with measurement\n" "Delay/String2;;;N NT;;;Delay with measurement\n" "Delay/String3;;;N NT;;;Delay in format : HH:MM:SS.MMM\n" "Delay/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n" "Delay_DropFrame;;;N NTY;;;Delay drop frame\n" "Delay_Source;;;N NTY;;;Delay source (Container or Stream or empty)\n" "Delay_Source/String;;;N NT;;;Delay source (Container or Stream or empty)\n" "Delay_Original;; ms;N NIY;;;Delay fixed in the raw stream (relative) IN MS\n" "Delay_Original/String;;;N NT;;;Delay with measurement\n" "Delay_Original/String1;;;N NT;;;Delay with measurement\n" "Delay_Original/String2;;;N NT;;;Delay with measurement\n" "Delay_Original/String3;;;N NT;;;Delay in format: HH:MM:SS.MMM;\n" "Delay_Original/String4;;;N NT;;;Delay in format: HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay_Original/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example);\n" "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n" "Delay_Original_Source;;;N NTY;;;Delay source (Stream or empty)\n" "Video_Delay;; ms;N NI;;;Delay fixed in the stream (absolute / video)\n" "Video_Delay/String;;;Y NT;;\n" "Video_Delay/String1;;;N NT;;\n" "Video_Delay/String2;;;N NT;;\n" "Video_Delay/String3;;;N NT;;\n" "Video_Delay/String4;;;N NT;;\n" "Video_Delay/String5;;;N NT;;\n" "Video0_Delay;; ms;N NI;;;Deprecated, do not use in new projects\n" "Video0_Delay/String;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String1;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String2;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String3;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String4;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String5;;;N NT;;;Deprecated, do not use in new projects\n" "StreamSize;; byte;N YIY;;;Streamsize in bytes;\n" "StreamSize/String;;;Y NT;;;Streamsize in with percentage value;\n" "StreamSize/String1;;;N NT;;;;\n" "StreamSize/String2;;;N NT;;;;\n" "StreamSize/String3;;;N NT;;;;\n" "StreamSize/String4;;;N NT;;;;\n" "StreamSize/String5;;;N NT;;;Streamsize in with percentage value;\n" "StreamSize_Proportion;;;N NT;;;Stream size divided by file size;\n" "StreamSize_Demuxed;; byte;N YIN;;;StreamSize in bytes of hte stream after demux;\n" "StreamSize_Demuxed/String;;;N NT;;;StreamSize_Demuxed in with percentage value;\n" "StreamSize_Demuxed/String1;;;N NT;;;;\n" "StreamSize_Demuxed/String2;;;N NT;;;;\n" "StreamSize_Demuxed/String3;;;N NT;;;;\n" "StreamSize_Demuxed/String4;;;N NT;;;;\n" "StreamSize_Demuxed/String5;;;N NT;;;StreamSize_Demuxed in with percentage value (note: theoritical value, not for real use);\n" "Source_StreamSize;; byte;N YIY;;;Source Streamsize in bytes;\n" "Source_StreamSize/String;;;Y NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize/String1;;;N NT;;;;\n" "Source_StreamSize/String2;;;N NT;;;;\n" "Source_StreamSize/String3;;;N NT;;;;\n" "Source_StreamSize/String4;;;N NT;;;;\n" "Source_StreamSize/String5;;;N NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize_Proportion;;;N NT;;;Source Stream size divided by file size;\n" "StreamSize_Encoded;; byte;N YIY;;;Encoded Streamsize in bytes;\n" "StreamSize_Encoded/String;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded/String1;;;N NT;;;;\n" "StreamSize_Encoded/String2;;;N NT;;;;\n" "StreamSize_Encoded/String3;;;N NT;;;;\n" "StreamSize_Encoded/String4;;;N NT;;;;\n" "StreamSize_Encoded/String5;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded_Proportion;;;N NT;;;Encoded Stream size divided by file size;\n" "Source_StreamSize_Encoded;; byte;N YI;;;Source Encoded Streamsize in bytes;\n" "Source_StreamSize_Encoded/String;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded/String1;;;N NT;;;;\n" "Source_StreamSize_Encoded/String2;;;N NT;;;;\n" "Source_StreamSize_Encoded/String3;;;N NT;;;;\n" "Source_StreamSize_Encoded/String4;;;N NT;;;;\n" "Source_StreamSize_Encoded/String5;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded_Proportion;;;N NT;;;Source Encoded Stream size divided by file size;\n" "Title;;;Y YTY;;;Name of the track\n" "Encoded_Application;;;N YT;;;Name of the software package used to create the file, such as Microsoft WaveEdit;;Technical\n" "Encoded_Application/String;;;Y NT;;;Name of the software package used to create the file, such as Microsoft WaveEdit, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Application_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Application_Name;;;N YTY;;;Name of the product;;Technical\n" "Encoded_Application_Version;;;N YTY;;;Version of the product;;Technical\n" "Encoded_Application_Url;;;N YTY;;;Name of the software package used to create the file, such as Microsoft WaveEdit.;;Technical\n" "Encoded_Library;;;N YT;;;Software used to create the file;;Technical\n" "Encoded_Library/String;;;Y NT;;;Software used to create the file, trying to have the format 'CompanyName ProductName (OperatingSystem) Version (Date)';;Technical\n" "Encoded_Library_CompanyName;;;N YTY;;;Name of the company;;Technical\n" "Encoded_Library_Name;;;N NTY;;;Name of the the encoding-software;;Technical\n" "Encoded_Library_Version;;;N NTY;;;Version of encoding-software;;Technical\n" "Encoded_Library_Date;;;N NTY;;;Release date of software;;Technical\n" "Encoded_Library_Settings;;;Y YTY;;;Parameters used by the software;;Technical\n" "Encoded_OperatingSystem;;;N YTY;;;Operating System of encoding-software;;Technical\n" "Language;;;N YTY;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)\n" "Language/String;;;Y NT;;;Language (full)\n" "Language/String1;;;N NT;;;Language (full)\n" "Language/String2;;;N NT;;;Language (2-letter ISO 639-1 if exists, else empty)\n" "Language/String3;;;N NT;;;Language (3-letter ISO 639-2 if exists, else empty);\n" "Language/String4;;;N NT;;;Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty);\n" "Language_More;;;Y YTY;;;More info about Language (e.g. Director's Comment);\n" "ServiceKind;;;N YTY;;;Service kind, e.g. visually impaired, commentary, voice over;\n" "ServiceKind/String;;;Y NT;;;Service kind (full);\n" "Disabled;;Yes;N YTY;;;Set if that track should not be used\n" "Disabled/String;;;Y NT;;;Set if that track should not be used\n" "Default;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Default/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "Forced;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Forced/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "AlternateGroup;;Yes;N YTY;;;Number of a group in order to provide versions of the same track\n" "AlternateGroup/String;;;Y NT;;;Number of a group in order to provide versions of the same track\n" "Summary;;;N NTY;;;;\n" "Encoded_Date;;;Y YTY;;;The time that the encoding of this item was completed began.;;Temporal\n" "Tagged_Date;;;Y YTY;;;The time that the tags were done for this item.;;Temporal\n" "Encryption;;;Y YTY;;;;\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Other (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of that kind available\n" "StreamKind;Other;;N NT;;;Stream type name\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Number of the stream (base=0)\n" "StreamKindPos;;;N NI;;;When multiple streams, number of the stream (base=1)\n" "StreamOrder;;;N YIY;;;Stream order in the file, whatever is the kind of stream (base=0)\n" "FirstPacketOrder;;;N YIY;;;Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "Type;;;Y YTY;;;Type\n" "Format;;;N YTY;;;Format used\n" "Format/String;;;Y NT;;;Format used + additional features\n" "Format/Info;;;N NT;;;Info about Format\n" "Format/Url;;;N NT;;;Link\n" "Format_Commercial;;;N NT;;;Commercial name used by vendor for theses setings or Format field if there is no difference\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for theses setings if there is one\n" "Format_Version;;;Y NTY;;;Version of this format\n" "Format_Profile;;;Y NTY;;;Profile of the Format\n" "Format_Compression;;;Y NTY;;;Compression method used;\n" "Format_Settings;;;Y NTY;;;Settings needed for decoder used\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "MuxingMode;;;Y YTY;;;How this file is muxed in the container\n" "CodecID;;;Y YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info about this codec\n" "CodecID/Hint;;;Y NT;;;A hint/popular name for this codec\n" "CodecID/Url;;;N NT;;;A link to more details about this codec ID\n" "CodecID_Description;;;Y YT;;;Manual description given by the container\n" "Duration;; ms;N YFY;;;Play time of the stream in ms\n" "Duration/String;;;Y NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String1;;;N NT;;;Play time in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration/String2;;;N NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String3;;;N NT;;;Play time in format : HH:MM:SS.MMM\n" "Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_Start;;;Y YTY;;\n" "Duration_End;;;Y YTY;;\n" "Source_Duration;; ms;N YFY;;;Source Play time of the stream, in ms;\n" "Source_Duration/String;;;Y NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String1;;;N NT;;;Source Play time in format : HHh MMmn SSs MMMms, XX omited if zero;\n" "Source_Duration/String2;;;N NT;;;Source Play time in format : XXx YYy only, YYy omited if zero;\n" "Source_Duration/String3;;;N NT;;;Source Play time in format : HH:MM:SS.MMM;\n" "Source_Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_FirstFrame;; ms;N YFY;;;Source Duration of the first frame if it is longer than others, in ms\n" "Source_Duration_FirstFrame/String;;;Y NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String1;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_FirstFrame/String2;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_FirstFrame/String3;;;N NT;;;Source Duration of the first frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_FirstFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_FirstFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Source_Duration_LastFrame;; ms;N YFY;;;Source Duration of the last frame if it is longer than others, in ms\n" "Source_Duration_LastFrame/String;;;Y NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String1;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Source_Duration_LastFrame/String2;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : XXx YYy only, YYy omited if zero\n" "Source_Duration_LastFrame/String3;;;N NT;;;Source Duration of the last frame if it is longer than others, in format : HH:MM:SS.MMM\n" "Source_Duration_LastFrame/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Source_Duration_LastFrame/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "BitRate_Mode;;;N YTY;;;Bit rate mode (VBR, CBR)\n" "BitRate_Mode/String;;;Y NT;;;Bit rate mode (Variable, Cconstant)\n" "BitRate;; bps;N YFY;;;Bit rate in bps\n" "BitRate/String;;;Y NT;;;Bit rate (with measurement)\n" "BitRate_Minimum;; bps;N YFY;;;Minimum Bit rate in bps\n" "BitRate_Minimum/String;;;Y NT;;;Minimum Bit rate (with measurement)\n" "BitRate_Nominal;; bps;N YFY;;;Nominal Bit rate in bps\n" "BitRate_Nominal/String;;;Y NT;;;Nominal Bit rate (with measurement)\n" "BitRate_Maximum;; bps;N YFY;;;Maximum Bit rate in bps\n" "BitRate_Maximum/String;;;Y NT;;;Maximum Bit rate (with measurement)\n" "BitRate_Encoded;; bps;N YFY;;;Encoded (with forced padding) bit rate in bps, if some container padding is present\n" "BitRate_Encoded/String;;;N NT;;;Encoded (with forced padding) bit rate (with measurement), if some container padding is present\n" "FrameRate;; fps;N YFY;;;Frames per second\n" "FrameRate/String;;;Y NT;;;Frames per second (with measurement)\n" "FrameRate_Num;;;N NFN;;;Frames per second, numerator\n" "FrameRate_Den;;;N NFN;;;Frames per second, denominator\n" "FrameCount;;;N NIY;;;Number of frames\n" "Source_FrameCount;;;N NI;;;Source Number of frames\n" "Delay;; ms;N NFY;;;Delay fixed in the stream (relative) IN MS\n" "Delay/String;;;N NT;;;Delay with measurement\n" "Delay/String1;;;N NT;;;Delay with measurement\n" "Delay/String2;;;N NT;;;Delay with measurement\n" "Delay/String3;;;N NT;;;Delay in format : HH:MM:SS.MMM\n" "Delay/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n" "Delay_DropFrame;;;N NT;;;Delay drop frame\n" "Delay_Source;;;N NT;;;Delay source (Container or Stream or empty)\n" "Delay_Source/String;;;N NT;;;Delay source (Container or Stream or empty)\n" "Delay_Original;; ms;N NIY;;;Delay fixed in the raw stream (relative) IN MS\n" "Delay_Original/String;;;N NT;;;Delay with measurement\n" "Delay_Original/String1;;;N NT;;;Delay with measurement\n" "Delay_Original/String2;;;N NT;;;Delay with measurement\n" "Delay_Original/String3;;;N NT;;;Delay in format: HH:MM:SS.MMM;\n" "Delay_Original/String4;;;N NT;;;Delay in format: HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay_Original/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Original_Settings;;;N NT;;;Delay settings (in case of timecode for example);\n" "Delay_Original_DropFrame;;;N NT;;;Delay drop frame info\n" "Delay_Original_Source;;;N NT;;;Delay source (Stream or empty)\n" "Video_Delay;; ms;N NI;;;Delay fixed in the stream (absolute / video)\n" "Video_Delay/String;;;Y NT;;\n" "Video_Delay/String1;;;N NT;;\n" "Video_Delay/String2;;;N NT;;\n" "Video_Delay/String3;;;N NT;;\n" "Video_Delay/String4;;;N NT;;\n" "Video_Delay/String5;;;N NT;;\n" "Video0_Delay;; ms;N NI;;;Deprecated, do not use in new projects\n" "Video0_Delay/String;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String1;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String2;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String3;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String4;;;N NT;;;Deprecated, do not use in new projects\n" "Video0_Delay/String5;;;N NT;;;Deprecated, do not use in new projects\n" "TimeStamp_FirstFrame;; ms;N YFY;;;TimeStamp fixed in the stream (relative) IN MS\n" "TimeStamp_FirstFrame/String;;;Y NT;;;TimeStamp with measurement\n" "TimeStamp_FirstFrame/String1;;;N NT;;;TimeStamp with measurement\n" "TimeStamp_FirstFrame/String2;;;N NT;;;TimeStamp with measurement\n" "TimeStamp_FirstFrame/String3;;;N NT;;;TimeStamp in format : HH:MM:SS.MMM\n" "TimeStamp_FirstFrame/String4;;;N NT;;;TimeStamp in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "TimeStamp_FirstFrame/String5;;;N NT;;;TimeStamp in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "TimeCode_FirstFrame;;;Y YCY;;;Time code in HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available format\n" "TimeCode_Settings;;;Y YTY;;;Time code settings\n" "TimeCode_Striped;;Yes;N YTY;;;Time code is striped (only 1st time code, no discontinuity)\n" "TimeCode_Striped/String;;;Y NT;;;Time code is striped (only 1st time code, no discontinuity)\n" "StreamSize;; byte;N YIY;;;Streamsize in bytes;\n" "StreamSize/String;;;Y NT;;;Streamsize in with percentage value;\n" "StreamSize/String1;;;N NT;;;;\n" "StreamSize/String2;;;N NT;;;;\n" "StreamSize/String3;;;N NT;;;;\n" "StreamSize/String4;;;N NT;;;;\n" "StreamSize/String5;;;N NT;;;Streamsize in with percentage value;\n" "StreamSize_Proportion;;;N NT;;;Stream size divided by file size;\n" "StreamSize_Demuxed;; byte;N YIN;;;StreamSize in bytes of hte stream after demux;\n" "StreamSize_Demuxed/String;;;N NT;;;StreamSize_Demuxed in with percentage value;\n" "StreamSize_Demuxed/String1;;;N NT;;;;\n" "StreamSize_Demuxed/String2;;;N NT;;;;\n" "StreamSize_Demuxed/String3;;;N NT;;;;\n" "StreamSize_Demuxed/String4;;;N NT;;;;\n" "StreamSize_Demuxed/String5;;;N NT;;;StreamSize_Demuxed in with percentage value (note: theoritical value, not for real use);\n" "Source_StreamSize;; byte;N YIY;;;Source Streamsize in bytes;\n" "Source_StreamSize/String;;;Y NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize/String1;;;N NT;;;;\n" "Source_StreamSize/String2;;;N NT;;;;\n" "Source_StreamSize/String3;;;N NT;;;;\n" "Source_StreamSize/String4;;;N NT;;;;\n" "Source_StreamSize/String5;;;N NT;;;Source Streamsize in with percentage value;\n" "Source_StreamSize_Proportion;;;N NT;;;Source Stream size divided by file size;\n" "StreamSize_Encoded;; byte;N YIY;;;Encoded Streamsize in bytes;\n" "StreamSize_Encoded/String;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded/String1;;;N NT;;;;\n" "StreamSize_Encoded/String2;;;N NT;;;;\n" "StreamSize_Encoded/String3;;;N NT;;;;\n" "StreamSize_Encoded/String4;;;N NT;;;;\n" "StreamSize_Encoded/String5;;;N NT;;;Encoded Streamsize in with percentage value;\n" "StreamSize_Encoded_Proportion;;;N NT;;;Encoded Stream size divided by file size;\n" "Source_StreamSize_Encoded;; byte;N YIY;;;Source Encoded Streamsize in bytes;\n" "Source_StreamSize_Encoded/String;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded/String1;;;N NT;;;;\n" "Source_StreamSize_Encoded/String2;;;N NT;;;;\n" "Source_StreamSize_Encoded/String3;;;N NT;;;;\n" "Source_StreamSize_Encoded/String4;;;N NT;;;;\n" "Source_StreamSize_Encoded/String5;;;N NT;;;Source Encoded Streamsize in with percentage value;\n" "Source_StreamSize_Encoded_Proportion;;;N NT;;;Source Encoded Stream size divided by file size;\n" "Title;;;Y YTY;;;Name of this menu\n" "Language;;;N YTY;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)\n" "Language/String;;;Y NT;;;Language (full)\n" "Language/String1;;;N NT;;;Language (full);\n" "Language/String2;;;N NT;;;Language (2-letter ISO 639-1 if exists, else empty);\n" "Language/String3;;;N NT;;;Language (3-letter ISO 639-2 if exists, else empty);\n" "Language/String4;;;N NT;;;Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty);\n" "Language_More;;;Y YTY;;;More info about Language (e.g. Director's Comment);\n" "ServiceKind;;;N YTY;;;Service kind, e.g. visually impaired, commentary, voice over;\n" "ServiceKind/String;;;Y NT;;;Service kind (full);\n" "Disabled;;Yes;N YTY;;;Set if that track should not be used\n" "Disabled/String;;;Y NT;;;Set if that track should not be used\n" "Default;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Default/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "Forced;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Forced/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "AlternateGroup;;Yes;N YTY;;;Number of a group in order to provide versions of the same track\n" "AlternateGroup/String;;;Y NT;;;Number of a group in order to provide versions of the same track\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Image (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of that kind available\n" "StreamKind;Image;;N NT;;;Stream type name\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Number of the stream (base=0)\n" "StreamKindPos;;;N NI;;;When multiple streams, number of the stream (base=1)\n" "StreamOrder;;;N YIY;;;Stream order in the file, whatever is the kind of stream (base=0)\n" "FirstPacketOrder;;;N YIY;;;Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "Title;;;Y YTY;;;Name of the track\n" "Format;;;N YTY;;;Format used\n" "Format/String;;;Y NT;;;Format used + additional features\n" "Format/Info;;;Y NT;;;Info about Format\n" "Format/Url;;;N NT;;;Link\n" "Format_Commercial;;;N NT;;;Commercial name used by vendor for theses setings or Format field if there is no difference\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for theses setings if there is one\n" "Format_Version;;;Y NTY;;;Version of this format\n" "Format_Profile;;;Y NTY;;;Profile of the Format\n" "Format_Settings_Endianness;;;N YTY;;;;\n" "Format_Settings_Packing;;;N YTY;;;;\n" "Format_Compression;;;Y YTY;;;Compression method used\n" "Format_Settings;;;Y NT;;;Settings needed for decoder used\n" "Format_Settings_Wrapping;;;Y YTY;;;Wrapping mode (Frame wrapped or Clip wrapped)\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "InternetMediaType;;;N YT;;;Internet Media Type (aka MIME Type, Content-Type)\n" "CodecID;;;Y YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info about codec ID\n" "CodecID/Hint;;;Y NT;;;A hint for this codec ID\n" "CodecID/Url;;;N NT;;;A link for more details about this codec ID\n" "CodecID_Description;;;Y YT;;;Manual description given by the container\n" "Codec;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/String;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Family;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Info;;;N NT;;;Deprecated, do not use in new projects\n" "Codec/Url;;;N NT;;;Deprecated, do not use in new projects\n" "Width;; pixel;N YIY;;;Width (aperture size if present) in pixel\n" "Width/String;;;Y NT;;;Width (aperture size if present) with measurement (pixel)\n" "Width_Offset;; pixel;N YIY;;;Offset between original width and displayed width (aperture size) in pixel\n" "Width_Offset/String;;;N NT;;;Offset between original width and displayed width (aperture size) in pixel\n" "Width_Original;; pixel;N YIY;;;Original (in the raw stream) width in pixel\n" "Width_Original/String;;;Y NT;;;Original (in the raw stream) width with measurement (pixel)\n" "Height;; pixel;N YIY;;;Height (aperture size if present) in pixel\n" "Height/String;;;Y NT;;;Height (aperture size if present) with measurement (pixel)\n" "Height_Offset;; pixel;N YIY;;;Offset between original height and displayed height (aperture size) in pixel\n" "Height_Offset/String;;;N NT;;;Offset between original height and displayed height (aperture size) in pixel\n" "Height_Original;; pixel;N YIY;;;Original (in the raw stream) height in pixel\n" "Height_Original/String;;;Y NT;;;Original (in the raw stream) height with measurement (pixel)\n" "PixelAspectRatio;;;N YFY;;;Pixel Aspect ratio\n" "PixelAspectRatio/String;;;N NT;;;Pixel Aspect ratio\n" "PixelAspectRatio_Original;;;N YFY;;;Original (in the raw stream) Pixel Aspect ratio\n" "PixelAspectRatio_Original/String;;;N NT;;;Original (in the raw stream) Pixel Aspect ratio\n" "DisplayAspectRatio;;;N YFY;;;Display Aspect ratio\n" "DisplayAspectRatio/String;;;Y NT;;;Display Aspect ratio\n" "DisplayAspectRatio_Original;;;N YFY;;;Original (in the raw stream) Display Aspect ratio\n" "DisplayAspectRatio_Original/String;;;Y NT;;;Original (in the raw stream) Display Aspect ratio\n" "ColorSpace;;;Y YTY;;\n" "ChromaSubsampling;;;Y YTY;;\n" "Resolution;; bit;N NI;;;Deprecated, do not use in new projects\n" "Resolution/String;;;N NT;;;Deprecated, do not use in new projects\n" "BitDepth;; bit;N YIY;;\n" "BitDepth/String;;;Y NT;;\n" "Compression_Mode;;;N YTY;;;Compression mode (Lossy or Lossless)\n" "Compression_Mode/String;;;Y NT;;;Compression mode (Lossy or Lossless)\n" "Compression_Ratio;;;Y YF;;;Current stream size divided by uncompressed stream size;\n" "StreamSize;; byte;N YIY;;;Stream size in bytes\n" "StreamSize/String;;;Y NT;;\n" "StreamSize/String1;;;N NT;;\n" "StreamSize/String2;;;N NT;;\n" "StreamSize/String3;;;N NT;;\n" "StreamSize/String4;;;N NT;;\n" "StreamSize/String5;;;N NT;;;With proportion;\n" "StreamSize_Proportion;;;N NT;;;Stream size divided by file size;\n" "StreamSize_Demuxed;; byte;N YIN;;;StreamSize in bytes of hte stream after demux;\n" "StreamSize_Demuxed/String;;;N NT;;;StreamSize_Demuxed in with percentage value;\n" "StreamSize_Demuxed/String1;;;N NT;;;;\n" "StreamSize_Demuxed/String2;;;N NT;;;;\n" "StreamSize_Demuxed/String3;;;N NT;;;;\n" "StreamSize_Demuxed/String4;;;N NT;;;;\n" "StreamSize_Demuxed/String5;;;N NT;;;StreamSize_Demuxed in with percentage value (note: theoritical value, not for real use);\n" "Encoded_Library;;;N YTY;;;Software used to create the file;\n" "Encoded_Library/String;;;Y NT;;;Software used to create the file;\n" "Encoded_Library_Name;;;N NTY;;;Info from the software;\n" "Encoded_Library_Version;;;N NTY;;;Version of software;\n" "Encoded_Library_Date;;;N NTY;;;Release date of software;\n" "Encoded_Library_Settings;;;Y YTY;;;Parameters used by the software;\n" "Language;;;N YTY;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn);\n" "Language/String;;;Y NT;;;Language (full);\n" "Language/String1;;;N NT;;;Language (full);\n" "Language/String2;;;N NT;;;Language (2-letter ISO 639-1 if exists, else empty);\n" "Language/String3;;;N NT;;;Language (3-letter ISO 639-2 if exists, else empty);\n" "Language/String4;;;N NT;;;Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty);\n" "Language_More;;;Y YTY;;;More info about Language (e.g. Director's Comment);\n" "ServiceKind;;;N YTY;;;Service kind, e.g. visually impaired, commentary, voice over;\n" "ServiceKind/String;;;Y NT;;;Service kind (full);\n" "Disabled;;Yes;N YTY;;;Set if that track should not be used\n" "Disabled/String;;;Y NT;;;Set if that track should not be used\n" "Default;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Default/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "Forced;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Forced/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "AlternateGroup;;Yes;N YTY;;;Number of a group in order to provide versions of the same track\n" "AlternateGroup/String;;;Y NT;;;Number of a group in order to provide versions of the same track\n" "Summary;;;N NTY;;;;\n" "Encoded_Date;;;Y YTY;;;The time that the encoding of this item was completed began.;;Temporal\n" "Tagged_Date;;;Y YTY;;;The time that the tags were done for this item.;;Temporal\n" "Encryption;;;Y YTY;;;;\n" "colour_description_present;;;N YTY;;;Presence of colour description\n" "colour_primaries;;;Y YTY;;;Chromaticity coordinates of the source primaries\n" "transfer_characteristics;;;Y YTY;;;Opto-electronic transfer characteristic of the source picture\n" "matrix_coefficients;;;Y YTY;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries\n" "colour_description_present_Original;;;N YTY;;;Presence of colour description\n" "colour_primaries_Original;;;Y YTY;;;Chromaticity coordinates of the source primaries\n" "transfer_characteristics_Original;;;Y YTY;;;Opto-electronic transfer characteristic of the source picture\n" "matrix_coefficients_Original;;;Y YTY;;;Matrix coefficients used in deriving luma and chroma signals from the green, blue, and red primaries\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Menu (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Count;;;N NI;;;Count of objects available in this stream\n" "Status;;;N NI;;;bit field (0=IsAccepted, 1=IsFilled, 2=IsUpdated, 3=IsFinished)\n" "StreamCount;;;N NI;;;Count of streams of that kind available\n" "StreamKind;Menu;;N NT;;;Stream type name\n" "StreamKind/String;;;N NT;;;Stream type name\n" "StreamKindID;;;N NI;;;Number of the stream (base=0)\n" "StreamKindPos;;;N NI;;;When multiple streams, number of the stream (base=1)\n" "StreamOrder;;;N YIY;;;Stream order in the file, whatever is the kind of stream (base=0)\n" "FirstPacketOrder;;;N YIY;;;Order of the first fully decodable packet met in the file, whatever is the kind of stream (base=0)\n" "Inform;;;N NT;;;Last **Inform** call\n" "ID;;;N YTY;;;The ID for this stream in this file\n" "ID/String;;;Y NT;;;The ID for this stream in this file\n" "OriginalSourceMedium_ID;;;N YTY;;;The ID for this stream in the original medium of the material\n" "OriginalSourceMedium_ID/String;;;Y NT;;;The ID for this stream in the original medium of the material\n" "UniqueID;;;N YTY;;;The unique ID for this stream, should be copied with stream copy\n" "UniqueID/String;;;Y NT;;;The unique ID for this stream, should be copied with stream copy\n" "MenuID;;;N YTY;;;The menu ID for this stream in this file\n" "MenuID/String;;;Y NT;;;The menu ID for this stream in this file\n" "Format;;;N YTY;;;Format used\n" "Format/String;;;N NT;;;Format used + additional features\n" "Format/Info;;;N NT;;;Info about Format\n" "Format/Url;;;N NT;;;Link\n" "Format_Commercial;;;N NT;;;Commercial name used by vendor for theses setings or Format field if there is no difference\n" "Format_Commercial_IfAny;;;Y YTY;;;Commercial name used by vendor for theses setings if there is one\n" "Format_Version;;;Y NTY;;;Version of this format\n" "Format_Profile;;;Y NTY;;;Profile of the Format\n" "Format_Compression;;;Y NTY;;;Compression method used;\n" "Format_Settings;;;Y NTY;;;Settings needed for decoder used\n" "Format_AdditionalFeatures;;;N YTY;;;Format features needed for fully supporting the content\n" "CodecID;;;Y YTY;;;Codec ID (found in some containers);\n" "CodecID/String;;;Y NT;;;Codec ID (found in some containers);\n" "CodecID/Info;;;Y NT;;;Info about this codec\n" "CodecID/Hint;;;Y NT;;;A hint/popular name for this codec\n" "CodecID/Url;;;N NT;;;A link to more details about this codec ID\n" "CodecID_Description;;;Y YT;;;Manual description given by the container\n" "Codec;;;N YT;;;Deprecated\n" "Codec/String;;;N NT;;;Deprecated\n" "Codec/Info;;;N NT;;;Deprecated\n" "Codec/Url;;;N NT;;;Deprecated\n" "Duration;; ms;N YFY;;;Play time of the stream in ms\n" "Duration/String;;;Y NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String1;;;N NT;;;Play time in format : HHh MMmn SSs MMMms, XX omited if zero\n" "Duration/String2;;;N NT;;;Play time in format : XXx YYy only, YYy omited if zero\n" "Duration/String3;;;N NT;;;Play time in format : HH:MM:SS.MMM\n" "Duration/String4;;;N NT;;;Play time in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Duration/String5;;;N NT;;;Play time in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Duration_Start;;;Y YTY;;\n" "Duration_End;;;Y YTY;;\n" "Delay;; ms;N NFY;;;Delay fixed in the stream (relative) IN MS\n" "Delay/String;;;N NT;;;Delay with measurement\n" "Delay/String1;;;N NT;;;Delay with measurement\n" "Delay/String2;;;N NT;;;Delay with measurement\n" "Delay/String3;;;N NT;;;Delay in format : HH:MM:SS.MMM\n" "Delay/String4;;;N NT;;;Delay in format : HH:MM:SS:FF, last colon replaced by semicolon for drop frame if available\n" "Delay/String5;;;N NT;;;Delay in format : HH:MM:SS.mmm (HH:MM:SS:FF)\n" "Delay_Settings;;;N NT;;;Delay settings (in case of timecode for example)\n" "Delay_DropFrame;;;N NTY;;;Delay drop frame\n" "Delay_Source;;;N NTY;;;Delay source (Container or Stream or empty)\n" "List_StreamKind;;;N YTY;;;List of programs available\n" "List_StreamPos;;;N YTY;;;List of programs available\n" "List;;;N YT;;;List of programs available\n" "List/String;;;Y NT;;;List of programs available\n" "Title;;;Y YTY;;;Name of this menu\n" "Language;;;N YTY;;;Language (2-letter ISO 639-1 if exists, else 3-letter ISO 639-2, and with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn)\n" "Language/String;;;Y NT;;;Language (full)\n" "Language/String1;;;N NT;;;Language (full);\n" "Language/String2;;;N NT;;;Language (2-letter ISO 639-1 if exists, else empty);\n" "Language/String3;;;N NT;;;Language (3-letter ISO 639-2 if exists, else empty);\n" "Language/String4;;;N NT;;;Language (2-letter ISO 639-1 if exists with optional ISO 3166-1 country separated by a dash if available, e.g. en, en-us, zh-cn, else empty);\n" "Language_More;;;Y YT;;;More info about Language (e.g. Director's Comment);\n" "ServiceKind;;;N YTY;;;Service kind, e.g. visually impaired, commentary, voice over;\n" "ServiceKind/String;;;Y NT;;;Service kind (full);\n" "ServiceName;;;Y YTY;;;;;Legal\n" "ServiceChannel;;;Y YTY;;;;;Legal\n" "Service/Url;;;Y YT;;;;;Legal\n" "ServiceProvider;;;Y YTY;;;;;Legal\n" "ServiceProvider/Url;;;Y YTN;;;;;Legal\n" "ServiceType;;;Y YTY;;;;;Legal\n" "NetworkName;;;Y YTY;;;;;Legal\n" "Original/NetworkName;;;Y YTY;;;;;Legal\n" "Countries;;;Y YTY;;;;;Legal\n" "TimeZones;;;Y YTY;;;;;Legal\n" "LawRating;;;Y YTY;;;Depending on the country it's the format of the rating of a movie (P, R, X in the USA, an age in other countries or a URI defining a logo).;;Classification\n" "LawRating_Reason;;;Y YTY;;;Reason for the law rating;;Classification\n" "Disabled;;Yes;N YTY;;;Set if that track should not be used\n" "Disabled/String;;;Y NT;;;Set if that track should not be used\n" "Default;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Default/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "Forced;;Yes;N YTY;;;Set if that track should be used if no language found matches the user preference.\n" "Forced/String;;;Y NT;;;Set if that track should be used if no language found matches the user preference.\n" "AlternateGroup;;Yes;N YTY;;;Number of a group in order to provide versions of the same track\n" "AlternateGroup/String;;;Y NT;;;Number of a group in order to provide versions of the same track\n" "Chapters_Pos_Begin;;;N NI;;;Used by third-party developers to know about the beginning of the chapters list, to be used by Get(Stream_Menu, x, Pos), where Pos is an Integer between Chapters_Pos_Begin and Chapters_Pos_End;\n" "Chapters_Pos_End;;;N NI;;;Used by third-party developers to know about the end of the chapters list (this position excluded)\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Iso639_1 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "aar;aa\n" "abk;ab\n" "ave;ae\n" "afr;af\n" "aka;ak\n" "amh;am\n" "arg;an\n" "ara;ar\n" "asm;as\n" "ava;av\n" "aym;ay\n" "aze;az\n" "bak;ba\n" "bel;be\n" "bul;bg\n" "bih;bh\n" "bis;bi\n" "bam;bm\n" "ben;bn\n" "tib;bo\n" "tib;bo\n" "bre;br\n" "bos;bs\n" "cat;ca\n" "che;ce\n" "cha;ch\n" "cos;co\n" "cre;cr\n" "ces;cs\n" "cze;cs\n" "chu;cu\n" "chv;cv\n" "cym;cy\n" "wel;cy\n" "dan;da\n" "deu;de\n" "ger;de\n" "div;dv\n" "dzo;dz\n" "ewe;ee\n" "gre;el\n" "ell;el\n" "eng;en\n" "epo;eo\n" "spa;es\n" "est;et\n" "baq;eu\n" "eus;eu\n" "fas;fa\n" "per;fa\n" "ful;ff\n" "fin;fi\n" "fij;fj\n" "fao;fo\n" "fra;fr\n" "fre;fr\n" "fry;fy\n" "gle;ga\n" "gla;gd\n" "glg;gl\n" "grn;gn\n" "guj;gu\n" "glv;gv\n" "hau;ha\n" "heb;he\n" "hin;hi\n" "hmo;ho\n" "hrv;hr\n" "hrv;hr\n" "hat;ht\n" "hun;hu\n" "hye;hy\n" "arm;hy\n" "her;hz\n" "ina;ia\n" "ind;id\n" "ile;ie\n" "ibo;ig\n" "iii;ii\n" "ipk;ik\n" "ido;io\n" "ice;is\n" "isl;is\n" "ita;it\n" "iku;iu\n" "jpn;ja\n" "jav;jv\n" "geo;ka\n" "kat;ka\n" "kon;kg\n" "kik;ki\n" "kua;kj\n" "kaz;kk\n" "kal;kl\n" "khm;km\n" "kan;kn\n" "kor;ko\n" "kau;kr\n" "kas;ks\n" "kur;ku\n" "kom;kv\n" "cor;kw\n" "kir;ky\n" "lat;la\n" "ltz;lb\n" "lug;lg\n" "lim;li\n" "lin;ln\n" "lao;lo\n" "lit;lt\n" "lub;lu\n" "lav;lv\n" "mlg;mg\n" "mah;mh\n" "mao;mi\n" "mri;mi\n" "mac;mk\n" "mkd;mk\n" "mal;ml\n" "mon;mn\n" "mol;mo\n" "mar;mr\n" "may;ms\n" "msa;ms\n" "mlt;mt\n" "bur;my\n" "mya;my\n" "nau;na\n" "nob;nb\n" "nde;nd\n" "nde;nd\n" "nep;ne\n" "ndo;ng\n" "dut;nl\n" "nld;nl\n" "nno;nn\n" "nor;no\n" "nbl;nr\n" "nbl;nr\n" "nav;nv\n" "nya;ny\n" "oci;oc\n" "oji;oj\n" "orm;om\n" "ori;or\n" "oss;os\n" "pan;pa\n" "pli;pi\n" "pol;pl\n" "pus;ps\n" "por;pt\n" "que;qu\n" "roh;rm\n" "run;rn\n" "ron;ro\n" "rum;ro\n" "rus;ru\n" "kin;rw\n" "san;sa\n" "srd;sc\n" "snd;sd\n" "sme;se\n" "sag;sg\n" "sin;si\n" "slk;sk\n" "slo;sk\n" "slv;sl\n" "smo;sm\n" "sna;sn\n" "som;so\n" "alb;sq\n" "sqi;sq\n" "scc;sr\n" "srp;sr\n" "ssw;ss\n" "sot;st\n" "sun;su\n" "swe;sv\n" "swa;sw\n" "tam;ta\n" "tel;te\n" "tgk;tg\n" "tha;th\n" "tir;ti\n" "tuk;tk\n" "tgl;tl\n" "tsn;tn\n" "ton;to\n" "tur;tr\n" "tso;ts\n" "tat;tt\n" "twi;tw\n" "tah;ty\n" "uig;ug\n" "ukr;uk\n" "urd;ur\n" "uzb;uz\n" "ven;ve\n" "vie;vi\n" "vol;vo\n" "wln;wa\n" "wol;wo\n" "xho;xh\n" "yid;yi\n" "yor;yo\n" "zha;za\n" "chi;zh\n" "zho;zh\n" "zul;zu\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Iso639_2 (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "aa;aar\n" "ab;abk\n" "ae;ave\n" "af;afr\n" "ak;aka\n" "am;amh\n" "an;arg\n" "ar;ara\n" "as;asm\n" "av;ava\n" "ay;aym\n" "az;aze\n" "ba;bak\n" "be;bel\n" "bg;bul\n" "bh;bih\n" "bi;bis\n" "bm;bam\n" "bn;ben\n" "bo;tib\n" "bo;tib\n" "br;bre\n" "bs;bos\n" "ca;cat\n" "ce;che\n" "ch;cha\n" "co;cos\n" "cr;cre\n" "cs;ces\n" "cs;cze\n" "cu;chu\n" "cv;chv\n" "cy;cym\n" "cy;wel\n" "da;dan\n" "de;deu\n" "de;ger\n" "dv;div\n" "dz;dzo\n" "ee;ewe\n" "el;gre\n" "el;ell\n" "en;eng\n" "eo;epo\n" "es;spa\n" "et;est\n" "eu;baq\n" "eu;eus\n" "fa;fas\n" "fa;per\n" "ff;ful\n" "fi;fin\n" "fj;fij\n" "fo;fao\n" "fr;fra\n" "fr;fre\n" "fy;fry\n" "ga;gle\n" "gd;gla\n" "gl;glg\n" "gn;grn\n" "gu;guj\n" "gv;glv\n" "ha;hau\n" "he;heb\n" "hi;hin\n" "ho;hmo\n" "hr;hrv\n" "hr;hrv\n" "ht;hat\n" "hu;hun\n" "hy;hye\n" "hy;arm\n" "hz;her\n" "ia;ina\n" "id;ind\n" "ie;ile\n" "ig;ibo\n" "ii;iii\n" "ik;ipk\n" "io;ido\n" "is;ice\n" "is;isl\n" "it;ita\n" "iu;iku\n" "ja;jpn\n" "jv;jav\n" "ka;geo\n" "ka;kat\n" "kg;kon\n" "ki;kik\n" "kj;kua\n" "kk;kaz\n" "kl;kal\n" "km;khm\n" "kn;kan\n" "ko;kor\n" "kr;kau\n" "ks;kas\n" "ku;kur\n" "kv;kom\n" "kw;cor\n" "ky;kir\n" "la;lat\n" "lb;ltz\n" "lg;lug\n" "li;lim\n" "ln;lin\n" "lo;lao\n" "lt;lit\n" "lu;lub\n" "lv;lav\n" "mg;mlg\n" "mh;mah\n" "mi;mao\n" "mi;mri\n" "mk;mac\n" "mk;mkd\n" "ml;mal\n" "mn;mon\n" "mo;mol\n" "mr;mar\n" "ms;may\n" "ms;msa\n" "mt;mlt\n" "my;bur\n" "my;mya\n" "na;nau\n" "nb;nob\n" "nd;nde\n" "nd;nde\n" "ne;nep\n" "ng;ndo\n" "nl;dut\n" "nl;nld\n" "nn;nno\n" "no;nor\n" "nr;nbl\n" "nr;nbl\n" "nv;nav\n" "ny;nya\n" "oc;oci\n" "oj;oji\n" "om;orm\n" "or;ori\n" "os;oss\n" "pa;pan\n" "pi;pli\n" "pl;pol\n" "ps;pus\n" "pt;por\n" "qu;que\n" "rm;roh\n" "rn;run\n" "ro;ron\n" "ro;rum\n" "ru;rus\n" "rw;kin\n" "sa;san\n" "sc;srd\n" "sd;snd\n" "se;sme\n" "sg;sag\n" "si;sin\n" "sk;slk\n" "sk;slo\n" "sl;slv\n" "sm;smo\n" "sn;sna\n" "so;som\n" "sq;alb\n" "sq;sqi\n" "sr;scc\n" "sr;srp\n" "ss;ssw\n" "st;sot\n" "su;sun\n" "sv;swe\n" "sw;swa\n" "ta;tam\n" "te;tel\n" "tg;tgk\n" "th;tha\n" "ti;tir\n" "tk;tuk\n" "tl;tgl\n" "tn;tsn\n" "to;ton\n" "tr;tur\n" "ts;tso\n" "tt;tat\n" "tw;twi\n" "ty;tah\n" "ug;uig\n" "uk;ukr\n" "ur;urd\n" "uz;uzb\n" "ve;ven\n" "vi;vie\n" "vo;vol\n" "wa;wln\n" "wo;wol\n" "xh;xho\n" "yi;yid\n" "yo;yor\n" "za;zha\n" "zh;chi\n" "zh;zho\n" "zu;zul\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Library_DivX (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Main source;http://xmm.sourceforge.net/DivX5-6_Xvid_Bitstream_version.php\n" "413;5.0.0;UTC 2002-03-04\n" "450;5.0.1;UTC 2002-04-09\n" "481;5.0.2;UTC 2002-05-16\n" "484;5.0.2;UTC 2002-05-16\n" "487;5.0.2;UTC 2002-05-16\n" "696;5.0.5 Beta(Tahanea);UTC 2003-01\n" "740;5.0.3;UTC 2003-01-24\n" "795;5.0.4 Beta1or2(Schizo);UTC 2003-01\n" "804;5.0.4 Beta3(Schizo);UTC 2003-01\n" "814;5.0.4 Beta4(Schizo);UTC 2003-01\n" "822;5.0.4;UTC 2003-04-17\n" "830;5.0.5;UTC 2003-04-24\n" "894;5.0.5 Kauehi;UTC 2003-07-02\n" "922;5.1.0 Beta1(Manihi);UTC 2003-07-26\n" "936;5.1.0 Beta2(Kaukura);UTC 2003-08-02\n" "959;5.1.0;UTC 2003-09-02\n" "985;5.1.0 (HD?);UTC 2003-10\n" "1009;5.1.1 Beta1;UTC 2003-10-21\n" "1025;5.1.1 Beta2;UTC 2003-11\n" "1031;5.1.1 (Maupiti);UTC 2003-11-19\n" "1263;5.2.0;UTC 2004-07-15\n" "1272;5.2.0 (DrDivX 105);UTC 2004-07-17\n" "1307;5.2.1 Alpha;UTC 2004-09-08\n" "1314;5.2.1 Beta;UTC 2004-09-08\n" "1328;5.2.1 (WaffleDay);UTC 2004-09-08\n" "1338;5.2.1 (DrDivX 106);UTC 2004-09-08\n" "1394;5.3.0 Plasma Alpha (Tritium);UTC 2004-09-08\n" "1408;5.3.0 Plasma Alpha (CoreBurn);UTC 2004-10\n" "1429;>5.3.0, <5.9.0\n" "1438;>5.3.0, <5.9.0\n" "1453;5.9.0 Fusion (InertialConfinement);UTC 2005-01\n" "1461;5.9.0 Fusion (HiggsBoson);UTC 2005-01\n" "1528;5.9.0 Fusion (HiggsBoson);UTC 2005-03-05\n" "1571;6.0.0;UTC 2005-06-15\n" "1594;6.0.0 (DivX Converter1.0);UTC 2005-06\n" "1599;6.0.0 Helium;UTC 2005-06\n" "1612;6.0.0 Helium (GodFatherOfSoul);UTC 2005-06-15\n" "1697;6.0.3 Fusion (ThermonuclearFusion);UTC 2005-10-18\n" "1737;He-3 (TwinTurbocharger);UTC 2005-12\n" "1786;6.1.0;UTC 2005-12-12\n" "1828;6.1.1;UTC 2006-02-01\n" "1893;6.2.0 Beta1;UTC 2006-03-25\n" "1910;6.2.0;UTC 2006-04-11\n" "1913;6.2.1;UTC 2006-04\n" "1915;6.2.1 Patch1Beta;UTC 2006-04\n" "1920;6.2.2;UTC 2006-04-26\n" "1977;6.2.5;UTC 2006-06-16\n" "1988;6.2.5;UTC 2006-07\n" "2075;>6.2.5, <6.4.0\n" "2081;6.4.0 Beta1;UTC 2006-09-27\n" "2086;6.4.0;UTC 2006-10-03\n" "2201;6.5.0;UTC 2006-12\n" "2207;6.5.1;UTC 2007-03\n" "2292;6.6.0;UTC 2007-05-04\n" "2306;6.6.1\n" "2309;6.6.1\n" "2318;6.6.1.4\n" "2396;6.7 Beta;UTC 2007-08-26\n" "2432;6.7.0;UTC 2007-09-20\n" "2510;6.8.0;UTC 2007-12-04\n" "2521;6.8.0 Converter 6.6\n" "2559;6.8.2;UTC 2008-05-17\n" "2676;6.8.3-6.8.4;UTC 2008-06-07\n" "2816;6.8.5;UTC 2009-08-20\n" "2851;6.8.5;UTC 2009-08-20\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Library_XviD (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Main source;http://xmm.sourceforge.net/DivX5-6_Xvid_Bitstream_version.php\n" "1;0.0.01;UTC 2002-10-17\n" "2;0.0.02;UTC 2002-10-30\n" "3;0.0.03;UTC 2002-12-09\n" "4;0.0.04;UTC 2003-01\n" "5;0.0.05;UTC 2003-01-11\n" "6;0.0.06;UTC 2003-01-12\n" "7;0.0.07;UTC 2003-01-13\n" "8;0.0.08;UTC 2003-01-14\n" "9;0.0.09;UTC 2003-03-25\n" "10;0.0.10;UTC 2003-06-09\n" "11;0.0.11;UTC 2003-06-09\n" "12;0.0.12;UTC 2003-06-11\n" "13;0.0.13;UTC 2003-06-11\n" "14;0.0.14;UTC 2003-06-28\n" "15;0.0.15;UTC 2003-07-28\n" "16;0.0.16;UTC 2003-07-28\n" "17;0.0.17;UTC 2003-08-06\n" "18;0.0.18;UTC 2003-09-04\n" "19;0.0.19;UTC 2003-09-28\n" "20;0.0.20;UTC 2003-10-09\n" "21;1.0.0 Beta1 (Aloha);UTC 2003-11-29\n" "22;1.0.0 Beta1.5;UTC 2003-12-03\n" "23;1.0.0 Beta2 (Ciao);UTC 2003-12-06\n" "24;1.0.0 Beta2.5;UTC 2003-12-18\n" "25;1.0.0 Beta3 (Selam);UTC 2003-12-27\n" "26;1.0.0 RC1 (Niltze);UTC 2004-01-26\n" "27;1.0.0 RC1b;UTC 2004-01-30\n" "28;1.0.0 RC2 (Jambo);UTC 2004-02-01\n" "29;1.0.0 RC3 (Nihao);UTC 2004-03-22\n" "30;1.0.0 RC4 (Hola);UTC 2004-04-05\n" "31;1.0.0 RC4b;UTC 2004-04-15\n" "32;1.0.0 RC4c;UTC 2004-05-02\n" "33;1.0.0 RC4d;UTC 2004-05-03\n" "34;1.0.0;UTC 2004-05-09\n" "35;1.0.1;UTC 2004-06-05\n" "36;1.0.2;UTC 2004-08-29\n" "37;1.0.3;UTC 2004-12-20\n" "38;1.1.0 Beta1;UTC 2005-01-16\n" "39;1.1.0 Beta2;UTC 2005-04-04\n" "40;1.1.0 RC;UTC 2005-11-22\n" "41;1.1.0;UTC 2005-11-22\n" "42;1.2.0.dev42;UTC 2005-12\n" "43;1.2.0SMP;UTC 2006-01-08\n" "44;1.1.1;UTC 2006-07-10\n" "45;1.2.0.dev45;UTC 2006-07-10\n" "46;1.1.2;UTC 2006-11-01\n" "47;1.2.0.dev47;UTC 2006-11-01\n" "48;1.2.0.dev48\n" "49;1.2.0.dev49\n" "50;1.2.1;UTC 2008-12-04\n" "55;1.3.0.dev55\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Library_MainConcept_Avc (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "2.0.1889;2.0.1889;UTC 2006-01-11\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Library_VorbisCom (InfoMap &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "Main source;http://wiki.hydrogenaudio.org/index.php?title=Recommended_Ogg_Vorbis\n" "Xiphophorus libVorbis I 20000508;1.0 Beta 1/2;UTC 2000-05-08\n" "Xiphophorus libVorbis I 20001031;1.0 Beta 3;UTC 2000-10-31\n" "Xiphophorus libVorbis I 20010225;1.0 Beta 4;UTC 2001-02-25\n" "Xiphophorus libVorbis I 20010615;1.0 RC1;UTC 2000-16-15\n" "Xiphophorus libVorbis I 20010813;1.0 RC2;UTC 2000-18-13\n" "Xiphophorus libVorbis I 20010816 (gtune 1);1.0 RC2 (GTune 1);UTC 2001-08-16\n" "Xiphophorus libVorbis I 20011014 (GTune 2);1.0 RC2 (GTune 2);UTC 2001-10-14\n" "Xiphophorus libVorbis I 20011217;1.0 RC3;UTC 2001-12-17\n" "Xiphophorus libVorbis I 20011231;1.0 RC3;UTC 2001-12-31\n" "Xiph.Org libVorbis I 20020717;1.0;UTC 2002-07-17\n" "Xiph.Org/Sjeng.Org libVorbis I 20020717 (GTune 3, beta 1);1.0 (GTune 3 Beta 1);UTC 2002-07-17\n" "Xiph.Org libVorbis I 20030308;1.0.1 (CVS);UTC 2003-03-08\n" "Xiph.Org libVorbis I 20030909;1.0.1;UTC 2003-09-09\n" "Xiph.Org/Sjeng.Org libVorbis I 20030909 (GTune 3, beta 2) EXPERIMENTAL;1.0 (GTune 3 Beta 2);UTC 2003-09-09\n" "Xiph.Org libVorbis I 20031230 (1.0.1);1.0.1 (CVS);UTC 2003-12-30\n" "Xiph.Org/Sjeng.Org libVorbis I 20031230 (GTune 3, beta 2);1.0.1 (GTune 3 Beta 2);UTC 2003-12-30\n" "AO aoTuV b2 [20040420] (based on Xiph.Org's 1.0.1);Beta 2;UTC 2004-04-20\n" "Xiph.Org libVorbis I 20040629;1.1;UTC 2004-06-29\n" "Xiph.Org libVorbis I 20040920;1.1 (with impulse_trigger_profile);UTC 2004-09-20\n" "AO aoTuV b3 [20041120] (based on Xiph.Org's libVorbis);Beta 3;UTC 2004-11-20\n" "Xiph.Org libVorbis I 20050304;1.1.1/1.1.2;UTC 2005-03-04\n" "AO aoTuV b4 [20050617] (based on Xiph.Org's libVorbis);Beta 4;UTC 2005-06-17\n" "BS Lancer [20050709] (based on aoTuV b4 [20050617]);(aoTuV Beta 4);UTC 2005-07-09\n" "AO aoTuV b4a [20051105] (based on Xiph.Org's libVorbis);Beta 4.5;UTC 2005-11-05\n" "AO aoTuV b4b [20051117] (based on Xiph.Org's libVorbis);Beta 4.51;UTC 2005-11-17\n" "BS Lancer [20051121] (based on aoTuV b4b [20051117]);(aoTuV Beta 4.51);UTC 2005-11-21\n" "AO aoTuV pre-beta5 [20060321] (based on Xiph.Org's libVorbis);Beta 5 (preBeta);UTC 2006-03-21\n" "AO aoTuV b5 [20061024] (based on Xiph.Org's libVorbis);Beta 5;UTC 2006-10-24\n" "Xiph.Org libVorbis I 20070622;1.2;UTC 2007-06-22\n" )); Info.Separator_Set(0, ZenLib::EOL); } //--------------------------------------------------------------------------- void MediaInfo_Config_Summary (ZtringListList &Info) { Info.Separator_Set(0, __T("\n")); Info.Write(Ztring().From_UTF8( "General;[%Format/String%][ (%Format_Profile%)][ (%Format_Commercial_IfAny%)]$if(%Format/String%,$: $)%FileSize/String%[, %Duration/String%]\n" "Video;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%Width%*][%Height%][ (%DisplayAspectRatio/String%), ][$at$ %FrameRate/String%, ][%Format/String%][ (%CodecID/Hint%)][ (%Standard%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][, %HDR_Format_Commercial%]\n" "Audio;[%Language/String%, ][%BitRate/String%$if(%BitRate_Nominal/String%, \\(%BitRate_Nominal/String%\\)), ][%SamplingRate/String%, ][%BitDepth/String%, ][%Channel(s)_Original/String% / ][%Channel(s)/String%, ][%Format/String%][ (%CodecID/Hint%)]$if(%MuxingMode%, \\(%MuxingMode%\\))$if(%Format_Version%, \\(%Format_Version%\\))$if(%Format_Profile%, \\(%Format_Profile%\\))$if(%Format_Settings%, \\(%Format_Settings%\\))[ (%Format_Commercial_IfAny%)][ (%ConformanceCheck/Short%)]\n" "Text;[%Language/String%, ][%Format/String%][ (%Format_Commercial_IfAny%)]$if(%MuxingMode%, \\(%MuxingMode%\\))\n" "Image;[%Language/String%, ][%Width%*][%Height%][ (%DisplayAspectRatio/String%)][, %Format/String%]\n" "Chapters;[%Language/String%, ]%Total% chapters[, %Format/String%][ (%Format_Commercial_IfAny%)]\n" )); Info.Separator_Set(0, ZenLib::EOL); } } //NameSpace
58.03108
489
0.665099
3CHosler
dceceebb8b5cc2cf98eae77528c968f99e465f20
1,056
cpp
C++
Day11/knightsTour.cpp
tejaswini212/100-Days-Of-Algo
ae90e91e302e2f1c9b1c067416fcb0bc42b12e99
[ "MIT" ]
1
2022-03-31T13:49:46.000Z
2022-03-31T13:49:46.000Z
Day11/knightsTour.cpp
tejaswini212/100-Days-Of-Algo
ae90e91e302e2f1c9b1c067416fcb0bc42b12e99
[ "MIT" ]
null
null
null
Day11/knightsTour.cpp
tejaswini212/100-Days-Of-Algo
ae90e91e302e2f1c9b1c067416fcb0bc42b12e99
[ "MIT" ]
null
null
null
#include<bits/stdc++.h> using namespace std; int move_x[8]={2,1,-1,-2,-2,-1,1,2}; int move_y[8]={1,2,2,1,-1,-2,-2,-1}; bool validateMove(vector<vector<int>> &board,int row,int col){ if(row<8 && row>=0 && col<8 && col>=0 && board[row][col]==0) return true; else return false; } bool solve(vector<vector<int>> &board,int row,int col,int counter){ if(counter>=65) return true; for(int i=0;i<8;i++){ int new_x = row+move_x[i]; int new_y = col+move_y[i]; if(validateMove(board,new_x,new_y)) { board[new_x][new_y]=counter; if(solve(board,new_x,new_y,counter+1))//==true) return true; else board[new_x][new_y]=0; } } return false; } int main(){ int m=8,n=8; vector<vector<int>> board(n,vector<int>(m,0)); board[0][0]=1; solve(board,0,0,2); for(int i=0;i<8;i++){ for(int j=0;j<8;j++){ cout<<board[i][j]<<" "; } cout<<"\n"; } return 0; }
22.956522
67
0.500947
tejaswini212
dced8b9a8bb8e3caee3c785e1996be318a8d0b02
10,179
cc
C++
lib/poppler/qt5/src/poppler-private.cc
nacimgoura/popplonode
51625d61248eeedf0a03d00a16d642cdef0329bb
[ "MIT" ]
4
2017-08-23T15:28:42.000Z
2019-10-18T01:50:16.000Z
lib/poppler/qt5/src/poppler-private.cc
nacimgoura/popplonode
51625d61248eeedf0a03d00a16d642cdef0329bb
[ "MIT" ]
2
2021-05-06T18:59:32.000Z
2021-08-31T16:38:27.000Z
lib/poppler/qt5/src/poppler-private.cc
istex/popplonode
1637685667757df6e54077fa93b60d5d1f7fbc8a
[ "MIT" ]
1
2017-09-05T07:56:18.000Z
2017-09-05T07:56:18.000Z
/* poppler-private.cc: qt interface to poppler * Copyright (C) 2005, Net Integration Technologies, Inc. * Copyright (C) 2006, 2011, 2015 by Albert Astals Cid <aacid@kde.org> * Copyright (C) 2008, 2010, 2011, 2014 by Pino Toscano <pino@kde.org> * Copyright (C) 2013 by Thomas Freitag <Thomas.Freitag@alfa.de> * Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com> * Copyright (C) 2016 Jakub Alba <jakubalba@gmail.com> * Inspired on code by * Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es> * Copyright (C) 2004 by Enrico Ros <eros.kde@email.it> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2, or (at your option) * any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA. */ #include "poppler-private.h" #include <QtCore/QByteArray> #include <QtCore/QDebug> #include <QtCore/QVariant> #include <Link.h> #include <Outline.h> #include <PDFDocEncoding.h> #include <UnicodeMap.h> namespace Poppler { namespace Debug { void qDebugDebugFunction(const QString &message, const QVariant & /*closure*/) { qDebug() << message; } PopplerDebugFunc debugFunction = qDebugDebugFunction; QVariant debugClosure; } static UnicodeMap *utf8Map = 0; void setDebugErrorFunction(PopplerDebugFunc function, const QVariant &closure) { Debug::debugFunction = function ? function : Debug::qDebugDebugFunction; Debug::debugClosure = closure; } void qt5ErrorFunction(void * /*data*/, ErrorCategory /*category*/, Goffset pos, char *msg) { QString emsg; if (pos >= 0) { emsg = QStringLiteral("Error (%1): ").arg(pos); } else { emsg = QStringLiteral("Error: "); } emsg += QString::fromLatin1(msg); (*Debug::debugFunction)(emsg, Debug::debugClosure); } QString unicodeToQString(Unicode* u, int len) { if (!utf8Map) { GooString enc("UTF-8"); utf8Map = globalParams->getUnicodeMap(&enc); utf8Map->incRefCnt(); } // ignore the last character if it is 0x0 if ((len > 0) && (u[len - 1] == 0)) { --len; } GooString convertedStr; for (int i = 0; i < len; ++i) { char buf[8]; const int n = utf8Map->mapUnicode(u[i], buf, sizeof(buf)); convertedStr.append(buf, n); } return QString::fromUtf8(convertedStr.getCString(), convertedStr.getLength()); } QString UnicodeParsedString(GooString *s1) { if ( !s1 || s1->getLength() == 0 ) return QString(); char *cString; int stringLength; bool deleteCString; if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getLength() > 1 && ( s1->getChar(1) & 0xff ) == 0xff ) ) { cString = s1->getCString(); stringLength = s1->getLength(); deleteCString = false; } else { cString = pdfDocEncodingToUTF16(s1, &stringLength); deleteCString = true; } QString result; // i = 2 to skip the unicode marker for ( int i = 2; i < stringLength; i += 2 ) { const Unicode u = ( ( cString[i] & 0xff ) << 8 ) | ( cString[i+1] & 0xff ); result += QChar( u ); } if (deleteCString) delete[] cString; return result; } GooString *QStringToUnicodeGooString(const QString &s) { int len = s.length() * 2 + 2; char *cstring = (char *)gmallocn(len, sizeof(char)); cstring[0] = 0xfe; cstring[1] = 0xff; for (int i = 0; i < s.length(); ++i) { cstring[2+i*2] = s.at(i).row(); cstring[3+i*2] = s.at(i).cell(); } GooString *ret = new GooString(cstring, len); gfree(cstring); return ret; } GooString *QStringToGooString(const QString &s) { int len = s.length(); char *cstring = (char *)gmallocn(s.length(), sizeof(char)); for (int i = 0; i < len; ++i) cstring[i] = s.at(i).unicode(); GooString *ret = new GooString(cstring, len); gfree(cstring); return ret; } GooString *QDateTimeToUnicodeGooString(const QDateTime &dt) { if (!dt.isValid()) { return NULL; } return QStringToUnicodeGooString(dt.toUTC().toString("yyyyMMddhhmmss+00'00'")); } void linkActionToTocItem( ::LinkAction * a, DocumentData * doc, QDomElement * e ) { if ( !a || !e ) return; switch ( a->getKind() ) { case actionGoTo: { // page number is contained/referenced in a LinkGoTo LinkGoTo * g = static_cast< LinkGoTo * >( a ); LinkDest * destination = g->getDest(); if ( !destination && g->getNamedDest() ) { // no 'destination' but an internal 'named reference'. we could // get the destination for the page now, but it's VERY time consuming, // so better storing the reference and provide the viewport on demand GooString *s = g->getNamedDest(); QChar *charArray = new QChar[s->getLength()]; for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]); QString aux(charArray, s->getLength()); e->setAttribute( QStringLiteral("DestinationName"), aux ); delete[] charArray; } else if ( destination && destination->isOk() ) { LinkDestinationData ldd(destination, NULL, doc, false); e->setAttribute( QStringLiteral("Destination"), LinkDestination(ldd).toString() ); } break; } case actionGoToR: { // page number is contained/referenced in a LinkGoToR LinkGoToR * g = static_cast< LinkGoToR * >( a ); LinkDest * destination = g->getDest(); if ( !destination && g->getNamedDest() ) { // no 'destination' but an internal 'named reference'. we could // get the destination for the page now, but it's VERY time consuming, // so better storing the reference and provide the viewport on demand GooString *s = g->getNamedDest(); QChar *charArray = new QChar[s->getLength()]; for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]); QString aux(charArray, s->getLength()); e->setAttribute( QStringLiteral("DestinationName"), aux ); delete[] charArray; } else if ( destination && destination->isOk() ) { LinkDestinationData ldd(destination, NULL, doc, g->getFileName() != 0); e->setAttribute( QStringLiteral("Destination"), LinkDestination(ldd).toString() ); } e->setAttribute( QStringLiteral("ExternalFileName"), g->getFileName()->getCString() ); break; } case actionURI: { LinkURI * u = static_cast< LinkURI * >( a ); e->setAttribute( QStringLiteral("DestinationURI"), u->getURI()->getCString() ); } default: ; } } DocumentData::~DocumentData() { qDeleteAll(m_embeddedFiles); delete (OptContentModel *)m_optContentModel; delete doc; count --; if ( count == 0 ) { utf8Map = 0; delete globalParams; } } void DocumentData::init() { m_backend = Document::SplashBackend; paperColor = Qt::white; m_hints = 0; m_optContentModel = 0; if ( count == 0 ) { utf8Map = 0; globalParams = new GlobalParams(); setErrorCallback(qt5ErrorFunction, NULL); } count ++; } void DocumentData::addTocChildren( QDomDocument * docSyn, QDomNode * parent, GooList * items ) { int numItems = items->getLength(); for ( int i = 0; i < numItems; ++i ) { // iterate over every object in 'items' OutlineItem * outlineItem = (OutlineItem *)items->get( i ); // 1. create element using outlineItem's title as tagName QString name; Unicode * uniChar = outlineItem->getTitle(); int titleLength = outlineItem->getTitleLength(); name = unicodeToQString(uniChar, titleLength); if ( name.isEmpty() ) continue; QDomElement item = docSyn->createElement( name ); parent->appendChild( item ); // 2. find the page the link refers to ::LinkAction * a = outlineItem->getAction(); linkActionToTocItem( a, this, &item ); item.setAttribute( QStringLiteral("Open"), QVariant( (bool)outlineItem->isOpen() ).toString() ); // 3. recursively descend over children outlineItem->open(); GooList * children = outlineItem->getKids(); if ( children ) addTocChildren( docSyn, &item, children ); } } }
34.505085
112
0.540721
nacimgoura
dcee6c654cbb3757e5112c58c809a763245426c4
590
cc
C++
X_Sum/653.cc
guohaoqiang/leetcode
802447c029c36892e8dd7391c825bcfc7ac0fd0b
[ "MIT" ]
null
null
null
X_Sum/653.cc
guohaoqiang/leetcode
802447c029c36892e8dd7391c825bcfc7ac0fd0b
[ "MIT" ]
null
null
null
X_Sum/653.cc
guohaoqiang/leetcode
802447c029c36892e8dd7391c825bcfc7ac0fd0b
[ "MIT" ]
null
null
null
class Solution { public: void inorder_visit(TreeNode* root){ if (root->left) inorder_visit(root->left); tree.push_back(root->val); if (root->right) inorder_visit(root->right); } bool findTarget(TreeNode* root, int k) { inorder_visit(root); int i=0,j=tree.size()-1; while (i<j){ if (tree[i]+tree[j]<k){ i++; }else if (tree[i]+tree[j]>k){ j--; }else { return true; } } return false; } vector<int> tree; };
22.692308
52
0.459322
guohaoqiang
dcef9028c7516850d032971ce520b6efe2ecb199
208
cpp
C++
Source/VREngine/Private/Interfaces/VRDualHands.cpp
Jordonbc/VREngine
c33e4eda5797dad233f8d813e3b8d3261e93632b
[ "Apache-2.0" ]
10
2020-11-26T19:04:08.000Z
2022-02-04T19:21:05.000Z
Source/VREngine/Private/Interfaces/VRDualHands.cpp
Jordonbc/VREngine
c33e4eda5797dad233f8d813e3b8d3261e93632b
[ "Apache-2.0" ]
4
2020-12-30T23:26:35.000Z
2021-12-19T23:43:08.000Z
Source/VREngine/Private/Interfaces/VRDualHands.cpp
Jordonbc/VREngine
c33e4eda5797dad233f8d813e3b8d3261e93632b
[ "Apache-2.0" ]
null
null
null
// Fill out your copyright notice in the Description page of Project Settings. #include "Interfaces/VRDualHands.h" // Add default functionality here for any IVRDualHands functions that are not pure virtual.
41.6
91
0.802885
Jordonbc
fd658b72395cbb9ddce97970d755871bb0debfec
29,622
cpp
C++
test/case/wal_object_test.cpp
atframework/atframe_utils
070eb63570e8094eeb4d03bf9761fd0311eb1ef3
[ "MIT" ]
55
2016-07-27T10:35:57.000Z
2022-03-27T13:46:26.000Z
test/case/wal_object_test.cpp
atframework/atframe_utils
070eb63570e8094eeb4d03bf9761fd0311eb1ef3
[ "MIT" ]
19
2021-05-29T07:30:04.000Z
2022-03-25T15:13:15.000Z
test/case/wal_object_test.cpp
atframework/atframe_utils
070eb63570e8094eeb4d03bf9761fd0311eb1ef3
[ "MIT" ]
18
2016-07-27T11:39:20.000Z
2021-08-17T06:33:44.000Z
// Copyright 2021 atframework #include <algorithm> #include <chrono> #include <cstring> #include <ctime> #include <memory> #include <sstream> #include <vector> #include <distributed_system/wal_object.h> #include "frame/test_macros.h" enum class test_wal_object_log_action { kDoNothing = 0, kRecursivePushBack, kIgnore, kFallbackDefault, kBreakOnDelegatePatcher, kBreakOnDefaultPatcher, }; namespace std { template <> struct hash<test_wal_object_log_action> { std::size_t operator()(test_wal_object_log_action const& s) const noexcept { return std::hash<int>{}(static_cast<int>(s)); } }; } // namespace std struct test_wal_object_log_type { util::distributed_system::wal_time_point timepoint; int64_t log_key; test_wal_object_log_action action; int64_t data; }; struct test_wal_object_log_storage_type { std::vector<test_wal_object_log_type> logs; int64_t global_ignore; }; struct test_wal_object_log_action_getter { test_wal_object_log_action operator()(const test_wal_object_log_type& log) { return log.action; } }; struct test_wal_object_context {}; struct test_wal_object_private_type { test_wal_object_log_storage_type* storage; inline test_wal_object_private_type() : storage(nullptr) {} inline explicit test_wal_object_private_type(test_wal_object_log_storage_type* input) : storage(input) {} }; using test_wal_object_log_operator = util::distributed_system::wal_log_operator<int64_t, test_wal_object_log_type, test_wal_object_log_action_getter>; using test_wal_object_type = util::distributed_system::wal_object<test_wal_object_log_storage_type, test_wal_object_log_operator, test_wal_object_context, test_wal_object_private_type>; struct test_wal_object_stats { int64_t key_alloc; size_t merge_count; size_t delegate_action_count; size_t default_action_count; size_t delegate_patcher_count; size_t default_patcher_count; size_t event_on_log_added; size_t event_on_log_removed; test_wal_object_type::log_type last_log; }; namespace details { test_wal_object_stats g_test_wal_object_stats{1, 0, 0, 0, 0, 0, 0, 0, test_wal_object_log_type()}; } static test_wal_object_type::vtable_pointer create_vtable() { using wal_object_type = test_wal_object_type; using wal_result_code = util::distributed_system::wal_result_code; wal_object_type::vtable_pointer ret = std::make_shared<wal_object_type::vtable_type>(); ret->load = [](wal_object_type& wal, const wal_object_type::storage_type& from, wal_object_type::callback_param_type) -> wal_result_code { *wal.get_private_data().storage = from; wal.set_global_ingore_key(from.global_ignore); std::vector<wal_object_type::log_pointer> container; for (auto& log : from.logs) { container.emplace_back(std::make_shared<wal_object_type::log_type>(log)); } wal.assign_logs(container.begin(), container.end()); if (!from.logs.empty()) { wal.set_last_removed_key((*from.logs.begin()).log_key - 1); } return wal_result_code::kOk; }; ret->dump = [](const wal_object_type& wal, wal_object_type::storage_type& to, wal_object_type::callback_param_type) -> wal_result_code { to = *wal.get_private_data().storage; if (nullptr != wal.get_global_ingore_key()) { to.global_ignore = *wal.get_global_ingore_key(); } return wal_result_code::kOk; }; ret->get_meta = [](const wal_object_type&, const wal_object_type::log_type& log) -> wal_object_type::meta_result_type { return wal_object_type::meta_result_type::make_success(log.timepoint, log.log_key, log.action); }; ret->set_meta = [](const wal_object_type&, wal_object_type::log_type& log, const wal_object_type::meta_type& meta) { log.action = meta.action_case; log.timepoint = meta.timepoint; log.log_key = meta.log_key; }; ret->merge_log = [](const wal_object_type&, wal_object_type::callback_param_type, wal_object_type::log_type& to, const wal_object_type::log_type& from) { ++details::g_test_wal_object_stats.merge_count; to.data = from.data; }; ret->get_log_key = [](const wal_object_type&, const wal_object_type::log_type& log) -> wal_object_type::log_key_type { return log.log_key; }; ret->allocate_log_key = [](wal_object_type&, const wal_object_type::log_type&, wal_object_type::callback_param_type) -> wal_object_type::log_key_result_type { return wal_object_type::log_key_result_type::make_success(++details::g_test_wal_object_stats.key_alloc); }; ret->on_log_added = [](wal_object_type&, const wal_object_type::log_pointer&) { ++details::g_test_wal_object_stats.event_on_log_added; }; ret->on_log_removed = [](wal_object_type&, const wal_object_type::log_pointer&) { ++details::g_test_wal_object_stats.event_on_log_removed; }; ret->log_action_delegate[test_wal_object_log_action::kDoNothing].action = [](wal_object_type&, const wal_object_type::log_type& log, wal_object_type::callback_param_type) -> wal_result_code { ++details::g_test_wal_object_stats.delegate_action_count; details::g_test_wal_object_stats.last_log = log; return wal_result_code::kOk; }; ret->log_action_delegate[test_wal_object_log_action::kRecursivePushBack].action = [](wal_object_type& wal, const wal_object_type::log_type& log, wal_object_type::callback_param_type param) -> wal_result_code { ++details::g_test_wal_object_stats.delegate_action_count; details::g_test_wal_object_stats.last_log = log; auto new_log = wal.allocate_log(log.timepoint, test_wal_object_log_action::kDoNothing, param); new_log->data = log.data + 1; CASE_EXPECT_TRUE(wal_result_code::kPending == wal.emplace_back(std::move(new_log), param)); return wal_result_code::kOk; }; ret->log_action_delegate[test_wal_object_log_action::kIgnore].action = [](wal_object_type&, const wal_object_type::log_type& log, wal_object_type::callback_param_type) -> wal_result_code { ++details::g_test_wal_object_stats.delegate_action_count; details::g_test_wal_object_stats.last_log = log; return wal_result_code::kIgnore; }; ret->log_action_delegate[test_wal_object_log_action::kBreakOnDelegatePatcher].patch = [](wal_object_type&, wal_object_type::log_type&, wal_object_type::callback_param_type) -> wal_result_code { ++details::g_test_wal_object_stats.delegate_patcher_count; return wal_result_code::kIgnore; }; ret->default_delegate.action = [](wal_object_type&, const wal_object_type::log_type& log, wal_object_type::callback_param_type) -> wal_result_code { ++details::g_test_wal_object_stats.default_action_count; details::g_test_wal_object_stats.last_log = log; return wal_result_code::kOk; }; ret->default_delegate.patch = [](wal_object_type&, wal_object_type::log_type& log, wal_object_type::callback_param_type) -> wal_result_code { ++details::g_test_wal_object_stats.default_patcher_count; if (log.action == test_wal_object_log_action::kBreakOnDefaultPatcher) { return wal_result_code::kActionNotSet; } return wal_result_code::kOk; }; return ret; } static test_wal_object_type::congfigure_pointer create_configure() { test_wal_object_type::congfigure_pointer ret = std::make_shared<test_wal_object_type::congfigure_type>(); test_wal_object_type::default_configure(*ret); ret->gc_expire_duration = std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{8}); ret->max_log_size = 8; ret->gc_log_size = 4; return ret; } CASE_TEST(wal_object, create_failed) { test_wal_object_log_storage_type storage; // test_wal_object_context ctx; auto conf = create_configure(); auto vtable = create_vtable(); CASE_EXPECT_EQ(nullptr, test_wal_object_type::create(vtable, nullptr, &storage)); CASE_EXPECT_EQ(nullptr, test_wal_object_type::create(nullptr, conf, &storage)); auto vtable_1 = vtable; vtable_1->get_meta = nullptr; CASE_EXPECT_EQ(nullptr, test_wal_object_type::create(vtable_1, conf, &storage)); auto vtable_2 = vtable; vtable_2->get_log_key = nullptr; CASE_EXPECT_EQ(nullptr, test_wal_object_type::create(vtable_2, conf, &storage)); auto vtable_3 = vtable; vtable_3->allocate_log_key = nullptr; CASE_EXPECT_EQ(nullptr, test_wal_object_type::create(vtable_3, conf, &storage)); } CASE_TEST(wal_object, load_and_dump) { auto old_action_count = details::g_test_wal_object_stats.default_action_count + details::g_test_wal_object_stats.delegate_action_count; test_wal_object_log_storage_type load_storege; util::distributed_system::wal_time_point now = std::chrono::system_clock::now(); load_storege.global_ignore = 123; load_storege.logs.push_back(test_wal_object_log_type{now, 124, test_wal_object_log_action::kDoNothing, 124}); load_storege.logs.push_back(test_wal_object_log_type{now, 125, test_wal_object_log_action::kFallbackDefault, 125}); load_storege.logs.push_back(test_wal_object_log_type{now, 126, test_wal_object_log_action::kRecursivePushBack, 126}); test_wal_object_log_storage_type storage; test_wal_object_context ctx; auto conf = create_configure(); auto vtable = create_vtable(); auto wal_obj = test_wal_object_type::create(vtable, conf, &storage); CASE_EXPECT_TRUE(!!wal_obj); if (!wal_obj) { return; } CASE_EXPECT_TRUE(util::distributed_system::wal_result_code::kOk == wal_obj->load(load_storege, ctx)); CASE_EXPECT_EQ(old_action_count, details::g_test_wal_object_stats.default_action_count + details::g_test_wal_object_stats.delegate_action_count); CASE_EXPECT_EQ(123, storage.global_ignore); CASE_EXPECT_EQ(3, storage.logs.size()); CASE_EXPECT_EQ(124, storage.logs[0].data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == storage.logs[2].action); CASE_EXPECT_EQ(3, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(124, (*wal_obj->get_all_logs().begin())->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == (*wal_obj->get_all_logs().rbegin())->action); // dump test_wal_object_log_storage_type dump_storege; CASE_EXPECT_TRUE(util::distributed_system::wal_result_code::kOk == wal_obj->dump(dump_storege, ctx)); CASE_EXPECT_EQ(123, dump_storege.global_ignore); CASE_EXPECT_EQ(3, dump_storege.logs.size()); CASE_EXPECT_EQ(124, dump_storege.logs[0].data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == dump_storege.logs[2].action); } CASE_TEST(wal_object, add_action) { test_wal_object_log_storage_type storage; test_wal_object_context ctx; util::distributed_system::wal_time_point now = std::chrono::system_clock::now(); auto conf = create_configure(); auto vtable = create_vtable(); auto wal_obj = test_wal_object_type::create(vtable, conf, &storage); CASE_EXPECT_TRUE(!!wal_obj); if (!wal_obj) { return; } do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto old_default_patcher_count = details::g_test_wal_object_stats.default_patcher_count; auto old_delegate_patcher_count = details::g_test_wal_object_stats.delegate_patcher_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kDoNothing, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kDoNothing == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(1, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count + 1, details::g_test_wal_object_stats.delegate_action_count); CASE_EXPECT_EQ(old_default_patcher_count, details::g_test_wal_object_stats.default_patcher_count); CASE_EXPECT_EQ(old_delegate_patcher_count, details::g_test_wal_object_stats.delegate_patcher_count); } while (false); int64_t find_key = 0; do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto old_default_patcher_count = details::g_test_wal_object_stats.default_patcher_count; auto old_delegate_patcher_count = details::g_test_wal_object_stats.delegate_patcher_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kRecursivePushBack, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; find_key = log->log_key; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(3, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count + 2, details::g_test_wal_object_stats.delegate_action_count); CASE_EXPECT_EQ(old_default_patcher_count, details::g_test_wal_object_stats.default_patcher_count); CASE_EXPECT_EQ(old_delegate_patcher_count, details::g_test_wal_object_stats.delegate_patcher_count); } while (false); do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto old_default_patcher_count = details::g_test_wal_object_stats.default_patcher_count; auto old_delegate_patcher_count = details::g_test_wal_object_stats.delegate_patcher_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kFallbackDefault, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kFallbackDefault == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(4, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count + 1, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count, details::g_test_wal_object_stats.delegate_action_count); CASE_EXPECT_EQ(old_default_patcher_count + 1, details::g_test_wal_object_stats.default_patcher_count); CASE_EXPECT_EQ(old_delegate_patcher_count, details::g_test_wal_object_stats.delegate_patcher_count); } while (false); do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto old_default_patcher_count = details::g_test_wal_object_stats.default_patcher_count; auto old_delegate_patcher_count = details::g_test_wal_object_stats.delegate_patcher_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kBreakOnDelegatePatcher, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kBreakOnDelegatePatcher == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(4, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count, details::g_test_wal_object_stats.delegate_action_count); CASE_EXPECT_EQ(old_default_patcher_count, details::g_test_wal_object_stats.default_patcher_count); CASE_EXPECT_EQ(old_delegate_patcher_count + 1, details::g_test_wal_object_stats.delegate_patcher_count); } while (false); do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto old_default_patcher_count = details::g_test_wal_object_stats.default_patcher_count; auto old_delegate_patcher_count = details::g_test_wal_object_stats.delegate_patcher_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kBreakOnDefaultPatcher, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kBreakOnDefaultPatcher == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(4, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count, details::g_test_wal_object_stats.delegate_action_count); CASE_EXPECT_EQ(old_default_patcher_count + 1, details::g_test_wal_object_stats.default_patcher_count); CASE_EXPECT_EQ(old_delegate_patcher_count, details::g_test_wal_object_stats.delegate_patcher_count); } while (false); // ============ iterators ============ { auto find_ptr = wal_obj->find_log(find_key); CASE_EXPECT_TRUE(!!find_ptr); CASE_EXPECT_EQ(find_key + 100, find_ptr->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == find_ptr->action); } { const auto& wal_cobj = *wal_obj; auto find_ptr = wal_cobj.find_log(find_key); CASE_EXPECT_TRUE(!!find_ptr); CASE_EXPECT_EQ(find_key + 100, find_ptr->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == find_ptr->action); } do { auto range = wal_obj->log_all_range(); CASE_EXPECT_TRUE(range.first != wal_obj->log_end()); if (range.first == wal_obj->log_end()) { break; } CASE_EXPECT_TRUE(range.first == wal_obj->log_begin()); CASE_EXPECT_TRUE(range.second == wal_obj->log_end()); CASE_EXPECT_EQ(find_key + 99, (*range.first)->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kDoNothing == (*range.first)->action); } while (false); do { const test_wal_object_type& obj = *wal_obj; auto range = obj.log_all_range(); CASE_EXPECT_TRUE(range.first != wal_obj->log_end()); if (range.first == wal_obj->log_end()) { break; } CASE_EXPECT_TRUE(range.first == obj.log_cbegin()); CASE_EXPECT_TRUE(range.second == obj.log_cend()); CASE_EXPECT_EQ(find_key + 99, (*range.first)->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kDoNothing == (*range.first)->action); } while (false); do { auto iter = wal_obj->log_lower_bound(find_key); CASE_EXPECT_TRUE(iter != wal_obj->log_end()); if (iter == wal_obj->log_end()) { break; } CASE_EXPECT_EQ(find_key + 100, (*iter)->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == (*iter)->action); } while (false); do { const test_wal_object_type& obj = *wal_obj; auto iter = obj.log_lower_bound(find_key); CASE_EXPECT_TRUE(iter != obj.log_cend()); if (iter == obj.log_cend()) { break; } CASE_EXPECT_EQ(find_key + 100, (*iter)->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == (*iter)->action); } while (false); do { auto iter = wal_obj->log_upper_bound(find_key + 1); CASE_EXPECT_TRUE(iter != wal_obj->log_end()); if (iter == wal_obj->log_end()) { break; } CASE_EXPECT_EQ(find_key + 102, (*iter)->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kFallbackDefault == (*iter)->action); } while (false); do { const test_wal_object_type& obj = *wal_obj; auto iter = obj.log_upper_bound(find_key + 1); CASE_EXPECT_TRUE(iter != obj.log_cend()); if (iter == obj.log_cend()) { break; } CASE_EXPECT_EQ(find_key + 102, (*iter)->data); CASE_EXPECT_TRUE(test_wal_object_log_action::kFallbackDefault == (*iter)->action); } while (false); } CASE_TEST(wal_object, gc) { test_wal_object_log_storage_type storage; test_wal_object_context ctx; util::distributed_system::wal_time_point now = std::chrono::system_clock::now(); auto conf = create_configure(); auto vtable = create_vtable(); conf->gc_expire_duration = std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{8}); conf->max_log_size = 8; conf->gc_log_size = 4; auto wal_obj = test_wal_object_type::create(vtable, conf, &storage); CASE_EXPECT_TRUE(!!wal_obj); if (!wal_obj) { return; } CASE_EXPECT_EQ(4, wal_obj->get_configure().gc_log_size); CASE_EXPECT_EQ(8, wal_obj->get_configure().max_log_size); CASE_EXPECT_TRUE(std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{8}) == wal_obj->get_configure().gc_expire_duration); auto old_remove_count = details::g_test_wal_object_stats.event_on_log_removed; auto old_add_count = details::g_test_wal_object_stats.event_on_log_added; auto begin_key = details::g_test_wal_object_stats.key_alloc; for (int i = 0; i < 3; ++i) { do { now += std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{1}); auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kDoNothing, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kDoNothing == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count + 1, details::g_test_wal_object_stats.delegate_action_count); } while (false); do { now += std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{1}); auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kRecursivePushBack, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kRecursivePushBack == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count + 2, details::g_test_wal_object_stats.delegate_action_count); } while (false); do { now += std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{1}); auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto previous_key = details::g_test_wal_object_stats.key_alloc; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kFallbackDefault, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; CASE_EXPECT_EQ(previous_key + 1, log->log_key); CASE_EXPECT_TRUE(test_wal_object_log_action::kFallbackDefault == log->action); CASE_EXPECT_TRUE(now == log->timepoint); wal_obj->push_back(log, ctx); CASE_EXPECT_EQ(old_default_action_count + 1, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count, details::g_test_wal_object_stats.delegate_action_count); } while (false); } CASE_EXPECT_EQ(4, wal_obj->gc(now)); CASE_EXPECT_EQ(8, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_add_count + 12, details::g_test_wal_object_stats.event_on_log_added); CASE_EXPECT_EQ(old_remove_count + 4, details::g_test_wal_object_stats.event_on_log_removed); now += std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{4}); CASE_EXPECT_EQ(0, wal_obj->gc(now, &begin_key, 1)); CASE_EXPECT_EQ(8, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_remove_count + 4, details::g_test_wal_object_stats.event_on_log_removed); CASE_EXPECT_EQ(1, wal_obj->gc(now, nullptr, 1)); CASE_EXPECT_EQ(7, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_remove_count + 5, details::g_test_wal_object_stats.event_on_log_removed); CASE_EXPECT_EQ(2, wal_obj->gc(now, nullptr)); CASE_EXPECT_EQ(5, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_remove_count + 7, details::g_test_wal_object_stats.event_on_log_removed); now += std::chrono::duration_cast<test_wal_object_type::duration>(std::chrono::seconds{2}); CASE_EXPECT_EQ(1, wal_obj->gc(now, nullptr)); CASE_EXPECT_EQ(4, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_remove_count + 8, details::g_test_wal_object_stats.event_on_log_removed); auto last_removed_key = (*wal_obj->log_cbegin())->log_key - 1; CASE_EXPECT_TRUE(wal_obj->get_last_removed_key() && *wal_obj->get_last_removed_key() == last_removed_key); } CASE_TEST(wal_object, ignore) { test_wal_object_log_storage_type storage; test_wal_object_context ctx; util::distributed_system::wal_time_point now = std::chrono::system_clock::now(); auto conf = create_configure(); auto vtable = create_vtable(); auto wal_obj = test_wal_object_type::create(vtable, conf, &storage); CASE_EXPECT_TRUE(!!wal_obj); if (!wal_obj) { return; } do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kDoNothing, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; wal_obj->set_global_ingore_key(log->log_key); auto push_back_result = wal_obj->push_back(log, ctx); CASE_EXPECT_TRUE(util::distributed_system::wal_result_code::kIgnore == push_back_result); CASE_EXPECT_EQ(0, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count, details::g_test_wal_object_stats.delegate_action_count); } while (false); do { auto old_default_action_count = details::g_test_wal_object_stats.default_action_count; auto old_delegate_action_count = details::g_test_wal_object_stats.delegate_action_count; auto log = wal_obj->allocate_log(now, test_wal_object_log_action::kIgnore, ctx); CASE_EXPECT_TRUE(!!log); if (!log) { break; } log->data = log->log_key + 100; auto push_back_result = wal_obj->push_back(log, ctx); CASE_EXPECT_TRUE(util::distributed_system::wal_result_code::kIgnore == push_back_result); CASE_EXPECT_EQ(0, wal_obj->get_all_logs().size()); CASE_EXPECT_EQ(old_default_action_count, details::g_test_wal_object_stats.default_action_count); CASE_EXPECT_EQ(old_delegate_action_count + 1, details::g_test_wal_object_stats.delegate_action_count); } while (false); } CASE_TEST(wal_object, reorder) { test_wal_object_log_storage_type storage; test_wal_object_context ctx; util::distributed_system::wal_time_point now = std::chrono::system_clock::now(); auto conf = create_configure(); auto vtable = create_vtable(); auto wal_obj = test_wal_object_type::create(vtable, conf, &storage); CASE_EXPECT_TRUE(!!wal_obj); if (!wal_obj) { return; } test_wal_object_type::log_pointer log1; test_wal_object_type::log_pointer log2; do { log1 = wal_obj->allocate_log(now, test_wal_object_log_action::kDoNothing, ctx); CASE_EXPECT_TRUE(!!log1); if (!log1) { break; } log1->data = log1->log_key + 100; } while (false); do { log2 = wal_obj->allocate_log(now, test_wal_object_log_action::kDoNothing, ctx); CASE_EXPECT_TRUE(!!log2); if (!log2) { break; } log2->data = log2->log_key + 100; } while (false); if (!log1 || !log2) { return; } wal_obj->push_back(log2, ctx); wal_obj->push_back(log1, ctx); auto iter = wal_obj->log_begin(); CASE_EXPECT_EQ(log1.get(), (*iter).get()); ++iter; CASE_EXPECT_EQ(log2.get(), (*iter).get()); }
40.578082
120
0.747485
atframework
fd679218bd84efa5a1e207aa695a148a66f8b89a
7,563
cpp
C++
test/varianttestconverttuple.cpp
katreniak/cppwamp
b37d3a9e83bca9594d6acd29a3fb7db39bda6cc9
[ "BSL-1.0" ]
39
2015-04-04T00:29:47.000Z
2021-06-27T11:25:38.000Z
test/varianttestconverttuple.cpp
katreniak/cppwamp
b37d3a9e83bca9594d6acd29a3fb7db39bda6cc9
[ "BSL-1.0" ]
115
2015-04-04T01:59:32.000Z
2020-12-04T09:23:09.000Z
test/varianttestconverttuple.cpp
katreniak/cppwamp
b37d3a9e83bca9594d6acd29a3fb7db39bda6cc9
[ "BSL-1.0" ]
8
2015-05-04T06:24:55.000Z
2020-11-11T12:38:46.000Z
/*------------------------------------------------------------------------------ Copyright Butterfly Energy Systems 2014-2015. Distributed under the Boost Software License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) ------------------------------------------------------------------------------*/ #if CPPWAMP_TESTING_VARIANT #include <tuple> #include <catch.hpp> #include <cppwamp/variant.hpp> #include <cppwamp/types/tuple.hpp> using namespace wamp; //------------------------------------------------------------------------------ SCENARIO( "Variant initialization from a tuple", "[Variant]" ) { GIVEN( "a tuple of valid types" ) { auto tuple = std::make_tuple(null, false, true, 0u, -1, 42.0, "foo", Blob{0x42}, Array{"a", 123}, Object{{"o", 321}}, std::make_tuple("b", 124)); Variant expected = Array{null, false, true, 0u, -1, 42.0, "foo", Blob{0x42}, Array{"a", 123}, Object{{"o", 321}}, Array{"b", 124}}; WHEN( "a variant is constructed from the tuple" ) { auto v = Variant::from(tuple); CHECK( v == expected ); } WHEN( "the tuple is assigned to a variant" ) { Variant v; v = toArray(tuple); CHECK( v == expected ); } } GIVEN( "an empty tuple" ) { std::tuple<> tuple; Variant expected = Array{}; WHEN( "a variant is constructed from the tuple" ) { auto v = Variant::from(tuple); CHECK( v == expected ); } WHEN( "the tuple is assigned to a variant" ) { Variant v; v = toArray(tuple); CHECK( v == expected ); } } // The following should cause 2 static assertion failures: //GIVEN( "a tuple with an invalid type" ) //{ // struct Invalid {}; // auto tuple = std::make_tuple(true, 42.0, Invalid()); // Array array; // array = toArray(tuple); // toTuple(array, tuple); //} } SCENARIO( "Variant conversion/comparison to tuple", "[Variant]" ) { GIVEN( "a tuple of valid types" ) { auto tuple = std::make_tuple(null, false, true, 0u, -1, 42.0, String("foo"), Blob{0x42}, Array{"a", 123}, Object{{"o", 321}}); using TupleType = decltype(tuple); WHEN( "a matching variant is converted to the tuple" ) { auto v = Variant::from(tuple); TupleType result; REQUIRE_NOTHROW( v.to(result) ); CHECK(( result == tuple )); CHECK(( v == tuple )); CHECK(( v.as<Array>() == tuple )); CHECK_FALSE(( v != tuple )); CHECK_FALSE(( v.as<Array>() != tuple )); } WHEN( "a matching variant differs by only one value" ) { auto v = Variant::from(tuple); v.as<Array>().at(3).as<UInt>() = 666u; CHECK_FALSE(( v == tuple )); CHECK_FALSE(( v.as<Array>() == tuple )); CHECK(( v != tuple )); CHECK(( v.as<Array>() != tuple )); } } GIVEN( "a tuple of convertible types" ) { auto tuple = std::make_tuple(false, 3, 42.0); using TupleType = decltype(tuple); WHEN( "a compatible variant is converted to the tuple" ) { Variant v(Array{0, 3u, 42}); TupleType result; REQUIRE_NOTHROW( v.to(result) ); CHECK(( result == tuple )); result = TupleType(); REQUIRE_NOTHROW( toTuple(v.as<Array>(), result) ); CHECK(( result == tuple )); } WHEN( "a compatible variant is compared to the tuple" ) { Variant v(Array{false, 3u, 42}); CHECK(( v == tuple )); CHECK(( v.as<Array>() == tuple )); CHECK_FALSE(( v != tuple )); CHECK_FALSE(( v.as<Array>() != tuple )); } WHEN( "a compatible variant differs by only one value" ) { Variant v(Array{false, 3u, 41}); CHECK_FALSE(( v == tuple )); CHECK_FALSE(( v.as<Array>() == tuple )); CHECK(( v != tuple )); CHECK(( v.as<Array>() != tuple )); } } GIVEN( "an empty tuple" ) { std::tuple<> tuple; using TupleType = decltype(tuple); WHEN( "an empty array variant is converted to the tuple" ) { Variant v(Array{}); TupleType result; REQUIRE_NOTHROW( v.to(result) ); CHECK(( result == tuple )); result = TupleType(); REQUIRE_NOTHROW( toTuple(v.as<Array>(), result) ); CHECK(( result == tuple )); CHECK(( v == tuple )); CHECK(( v.as<Array>() == tuple )); CHECK_FALSE(( v != tuple )); CHECK_FALSE(( v.as<Array>() != tuple )); } WHEN( "a non-empty array variant is converted to the tuple" ) { Variant v(Array{null}); TupleType result; REQUIRE_THROWS_AS( v.to(result), error::Conversion ); REQUIRE_THROWS_AS( toTuple(v.as<Array>(), result), error::Conversion ); CHECK_FALSE(( v == tuple )); CHECK_FALSE(( v.as<Array>() == tuple )); CHECK(( v != tuple )); CHECK(( v.as<Array>() != tuple )); } WHEN( "a null variant is compared to the tuple" ) { Variant v; CHECK_FALSE(( v == tuple )); CHECK(( v != tuple )); } } GIVEN( "a wrongly-sized tuple type" ) { auto tuple = std::make_tuple(true, Int(42)); using TupleType = decltype(tuple); WHEN( "an array Variant is narrower than the tuple" ) { Variant v(Array{true}); TupleType result; REQUIRE_THROWS_AS( v.to(result), error::Conversion ); REQUIRE_THROWS_AS( toTuple(v.as<Array>(), result), error::Conversion ); CHECK_FALSE(( v == tuple )); CHECK_FALSE(( v.as<Array>() == tuple )); CHECK(( v != tuple )); CHECK(( v.as<Array>() != tuple )); } WHEN( "an array Variant is wider than the tuple" ) { Variant v(Array{true, 42, null}); TupleType result; REQUIRE_THROWS_AS( v.to(result), error::Conversion ); REQUIRE_THROWS_AS( toTuple(v.as<Array>(), result), error::Conversion ); CHECK_FALSE(( v == tuple )); CHECK_FALSE(( v.as<Array>() == tuple )); CHECK(( v != tuple )); CHECK(( v.as<Array>() != tuple )); } } GIVEN( "a correctly-sized tuple with unconvertible types" ) { auto tuple = std::make_tuple(null, true, Int(42)); using TupleType = decltype(tuple); WHEN( "a Variant is converted to a mismatched tuple" ) { Variant v(Array{true, null, 42}); TupleType result; REQUIRE_THROWS_AS( v.to(result), error::Conversion ); REQUIRE_THROWS_AS( toTuple(v.as<Array>(), result), error::Conversion ); CHECK_FALSE(( v == tuple )); CHECK_FALSE(( v.as<Array>() == tuple )); CHECK(( v != tuple )); CHECK(( v.as<Array>() != tuple )); } } } #endif // #if CPPWAMP_TESTING_VARIANT
34.852535
81
0.479439
katreniak
fd6f95d88caf69e2ae197cf940beb93c164565bc
2,714
cpp
C++
src/csi/utils.cpp
liangyuRain/mesos
0f9448497ddb259063911811ab3ce5784747ca2d
[ "Apache-2.0" ]
2
2017-01-13T19:40:15.000Z
2018-05-16T21:37:13.000Z
src/csi/utils.cpp
liangyuRain/mesos
0f9448497ddb259063911811ab3ce5784747ca2d
[ "Apache-2.0" ]
3
2021-05-20T23:17:32.000Z
2022-02-26T10:27:21.000Z
src/csi/utils.cpp
liangyuRain/mesos
0f9448497ddb259063911811ab3ce5784747ca2d
[ "Apache-2.0" ]
1
2021-08-18T09:26:06.000Z
2021-08-18T09:26:06.000Z
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "csi/utils.hpp" #include <google/protobuf/util/json_util.h> #include <stout/strings.hpp> using std::ostream; using std::string; using google::protobuf::util::MessageToJsonString; namespace csi { namespace v0 { bool operator==( const ControllerServiceCapability::RPC& left, const ControllerServiceCapability::RPC& right) { return left.type() == right.type(); } bool operator==( const ControllerServiceCapability& left, const ControllerServiceCapability& right) { return left.has_rpc() == right.has_rpc() && (!left.has_rpc() || left.rpc() == right.rpc()); } bool operator==(const VolumeCapability& left, const VolumeCapability& right) { // NOTE: This enumeration is set when `block` or `mount` are set and // covers the case where neither are set. if (left.access_type_case() != right.access_type_case()) { return false; } // NOTE: No need to check `block` for equality as that object is empty. if (left.has_mount()) { if (left.mount().fs_type() != right.mount().fs_type()) { return false; } if (left.mount().mount_flags_size() != right.mount().mount_flags_size()) { return false; } // NOTE: Ordering may or may not matter for these flags, but this helper // only checks for complete equality. for (int i = 0; i < left.mount().mount_flags_size(); i++) { if (left.mount().mount_flags(i) != right.mount().mount_flags(i)) { return false; } } } if (left.has_access_mode() != right.has_access_mode()) { return false; } if (left.has_access_mode()) { if (left.access_mode().mode() != right.access_mode().mode()) { return false; } } return true; } ostream& operator<<( ostream& stream, const ControllerServiceCapability::RPC::Type& type) { return stream << ControllerServiceCapability::RPC::Type_Name(type); } } // namespace v0 { } // namespace csi {
27.693878
78
0.686441
liangyuRain
fd744bb1876c92e9b7e2bd7ee3416162ec6bdf0e
285
hpp
C++
Firmware/Src/system/GlobalInterrupts.hpp
borgu/midi-grid
ce65669f55d5d5598a8ff185debcec76ab001bfa
[ "BSD-3-Clause" ]
null
null
null
Firmware/Src/system/GlobalInterrupts.hpp
borgu/midi-grid
ce65669f55d5d5598a8ff185debcec76ab001bfa
[ "BSD-3-Clause" ]
null
null
null
Firmware/Src/system/GlobalInterrupts.hpp
borgu/midi-grid
ce65669f55d5d5598a8ff185debcec76ab001bfa
[ "BSD-3-Clause" ]
null
null
null
#ifndef SYSTEM_GLOBALINTERRUPTS_HPP_ #define SYSTEM_GLOBALINTERRUPTS_HPP_ namespace mcu { class GlobalInterrupts { public: GlobalInterrupts(); virtual ~GlobalInterrupts(); void disable(); void enable(); }; } // namespace hal #endif // SYSTEM_GLOBALINTERRUPTS_HPP_
15
38
0.74386
borgu
fd754c337e38edbe0f32c1fa6f8a1ac1498aabc2
469
cpp
C++
doc/tutorial/argument_parser/solution1.cpp
seqan/seqan3-sarg-lib
838efea0ac76822353df002adce3b558dac5c9a3
[ "CC0-1.0", "CC-BY-4.0" ]
2
2022-01-06T10:22:34.000Z
2022-02-13T21:18:24.000Z
doc/tutorial/argument_parser/solution1.cpp
seqan/seqan3-sarg-lib
838efea0ac76822353df002adce3b558dac5c9a3
[ "CC0-1.0", "CC-BY-4.0" ]
82
2021-11-30T12:25:56.000Z
2022-03-31T11:18:18.000Z
doc/tutorial/argument_parser/solution1.cpp
seqan/seqan3-sarg-lib
838efea0ac76822353df002adce3b558dac5c9a3
[ "CC0-1.0", "CC-BY-4.0" ]
6
2021-11-30T12:16:30.000Z
2022-02-16T10:45:15.000Z
#include <sharg/all.hpp> // includes all necessary headers void initialise_argument_parser(sharg::argument_parser & parser) { parser.info.author = "Cersei"; parser.info.short_description = "Aggregate average Game of Thrones viewers by season."; parser.info.version = "1.0.0"; } int main(int argc, char ** argv) { sharg::argument_parser myparser{"Game-of-Parsing", argc, argv}; initialise_argument_parser(myparser); // code from assignment 1 }
29.3125
91
0.720682
seqan
fd7a76991002ed560d1764f519766343e895854a
10,883
cpp
C++
Source/AllProjects/WndUtils/CIDCtrls/CIDCtrls_Slider.cpp
MarkStega/CIDLib
82014e064eef51cad998bf2c694ed9c1c8cceac6
[ "MIT" ]
216
2019-03-09T06:41:28.000Z
2022-02-25T16:27:19.000Z
Source/AllProjects/WndUtils/CIDCtrls/CIDCtrls_Slider.cpp
MarkStega/CIDLib
82014e064eef51cad998bf2c694ed9c1c8cceac6
[ "MIT" ]
9
2020-09-27T08:00:52.000Z
2021-07-02T14:27:31.000Z
Source/AllProjects/WndUtils/CIDCtrls/CIDCtrls_Slider.cpp
MarkStega/CIDLib
82014e064eef51cad998bf2c694ed9c1c8cceac6
[ "MIT" ]
29
2019-03-09T10:12:24.000Z
2021-03-03T22:25:29.000Z
// // FILE NAME: CIDCtrls_Slider.cpp // // AUTHOR: Dean Roddey // // CREATED: 04/16/2015 // // COPYRIGHT: Charmed Quark Systems, Ltd @ 2019 // // This software is copyrighted by 'Charmed Quark Systems, Ltd' and // the author (Dean Roddey.) It is licensed under the MIT Open Source // license: // // https://opensource.org/licenses/MIT // // DESCRIPTION: // // This file implements the check box control. // // CAVEATS/GOTCHAS: // // LOG: // // $_CIDLib_Log_$ // // --------------------------------------------------------------------------- // Facility specific includes // --------------------------------------------------------------------------- #include "CIDCtrls_.hpp" // --------------------------------------------------------------------------- // Do our RTTI macros // --------------------------------------------------------------------------- RTTIDecls(TSliderChangeInfo,TCtrlNotify) AdvRTTIDecls(TSlider, TStdCtrlWnd) // --------------------------------------------------------------------------- // CLASS: TSliderChangeInfo // PREFIX: wnot // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TSliderChangeInfo: Constructors and Destructor // --------------------------------------------------------------------------- TSliderChangeInfo::TSliderChangeInfo(const tCIDLib::TInt4 i4Value , const tCIDCtrls::ESldrEvents eEvent , const TWindow& wndSrc) : TCtrlNotify(wndSrc) , m_eEvent(eEvent) , m_i4Value(i4Value) { } TSliderChangeInfo::TSliderChangeInfo(const TSliderChangeInfo& wnotToCopy) : TCtrlNotify(wnotToCopy) , m_eEvent(wnotToCopy.m_eEvent) , m_i4Value(wnotToCopy.m_i4Value) { } TSliderChangeInfo::~TSliderChangeInfo() { } // --------------------------------------------------------------------------- // TSliderChangeInfo: Public operators // --------------------------------------------------------------------------- TSliderChangeInfo& TSliderChangeInfo::operator=(const TSliderChangeInfo& wnotToAssign) { if (this != &wnotToAssign) { TParent::operator=(wnotToAssign); m_eEvent = wnotToAssign.m_eEvent; m_i4Value = wnotToAssign.m_i4Value; } return *this; } // ------------------------------------------------------------------- // Public, non-virtual methods // ------------------------------------------------------------------- tCIDCtrls::ESldrEvents TSliderChangeInfo::eEvent() const { return m_eEvent; } tCIDLib::TInt4 TSliderChangeInfo::i4Value() const { return m_i4Value; } // --------------------------------------------------------------------------- // CLASS: TSlider // PREFIX: wnd // --------------------------------------------------------------------------- // --------------------------------------------------------------------------- // TSlider: Public static data // --------------------------------------------------------------------------- const TNotificationId TSlider::nidChange(L"SliderChangeEvent"); // --------------------------------------------------------------------------- // TSlider: Constructors and Destructor // --------------------------------------------------------------------------- TSlider::TSlider() : TStdCtrlWnd() , m_eSliderStyles(tCIDCtrls::ESldrStyles::None) , m_i4Max(100) , m_i4Min(0) { } TSlider::~TSlider() { } // --------------------------------------------------------------------------- // TSlider: Public, inherited methods // --------------------------------------------------------------------------- tCIDLib::TVoid TSlider::InitFromDesc( const TWindow& wndParent , const TDlgItem& dlgiSrc , const tCIDCtrls::EWndThemes eTheme) { tCIDCtrls::ESldrStyles eSldrStyles = tCIDCtrls::ESldrStyles::None; tCIDCtrls::EWndStyles eStyles = tCIDCtrls::EWndStyles ( tCIDCtrls::EWndStyles::VisTabChild ); tCIDLib::TCard4 c4Min = 0; tCIDLib::TCard4 c4Max = 100; if (dlgiSrc.bHasHint(kCIDCtrls::strHint_Group)) eStyles |= tCIDCtrls::EWndStyles::Group; if (dlgiSrc.bHasHint(kCIDCtrls::strHint_LiveTrack)) eSldrStyles |= tCIDCtrls::ESldrStyles::TrackEvs; if (dlgiSrc.bHasHint(kCIDCtrls::strHint_Ticks)) eSldrStyles |= tCIDCtrls::ESldrStyles::Ticks; if (dlgiSrc.bHasHint(kCIDCtrls::strHint_AutoTicks)) eSldrStyles |= tCIDCtrls::ESldrStyles::AutoTicks; Create ( wndParent , dlgiSrc.ridChild() , dlgiSrc.areaPos() , c4Min , c4Max , eStyles , eSldrStyles ); } tCIDLib::TVoid TSlider::QueryHints(tCIDLib::TStrCollect& colToFill) const { TParent::QueryHints(colToFill); colToFill.objAdd(kCIDCtrls::strHint_Group); colToFill.objAdd(kCIDCtrls::strHint_LiveTrack); colToFill.objAdd(kCIDCtrls::strHint_Ticks); } // --------------------------------------------------------------------------- // TSlider: Public, non-virtual methods // --------------------------------------------------------------------------- tCIDLib::TInt4 TSlider::i4CurValue() const { // Get the raw position tCIDLib::TCard4 c4Pos = ::SendMessage(hwndSafe(), TBM_GETPOS, 0, 0); // Convert to the virtual range and return return (m_i4Min + tCIDLib::TInt4(c4Pos)); } // Just set up the styles and call our parent to create the control tCIDLib::TVoid TSlider::Create(const TWindow& wndParent , const tCIDCtrls::TWndId widThis , const TArea& areaInit , const tCIDLib::TInt4 i4MinVal , const tCIDLib::TInt4 i4MaxVal , const tCIDCtrls::EWndStyles eStyles , const tCIDCtrls::ESldrStyles eSliderStyles) { // Has to be a child window and add any slider styles we enforce tCIDLib::TCard4 c4Styles = 0; // Add any control specific styles if (tCIDLib::bAllBitsOn(eSliderStyles, tCIDCtrls::ESldrStyles::Ticks)) { if (tCIDLib::bAllBitsOn(eSliderStyles, tCIDCtrls::ESldrStyles::Vertical)) c4Styles |= TBS_RIGHT; else c4Styles |= TBS_BOTTOM; // If auto-ticks, set that if (tCIDLib::bAllBitsOn(eSliderStyles, tCIDCtrls::ESldrStyles::AutoTicks)) c4Styles |= TBS_AUTOTICKS; } else { c4Styles |= TBS_NOTICKS; } // Set the orientation if (tCIDLib::bAllBitsOn(eSliderStyles, tCIDCtrls::ESldrStyles::Vertical)) c4Styles |= TBS_VERT; // Store our class specific styles m_eSliderStyles = eSliderStyles; // And create the class CreateWnd ( wndParent.hwndThis() , TRACKBAR_CLASS , kCIDLib::pszEmptyZStr , areaInit , eStyles | tCIDCtrls::EWndStyles(c4Styles) , tCIDCtrls::EExWndStyles::None , widThis ); // Set the range now SetRange(i4MinVal, i4MaxVal); // All standard controls must be subclassed SetSubclass(); } // Set a new range. Sometimes it's not known at creation time tCIDLib::TVoid TSlider::SetRange(const tCIDLib::TInt4 i4Min, const tCIDLib::TInt4 i4Max) { // Make sure the range is valid if (i4Min >= i4Max) { facCIDCtrls().ThrowErr ( CID_FILE , CID_LINE , kCtrlsErrs::errcRange_MinMax , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::Range , TInteger(i4Min) , TInteger(i4Max) ); } // Store the vitual range value m_i4Min = i4Min; m_i4Max = i4Max; // // Caculate the range and set that on the control itself. It's inclusive so // we don't subtract 1. Min is always zero internally. // ::SendMessage ( hwndSafe() , TBM_SETRANGE , 1 , MAKELONG(0, tCIDLib::TCard4(i4Max - i4Min)) ); } // Set the number of slots between ticks tCIDLib::TVoid TSlider::SetTickFreq(const tCIDLib::TCard4 c4EveryN) { ::SendMessage(hwndSafe(), TBM_SETTICFREQ, c4EveryN, 0); } // Set the slider thumb postion tCIDLib::TVoid TSlider::SetValue(const tCIDLib::TInt4 i4ToSet) { // Make sure the new value is valid if ((i4ToSet < m_i4Min) || (i4ToSet > m_i4Max)) { facCIDCtrls().ThrowErr ( CID_FILE , CID_LINE , kCtrlsErrs::errcRange_NewVal2 , tCIDLib::ESeverities::Failed , tCIDLib::EErrClasses::Range , TInteger(i4ToSet) , TInteger(m_i4Min) , TInteger(m_i4Max) ); } // Adjust it to the internal zero based range tCIDLib::TCard4 c4ToSet(i4ToSet - m_i4Min); ::SendMessage(hwndSafe(), TBM_SETPOS, 1, c4ToSet); } // --------------------------------------------------------------------------- // TSlider: Protected, inherited methods // --------------------------------------------------------------------------- // We can handle clicked notifications on behalf of all of our derivatives tCIDLib::TBoolean TSlider::bNotReflect( TWindow& wndTar , const tCIDCtrls::TWndMsg wmsgMsg , const tCIDCtrls::TWParam wParam , const tCIDCtrls::TLParam lParam , tCIDCtrls::TMsgResult& mresResult) { // We expect an H/V scroll message if ((wmsgMsg != WM_HSCROLL) && (wmsgMsg != WM_VSCROLL)) return kCIDLib::False; // Set the correct event type tCIDLib::TCard4 c4Pos; tCIDCtrls::ESldrEvents eEv = tCIDCtrls::ESldrEvents::Count; switch(wParam & 0xFFFF) { case SB_THUMBTRACK : // Only do this if they asked for tracking events if (tCIDLib::bAllBitsOn(m_eSliderStyles, tCIDCtrls::ESldrStyles::TrackEvs)) { eEv = tCIDCtrls::ESldrEvents::Track; c4Pos = wParam >> 16; } break; case SB_THUMBPOSITION : eEv = tCIDCtrls::ESldrEvents::EndTrack; c4Pos = wParam >> 16; break; default : eEv = tCIDCtrls::ESldrEvents::Change; // For these we have to query the position c4Pos = ::SendMessage(hwndThis(), TBM_GETPOS, 0, 0); break; }; if (eEv != tCIDCtrls::ESldrEvents::Count) { // Convert the value to the client's virtual range const tCIDLib::TInt4 i4Pos = m_i4Min + tCIDLib::TInt4(c4Pos); TSliderChangeInfo wnotSend(i4Pos, eEv, *this); SendSyncNotify(wnotSend, TSlider::nidChange); return kCIDLib::True; } return kCIDLib::False; }
28.415144
87
0.508959
MarkStega
fd837adcd01c2eae6229bc8eee4d902c4aac9d1f
218
cpp
C++
programs_AtoZ/Add 2 Numbers/If User enters Real Numbers.cpp
EarthMan123/unitech_cpp_with_oops-course
941fec057bdcb8a5289994780ae553e6d4fddbbe
[ "Unlicense" ]
2
2021-06-12T02:55:28.000Z
2021-07-04T22:25:38.000Z
programs_AtoZ/Add 2 Numbers/If User enters Real Numbers.cpp
EarthMan123/unitech_cpp_with_oops-course
941fec057bdcb8a5289994780ae553e6d4fddbbe
[ "Unlicense" ]
null
null
null
programs_AtoZ/Add 2 Numbers/If User enters Real Numbers.cpp
EarthMan123/unitech_cpp_with_oops-course
941fec057bdcb8a5289994780ae553e6d4fddbbe
[ "Unlicense" ]
1
2021-07-04T22:28:38.000Z
2021-07-04T22:28:38.000Z
#include<iostream> using namespace std; int main() { float num1, num2, add; cout<<"Enter Two Numbers: "; cin>>num1>>num2; add = num1+num2; cout<<"\nResult = "<<add; cout<<endl; return 0; }
15.571429
32
0.573394
EarthMan123
fd852b3dee888a2151647e677c8270e34671d723
1,941
cpp
C++
src/ui/elementdelegate.cpp
lawarner/aft
fd2b6b97bedd2be3ccb1739b890aeea6aa2f9603
[ "Apache-2.0" ]
null
null
null
src/ui/elementdelegate.cpp
lawarner/aft
fd2b6b97bedd2be3ccb1739b890aeea6aa2f9603
[ "Apache-2.0" ]
null
null
null
src/ui/elementdelegate.cpp
lawarner/aft
fd2b6b97bedd2be3ccb1739b890aeea6aa2f9603
[ "Apache-2.0" ]
null
null
null
/* * elementdelegate.cpp * libaft * * Copyright © 2017 Andy Warner. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #include <iostream> #include <sstream> #include "element.h" #include "elementdelegate.h" using namespace aft::ui; using namespace std; BaseElementDelegate::BaseElementDelegate() { } void BaseElementDelegate::flush(const Element* element) { } const std::string& BaseElementDelegate::getValue(const Element* element) const { if (element->getValue().empty()) { return element->getDefault(); } return element->getValue(); } void BaseElementDelegate::setValue(Element* element, const std::string& value) { element->setValue(value); } bool BaseElementDelegate::getFocus(Element* element) const { return false; } bool BaseElementDelegate::setFocus(Element* element, bool hasFocus) { return false; } bool BaseElementDelegate::getFacet(Element* element, const std::string& name, UIFacetCategory category, UIFacet& facet) const { return false; } bool BaseElementDelegate::setFacet(Element* element, const UIFacet& facet) { element->apply(facet); return true; } bool BaseElementDelegate::input(Element* element, std::string& value) { value = element->getValue(); return true; } bool BaseElementDelegate::output(const Element* element, bool showValue) { return true; }
26.589041
84
0.706852
lawarner
fd86c29fd4295108941a22556ef1a03226fec95a
660
cc
C++
AbstractObject.cc
relyah/cubecamera
051427ce7f5c3eda2738f0f05849900bcc4ea422
[ "Apache-2.0" ]
null
null
null
AbstractObject.cc
relyah/cubecamera
051427ce7f5c3eda2738f0f05849900bcc4ea422
[ "Apache-2.0" ]
null
null
null
AbstractObject.cc
relyah/cubecamera
051427ce7f5c3eda2738f0f05849900bcc4ea422
[ "Apache-2.0" ]
null
null
null
#include "AbstractObject.h" AbstractObject::AbstractObject(IOpenGLProgram* program, IModel *model, bool isRenderToFBO) : program(program), model(model), isRenderToFBO(isRenderToFBO){ } AbstractObject::~AbstractObject() { program=0; model=0; } void AbstractObject::Gen() { glGenVertexArrays(1, &vao); Bind(); } void AbstractObject::Bind() { std::cout << "Binding VAO: " << vao << std::endl; glBindVertexArray(vao); } void AbstractObject::Unbind() { std::cout << "UnBinding VAO: " << vao << std::endl; glBindVertexArray(0); } void AbstractObject::Shutdown() { Unbind(); glDeleteVertexArrays(1,&vao); program = 0; model =0; }
18.333333
92
0.677273
relyah
fd8eb1a6d94caf2c182dc29106f6fcc7ad010cfb
1,385
cpp
C++
MonoNative.Tests/mscorlib/System/Runtime/Remoting/Messaging/mscorlib_System_Runtime_Remoting_Messaging_Header_Fixture.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
7
2015-03-10T03:36:16.000Z
2021-11-05T01:16:58.000Z
MonoNative.Tests/mscorlib/System/Runtime/Remoting/Messaging/mscorlib_System_Runtime_Remoting_Messaging_Header_Fixture.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
1
2020-06-23T10:02:33.000Z
2020-06-24T02:05:47.000Z
MonoNative.Tests/mscorlib/System/Runtime/Remoting/Messaging/mscorlib_System_Runtime_Remoting_Messaging_Header_Fixture.cpp
brunolauze/MonoNative
959fb52c2c1ffe87476ab0d6e4fcce0ad9ce1e66
[ "BSD-2-Clause" ]
null
null
null
// Mono Native Fixture // Assembly: mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 // Namespace: System.Runtime.Remoting.Messaging // Name: Header // C++ Typed Name: mscorlib::System::Runtime::Remoting::Messaging::Header #include <gtest/gtest.h> #include <mscorlib/System/Runtime/Remoting/Messaging/mscorlib_System_Runtime_Remoting_Messaging_Header.h> #include <mscorlib/System/mscorlib_System_Type.h> namespace mscorlib { namespace System { namespace Runtime { namespace Remoting { namespace Messaging { //Constructors Tests //Header(mscorlib::System::String _Name, mscorlib::System::Object _Value) TEST(mscorlib_System_Runtime_Remoting_Messaging_Header_Fixture,Constructor_1) { } //Header(mscorlib::System::String _Name, mscorlib::System::Object _Value, mscorlib::System::Boolean _MustUnderstand) TEST(mscorlib_System_Runtime_Remoting_Messaging_Header_Fixture,Constructor_2) { } //Header(mscorlib::System::String _Name, mscorlib::System::Object _Value, mscorlib::System::Boolean _MustUnderstand, mscorlib::System::String _HeaderNamespace) TEST(mscorlib_System_Runtime_Remoting_Messaging_Header_Fixture,Constructor_3) { } //Public Methods Tests } } } } }
23.474576
164
0.696751
brunolauze
fd8ec93870ce1343796355504e52c4502b205669
5,495
cpp
C++
framework/areg/ipc/private/ServerConnectionBase.cpp
Ali-Nasrolahi/areg-sdk
4fbc2f2644220196004a31672a697a864755f0b6
[ "Apache-2.0" ]
70
2021-07-20T11:26:16.000Z
2022-03-27T11:17:43.000Z
framework/areg/ipc/private/ServerConnectionBase.cpp
Ali-Nasrolahi/areg-sdk
4fbc2f2644220196004a31672a697a864755f0b6
[ "Apache-2.0" ]
32
2021-07-31T05:20:44.000Z
2022-03-20T10:11:52.000Z
framework/areg/ipc/private/ServerConnectionBase.cpp
Ali-Nasrolahi/areg-sdk
4fbc2f2644220196004a31672a697a864755f0b6
[ "Apache-2.0" ]
40
2021-11-02T09:45:38.000Z
2022-03-27T11:17:46.000Z
/************************************************************************ * This file is part of the AREG SDK core engine. * AREG SDK is dual-licensed under Free open source (Apache version 2.0 * License) and Commercial (with various pricing models) licenses, depending * on the nature of the project (commercial, research, academic or free). * You should have received a copy of the AREG SDK license description in LICENSE.txt. * If not, please contact to info[at]aregtech.com * * \copyright (c) 2017-2021 Aregtech UG. All rights reserved. * \file areg/ipc/private/ServerConnectionBase.cpp * \ingroup AREG Asynchronous Event-Driven Communication Framework * \author Artak Avetyan * \brief AREG Platform Server Connection class declaration. ************************************************************************/ #include "areg/ipc/ServerConnectionBase.hpp" ServerConnectionBase::ServerConnectionBase( void ) : mServerSocket ( ) , mCookieGenerator ( static_cast<ITEM_ID>(NEService::eCookies::CookieFirstValid) ) , mAcceptedConnections ( ) , mCookieToSocket ( ) , mSocketToCookie ( ) , mMasterList ( ServerConnectionBase::MASTER_LIST_SIZE ) , mLock ( ) { } ServerConnectionBase::ServerConnectionBase(const char * hostName, unsigned short portNr) : mServerSocket ( hostName, portNr ) , mCookieGenerator ( static_cast<ITEM_ID>(NEService::eCookies::CookieFirstValid) ) , mAcceptedConnections ( ) , mCookieToSocket ( ) , mSocketToCookie ( ) , mMasterList ( ServerConnectionBase::MASTER_LIST_SIZE ) , mLock ( ) { } ServerConnectionBase::ServerConnectionBase(const NESocket::SocketAddress & serverAddress) : mServerSocket ( serverAddress ) , mCookieGenerator ( static_cast<ITEM_ID>(NEService::eCookies::CookieFirstValid) ) , mAcceptedConnections ( ) , mCookieToSocket ( ) , mSocketToCookie ( ) , mMasterList ( ServerConnectionBase::MASTER_LIST_SIZE ) , mLock ( ) { } bool ServerConnectionBase::createSocket(const char * hostName, unsigned short portNr) { Lock lock(mLock); return mServerSocket.createSocket(hostName, portNr); } bool ServerConnectionBase::createSocket(void) { Lock lock(mLock); return mServerSocket.createSocket(); } void ServerConnectionBase::closeSocket(void) { Lock lock(mLock); mMasterList.removeAll(); mCookieToSocket.removeAll(); mSocketToCookie.removeAll(); mAcceptedConnections.removeAll(); mCookieGenerator = static_cast<ITEM_ID>(NEService::eCookies::CookieFirstValid); mServerSocket.closeSocket(); } bool ServerConnectionBase::serverListen(int maxQueueSize /*= NESocket::MAXIMUM_LISTEN_QUEUE_SIZE */) { return mServerSocket.listenConnection(maxQueueSize); } SOCKETHANDLE ServerConnectionBase::waitForConnectionEvent(NESocket::SocketAddress & out_addrNewAccepted) { return mServerSocket.waitConnectionEvent(out_addrNewAccepted, static_cast<const SOCKETHANDLE *>(mMasterList), mMasterList.getSize()); } bool ServerConnectionBase::acceptConnection(SocketAccepted & clientConnection) { Lock lock(mLock); bool result = false; if ( mServerSocket.isValid() ) { if ( clientConnection.isValid() ) { const SOCKETHANDLE hSocket = clientConnection.getHandle(); ASSERT(hSocket != NESocket::InvalidSocketHandle); if ( mMasterList.find(hSocket) == -1) { ASSERT(mAcceptedConnections.find( hSocket ) == nullptr); ASSERT(mSocketToCookie.find(hSocket) == nullptr); ITEM_ID cookie = mCookieGenerator ++; ASSERT(cookie >= static_cast<ITEM_ID>(NEService::eCookies::CookieFirstValid)); mAcceptedConnections.setAt(hSocket, clientConnection); mCookieToSocket.setAt(cookie, hSocket); mSocketToCookie.setAt(hSocket, cookie); mMasterList.add( hSocket ); result = true; } else { ASSERT(mAcceptedConnections.find( hSocket ) != nullptr); ASSERT(mSocketToCookie.find(hSocket) != nullptr); result = true; } } } return result; } void ServerConnectionBase::closeConnection(SocketAccepted & clientConnection) { Lock lock( mLock ); SOCKETHANDLE hSocket= clientConnection.getHandle(); MAPPOS pos = mSocketToCookie.find(hSocket); ITEM_ID cookie = pos != nullptr ? mSocketToCookie.valueAtPosition(pos) : NEService::COOKIE_UNKNOWN; mSocketToCookie.removeAt(hSocket); mCookieToSocket.removeAt(cookie); mAcceptedConnections.removeAt(hSocket); mMasterList.remove(hSocket, 0); clientConnection.closeSocket(); } void ServerConnectionBase::closeConnection( ITEM_ID cookie ) { Lock lock(mLock); MAPPOS posCookie = mCookieToSocket.find( cookie ); if (posCookie != nullptr) { SOCKETHANDLE hSocket= mCookieToSocket.removePosition( posCookie ); MAPPOS posClient = mAcceptedConnections.find( hSocket ); mSocketToCookie.removeAt( hSocket ); mMasterList.remove( hSocket, 0 ); if (posClient != nullptr) { SocketAccepted client(mAcceptedConnections.removePosition(posClient)); client.closeSocket( ); } } }
35.224359
137
0.650773
Ali-Nasrolahi
fd9b2165144da77a523e41d630536c1842140fcd
345
cpp
C++
Note/Recursion/ccRecursion.cpp
cs-joy/cpp-2a
3c62f582d8b4fe808153d0639c762ccec0c76af6
[ "MIT" ]
1
2022-03-07T16:57:04.000Z
2022-03-07T16:57:04.000Z
Note/Recursion/ccRecursion.cpp
cs-joy/cpp-2a
3c62f582d8b4fe808153d0639c762ccec0c76af6
[ "MIT" ]
null
null
null
Note/Recursion/ccRecursion.cpp
cs-joy/cpp-2a
3c62f582d8b4fe808153d0639c762ccec0c76af6
[ "MIT" ]
null
null
null
// A function that calls itself is known as a recursive function. // And, this technique is known as recursion. #include <iostream> using namespace std; int sum(int j) { if(j > 0) { return j + sum(j - 1); } else { return 0; } } int main() { int result = sum(10); cout << result << endl; return 0; }
15.681818
66
0.568116
cs-joy
fd9c24fcd2b9635b25589779e4e3421218f1259b
681
cpp
C++
source/details/memory/detail/free_list_array.cpp
loopunit/lu
699ddfdd576a2d94f516ed47bc10994f9c071083
[ "Unlicense" ]
null
null
null
source/details/memory/detail/free_list_array.cpp
loopunit/lu
699ddfdd576a2d94f516ed47bc10994f9c071083
[ "Unlicense" ]
null
null
null
source/details/memory/detail/free_list_array.cpp
loopunit/lu
699ddfdd576a2d94f516ed47bc10994f9c071083
[ "Unlicense" ]
null
null
null
// Copyright (C) 2015-2021 Müller <jonathanmueller.dev@gmail.com> // This file is subject to the license terms in the LICENSE file // found in the top-level directory of this distribution. #include <details/memory/detail/free_list_array.hpp> #include <details/memory/detail/assert.hpp> #include <details/memory/detail/ilog2.hpp> using namespace foonathan::memory; using namespace detail; std::size_t log2_access_policy::index_from_size(std::size_t size) noexcept { FOONATHAN_MEMORY_ASSERT_MSG(size, "size must not be zero"); return ilog2_ceil(size); } std::size_t log2_access_policy::size_from_index(std::size_t index) noexcept { return std::size_t(1) << index; }
29.608696
75
0.767988
loopunit
fd9f193d6b3309bc29c0bf439aa20a3531a746db
28,898
cpp
C++
SDK/ARKSurvivalEvolved_HoverSkiffHudWidget_functions.cpp
2bite/ARK-SDK
c38ca9925309516b2093ad8c3a70ed9489e1d573
[ "MIT" ]
10
2020-02-17T19:08:46.000Z
2021-07-31T11:07:19.000Z
SDK/ARKSurvivalEvolved_HoverSkiffHudWidget_functions.cpp
2bite/ARK-SDK
c38ca9925309516b2093ad8c3a70ed9489e1d573
[ "MIT" ]
9
2020-02-17T18:15:41.000Z
2021-06-06T19:17:34.000Z
SDK/ARKSurvivalEvolved_HoverSkiffHudWidget_functions.cpp
2bite/ARK-SDK
c38ca9925309516b2093ad8c3a70ed9489e1d573
[ "MIT" ]
3
2020-07-22T17:42:07.000Z
2021-06-19T17:16:13.000Z
// ARKSurvivalEvolved (329.9) SDK #ifdef _MSC_VER #pragma pack(push, 0x8) #endif #include "ARKSurvivalEvolved_HoverSkiffHudWidget_parameters.hpp" namespace sdk { //--------------------------------------------------------------------------- //Functions //--------------------------------------------------------------------------- // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_RepairPanel_BrushColor_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_RepairPanel_BrushColor_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_RepairPanel_BrushColor_1"); UHoverSkiffHudWidget_C_Get_RepairPanel_BrushColor_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_SkiffModeSubStatusTextBlock_Text_1 // (Net, NetResponse, NetMulticast, Public, Protected, NetServer, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_SkiffModeSubStatusTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_SkiffModeSubStatusTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_SkiffModeSubStatusTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_RepairLabelTextBlock_Text_1 // (Net, NetRequest, Event, NetResponse, NetMulticast, Public, Protected, NetServer, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_RepairLabelTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_RepairLabelTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_RepairLabelTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.WidgetBoolToVisibilty // () // Parameters: // class UObject* TargetWidget (Parm, ZeroConstructor, IsPlainOldData) // bool IsVisible (Parm, ZeroConstructor, IsPlainOldData) // bool UseHiddenInsteadOfCollapsed (Parm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::WidgetBoolToVisibilty(class UObject* TargetWidget, bool IsVisible, bool UseHiddenInsteadOfCollapsed) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.WidgetBoolToVisibilty"); UHoverSkiffHudWidget_C_WidgetBoolToVisibilty_Params params; params.TargetWidget = TargetWidget; params.IsVisible = IsVisible; params.UseHiddenInsteadOfCollapsed = UseHiddenInsteadOfCollapsed; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateRepairProgressBarsPercentAndForegroundColor // (NetReliable, NetRequest, Exec, Event, NetResponse, Public, Private, Protected, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) void UHoverSkiffHudWidget_C::UpdateRepairProgressBarsPercentAndForegroundColor() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateRepairProgressBarsPercentAndForegroundColor"); UHoverSkiffHudWidget_C_UpdateRepairProgressBarsPercentAndForegroundColor_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateRepairPanelVisibility // () void UHoverSkiffHudWidget_C::UpdateRepairPanelVisibility() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateRepairPanelVisibility"); UHoverSkiffHudWidget_C_UpdateRepairPanelVisibility_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateAllFuelGaugesPanelVisibility // () void UHoverSkiffHudWidget_C::UpdateAllFuelGaugesPanelVisibility() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateAllFuelGaugesPanelVisibility"); UHoverSkiffHudWidget_C_UpdateAllFuelGaugesPanelVisibility_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltFuelLabelTextBlock_Text_1 // (NetRequest, Exec, Native, Event, NetResponse, NetMulticast, Public, Protected, NetServer, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_AltFuelLabelTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltFuelLabelTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_AltFuelLabelTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Update Status Visibilities // () void UHoverSkiffHudWidget_C::Update_Status_Visibilities() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Update Status Visibilities"); UHoverSkiffHudWidget_C_Update_Status_Visibilities_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateNeedleRotation // () void UHoverSkiffHudWidget_C::UpdateNeedleRotation() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.UpdateNeedleRotation"); UHoverSkiffHudWidget_C_UpdateNeedleRotation_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Update Tractor Beam Crosshair Visuals // (NetReliable, NetRequest, Exec, Native, Event, Static, Public, Private, Protected, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) void UHoverSkiffHudWidget_C::STATIC_Update_Tractor_Beam_Crosshair_Visuals() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Update Tractor Beam Crosshair Visuals"); UHoverSkiffHudWidget_C_Update_Tractor_Beam_Crosshair_Visuals_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelUsageNeedleImage_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_FuelUsageNeedleImage_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelUsageNeedleImage_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_FuelUsageNeedleImage_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelReserveNeedleImage_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_FuelReserveNeedleImage_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelReserveNeedleImage_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_FuelReserveNeedleImage_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelTankNeedleImage_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_FuelTankNeedleImage_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelTankNeedleImage_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_FuelTankNeedleImage_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelTankGaugeImage_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_FuelTankGaugeImage_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelTankGaugeImage_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_FuelTankGaugeImage_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelReserveGaugeImage_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_FuelReserveGaugeImage_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelReserveGaugeImage_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_FuelReserveGaugeImage_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.IsExtendedInfoKeyPressed // () // Parameters: // bool bShowExtendedInfoKey (Parm, OutParm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::IsExtendedInfoKeyPressed(bool* bShowExtendedInfoKey) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.IsExtendedInfoKeyPressed"); UHoverSkiffHudWidget_C_IsExtendedInfoKeyPressed_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; if (bShowExtendedInfoKey != nullptr) *bShowExtendedInfoKey = params.bShowExtendedInfoKey; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelUsageGaugeImage_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_FuelUsageGaugeImage_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelUsageGaugeImage_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_FuelUsageGaugeImage_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.DimGaugesAndNeedlesOnBool // () // Parameters: // bool Bool (Parm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::DimGaugesAndNeedlesOnBool(bool Bool) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.DimGaugesAndNeedlesOnBool"); UHoverSkiffHudWidget_C_DimGaugesAndNeedlesOnBool_Params params; params.Bool = Bool; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.OnShowExtendedInfoKeyPressed // () void UHoverSkiffHudWidget_C::OnShowExtendedInfoKeyPressed() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.OnShowExtendedInfoKeyPressed"); UHoverSkiffHudWidget_C_OnShowExtendedInfoKeyPressed_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_RepairValueTextBlock_Text_1 // (Net, NetRequest, Native, Event, NetResponse, Static, NetMulticast, Public, Protected, NetServer, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::STATIC_Get_RepairValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_RepairValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_RepairValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltFuelValueTextBlock_Text_1 // (Exec, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_AltFuelValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltFuelValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_AltFuelValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltFuelIcon_Brush_1 // (NetReliable, Exec, Native, NetResponse, NetMulticast, Public, Private, Protected, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FSlateBrush ReturnValue (Parm, OutParm, ReturnParm) struct FSlateBrush UHoverSkiffHudWidget_C::Get_AltFuelIcon_Brush_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltFuelIcon_Brush_1"); UHoverSkiffHudWidget_C_Get_AltFuelIcon_Brush_1_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_SkiffModeValueTextBlock_Text_1 // (NetReliable, NetRequest, Exec, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_SkiffModeValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_SkiffModeValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_SkiffModeValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltitudeValueTextBlock_Text_1 // (Net, NetReliable, Exec, Event, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_AltitudeValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltitudeValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_AltitudeValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltitudeLabelTextBlock_Text_1 // (NetReliable, NetResponse, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_AltitudeLabelTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_AltitudeLabelTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_AltitudeLabelTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get Debug Text 0 // (Net, NetReliable, NetRequest, NetResponse, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_Debug_Text_0() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get Debug Text 0"); UHoverSkiffHudWidget_C_Get_Debug_Text_0_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelReserveTextBlock_Text_1 // (Net, NetRequest, Exec, NetResponse, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_FuelReserveTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelReserveTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_FuelReserveTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Set Progress Bar Fill And Background Colors // (Exec, NetResponse, Static, NetMulticast, Public, Private, Protected, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // class UProgressBar* ProgressBar (Parm, ZeroConstructor, IsPlainOldData) // struct FLinearColor LinearColor (Parm, ZeroConstructor, IsPlainOldData) // struct FProgressBarStyle ProgressBarStyle (Parm, OutParm) void UHoverSkiffHudWidget_C::STATIC_Set_Progress_Bar_Fill_And_Background_Colors(class UProgressBar* ProgressBar, const struct FLinearColor& LinearColor, struct FProgressBarStyle* ProgressBarStyle) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Set Progress Bar Fill And Background Colors"); UHoverSkiffHudWidget_C_Set_Progress_Bar_Fill_And_Background_Colors_Params params; params.ProgressBar = ProgressBar; params.LinearColor = LinearColor; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; if (ProgressBarStyle != nullptr) *ProgressBarStyle = params.ProgressBarStyle; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_CurrentElementValueTextBlock_Text_1 // (Net, NetReliable, NetRequest, Native, NetResponse, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_CurrentElementValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_CurrentElementValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_CurrentElementValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; fn->FunctionFlags |= 0x400; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get Tractor Progress Bar Percent // () // Parameters: // float ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) float UHoverSkiffHudWidget_C::Get_Tractor_Progress_Bar_Percent_() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get Tractor Progress Bar Percent "); UHoverSkiffHudWidget_C_Get_Tractor_Progress_Bar_Percent__Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_Crosshair_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_Crosshair_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_Crosshair_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_Crosshair_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_CameraLockIcon_ColorAndOpacity_1 // () // Parameters: // struct FLinearColor ReturnValue (Parm, OutParm, ZeroConstructor, ReturnParm, IsPlainOldData) struct FLinearColor UHoverSkiffHudWidget_C::Get_CameraLockIcon_ColorAndOpacity_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_CameraLockIcon_ColorAndOpacity_1"); UHoverSkiffHudWidget_C_Get_CameraLockIcon_ColorAndOpacity_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelConsumptionRateValueTextBlock_Text_1 // (NetReliable, Event, NetResponse, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_FuelConsumptionRateValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_FuelConsumptionRateValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_FuelConsumptionRateValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_ElementFuelValueTextBlock_Text_1 // (NetReliable, Exec, Event, NetResponse, MulticastDelegate, Private, Delegate, HasOutParms, NetClient, BlueprintCallable, BlueprintEvent, BlueprintPure, NetValidate) // Parameters: // struct FText ReturnValue (Parm, OutParm, ReturnParm) struct FText UHoverSkiffHudWidget_C::Get_ElementFuelValueTextBlock_Text_1() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Get_ElementFuelValueTextBlock_Text_1"); UHoverSkiffHudWidget_C_Get_ElementFuelValueTextBlock_Text_1_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; return params.ReturnValue; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.InitFromSkiff // () // Parameters: // class ATekHoverSkiff_Character_BP_C* FromSkiff (Parm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::InitFromSkiff(class ATekHoverSkiff_Character_BP_C* FromSkiff) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.InitFromSkiff"); UHoverSkiffHudWidget_C_InitFromSkiff_Params params; params.FromSkiff = FromSkiff; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.StartClosingWidget // () // Parameters: // float NewLifeSpan (Parm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::StartClosingWidget(float NewLifeSpan) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.StartClosingWidget"); UHoverSkiffHudWidget_C_StartClosingWidget_Params params; params.NewLifeSpan = NewLifeSpan; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.DestroySkiffHudWidget // () void UHoverSkiffHudWidget_C::DestroySkiffHudWidget() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.DestroySkiffHudWidget"); UHoverSkiffHudWidget_C_DestroySkiffHudWidget_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.ResetSkiffHudWidget // () void UHoverSkiffHudWidget_C::ResetSkiffHudWidget() { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.ResetSkiffHudWidget"); UHoverSkiffHudWidget_C_ResetSkiffHudWidget_Params params; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Tick // () // Parameters: // struct FGeometry* MyGeometry (Parm, IsPlainOldData) // float* InDeltaTime (Parm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::Tick(struct FGeometry* MyGeometry, float* InDeltaTime) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.Tick"); UHoverSkiffHudWidget_C_Tick_Params params; params.MyGeometry = MyGeometry; params.InDeltaTime = InDeltaTime; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } // Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.ExecuteUbergraph_HoverSkiffHudWidget // () // Parameters: // int EntryPoint (Parm, ZeroConstructor, IsPlainOldData) void UHoverSkiffHudWidget_C::ExecuteUbergraph_HoverSkiffHudWidget(int EntryPoint) { static auto fn = UObject::FindObject<UFunction>("Function HoverSkiffHudWidget.HoverSkiffHudWidget_C.ExecuteUbergraph_HoverSkiffHudWidget"); UHoverSkiffHudWidget_C_ExecuteUbergraph_HoverSkiffHudWidget_Params params; params.EntryPoint = EntryPoint; auto flags = fn->FunctionFlags; UObject::ProcessEvent(fn, &params); fn->FunctionFlags = flags; } } #ifdef _MSC_VER #pragma pack(pop) #endif
33.759346
196
0.782546
2bite
fda3e15aeec103dae5fef777bbc16ea0fa563c4a
1,210
cpp
C++
src/stage_controller.cpp
eksd3/shmup-engine
bdc4c6e0f412559026e2cb59dbfafa3440fb82ff
[ "MIT" ]
null
null
null
src/stage_controller.cpp
eksd3/shmup-engine
bdc4c6e0f412559026e2cb59dbfafa3440fb82ff
[ "MIT" ]
null
null
null
src/stage_controller.cpp
eksd3/shmup-engine
bdc4c6e0f412559026e2cb59dbfafa3440fb82ff
[ "MIT" ]
null
null
null
#include "stage_controller.h" StageController::StageController(SDL* sdl, SDL_Texture* tex, bool scr, bool l, int spd, int stage_length) { m_sdl = sdl; m_sdl->setBackgroundLayer(tex); int width, height; SDL_QueryTexture(tex, NULL, NULL, &width, &height); float s_ratio = height / m_sdl->getWindowHeight(); m_maxy = height - (m_sdl->getWindowHeight() * s_ratio); m_sdl->setBackgroundClip(m_maxy); m_currentY = 0; m_stageLength = stage_length; m_scroll = scr; m_loop = l; m_scrollSpeed = spd; } StageController::~StageController() { } bool StageController::reachedEndOfTexture() { return (m_sdl->getBackgroundClip() <= 0); } bool StageController::reachedEndOfStage() { return (m_currentY >= m_stageLength); } void StageController::loopStage() { m_sdl->setBackgroundClip(m_maxy); } void StageController::scrollStage() { m_sdl->setBackgroundClip( m_sdl->getBackgroundClip() - m_scrollSpeed ); } void StageController::update() { if (m_scroll) { if (reachedEndOfTexture()) { if (m_loop) loopStage(); } else scrollStage(); } m_currentY += FRAME_DELAY; }
19.516129
105
0.646281
eksd3
fdaeffd93ddf91f60150fc3bc5d4fdae0c6bbec4
562
hpp
C++
hw4-jasonsie88-master/src/include/AST/ConstantValue.hpp
jasonsie88/Intro._to_Compiler_Design
228205241fcba7eb3407ec72936a52b0266671bb
[ "MIT" ]
null
null
null
hw4-jasonsie88-master/src/include/AST/ConstantValue.hpp
jasonsie88/Intro._to_Compiler_Design
228205241fcba7eb3407ec72936a52b0266671bb
[ "MIT" ]
null
null
null
hw4-jasonsie88-master/src/include/AST/ConstantValue.hpp
jasonsie88/Intro._to_Compiler_Design
228205241fcba7eb3407ec72936a52b0266671bb
[ "MIT" ]
null
null
null
#ifndef __AST_CONSTANT_VALUE_NODE_H #define __AST_CONSTANT_VALUE_NODE_H #include "AST/constant.hpp" #include "AST/expression.hpp" #include <memory> class ConstantValueNode : public ExpressionNode { public: ConstantValueNode(const uint32_t line, const uint32_t col,const Constant *new_p_constant); ~ConstantValueNode() = default; const PTypeSharedPtr &getTypePtr() const; const char *getConstantValueCString() const; void accept(AstNodeVisitor &p_visitor) override; public: std::unique_ptr<const Constant> m_constant; }; #endif
23.416667
94
0.766904
jasonsie88
fdaf8f37553adb45870d510cd6a060140696ff62
1,795
cpp
C++
Game/graphics/posepool.cpp
swick/OpenGothic
7cc7c0539c90a820607b227a38ae1146c104d420
[ "MIT" ]
null
null
null
Game/graphics/posepool.cpp
swick/OpenGothic
7cc7c0539c90a820607b227a38ae1146c104d420
[ "MIT" ]
null
null
null
Game/graphics/posepool.cpp
swick/OpenGothic
7cc7c0539c90a820607b227a38ae1146c104d420
[ "MIT" ]
null
null
null
#include "posepool.h" PosePool::Inst::Inst(const Skeleton& s, const Animation::Sequence* sq, const Animation::Sequence *sq1, uint64_t sTime) :pose(s,sq,sq1),sTime(sTime) { } PosePool::PosePool() { } std::shared_ptr<Pose> PosePool::get(const Skeleton *s, const Animation::Sequence *sq1, uint64_t sT, std::shared_ptr<Pose> &prev) { return get(s,nullptr,sq1,sT,prev); } std::shared_ptr<Pose> PosePool::get(const Skeleton *s, const Animation::Sequence *sq, const Animation::Sequence *sq1, uint64_t sT, std::shared_ptr<Pose> &prev) { if(prev.use_count()==1) { prev->reset(*s,sq,sq1); return prev; } if(s==nullptr) return nullptr; if(sq1==nullptr) return find(*s); // no cache for now, to be parallel friendly return find(*s,sq,*sq1,sT); } void PosePool::updateAnimation(uint64_t tickCount) { for(auto& i:chunks){ for(auto& r:i.timed){ if(r.use_count()>1){ uint64_t dt=tickCount - r->sTime; r->pose.update(dt); } } } } PosePool::Chunk &PosePool::findChunk(const Skeleton& s, const Animation::Sequence* sq0, const Animation::Sequence* sq1) { for(auto& i:chunks) if(i.skeleton==&s && i.sq0==sq0 && i.sq1==sq1) return i; chunks.emplace_back(s,sq0,sq1); return chunks.back(); } std::shared_ptr<Pose> PosePool::find(const Skeleton& s, const Animation::Sequence* sq0, const Animation::Sequence& sq1, uint64_t sTime) { auto i = std::make_shared<Inst>(s,sq0,&sq1,sTime); return std::shared_ptr<Pose>(i,&i->pose); } std::shared_ptr<Pose> PosePool::find(const Skeleton &s) { auto i = std::make_shared<Inst>(s,nullptr,nullptr,0); return std::shared_ptr<Pose>(i,&i->pose); }
30.423729
130
0.620613
swick
fdb783477067c56cbb4b81125e4b4c2b654a15cd
1,179
cpp
C++
src/Server.cpp
gabswb/ap4a-submarine-monitoring
84d025c084c373259edc18041ff9aae868a99b8b
[ "MIT" ]
4
2021-11-02T13:52:58.000Z
2022-03-04T14:34:36.000Z
src/Server.cpp
gabswb/ap4a-submarine-monitoring
84d025c084c373259edc18041ff9aae868a99b8b
[ "MIT" ]
null
null
null
src/Server.cpp
gabswb/ap4a-submarine-monitoring
84d025c084c373259edc18041ff9aae868a99b8b
[ "MIT" ]
null
null
null
/** * @author Gabriel_SCHWAB * @file Server.cpp * @date 27/09/2021 * */ #include <iostream> #include <fstream> #include <ctime> #include "Server.hpp" Server::Server(): m_consoleActivation(true), m_logActivation(true){} Server::Server(bool consoleActivation_p, bool logActivation_p): m_consoleActivation(consoleActivation_p), m_logActivation(logActivation_p){} Server::Server(const Server& server_p): m_consoleActivation(server_p.m_consoleActivation), m_logActivation(server_p.m_logActivation){} Server::~Server(){} Server& Server::operator=(const Server& server_p) { this->m_consoleActivation=server_p.m_consoleActivation; this->m_logActivation=server_p.m_logActivation; return *this; } void Server::setConsoleActivation(bool consoleActivation_p) { this->m_consoleActivation = consoleActivation_p; } void Server::setLogActivation(bool logActivation_p) { this->m_logActivation = logActivation_p; } std::string Server::getTime() { time_t now = time(0);///< current date/time based on current system std::string date = ctime(&now);///< convert now to string form date.pop_back();///<delete the "\n" at the end of the string return date; }
19.016129
96
0.750636
gabswb
fdb84c2d4269f0aaed8480a561c9a8bc6cc0613d
137,444
cpp
C++
MRTK/h/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs36.cpp
DreVinciCode/TEAM-08
4f148953a9f492c0fc0db7ee85803212caa1a579
[ "MIT" ]
null
null
null
MRTK/h/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs36.cpp
DreVinciCode/TEAM-08
4f148953a9f492c0fc0db7ee85803212caa1a579
[ "MIT" ]
null
null
null
MRTK/h/Il2CppOutputProject/Source/il2cppOutput/Il2CppCCWs36.cpp
DreVinciCode/TEAM-08
4f148953a9f492c0fc0db7ee85803212caa1a579
[ "MIT" ]
null
null
null
#include "pch-cpp.hpp" #ifndef _MSC_VER # include <alloca.h> #else # include <malloc.h> #endif #include <stdint.h> #include <limits> #include "vm/CachedCCWBase.h" #include "utils/New.h" // Microsoft.MixedReality.Toolkit.Input.IMixedRealityController[] struct IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057; // Microsoft.MixedReality.Toolkit.IMixedRealityDataProvider[] struct IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputDeviceManager[] struct IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource[] struct IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F; // Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer[] struct IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C; // Microsoft.MixedReality.Toolkit.IMixedRealityService[] struct IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA; // Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessObserver[] struct IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0; // Microsoft.MixedReality.Toolkit.Experimental.StateVisualizer.IStateAnimatableProperty[] struct IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F; // Microsoft.MixedReality.Toolkit.UI.IToolTipBackground[] struct IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87; // Microsoft.MixedReality.Toolkit.UI.IToolTipHighlight[] struct IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA; // UnityEngine.UI.Image[] struct ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224; struct IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB; struct IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA; struct IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953; struct IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C; struct IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D; IL2CPP_EXTERN_C_BEGIN IL2CPP_EXTERN_C_END #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Winvalid-offsetof" #pragma clang diagnostic ignored "-Wunused-variable" #endif // Windows.Foundation.Collections.IIterable`1<System.IDisposable> struct NOVTABLE IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937(IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D** comReturnValue) = 0; }; // Windows.Foundation.Collections.IIterable`1<System.Object> struct NOVTABLE IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) = 0; }; // Windows.Foundation.Collections.IVectorView`1<System.IDisposable> struct NOVTABLE IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348(uint32_t ___index0, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896(IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953* ___value0, uint32_t* ___index1, bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55(uint32_t ___startIndex0, uint32_t ___items1ArraySize, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** ___items1, uint32_t* comReturnValue) = 0; }; // Windows.Foundation.Collections.IVectorView`1<System.Object> struct NOVTABLE IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) = 0; }; // Windows.UI.Xaml.Interop.IBindableIterable struct NOVTABLE IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8 : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) = 0; }; // Windows.UI.Xaml.Interop.IBindableVector struct NOVTABLE IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC : Il2CppIInspectable { static const Il2CppGuid IID; virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() = 0; virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() = 0; }; // System.Object // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController> struct List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F, ____items_1)); } inline IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057* get__items_1() const { return ____items_1; } inline IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_StaticFields, ____emptyArray_5)); } inline IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealityControllerU5BU5D_tD7B611303C8ABB2A8AC8CF1B7C63EFEFF42BC057* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityDataProvider> struct List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37, ____items_1)); } inline IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54* get__items_1() const { return ____items_1; } inline IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_StaticFields, ____emptyArray_5)); } inline IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealityDataProviderU5BU5D_tB11A2F6A8181EBCE0283B1D0E68BB41AD7ADAC54* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputDeviceManager> struct List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265, ____items_1)); } inline IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2* get__items_1() const { return ____items_1; } inline IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_StaticFields, ____emptyArray_5)); } inline IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealityInputDeviceManagerU5BU5D_t764F950A561C29931D111AE8CF1558349C09D9D2* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource> struct List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD, ____items_1)); } inline IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F* get__items_1() const { return ____items_1; } inline IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_StaticFields, ____emptyArray_5)); } inline IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealityInputSourceU5BU5D_t154A4408FAFE38ECB419DEB06B1F19F3F2A3777F* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer> struct List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A, ____items_1)); } inline IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C* get__items_1() const { return ____items_1; } inline IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_StaticFields, ____emptyArray_5)); } inline IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealityPointerU5BU5D_tBA705C167A9AA88747F0E71091D027919388F80C* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService> struct List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40, ____items_1)); } inline IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA* get__items_1() const { return ____items_1; } inline IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_StaticFields, ____emptyArray_5)); } inline IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealityServiceU5BU5D_tDC7BA25E4B85332C438C24B93DAFA8B9EC5BFEEA* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessObserver> struct List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78, ____items_1)); } inline IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0* get__items_1() const { return ____items_1; } inline IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_StaticFields, ____emptyArray_5)); } inline IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0* get__emptyArray_5() const { return ____emptyArray_5; } inline IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IMixedRealitySpatialAwarenessObserverU5BU5D_t581FB2BA19A2C4DA61A7A1D12A5A577199C602E0* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Experimental.StateVisualizer.IStateAnimatableProperty> struct List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883, ____items_1)); } inline IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F* get__items_1() const { return ____items_1; } inline IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_StaticFields, ____emptyArray_5)); } inline IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F* get__emptyArray_5() const { return ____emptyArray_5; } inline IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IStateAnimatablePropertyU5BU5D_t914CB2D089EB864F169CF3F53E05DCDF53910D7F* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.IToolTipBackground> struct List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6 : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6, ____items_1)); } inline IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87* get__items_1() const { return ____items_1; } inline IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_StaticFields, ____emptyArray_5)); } inline IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87* get__emptyArray_5() const { return ____emptyArray_5; } inline IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IToolTipBackgroundU5BU5D_tA560BC2E8C655407F78DE21409F0EB6434349B87* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.IToolTipHighlight> struct List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C, ____items_1)); } inline IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA* get__items_1() const { return ____items_1; } inline IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA** get_address_of__items_1() { return &____items_1; } inline void set__items_1(IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_StaticFields, ____emptyArray_5)); } inline IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA* get__emptyArray_5() const { return ____emptyArray_5; } inline IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(IToolTipHighlightU5BU5D_t3CAEE84DCD244945F9F49A159149723188A4D9FA* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; // System.Collections.Generic.List`1<UnityEngine.UI.Image> struct List_1_t815A476B0A21E183042059E705F9E505478CD8AE : public RuntimeObject { public: // T[] System.Collections.Generic.List`1::_items ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224* ____items_1; // System.Int32 System.Collections.Generic.List`1::_size int32_t ____size_2; // System.Int32 System.Collections.Generic.List`1::_version int32_t ____version_3; // System.Object System.Collections.Generic.List`1::_syncRoot RuntimeObject * ____syncRoot_4; public: inline static int32_t get_offset_of__items_1() { return static_cast<int32_t>(offsetof(List_1_t815A476B0A21E183042059E705F9E505478CD8AE, ____items_1)); } inline ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224* get__items_1() const { return ____items_1; } inline ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224** get_address_of__items_1() { return &____items_1; } inline void set__items_1(ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224* value) { ____items_1 = value; Il2CppCodeGenWriteBarrier((void**)(&____items_1), (void*)value); } inline static int32_t get_offset_of__size_2() { return static_cast<int32_t>(offsetof(List_1_t815A476B0A21E183042059E705F9E505478CD8AE, ____size_2)); } inline int32_t get__size_2() const { return ____size_2; } inline int32_t* get_address_of__size_2() { return &____size_2; } inline void set__size_2(int32_t value) { ____size_2 = value; } inline static int32_t get_offset_of__version_3() { return static_cast<int32_t>(offsetof(List_1_t815A476B0A21E183042059E705F9E505478CD8AE, ____version_3)); } inline int32_t get__version_3() const { return ____version_3; } inline int32_t* get_address_of__version_3() { return &____version_3; } inline void set__version_3(int32_t value) { ____version_3 = value; } inline static int32_t get_offset_of__syncRoot_4() { return static_cast<int32_t>(offsetof(List_1_t815A476B0A21E183042059E705F9E505478CD8AE, ____syncRoot_4)); } inline RuntimeObject * get__syncRoot_4() const { return ____syncRoot_4; } inline RuntimeObject ** get_address_of__syncRoot_4() { return &____syncRoot_4; } inline void set__syncRoot_4(RuntimeObject * value) { ____syncRoot_4 = value; Il2CppCodeGenWriteBarrier((void**)(&____syncRoot_4), (void*)value); } }; struct List_1_t815A476B0A21E183042059E705F9E505478CD8AE_StaticFields { public: // T[] System.Collections.Generic.List`1::_emptyArray ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224* ____emptyArray_5; public: inline static int32_t get_offset_of__emptyArray_5() { return static_cast<int32_t>(offsetof(List_1_t815A476B0A21E183042059E705F9E505478CD8AE_StaticFields, ____emptyArray_5)); } inline ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224* get__emptyArray_5() const { return ____emptyArray_5; } inline ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224** get_address_of__emptyArray_5() { return &____emptyArray_5; } inline void set__emptyArray_5(ImageU5BU5D_t173C9D1F1D57DABC8260713678F7094C9E7FD224* value) { ____emptyArray_5 = value; Il2CppCodeGenWriteBarrier((void**)(&____emptyArray_5), (void*)value); } }; #ifdef __clang__ #pragma clang diagnostic pop #endif il2cpp_hresult_t IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue); il2cpp_hresult_t IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable** comReturnValue); il2cpp_hresult_t IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue); il2cpp_hresult_t IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue); il2cpp_hresult_t IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue); il2cpp_hresult_t IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable* ___value1); il2cpp_hresult_t IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable* ___value1); il2cpp_hresult_t IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0); il2cpp_hresult_t IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Il2CppIInspectable* ___value0); il2cpp_hresult_t IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(RuntimeObject* __this); il2cpp_hresult_t IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(RuntimeObject* __this); il2cpp_hresult_t IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D** comReturnValue); il2cpp_hresult_t IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** comReturnValue); il2cpp_hresult_t IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue); il2cpp_hresult_t IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953* ___value0, uint32_t* ___index1, bool* comReturnValue); il2cpp_hresult_t IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___startIndex0, uint32_t ___items1ArraySize, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** ___items1, uint32_t* comReturnValue); il2cpp_hresult_t IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(RuntimeObject* __this, IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue); il2cpp_hresult_t IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___index0, Il2CppIInspectable** comReturnValue); il2cpp_hresult_t IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t* comReturnValue); il2cpp_hresult_t IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(RuntimeObject* __this, Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue); il2cpp_hresult_t IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(RuntimeObject* __this, uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue); // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityController> struct List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t4A72A7F993144B8746576E884ADDA98BCDFFE12F_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityDataProvider> struct List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_ComCallableWrapper>, IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E { inline List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937(IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348(uint32_t ___index0, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896(IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55(uint32_t ___startIndex0, uint32_t ___items1ArraySize, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t8EDD018BF26DB64590A9401CA14BBAB7BC5D2F37_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputDeviceManager> struct List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_ComCallableWrapper>, IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E { inline List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937(IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348(uint32_t ___index0, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896(IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55(uint32_t ___startIndex0, uint32_t ___items1ArraySize, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tE7084CD29AF616D041678A4D0099E391D3DD5265_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityInputSource> struct List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tCBF7C6A7D4F21488BDCF98F50498104B254ED6BD_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Input.IMixedRealityPointer> struct List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t535309B4CEA15437136325EEBD510D7C9EBC860A_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.IMixedRealityService> struct List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_ComCallableWrapper>, IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E { inline List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937(IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348(uint32_t ___index0, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896(IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55(uint32_t ___startIndex0, uint32_t ___items1ArraySize, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tEE673DC2821DB102F60CA7575C587CDA4EB57E40_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.SpatialAwareness.IMixedRealitySpatialAwarenessObserver> struct List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_ComCallableWrapper>, IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E { inline List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t5F4BD9477DDC56D9428ADFFD61354FCFE2E78588::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_tF548FBFC73854E307F2AA2286569F664A1E4591E::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937(IIterator_1_tE84305D19EB46B9DD6D1B86BE7195EBA9B09BF2D** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_mDDCB90F64D3007CB280F2A112BFB11FEDF4CF937_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348(uint32_t ___index0, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_mAAA90556845E6A9FA05500C3DA1B62AFCD594348_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_mD62BFB5D4843800B4A741E45A641F4ADE113D420_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896(IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_m746B31C36F4EA4DEE36100C137BB622A7FE4F896_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55(uint32_t ___startIndex0, uint32_t ___items1ArraySize, IClosable_t30CA7D2BE598B3BD6AA57CE9DF977DB51540B953** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m901FA6BCD9F6C87B5EBD41947DF80ACD2028AA55_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_tC0E56FCD8C7F369C92D1D812363BEE53E9776B78_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.Experimental.StateVisualizer.IStateAnimatableProperty> struct List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t061F239B882D5753F7908EA1C72CE6AE4E545883_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.IToolTipBackground> struct List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t590FD3BE6016263B4F82CF7C9B5180D4AEE04AF6_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<Microsoft.MixedReality.Toolkit.UI.IToolTipHighlight> struct List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_ComCallableWrapper>, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC { inline List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(2); interfaceIds[0] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[1] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; *iidCount = 2; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t66DC14F043420562F691A2CEDF39AC48E8C68C2C_ComCallableWrapper(obj)); } // COM Callable Wrapper for System.Collections.Generic.List`1<UnityEngine.UI.Image> struct List_1_t815A476B0A21E183042059E705F9E505478CD8AE_ComCallableWrapper IL2CPP_FINAL : il2cpp::vm::CachedCCWBase<List_1_t815A476B0A21E183042059E705F9E505478CD8AE_ComCallableWrapper>, IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4, IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8, IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC, IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A { inline List_1_t815A476B0A21E183042059E705F9E505478CD8AE_ComCallableWrapper(RuntimeObject* obj) : il2cpp::vm::CachedCCWBase<List_1_t815A476B0A21E183042059E705F9E505478CD8AE_ComCallableWrapper>(obj) {} virtual il2cpp_hresult_t STDCALL QueryInterface(const Il2CppGuid& iid, void** object) IL2CPP_OVERRIDE { if (::memcmp(&iid, &Il2CppIUnknown::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIInspectable::IID, sizeof(Il2CppGuid)) == 0 || ::memcmp(&iid, &Il2CppIAgileObject::IID, sizeof(Il2CppGuid)) == 0) { *object = GetIdentity(); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIManagedObjectHolder::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIManagedObjectHolder*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIMarshal::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIMarshal*>(this); AddRefImpl(); return IL2CPP_S_OK; } if (::memcmp(&iid, &Il2CppIWeakReferenceSource::IID, sizeof(Il2CppGuid)) == 0) { *object = static_cast<Il2CppIWeakReferenceSource*>(this); AddRefImpl(); return IL2CPP_S_OK; } *object = NULL; return IL2CPP_E_NOINTERFACE; } virtual uint32_t STDCALL AddRef() IL2CPP_OVERRIDE { return AddRefImpl(); } virtual uint32_t STDCALL Release() IL2CPP_OVERRIDE { return ReleaseImpl(); } virtual il2cpp_hresult_t STDCALL GetIids(uint32_t* iidCount, Il2CppGuid** iids) IL2CPP_OVERRIDE { Il2CppGuid* interfaceIds = il2cpp_codegen_marshal_allocate_array<Il2CppGuid>(4); interfaceIds[0] = IIterable_1_t64693143CE4E5082C6101BC54B0427C21F3C01C4::IID; interfaceIds[1] = IBindableIterable_tF6BD0C070562CD9C91E3C1B1A5F4667E9C3C74A8::IID; interfaceIds[2] = IBindableVector_tC070A96258CD93818901E9B7808E1A8EFB64B7EC::IID; interfaceIds[3] = IVectorView_1_t9D427951F2D09C2E6F846759B5273E993F185D4A::IID; *iidCount = 4; *iids = interfaceIds; return IL2CPP_S_OK; } virtual il2cpp_hresult_t STDCALL GetRuntimeClassName(Il2CppHString* className) IL2CPP_OVERRIDE { return GetRuntimeClassNameImpl(className); } virtual il2cpp_hresult_t STDCALL GetTrustLevel(int32_t* trustLevel) IL2CPP_OVERRIDE { return ComObjectBase::GetTrustLevel(trustLevel); } virtual il2cpp_hresult_t STDCALL IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619(IIterator_1_tB1AB5AB497E87D6A397AA084D3D3D6B8D211022C** comReturnValue) IL2CPP_OVERRIDE { return IIterable_1_First_m54AC7E778E98ED35C6B7AD98C35C325B8A3DF619_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7(IBindableIterator_tD7550F1144CFBE58090050457A2BE92B1CAEABBB** comReturnValue) IL2CPP_OVERRIDE { return IBindableIterable_First_m91EC6ED0173145266318FDB7F9074798CD766BD7_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetAt_m33D2170810828C01473D9BDC22745A0354FA4FED_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_get_Size_m45347BCD42A1FE180ED2B377BB9C88C7B50CD7D9_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38(IBindableVectorView_tD80A01049DD2609FEA5FACD5E77BF95A875534FA** comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_GetView_m9736FE93BC8979E0CBF8ED26090D1FE54C2E1A38_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IBindableVector_IndexOf_m2F1A64750D19C5A03E9B65880F4A04275E6AABF4_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_SetAt_mD4C84EC02EAD7F636873B77E6D48E7132055A213_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5(uint32_t ___index0, Il2CppIInspectable* ___value1) IL2CPP_OVERRIDE { return IBindableVector_InsertAt_m19A0C885F7C7A7FFA257A46218D7232317E022B5_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, ___value1); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0(uint32_t ___index0) IL2CPP_OVERRIDE { return IBindableVector_RemoveAt_m1AC6E54165809374E91F456B9922A9B24F8652B0_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0); } virtual il2cpp_hresult_t STDCALL IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F(Il2CppIInspectable* ___value0) IL2CPP_OVERRIDE { return IBindableVector_Append_mCA138F8E4026725AC867B607FA63709B6752BB7F_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0); } virtual il2cpp_hresult_t STDCALL IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3() IL2CPP_OVERRIDE { return IBindableVector_RemoveAtEnd_mB3178911995D4CC7BAC0EA43720C1280267E54E3_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF() IL2CPP_OVERRIDE { return IBindableVector_Clear_mEF05B40EFF6D42CBB5A5E336B0946FECE7A4A6EF_ComCallableWrapperProjectedMethod(GetManagedObjectInline()); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260(uint32_t ___index0, Il2CppIInspectable** comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetAt_m38CCDDE1E25317AEF5170D9818FC01816AF34260_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___index0, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B(uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_get_Size_m33BC340C458F20A80A8B07FF4764CEF1F5513F8B_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67(Il2CppIInspectable* ___value0, uint32_t* ___index1, bool* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_IndexOf_mFAE432DA0C1902EEF54AB68CFFD3E2182C443F67_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___value0, ___index1, comReturnValue); } virtual il2cpp_hresult_t STDCALL IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1(uint32_t ___startIndex0, uint32_t ___items1ArraySize, Il2CppIInspectable** ___items1, uint32_t* comReturnValue) IL2CPP_OVERRIDE { return IVectorView_1_GetMany_m6AA46969FB50015EB7107EBCC29E48B7AD4BB6B1_ComCallableWrapperProjectedMethod(GetManagedObjectInline(), ___startIndex0, ___items1ArraySize, ___items1, comReturnValue); } }; IL2CPP_EXTERN_C Il2CppIUnknown* CreateComCallableWrapperFor_List_1_t815A476B0A21E183042059E705F9E505478CD8AE(RuntimeObject* obj) { void* memory = il2cpp::utils::Memory::Malloc(sizeof(List_1_t815A476B0A21E183042059E705F9E505478CD8AE_ComCallableWrapper)); if (memory == NULL) { il2cpp_codegen_raise_out_of_memory_exception(); } return static_cast<Il2CppIManagedObjectHolder*>(new(memory) List_1_t815A476B0A21E183042059E705F9E505478CD8AE_ComCallableWrapper(obj)); }
49.780514
416
0.849852
DreVinciCode
fdb86163e1b837023025962f053e4b0408f62f38
2,611
cc
C++
prob01/pizza.cc
crimsonGnome/121-Lab-02
8f5152d902fe71372f4738cdaa33e6378b88482a
[ "MIT" ]
null
null
null
prob01/pizza.cc
crimsonGnome/121-Lab-02
8f5152d902fe71372f4738cdaa33e6378b88482a
[ "MIT" ]
null
null
null
prob01/pizza.cc
crimsonGnome/121-Lab-02
8f5152d902fe71372f4738cdaa33e6378b88482a
[ "MIT" ]
null
null
null
#include "pizza.h" #include <math.h> #include <stdlib.h> #include "cpputils/graphics/image.h" // You do not need to edit this file, but feel free to look around! constexpr double pi = 3.141592; const graphics::Color crust(237, 244, 173); const graphics::Color sauce(217, 71, 39); const graphics::Color cheese(255, 250, 235); const graphics::Color pepperoni(150, 47, 47); const graphics::Color onion(227, 227, 222); const graphics::Color jalapeno(100, 145, 36); const int kSauceOuterRadius = 20; const int kCheeseOuterRadius = 30; const int kPepperoniRadius = 30; const int kOnionRadius = 10; const int kJalapenoRadius = 15; const int kNumPepperoni = 15; const int kNumOnion = 30; const int kNumJalapeno = 20; const int kDegrees = 360; int GetMinimumDimension(graphics::Image& image) { return std::min(image.GetWidth(), image.GetHeight()); } void AddTopping(graphics::Image& pizza, const graphics::Color& color, int topping_radius, int num_topping) { int size = GetMinimumDimension(pizza); for (int i = 0; i < num_topping; i++) { int radius = rand() % (size / 2 - kCheeseOuterRadius - 3 * topping_radius) + 2 * topping_radius; int theta = i * kDegrees / num_topping; int x = size / 2 + radius * cos(theta * pi / (kDegrees / 2)); int y = size / 2 + radius * sin(theta * pi / (kDegrees / 2)); pizza.DrawCircle(x, y, topping_radius, color); } } void AddCrust(graphics::Image& pizza) { int size = GetMinimumDimension(pizza); // The crust fills the whole minimum dimension. pizza.DrawCircle(size / 2, size / 2, size / 2, crust); } void AddSauce(graphics::Image& pizza) { int size = GetMinimumDimension(pizza); // The sauce is almost as large as the crust, minus the outer radius. pizza.DrawCircle(size / 2, size / 2, size / 2 - kSauceOuterRadius, sauce); } void AddCheese(graphics::Image& pizza) { int size = GetMinimumDimension(pizza); // The cheese is almost as large as the crust, minus the outer radius. pizza.DrawCircle(size / 2, size / 2, size / 2 - kCheeseOuterRadius, cheese); } void AddPepperoni(graphics::Image& pizza) { // Initialize random seed so we can have predictable unit tests. The pepperoni // looks better when intialized with kPepperoniRadius * 2. srand(2 * kPepperoniRadius); AddTopping(pizza, pepperoni, kPepperoniRadius, kNumPepperoni); } void AddOnion(graphics::Image& pizza) { srand(kOnionRadius); AddTopping(pizza, onion, kOnionRadius, kNumOnion); } void AddJalapeno(graphics::Image& pizza) { srand(kJalapenoRadius); AddTopping(pizza, jalapeno, kJalapenoRadius, kNumJalapeno); }
31.841463
80
0.703945
crimsonGnome
fdbebeae55ef28bd2bcca78a5f14fc42bd3edd7b
11,149
cpp
C++
src/utest/utestScrambling.cpp
jakub-zwolakowski/tsduck
79d9648967fc3aa3b590131e71c80fbfb1c11581
[ "BSD-2-Clause" ]
2
2020-02-27T04:34:41.000Z
2020-04-29T10:43:23.000Z
src/utest/utestScrambling.cpp
jakub-zwolakowski/tsduck
79d9648967fc3aa3b590131e71c80fbfb1c11581
[ "BSD-2-Clause" ]
null
null
null
src/utest/utestScrambling.cpp
jakub-zwolakowski/tsduck
79d9648967fc3aa3b590131e71c80fbfb1c11581
[ "BSD-2-Clause" ]
1
2021-02-18T13:35:31.000Z
2021-02-18T13:35:31.000Z
//---------------------------------------------------------------------------- // // TSDuck - The MPEG Transport Stream Toolkit // Copyright (c) 2005-2020, Thierry Lelegard // All rights reserved. // // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are met: // // 1. Redistributions of source code must retain the above copyright notice, // this list of conditions and the following disclaimer. // 2. Redistributions in binary form must reproduce the above copyright // notice, this list of conditions and the following disclaimer in the // documentation and/or other materials provided with the distribution. // // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF // THE POSSIBILITY OF SUCH DAMAGE. // //---------------------------------------------------------------------------- // // TSUnit test suite for class ts::DVBCSA2 // //---------------------------------------------------------------------------- #include "tsDVBCSA2.h" #include "tsTSPacket.h" #include "tsNames.h" #include "tsunit.h" TSDUCK_SOURCE; //---------------------------------------------------------------------------- // The test fixture //---------------------------------------------------------------------------- class ScramblingTest: public tsunit::Test { public: virtual void beforeTest() override; virtual void afterTest() override; void testScrambling(); TSUNIT_TEST_BEGIN(ScramblingTest); TSUNIT_TEST(testScrambling); TSUNIT_TEST_END(); }; TSUNIT_REGISTER(ScramblingTest); //---------------------------------------------------------------------------- // Initialization. //---------------------------------------------------------------------------- // Test suite initialization method. void ScramblingTest::beforeTest() { } // Test suite cleanup method. void ScramblingTest::afterTest() { } //---------------------------------------------------------------------------- // Unitary tests. //---------------------------------------------------------------------------- // Test vectors for DVB-CSA // // Extracted from TNT R4, 2007/11/30, service Paris Premiere // Control Words: // CP1: even: C0 B1 F0 61 A6 ED 71 04 odd: B2 92 D3 17 7C CC CE 16 // CP2: even: A6 34 69 43 D3 EE 85 46 odd: B2 92 D3 17 7C CC CE 16 // CP3: even: A6 34 69 43 D3 EE 85 46 odd: 03 0B 48 56 54 37 75 00 namespace { struct ScramblingTestVector { uint8_t cw_even[ts::DVBCSA2::KEY_SIZE]; uint8_t cw_odd[ts::DVBCSA2::KEY_SIZE]; ts::TSPacket plain; ts::TSPacket cipher; }; const ScramblingTestVector scrambling_test_vectors[] = { // Payload size: 184 bytes, no residue { // cw_even {0xC0, 0xB1, 0xF0, 0x61, 0xA6, 0xED, 0x71, 0x04}, // cw_odd {0xB2, 0x92, 0xD3, 0x17, 0x7C, 0xCC, 0xCE, 0x16}, // plain {{ 0x47, 0x01, 0xA4, 0x10, 0x81, 0xDB, 0xEF, 0xC2, 0x7A, 0xAE, 0x3F, 0xB0, 0x41, 0x48, 0x1E, 0x0D, 0xA8, 0xC0, 0x76, 0x4A, 0xB3, 0x0F, 0xCB, 0x33, 0x94, 0xA5, 0x79, 0x9C, 0xAD, 0x9D, 0xA2, 0x79, 0xA9, 0x25, 0x89, 0x71, 0xB2, 0xE8, 0xE5, 0x06, 0x1F, 0xDA, 0x3B, 0xBF, 0x32, 0xD2, 0x02, 0xDF, 0xC0, 0x2D, 0xD3, 0x9A, 0xE3, 0x29, 0xE7, 0x7E, 0xDF, 0x21, 0x74, 0x36, 0x35, 0x33, 0x1D, 0x5A, 0xC6, 0xB1, 0xB8, 0x4C, 0x88, 0x5D, 0x71, 0x9B, 0xBE, 0x77, 0x7C, 0x29, 0xBF, 0x44, 0xA9, 0xF0, 0xFA, 0xBA, 0x07, 0x69, 0xAD, 0xC7, 0x0E, 0xF8, 0x51, 0x71, 0xA0, 0x57, 0xE5, 0x73, 0xE6, 0x39, 0xCC, 0xC0, 0xE8, 0x9F, 0x7C, 0xF1, 0x23, 0x06, 0xEC, 0x5D, 0x9B, 0x4B, 0xF3, 0x53, 0xB7, 0x92, 0xD4, 0x71, 0xC9, 0xEB, 0xFF, 0xAE, 0x47, 0xF3, 0x4D, 0x63, 0x28, 0x6A, 0xD6, 0x39, 0x11, 0x97, 0x94, 0xA5, 0x5C, 0x21, 0x65, 0x19, 0x32, 0x24, 0xFA, 0x41, 0xEB, 0x42, 0xCA, 0x44, 0x93, 0xA1, 0xD5, 0xE9, 0xE0, 0x37, 0x02, 0x91, 0xC6, 0xE0, 0x5E, 0x0B, 0xA9, 0xDC, 0x0E, 0xFE, 0xA5, 0xF9, 0x47, 0x5B, 0x5A, 0x45, 0x7F, 0x4B, 0x79, 0x31, 0xAE, 0xB6, 0xDE, 0x9C, 0x0C, 0x40, 0x4B, 0x93, 0x50, 0x3A, 0xD5, 0x7B, 0x8A, 0x00, 0x74, 0xEB, 0xB6, 0x43, 0x12, 0xF2, }}, // cipher {{ 0x47, 0x01, 0xA4, 0x90, 0xE3, 0x4B, 0x70, 0x1E, 0x54, 0x16, 0x5B, 0x14, 0x07, 0xC5, 0x81, 0xAA, 0x37, 0xC7, 0x00, 0x9E, 0xC9, 0x85, 0x83, 0x79, 0xF1, 0x85, 0x3B, 0x4E, 0x9C, 0xFA, 0x0D, 0x50, 0xA7, 0x0E, 0xF6, 0x95, 0x7B, 0x1C, 0xFB, 0xD1, 0x31, 0xF1, 0xA9, 0x99, 0x54, 0x91, 0x55, 0xBA, 0x41, 0x23, 0x0E, 0xFE, 0x02, 0x91, 0x90, 0x58, 0x38, 0x50, 0x7A, 0x40, 0x8A, 0xA9, 0x79, 0x00, 0x3C, 0x55, 0xB6, 0x07, 0xFD, 0x4E, 0xED, 0xFE, 0xA3, 0x93, 0x22, 0x6A, 0x2A, 0xB1, 0xA2, 0x43, 0x6F, 0x32, 0xE2, 0x97, 0x29, 0xE7, 0xF5, 0x6A, 0x43, 0xF4, 0x7A, 0x6C, 0x64, 0x55, 0x64, 0x04, 0xA3, 0x77, 0x28, 0x98, 0xB1, 0x6F, 0xC5, 0x07, 0xF7, 0xD5, 0x97, 0xBE, 0x6B, 0x73, 0xF5, 0x15, 0x8A, 0xBA, 0x80, 0xB7, 0x14, 0xC8, 0x2E, 0x34, 0x69, 0x47, 0x09, 0x9B, 0x53, 0xB3, 0x0E, 0xFD, 0x28, 0x81, 0x2E, 0xFF, 0xD6, 0x6E, 0xAE, 0x5C, 0xBC, 0x91, 0xCE, 0x5B, 0x98, 0xA2, 0xED, 0x6B, 0x05, 0x53, 0x61, 0x30, 0xD1, 0xAD, 0x73, 0x25, 0xB0, 0x9A, 0x4F, 0xFC, 0x5E, 0x70, 0xDD, 0x51, 0x7B, 0x2D, 0xC2, 0x7D, 0xAF, 0x70, 0xE1, 0x58, 0x98, 0xF6, 0x96, 0x66, 0x84, 0x06, 0x00, 0x6C, 0x4D, 0x8D, 0x65, 0xFE, 0x6F, 0x6A, 0x83, 0xBC, 0xF5, 0xCF, 0xF0, 0x5A, }}, }, // Payload size: 108 bytes, residue: 8 bytes { // cw_even {0xC0, 0xB1, 0xF0, 0x61, 0xA6, 0xED, 0x71, 0x04}, // cw_odd {0xB2, 0x92, 0xD3, 0x17, 0x7C, 0xCC, 0xCE, 0x16}, // plain {{ 0x47, 0x01, 0xA4, 0x31, 0x4B, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x62, 0x34, 0xAC, 0x56, 0xDB, 0x0E, 0x38, 0x37, 0xE5, 0x7B, 0x7E, 0x6A, 0xDB, 0xC1, 0x6F, 0x44, 0xF3, 0xDB, 0xF6, 0xFE, 0x0E, 0xD7, 0x2F, 0xF8, 0xEA, 0xCF, 0x67, 0x55, 0x8A, 0xAF, 0x3F, 0x12, 0x54, 0x5C, 0x87, 0x4F, 0x0D, 0xA9, 0x47, 0x6E, 0xDC, 0xC2, 0x60, 0x12, 0xC7, 0x45, 0xAA, 0xA8, 0xFD, 0x14, 0xEB, 0x63, 0x6A, 0x87, 0x4E, 0xC3, 0xFA, 0x99, 0xA3, 0x04, 0x71, 0x3B, 0x98, 0x22, 0x90, 0xC1, 0xFC, 0x24, 0x99, 0x97, 0xA3, 0xD8, 0x15, 0x7E, 0x9F, 0x6F, 0x2A, 0x10, 0x62, 0x61, 0x65, 0x32, 0x01, 0xC7, 0xEA, 0x48, 0xC0, 0xC9, 0xA1, 0xB8, 0x8F, 0x8B, 0xDE, 0x4F, 0xC9, 0x49, 0x8A, 0x32, 0xB2, 0x9A, 0xC5, 0xAB, 0x63, 0x22, 0x6F, 0x82, 0xD2, 0x77, }}, // cipher {{ 0x47, 0x01, 0xA4, 0xB1, 0x4B, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xA1, 0x30, 0x42, 0x32, 0x1C, 0xD1, 0x98, 0x38, 0x1C, 0x80, 0x71, 0xF3, 0xFC, 0x60, 0xB3, 0x28, 0xB9, 0xDD, 0x2C, 0x79, 0x0C, 0x61, 0x00, 0xFD, 0xBF, 0x94, 0x5A, 0xEC, 0xED, 0x00, 0xCD, 0x82, 0x33, 0xCC, 0x86, 0xEC, 0xD6, 0x1C, 0x92, 0xF6, 0xEE, 0xE3, 0xD2, 0x85, 0xFD, 0xB7, 0xD4, 0xA3, 0x37, 0xE3, 0x1C, 0xFA, 0x3A, 0x9B, 0x6A, 0xCE, 0xCD, 0x93, 0x18, 0x28, 0xEF, 0xCE, 0x22, 0x5B, 0x64, 0x18, 0xE4, 0x72, 0xBF, 0x4F, 0xF6, 0xE5, 0xD6, 0x49, 0x51, 0xB2, 0xFB, 0xF4, 0x06, 0x1C, 0xA8, 0x49, 0xFB, 0x9C, 0x18, 0x5F, 0x8B, 0xE2, 0x3B, 0x07, 0xED, 0x0A, 0x16, 0xA6, 0x50, 0x91, 0x0F, 0xB8, 0xA1, 0x42, 0x95, 0x86, 0x65, 0x25, 0xDF, 0xB0, 0x07, 0xA5, }}, }, }; } void ScramblingTest::testScrambling() { const ScramblingTestVector* vec = scrambling_test_vectors; size_t count = sizeof(scrambling_test_vectors) / sizeof(ScramblingTestVector); ts::DVBCSA2 scrambler; ts::TSPacket pkt; debug() << "ScramblingTest: " << count << " test vectors" << std::endl; for (size_t ti = 0; ti < count; ++ti, ++vec) { const size_t header_size = vec->plain.getHeaderSize(); const size_t payload_size = vec->plain.getPayloadSize(); const uint8_t scv = vec->cipher.getScrambling(); debug() << "ScramblingTest: " << ti << ", header: " << header_size << " byte, payload: " << payload_size << " bytes, PID: " << vec->plain.getPID() << ", scrambling: " << ts::names::ScramblingControl(scv) << std::endl; TSUNIT_ASSERT(header_size == vec->cipher.getHeaderSize()); TSUNIT_ASSERT(payload_size == vec->cipher.getPayloadSize()); TSUNIT_ASSERT(header_size + payload_size == ts::PKT_SIZE); TSUNIT_ASSERT(scv == ts::SC_EVEN_KEY || scv == ts::SC_ODD_KEY); TSUNIT_ASSERT(vec->plain.getScrambling() == ts::SC_CLEAR); TSUNIT_ASSERT(scrambler.setKey(scv == ts::SC_EVEN_KEY ? vec->cw_even : vec->cw_odd, sizeof(vec->cw_even))); // Descrambling test pkt = vec->cipher; TSUNIT_ASSERT(scrambler.decryptInPlace(pkt.b + header_size, payload_size)); TSUNIT_ASSERT(::memcmp (pkt.b + header_size, vec->plain.b + header_size, payload_size) == 0); // Scrambling test pkt = vec->plain; TSUNIT_ASSERT(scrambler.encryptInPlace(pkt.b + header_size, payload_size)); TSUNIT_ASSERT(::memcmp(pkt.b + header_size, vec->cipher.b + header_size, payload_size) == 0); } }
52.098131
115
0.56588
jakub-zwolakowski
fdbec2818c74babbe32e2ee7d08c1e01335482ba
9,992
hpp
C++
slope/slope/math/matrix44.hpp
muleax/slope
254138703163705b57332fc7490dd2eea0082b57
[ "MIT" ]
6
2022-02-05T23:28:12.000Z
2022-02-24T11:08:04.000Z
slope/slope/math/matrix44.hpp
muleax/slope
254138703163705b57332fc7490dd2eea0082b57
[ "MIT" ]
null
null
null
slope/slope/math/matrix44.hpp
muleax/slope
254138703163705b57332fc7490dd2eea0082b57
[ "MIT" ]
null
null
null
#pragma once #include "slope/math/matrix33.hpp" #include "slope/math/vector4.hpp" namespace slope { class mat44 { public: constexpr static mat44 identity() { return {}; } static mat44 rotation(const vec3& axis, float angle); constexpr static mat44 scale(const vec3& scale); constexpr static mat44 translate(const vec3& translation); constexpr mat44(); constexpr mat44( float _11, float _12, float _13, float _14, float _21, float _22, float _23, float _24, float _31, float _32, float _33, float _34, float _41, float _42, float _43, float _44); explicit constexpr mat44(const mat22& value); explicit constexpr mat44(const mat33& value); constexpr mat44(const vec4& r0, const vec4& r1, const vec4& r2, const vec4& r3); explicit mat44(const quat& q); constexpr mat44 operator*(const mat44& rhs) const; constexpr mat44& operator*=(const mat44& value) { return *this = *this * value; } constexpr mat44 operator+(const mat44& rhs) const; constexpr mat44 operator-(const mat44& rhs) const; constexpr mat44& operator+=(const mat44& value) { return *this = *this + value; } constexpr mat44& operator-=(const mat44& value) { return *this = *this - value; } friend constexpr mat44 operator*(float lhs, const mat44& rhs); constexpr mat44 operator*(float rhs) const; constexpr mat44 operator/(float rhs) const { return *this * (1.f / rhs); } constexpr mat44& operator*=(float value) { return *this = *this * value; } constexpr mat44& operator/=(float value) { return *this = *this / value; } friend constexpr vec3 operator*(const vec3& lhs, const mat44& rhs); constexpr vec3 operator*(const vec3& rhs) const; friend constexpr vec4 operator*(const vec4& lhs, const mat44& rhs); constexpr vec4 operator*(const vec4& rhs) const; constexpr bool operator==(const mat44& value) const; constexpr bool operator!=(const mat44& value) const { return !(*this == value); } constexpr vec4& operator[](size_t index) { return rows[index]; } constexpr const vec4& operator[](size_t index) const { return rows[index]; } void normalize_rotation(); void set_translation(const vec3& translation); constexpr vec3 apply_point(const vec3& point) const; constexpr vec3 apply_normal(const vec3& normal) const; const vec3& translation() const; const vec3& apply_to_unit_axis(uint32_t axis) const; constexpr float determinant() const; mat44 transposed() const; mat44 inverted_orthonormal() const; mat44 inverted() const; bool is_finite() const; bool equal(const mat44& rhs, float epsilon = EQUALITY_EPSILON) const; union { struct { float _00, _01, _02, _03; float _10, _11, _12, _13; float _20, _21, _22, _23; float _30, _31, _32, _33; }; vec4 rows[4]; float data[16]; }; }; constexpr mat44::mat44() : _00(1.f), _01(0.f), _02(0.f), _03(0.f) , _10(0.f), _11(1.f), _12(0.f), _13(0.f) , _20(0.f), _21(0.f), _22(1.f), _23(0.f) , _30(0.f), _31(0.f), _32(0.f), _33(1.f) {} constexpr mat44::mat44( float _11, float _12, float _13, float _14, float _21, float _22, float _23, float _24, float _31, float _32, float _33, float _34, float _41, float _42, float _43, float _44) : _00(_11), _01(_12), _02(_13), _03(_14) , _10(_21), _11(_22), _12(_23), _13(_24) , _20(_31), _21(_32), _22(_33), _23(_34) , _30(_41), _31(_42), _32(_43), _33(_44) {} constexpr mat44::mat44(const mat22& value) : _00(value._00), _01(value._01), _02(0.f), _03(0.f) , _10(value._10), _11(value._11), _12(0.f), _13(0.f) , _20(0.f), _21(0.f), _22(1.f), _23(0.f) , _30(0.f), _31(0.f), _32(0.f), _33(1.f) {} constexpr mat44::mat44(const mat33& value) : _00(value._00), _01(value._01), _02(value._02), _03(0.f) , _10(value._10), _11(value._11), _12(value._12), _13(0.f) , _20(value._20), _21(value._21), _22(value._22), _23(0.f) , _30(0.f), _31(0.f), _32(0.f), _33(1.f) {} constexpr mat44::mat44(const vec4& r0, const vec4& r1, const vec4& r2, const vec4& r3) : rows{ r0, r1, r2, r3 } {} constexpr mat44 mat44::operator+(const mat44& rhs) const { return { _00 + rhs._00, _01 + rhs._01, _02 + rhs._02, _03 + rhs._03, _10 + rhs._10, _11 + rhs._11, _12 + rhs._12, _13 + rhs._13, _20 + rhs._20, _21 + rhs._21, _22 + rhs._22, _23 + rhs._23, _30 + rhs._30, _31 + rhs._31, _32 + rhs._32, _33 + rhs._33}; } constexpr mat44 mat44::operator-(const mat44& rhs) const { return { _00 - rhs._00, _01 - rhs._01, _02 - rhs._02, _03 - rhs._03, _10 - rhs._10, _11 - rhs._11, _12 - rhs._12, _13 - rhs._13, _20 - rhs._20, _21 - rhs._21, _22 - rhs._22, _23 - rhs._23, _30 - rhs._30, _31 - rhs._31, _32 - rhs._32, _33 - rhs._33}; } constexpr mat44 mat44::operator*(const mat44& rhs) const { return { _00 * rhs._00 + _01 * rhs._10 + _02 * rhs._20 + _03 * rhs._30, _00 * rhs._01 + _01 * rhs._11 + _02 * rhs._21 + _03 * rhs._31, _00 * rhs._02 + _01 * rhs._12 + _02 * rhs._22 + _03 * rhs._32, _00 * rhs._03 + _01 * rhs._13 + _02 * rhs._23 + _03 * rhs._33, _10 * rhs._00 + _11 * rhs._10 + _12 * rhs._20 + _13 * rhs._30, _10 * rhs._01 + _11 * rhs._11 + _12 * rhs._21 + _13 * rhs._31, _10 * rhs._02 + _11 * rhs._12 + _12 * rhs._22 + _13 * rhs._32, _10 * rhs._03 + _11 * rhs._13 + _12 * rhs._23 + _13 * rhs._33, _20 * rhs._00 + _21 * rhs._10 + _22 * rhs._20 + _23 * rhs._30, _20 * rhs._01 + _21 * rhs._11 + _22 * rhs._21 + _23 * rhs._31, _20 * rhs._02 + _21 * rhs._12 + _22 * rhs._22 + _23 * rhs._32, _20 * rhs._03 + _21 * rhs._13 + _22 * rhs._23 + _23 * rhs._33, _30 * rhs._00 + _31 * rhs._10 + _32 * rhs._20 + _33 * rhs._30, _30 * rhs._01 + _31 * rhs._11 + _32 * rhs._21 + _33 * rhs._31, _30 * rhs._02 + _31 * rhs._12 + _32 * rhs._22 + _33 * rhs._32, _30 * rhs._03 + _31 * rhs._13 + _32 * rhs._23 + _33 * rhs._33}; } constexpr mat44 operator*(float lhs, const mat44& rhs) { return rhs * lhs; } constexpr mat44 mat44::operator*(float rhs) const { return { _00 * rhs, _01 * rhs, _02 * rhs, _03 * rhs, _10 * rhs, _11 * rhs, _12 * rhs, _13 * rhs, _20 * rhs, _21 * rhs, _22 * rhs, _23 * rhs, _30 * rhs, _31 * rhs, _32 * rhs, _33 * rhs}; } constexpr vec3 operator*(const vec3& lhs, const mat44& rhs) { return rhs * lhs; } constexpr vec3 mat44::operator*(const vec3& rhs) const { return { _00 * rhs.x + _01 * rhs.y + _02 * rhs.z, _10 * rhs.x + _11 * rhs.y + _12 * rhs.z, _20 * rhs.x + _21 * rhs.y + _22 * rhs.z}; } constexpr vec4 operator*(const vec4& lhs, const mat44& rhs) { return rhs * lhs; } constexpr vec4 mat44::operator*(const vec4& rhs) const { return { _00 * rhs.x + _01 * rhs.y + _02 * rhs.z + _03 * rhs.w, _10 * rhs.x + _11 * rhs.y + _12 * rhs.z + _13 * rhs.w, _20 * rhs.x + _21 * rhs.y + _22 * rhs.z + _23 * rhs.w, _30 * rhs.x + _31 * rhs.y + _32 * rhs.z + _33 * rhs.w}; } constexpr bool mat44::operator==(const mat44& value) const { return _00 == value._00 && _01 == value._01 && _02 == value._02 && _03 == value._03 && _10 == value._10 && _11 == value._11 && _12 == value._12 && _13 == value._13 && _20 == value._20 && _21 == value._21 && _22 == value._22 && _23 == value._23 && _30 == value._30 && _31 == value._31 && _32 == value._32 && _33 == value._33; } constexpr vec3 mat44::apply_point(const vec3& point) const { return { point.x * _00 + point.y * _10 + point.z * _20 + _30, point.x * _01 + point.y * _11 + point.z * _21 + _31, point.x * _02 + point.y * _12 + point.z * _22 + _32}; } constexpr vec3 mat44::apply_normal(const vec3& normal) const { return { normal.x * _00 + normal.y * _10 + normal.z * _20, normal.x * _01 + normal.y * _11 + normal.z * _21, normal.x * _02 + normal.y * _12 + normal.z * _22}; } inline const vec3& mat44::translation() const { return *reinterpret_cast<const vec3*>(rows + 3); } inline const vec3& mat44::apply_to_unit_axis(uint32_t axis) const { return *reinterpret_cast<const vec3*>(rows + axis); } inline void mat44::set_translation(const vec3& translation) { rows[3].x = translation.x; rows[3].y = translation.y; rows[3].z = translation.z; } constexpr float mat44::determinant() const { float det = _00 * (_11 * _22 - _12 * _21); det -= _01 * (_10 * _22 - _12 * _20); det += _02 * (_10 * _21 - _11 * _20); return det; } constexpr mat44 mat44::scale(const vec3& scale) { SL_ASSERT(scale.isfinite()); return { scale.x, 0.f, 0.f, 0.f, 0.f, scale.y, 0.f, 0.f, 0.f, 0.f, scale.z, 0.f, 0.f, 0.f, 0.f, 1.f}; } constexpr mat44 mat44::translate(const vec3& translation) { SL_ASSERT(translation.isfinite()); return { 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, 0.f, 0.f, 0.f, 1.f, 0.f, translation.x, translation.y, translation.z, 1.f}; } } // slope
37.992395
99
0.544135
muleax
fdbfcaefdb2578eaabdc55be0bc66ebf8c88e3cc
843
cpp
C++
1190.ReverseSubstringsBetweenEachPairofParentheses/main.cpp
SumanSudhir/LeetCode
cab5205747b8c1a9d5c27f0e821cf6e6d9ac10d6
[ "MIT" ]
1
2020-01-13T11:10:35.000Z
2020-01-13T11:10:35.000Z
1190.ReverseSubstringsBetweenEachPairofParentheses/main.cpp
SumanSudhir/LeetCode
cab5205747b8c1a9d5c27f0e821cf6e6d9ac10d6
[ "MIT" ]
4
2020-01-01T09:47:39.000Z
2020-04-08T08:34:29.000Z
1190.ReverseSubstringsBetweenEachPairofParentheses/main.cpp
SumanSudhir/LeetCode
cab5205747b8c1a9d5c27f0e821cf6e6d9ac10d6
[ "MIT" ]
null
null
null
class Solution { public: string reverseParentheses(string s) { string output; stack<int>index_open; int count = 0; char temp; for(int i=0;i<s.length();i++){ if(s[i] == '('){ index_open.push(i-count); count++; } else if(s[i] == ')'){ count++; int start = index_open.top(); index_open.pop(); int end = i - count; for(int i=start;i<(start + end + 1)/2;i++){ temp = output[i]; output[i] = output[end + start - i]; output[end + start - i] = temp; } } else{ output.push_back(s[i]); } } return output; } };
25.545455
59
0.368921
SumanSudhir
fdc0f6aaf42e6e98a3f1a3d040d240d8ffdba706
8,579
cpp
C++
Chapter10/v4l2qt/v4l2qt.cpp
valeriyvan/LinuxProgrammingWithRaspberryPi
7c57afcf2cbfc8e0486c78aa75b361fd712a136f
[ "MIT" ]
4
2020-03-11T13:38:25.000Z
2021-12-25T00:48:53.000Z
Chapter10/v4l2qt/v4l2qt.cpp
valeriyvan/LinuxProgrammingWithRaspberryPi
7c57afcf2cbfc8e0486c78aa75b361fd712a136f
[ "MIT" ]
null
null
null
Chapter10/v4l2qt/v4l2qt.cpp
valeriyvan/LinuxProgrammingWithRaspberryPi
7c57afcf2cbfc8e0486c78aa75b361fd712a136f
[ "MIT" ]
8
2020-07-10T22:02:05.000Z
2021-12-15T02:11:44.000Z
#include <stdio.h> #include <stdlib.h> #include <string.h> #include <fcntl.h> /* 저수준(Low level) I/O를 위해 사용 */ #include <errno.h> #include <unistd.h> #include <sys/mman.h> #include <sys/ioctl.h> #include <linux/fb.h> #include <linux/videodev2.h> /* Video4Linux2를 위한 헤더 파일 */ #define VIDEODEV "/dev/video0" /* Pi Camera를 위한 디바이스 파일 */ #define FBDEV "/dev/fb0" /* 프레임 버퍼를 위한 디바이스 파일 */ #define WIDTH 800 /* 캡처할 영상의 크기 */ #define HEIGHT 600 /* Video4Linux에서 사용할 영상을 저장하기 위한 버퍼를 위한 구조체 */ struct buffer { void* start; size_t length; }; static int fd = -1; /* Pi Camera의 디바이스의 파일 디스크립터 */ struct buffer *buffers = NULL; /* Pi Camera의 MMAP를 위한 변수 */ static int fbfd = -1; /* 프레임 버퍼의 파일 디스크립터 */ static unsigned char *fbp = NULL; /* 프레임 버퍼의 MMAP를 위한 변수 */ static struct fb_var_screeninfo vinfo; /* 프레임 버퍼의 정보 저장을 위한 구조체 */ static void processImage(const void *p); static int readFrame(); static void initRead(unsigned int buffer_size); static void initDevice() { struct v4l2_capability cap; /* 비디오 디바이스에 대한 기능을 조사한다. */ struct v4l2_format fmt; unsigned int min; /* v4l2_capability 구조체를 이용해서 V4L2를 지원하는지 조사 */ if(ioctl(fd, VIDIOC_QUERYCAP, &cap) < 0) { if(errno == EINVAL) { perror("/dev/video0 is no V4L2 device"); exit(EXIT_FAILURE); } else { perror("VIDIOC_QUERYCAP"); exit(EXIT_FAILURE); } } /* 카메라가 영상 캡처 기능이 있는지 조사한다. */ if(!(cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) { perror("/dev/video0 is no video capture device"); exit(EXIT_FAILURE); } /* v4l2_format 구조체를 이용해서 영상의 포맷 설정 */ //memset(&fmt, 0, sizeof(struct v4l2_format)); memset(&fmt, 0, sizeof(fmt)); fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; fmt.fmt.pix.width = WIDTH; fmt.fmt.pix.height = HEIGHT; fmt.fmt.pix.pixelformat = V4L2_PIX_FMT_YUYV; fmt.fmt.pix.field = V4L2_FIELD_NONE; /* 카메라 디바이스에 영상의 포맷을 설정 */ if(ioctl(fd, VIDIOC_S_FMT, &fmt) == -1) { perror("VIDIOC_S_FMT"); exit(EXIT_FAILURE); } /* 영상의 최소 크기를 구한다. */ min = fmt.fmt.pix.width * vinfo.bits_per_pixel/8; if(fmt.fmt.pix.bytesperline < min) fmt.fmt.pix.bytesperline = min; min = fmt.fmt.pix.bytesperline * fmt.fmt.pix.height; if(fmt.fmt.pix.sizeimage < min) fmt.fmt.pix.sizeimage = min; /* 영상 읽기를 위한 초기화 */ initRead(fmt.fmt.pix.sizeimage); } static void initRead(unsigned int buffer_size) { /* 카메라에서 사용하는 영상을 위한 메모리를 할당한다. */ buffers = (struct buffer*)calloc(1, sizeof(*buffers)); if(!buffers) { perror("Out of memory"); exit(EXIT_FAILURE); } /* 버퍼를 초기화한다. */ buffers[0].length = buffer_size; buffers[0].start = malloc(buffer_size); if(!buffers[0].start) { perror("Out of memory"); exit(EXIT_FAILURE); } } #define NO_OF_LOOP 1 static void mainloop() { unsigned int count = NO_OF_LOOP; while(count-- > 0) { /* 100회 반복 */ for(;;) { fd_set fds; struct timeval tv; /* select 함수의 대기시간을 위한 구조체 */ int r; /* fd_set 구조체를 초기화하고 비디오 디바이스를 파일 디스크립터를 설정한다. */ FD_ZERO(&fds); FD_SET(fd, &fds); /* 타임아웃을 2초로 설정한다. */ tv.tv_sec = 2; tv.tv_usec = 0; /* 비디오 데이터가 올 때까지 대기한다. */ r = select(fd + 1, &fds, NULL, NULL, &tv); switch(r) { case -1: /* select( ) 함수 에러 시의 처리 */ if(errno != EINTR) { perror("select()"); exit(EXIT_FAILURE); } break; case 0: /* 타임아웃 시의 처리 */ perror("select timeout"); exit(EXIT_FAILURE); break; }; if(readFrame()) break; /* 카메라에서 하나의 프레임을 읽고 화면에 표시 */ } } } static int readFrame() { /* 카메라에서 하나의 프레임을 읽어온다. */ if(::read(fd, buffers[0].start, buffers[0].length) < 0) { perror("read()"); exit(EXIT_FAILURE); } /* 읽어온 프레임을 색상 공간 등을 변경하고 화면에 출력한다. */ processImage(buffers[0].start); return 1; } /* unsigned char의 범위를 넘어가지 않도록 경계 검사를 수행한다. */ inline unsigned char clip(int value, int min, int max); unsigned char clip(int value, int min, int max) { return(value > max ? max : value < min ? min : value); } /* Qt에서 사용할 헤더 파일과 전역변수들을 정의한다. */ #include <QApplication> #include <QLabel> QApplication* app; QLabel* label; /* YUYV를 BGRA로 변환한다. */ static void processImage(const void *p) { int j, y; long location = 0; int width = WIDTH, height = HEIGHT; int istride = WIDTH*2; /* 이미지의 폭을 넘어가면 다음 라인으로 내려가도록 설정한다. */ unsigned char* in = (unsigned char*)p; int y0, u, y1, v, colors = vinfo.bits_per_pixel/8; unsigned char r, g, b, a = 0xff; unsigned char* data = (unsigned char*)malloc(width*height*3*sizeof(unsigned char)); for(y = 0; y < height; y++, in += istride) { for(j = 0; j < vinfo.xres*2; j += colors) { if(j >= width*2) { /* 현재의 화면에서 이미지를 넘어서는 남은 공간을 처리한다. */ // location += colors*2; continue; } /* YUYV 성분을 분리한다. */ y0 = in[j]; u = in[j + 1] - 128; y1 = in[j + 2]; v = in[j + 3] - 128; /* YUV를 RBGA로 전환한다. */ r = clip((298 * y0 + 409 * v + 128) >> 8, 0, 255); g = clip((298 * y0 - 100 * u - 208 * v + 128) >> 8, 0, 255); b = clip((298 * y0 + 516 * u + 128) >> 8, 0, 255); #if 1 data[location++] = r; data[location++] = g; data[location++] = b; #else fbp[location++] = b; fbp[location++] = g; fbp[location++] = r; fbp[location++] = a; #endif /* YUV를 RBGA로 전환: Y1 */ r = clip((298 * y1 + 409 * v + 128) >> 8, 0, 255); g = clip((298 * y1 - 100 * u - 208 * v + 128) >> 8, 0, 255); b = clip((298 * y1 + 516 * u + 128) >> 8, 0, 255); #if 1 data[location++] = r; data[location++] = g; data[location++] = b; #else fbp[location++] = b; fbp[location++] = g; fbp[location++] = r; fbp[location++] = a; #endif } } #if 0 label->setPixmap(QPixmap::fromImage(QImage(data, width, height, QImage::Format_RGB888))); #else QPixmap pixmap = QPixmap(width, height); pixmap = QPixmap::fromImage(QImage(data, width, height, QImage::Format_RGB888)); pixmap.save("sample.bmp"); label->setPixmap(pixmap); #endif free(data); } static void uninitDevice() { long screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8; /* 사용했던 메모리를 해제한다. */ free(buffers[0].start); free(buffers); munmap(fbp, screensize); } static void rgb2rgba(int width, int height, unsigned char *src, unsigned char *dst) { unsigned int x, y, p; for(y = 0; y < (unsigned int)height; y++) { for(x = 0; x < (unsigned int)width; x++) { for(p = 0; p < 3; p++) { dst[4*(y*width+x)+p] = src[3*(y*width+x)+p]; /* R, G, B 채널의 복사 */ } dst[4*(y*width+x)+3] = 0xFF; /* 알파 채널을 위한 설정 */ } } } int main(int argc, char **argv) { app = new QApplication(argc, argv); label = new QLabel(0); label->resize(WIDTH, HEIGHT); label->show(); long screensize = 0; /* 디바이스 열기 */ /* Pi Camera 열기 */ fd = open(VIDEODEV, O_RDWR | O_NONBLOCK, 0); if(fd == -1) { perror("open() : video devive"); return EXIT_FAILURE; } /* 프레임 버퍼 열기 */ fbfd = open(FBDEV, O_RDWR); if(fbfd == -1) { perror("open() : framebuffer device"); return EXIT_FAILURE; } /* 프레임 버퍼의 정보 가져오기 */ if(ioctl(fbfd, FBIOGET_VSCREENINFO, &vinfo) == -1) { perror("Error reading variable information."); exit(EXIT_FAILURE); } /* mmap(): 프레임 버퍼를 위한 메모리 공간 확보 */ screensize = vinfo.xres * vinfo.yres * vinfo.bits_per_pixel/8; fbp = (unsigned char *)mmap(NULL, screensize, PROT_READ | PROT_WRITE, MAP_SHARED, fbfd, 0); if((int)fbp == -1) { perror("mmap() : framebuffer device to memory"); return EXIT_FAILURE; } memset(fbp, 0, screensize); initDevice(); /* 디바이스 초기화 */ mainloop(); /* 캡처 실행 */ uninitDevice(); /* 디바이스 해제 */ /* 디바이스 닫기 */ close(fbfd); close(fd); return app->exec(); /* Qt의 이벤트 루프 시작 */ }
27.853896
95
0.532813
valeriyvan
fdc51be030c0ab76bd2c26a1669d6a87fe71b462
475
cpp
C++
aug-data/main/mini_main.cpp
kvathupo/Synthetic-Time-Series-Generator
ac133d2b0beff7f93f686742ce59401bc3cd1b90
[ "MIT" ]
null
null
null
aug-data/main/mini_main.cpp
kvathupo/Synthetic-Time-Series-Generator
ac133d2b0beff7f93f686742ce59401bc3cd1b90
[ "MIT" ]
null
null
null
aug-data/main/mini_main.cpp
kvathupo/Synthetic-Time-Series-Generator
ac133d2b0beff7f93f686742ce59401bc3cd1b90
[ "MIT" ]
null
null
null
#include <iostream> #include <string> #include <unordered_map> #include "augment.h" int main() { std::string dir_path, csv_path, first_letter; dir_path = "./Datasets/Daily/Train/"; first_letter = "D"; for (auto i = 146; i < 4227 + 1; i++) { // augmenting data csv_path = dir_path + first_letter + std::to_string(i) + ".csv"; aug::augment_data(csv_path); std::cout << "Done " << csv_path << std::endl; } return 0; }
22.619048
72
0.585263
kvathupo
fdc7b5ff3ee50b4ef3647fb3984e68f39c231a0a
2,647
cpp
C++
Infoarena/Domino.cpp
Fresher001/Competitive-Programming-2
e1e953bb1d4ade46cc670b2d0432f68504538ed2
[ "MIT" ]
86
2016-10-18T23:30:36.000Z
2022-01-09T21:57:34.000Z
Infoarena/Domino.cpp
Fresher001/Competitive-Programming-2
e1e953bb1d4ade46cc670b2d0432f68504538ed2
[ "MIT" ]
1
2018-04-13T09:38:36.000Z
2018-04-13T09:38:36.000Z
Infoarena/Domino.cpp
Fresher001/Competitive-Programming-2
e1e953bb1d4ade46cc670b2d0432f68504538ed2
[ "MIT" ]
39
2017-03-02T07:25:40.000Z
2020-12-14T12:13:50.000Z
#include <bits/stdc++.h> using namespace std; const int Nmax = 9 + 1; const int Mmax = 50000 + 1; const int NIL = -1; struct Edge { int nod; int urm; int indice; int rev; }; struct Node { int nod; int indice; int rev; }; struct Pair { int a, b; }; Edge G[2 * Mmax]; int head[Nmax]; int degree[Nmax]; int vis[Nmax]; Node stiva[Mmax + 1]; int top; int sizeCycle; Pair eulerPath[Mmax + 1]; int N, contor; void addEdge(int x, int y, int ind, int rev) { G[contor].nod = y; G[contor].urm = head[x]; G[contor].indice = ind; G[contor].rev = rev; head[x] = contor; degree[x]++; contor++; } void dfs(int nod) { vis[nod] = 1; for (int p = head[nod]; p != NIL; p = G[p].urm) { int son = G[p].nod; if ( !vis[son] ) dfs(son); } } bool isEulerian() { int nrComp = 0; for ( int i = 0; i <= 9; ++i ) if ( degree[i] != 0 && !vis[i] ) { nrComp++; dfs(i); } if ( nrComp > 1 ) return false; int nr = 0; for ( int i = 0; i <= 9; ++i ) if ( degree[i] % 2 ) nr++; if ( nr > 2 ) return false; return true; } int findRoot() { for ( int i = 0; i <= 9; ++i ) if ( degree[i] % 2 ) return i; for ( int i = 0; i <= 9; ++i ) if ( degree[i] ) return i; return -1; } void euler(int nod) { top = 1; stiva[1] = {nod, 0, 0}; while (top) { nod = stiva[top].nod; while ( head[nod] != NIL && G[ head[nod] ].nod == NIL ) head[nod] = G[ head[nod] ].urm; if ( head[nod] == NIL ) { sizeCycle++; eulerPath[sizeCycle] = { stiva[top].indice, stiva[top].rev }; top--; } else { stiva[ ++top ] = { G[ head[nod] ].nod, G[ head[nod] ].indice, G[ head[nod] ].rev }; G[ head[nod] ^ 1 ].nod = NIL; head[nod] = G[ head[nod] ].urm; } } } int main() { ifstream in("domino.in"); ofstream out("domino.out"); ios_base::sync_with_stdio(false); in >> N; for ( int i = 0; i <= 9; ++i ) head[i] = NIL; for ( int i = 1; i <= N; ++i ) { int a, b; in >> a >> b; addEdge(a, b, i, 0); addEdge(b, a, i, 1); } if ( isEulerian() == false ) out << "0\n"; else { out << "1\n"; euler(findRoot()); for ( int i = sizeCycle - 1; i >= 1; i-- ) out << eulerPath[i].a << " " << eulerPath[i].b << "\n"; } return 0; }
15.479532
95
0.427276
Fresher001
fdc7dee6709a22b6a3e784d089cf681c193115db
2,759
hpp
C++
llarp/util/thread/threading.hpp
Cipherwraith/loki-network
44e941d0b894ead3ca7d488fc3fb6f2d9b3a34ff
[ "Zlib" ]
1
2021-03-05T18:23:45.000Z
2021-03-05T18:23:45.000Z
llarp/util/thread/threading.hpp
gjyoung1974/loki-network
6559bb8f9e80095b4a7462ccb8fdf12e8ce19527
[ "Zlib" ]
null
null
null
llarp/util/thread/threading.hpp
gjyoung1974/loki-network
6559bb8f9e80095b4a7462ccb8fdf12e8ce19527
[ "Zlib" ]
null
null
null
#ifndef LLARP_THREADING_HPP #define LLARP_THREADING_HPP #include <absl/synchronization/barrier.h> #include <absl/synchronization/mutex.h> #include <absl/types/optional.h> #include <absl/time/time.h> #include <iostream> #include <thread> #if defined(WIN32) && !defined(__GNUC__) #include <process.h> using pid_t = int; #else #include <sys/types.h> #include <unistd.h> #endif namespace llarp { namespace util { /// a mutex that does nothing struct LOCKABLE NullMutex { #ifdef LOKINET_DEBUG mutable absl::optional< std::thread::id > m_id; void lock() const { if(!m_id) { m_id.emplace(std::this_thread::get_id()); } else if(m_id.value() != std::this_thread::get_id()) { std::cerr << "NullMutex " << this << " was locked by " << std::this_thread::get_id() << " and was previously locked by " << m_id.value() << "\n"; std::abort(); } } #else void lock() const { } #endif }; /// a lock that does nothing struct SCOPED_LOCKABLE NullLock { NullLock(ABSL_ATTRIBUTE_UNUSED const NullMutex* mtx) EXCLUSIVE_LOCK_FUNCTION(mtx) { mtx->lock(); } ~NullLock() UNLOCK_FUNCTION() { (void)this; // trick clang-tidy } }; using Mutex = absl::Mutex; using Lock = absl::MutexLock; using ReleasableLock = absl::ReleasableMutexLock; using Condition = absl::CondVar; class Semaphore { private: Mutex m_mutex; // protects m_count size_t m_count GUARDED_BY(m_mutex); bool ready() const SHARED_LOCKS_REQUIRED(m_mutex) { return m_count > 0; } public: Semaphore(size_t count) : m_count(count) { } void notify() LOCKS_EXCLUDED(m_mutex) { Lock lock(&m_mutex); m_count++; } void wait() LOCKS_EXCLUDED(m_mutex) { Lock lock(&m_mutex); m_mutex.Await(absl::Condition(this, &Semaphore::ready)); m_count--; } bool waitFor(absl::Duration timeout) LOCKS_EXCLUDED(m_mutex) { Lock lock(&m_mutex); if(!m_mutex.AwaitWithTimeout(absl::Condition(this, &Semaphore::ready), timeout)) { return false; } m_count--; return true; } }; using Barrier = absl::Barrier; void SetThreadName(const std::string& name); inline pid_t GetPid() { #ifdef WIN32 return _getpid(); #else return ::getpid(); #endif } } // namespace util } // namespace llarp #endif
19.848921
80
0.549474
Cipherwraith
fdc9fdb54aefa4c0ae7c9f63fdae08d58e491926
1,577
cpp
C++
src/Bluetooth/BtPacket.cpp
juliencombattelli/Hexapode
d240efa3c1ebbb0287f18d3380d5c2ad19d7ecc9
[ "MIT" ]
2
2018-10-25T07:09:36.000Z
2020-09-11T12:30:52.000Z
src/Bluetooth/BtPacket.cpp
juliencombattelli/Hexapode
d240efa3c1ebbb0287f18d3380d5c2ad19d7ecc9
[ "MIT" ]
2
2018-03-20T13:03:19.000Z
2018-03-25T12:29:05.000Z
src/Bluetooth/BtPacket.cpp
OpenPode/OpenPode
d240efa3c1ebbb0287f18d3380d5c2ad19d7ecc9
[ "MIT" ]
null
null
null
//============================================================================ // Name : BtPacket.cpp // Author : Julien Combattelli // EMail : julien.combattelli@hotmail.com // Date : 29 avr. 2017 // Version : 1.0.0 // Copyright : This file is part of MUL project which is released under // MIT license. See file LICENSE.txt for full license details // Description : //============================================================================ #include "BtPacket.h" namespace bt { Packet::Packet() : byteSent(0), byteRead(0) { m_data.resize(sizeof(std::size_t)); } void Packet::clear() { byteSent = 0; byteRead = 0; m_data.clear(); m_data.resize(sizeof(std::size_t)); } void Packet::append(const void* data, std::size_t sizeInBytes) { m_data.insert(m_data.end(), (char*)data, (char*)data+sizeInBytes); updatePayloadSizeField(); } void Packet::append(const std::string& str) { append(str.c_str(), str.size()); } void* Packet::data() { return m_data.data(); } size_t Packet::size() const { return m_data.size(); } void* Packet::payload() { return &m_data[sizeof(size_t)]; } size_t Packet::payloadSize() const { return m_data.size() - sizeof(size_t); } void Packet::updatePayloadSizeField() { size_t sz = payloadSize(); std::copy((char*)&sz, ((char*)&sz) + sizeof(size_t), m_data.begin()); } std::string Packet::toString() { return {m_data.begin() + sizeof(size_t), m_data.end()}; } std::vector<uint8_t> Packet::toByteArray() { return {m_data.begin() + sizeof(size_t), m_data.end()}; } } // namespace bt
19.962025
78
0.592898
juliencombattelli
fdcc7a0463811b55dc5b77e8a95fbf1861150cde
1,921
cpp
C++
Engine/source/ts/loader/appNode.cpp
fr1tz/alux3d
249a3b51751ce3184d52879b481f83eabe89e7e3
[ "MIT" ]
46
2015-01-05T17:34:43.000Z
2022-01-04T04:03:09.000Z
Engine/source/ts/loader/appNode.cpp
fr1tz/alux3d
249a3b51751ce3184d52879b481f83eabe89e7e3
[ "MIT" ]
10
2015-01-20T23:14:46.000Z
2019-04-05T22:04:15.000Z
Engine/source/ts/loader/appNode.cpp
fr1tz/terminal-overload
85f0689a40022e5eb7e54dcb6ddfb5ddd82a0a60
[ "CC-BY-4.0" ]
9
2015-08-08T18:46:06.000Z
2021-02-01T13:53:20.000Z
// Copyright information can be found in the file named COPYING // located in the root directory of this distribution. #include "ts/loader/appNode.h" AppNode::AppNode() { mName = NULL; mParentName = NULL; } AppNode::~AppNode() { dFree( mName ); dFree( mParentName ); // delete children and meshes for (S32 i = 0; i < mChildNodes.size(); i++) delete mChildNodes[i]; for (S32 i = 0; i < mMeshes.size(); i++) delete mMeshes[i]; } S32 AppNode::getNumMesh() { if (mMeshes.size() == 0) buildMeshList(); return mMeshes.size(); } AppMesh* AppNode::getMesh(S32 idx) { return (idx < getNumMesh() && idx >= 0) ? mMeshes[idx] : NULL; } S32 AppNode::getNumChildNodes() { if (mChildNodes.size() == 0) buildChildList(); return mChildNodes.size(); } AppNode * AppNode::getChildNode(S32 idx) { return (idx < getNumChildNodes() && idx >= 0) ? mChildNodes[idx] : NULL; } bool AppNode::isBillboard() { return !dStrnicmp(getName(),"BB::",4) || !dStrnicmp(getName(),"BB_",3) || isBillboardZAxis(); } bool AppNode::isBillboardZAxis() { return !dStrnicmp(getName(),"BBZ::",5) || !dStrnicmp(getName(),"BBZ_",4); } bool AppNode::isDummy() { // naming convention should work well enough... // ...but can override this method if one wants more return !dStrnicmp(getName(), "dummy", 5); } bool AppNode::isBounds() { // naming convention should work well enough... // ...but can override this method if one wants more return !dStricmp(getName(), "bounds"); } bool AppNode::isSequence() { // naming convention should work well enough... // ...but can override this method if one wants more return !dStrnicmp(getName(), "Sequence", 8); } bool AppNode::isRoot() { // we assume root node isn't added, so this is never true // but allow for possibility (by overriding this method) // so that isParentRoot still works. return false; }
22.337209
96
0.649141
fr1tz
fdcdd1da538748afb3cf71fe7960af802504528e
3,723
cpp
C++
code/szen/src/System/SpriteBatch.cpp
Sonaza/scyori
a894a9c7bd45a68ea1b6ff14877cdbe47ddd39cf
[ "BSD-3-Clause" ]
null
null
null
code/szen/src/System/SpriteBatch.cpp
Sonaza/scyori
a894a9c7bd45a68ea1b6ff14877cdbe47ddd39cf
[ "BSD-3-Clause" ]
null
null
null
code/szen/src/System/SpriteBatch.cpp
Sonaza/scyori
a894a9c7bd45a68ea1b6ff14877cdbe47ddd39cf
[ "BSD-3-Clause" ]
null
null
null
#include <szen/System/SpriteBatch.hpp> #include <szen/System/Assets/TextureAsset.hpp> #include <szen/System/Assets/ShaderAsset.hpp> #include <thor/Particles.hpp> using namespace sz; BatchDataList SpriteBatch::m_batchData; //////////////////////////////////////////////////// SpriteBatch::SpriteBatch() { } //////////////////////////////////////////////////// SpriteBatch::~SpriteBatch() { } //////////////////////////////////////////////////// BatchData::BatchData(size_t layer, const sf::Texture* texture, const sf::Shader* shader, sf::BlendMode blendmode) : layer (layer), texture (texture), shader (shader), particles (NULL), blendmode (blendmode), type (Vertices) { } //////////////////////////////////////////////////// BatchData::BatchData(size_t layer, thor::ParticleSystem* system, const sf::Shader* shader, sf::BlendMode blendmode) : layer (layer), texture (NULL), shader (shader), particles (system), blendmode (blendmode), type (Particles) { } //////////////////////////////////////////////////// BatchData::BatchData(size_t layer, sf::Text* text, sf::BlendMode blendmode) : layer (layer), texture (NULL), shader (NULL), particles (NULL), text (sf::Text(*text)), blendmode (blendmode), type (Text) { } //////////////////////////////////////////////////// void SpriteBatch::init() { m_batchData.reserve(100); } //////////////////////////////////////////////////// void SpriteBatch::clear() { m_batchData.clear(); } //////////////////////////////////////////////////// void SpriteBatch::append(const sf::Vertex* quad, sf::Uint32 layer, const sf::Texture* textureasset, ShaderAsset* shaderasset, sf::BlendMode blendmode) { const sf::Texture* texture = textureasset != NULL ? textureasset : NULL; const sf::Shader* shader = shaderasset != NULL ? shaderasset->getAsset() : NULL; BatchDataList::iterator data = std::find_if(m_batchData.begin(), m_batchData.end(), [&](BatchData& d) { return d.particles == NULL && d.layer == layer && d.texture == texture && d.shader == shader && d.blendmode == blendmode; }); if(data != m_batchData.end()) { BatchData* d = &*data; d->vertices.append(quad[0]); d->vertices.append(quad[1]); d->vertices.append(quad[2]); d->vertices.append(quad[3]); } else { BatchData d(layer, texture, shader, blendmode); d.vertices.setPrimitiveType(sf::Quads); d.vertices.append(quad[0]); d.vertices.append(quad[1]); d.vertices.append(quad[2]); d.vertices.append(quad[3]); m_batchData.push_back(d); } } //////////////////////////////////////////////////// void SpriteBatch::append(thor::ParticleSystem* system, sf::Uint32 layer, ShaderAsset* shader, sf::BlendMode blendmode) { m_batchData.push_back( BatchData(layer, system, shader ? shader->getAsset() : NULL, blendmode) ); } //////////////////////////////////////////////////// void SpriteBatch::append(sf::Text* text, sf::Uint32 layer, sf::BlendMode blendmode) { m_batchData.push_back( BatchData(layer, text, blendmode) ); } //////////////////////////////////////////////////// void SpriteBatch::draw(sf::RenderTarget& target) { for(BatchDataList::iterator it = m_batchData.begin(); it != m_batchData.end(); ++it) { //BatchData* data = &it->second; BatchData* data = &*it; sf::RenderStates states; if(data->texture) states.texture = data->texture; if(data->shader) states.shader = data->shader; states.blendMode = data->blendmode; //states.blendMode = sf::BlendAlpha; switch(data->type) { case BatchData::Vertices: target.draw(data->vertices, states); break; case BatchData::Particles: target.draw(*data->particles, states); break; case BatchData::Text: target.draw(data->text, states); break; } } }
25.5
150
0.586086
Sonaza
fdcea0c0a1f6dd691f8e293c6407b22a928664ed
10,990
cpp
C++
jack/common/JackTransportEngine.cpp
KimJeongYeon/jack2_android
4a8787be4306558cb52e5379466c0ed4cc67e788
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
47
2015-01-04T21:47:07.000Z
2022-03-23T16:27:16.000Z
jack/common/JackTransportEngine.cpp
KimJeongYeon/jack2_android
4a8787be4306558cb52e5379466c0ed4cc67e788
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
3
2015-02-04T21:40:11.000Z
2019-09-16T19:53:51.000Z
jack/common/JackTransportEngine.cpp
KimJeongYeon/jack2_android
4a8787be4306558cb52e5379466c0ed4cc67e788
[ "BSD-3-Clause-No-Nuclear-Warranty" ]
7
2015-05-17T08:22:52.000Z
2021-08-07T22:36:17.000Z
/* Copyright (C) 2001 Paul Davis Copyright (C) 2004-2008 Grame This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include "JackTransportEngine.h" #include "JackClientInterface.h" #include "JackClientControl.h" #include "JackEngineControl.h" #include "JackGlobals.h" #include "JackError.h" #include "JackTime.h" #include <assert.h> #include <math.h> #include <stdlib.h> using namespace std; namespace Jack { JackTransportEngine::JackTransportEngine(): JackAtomicArrayState<jack_position_t>() { fTransportState = JackTransportStopped; fTransportCmd = fPreviousCmd = TransportCommandStop; fSyncTimeout = 10000000; /* 10 seconds default... in case of big netjack1 roundtrip */ fSyncTimeLeft = 0; fTimeBaseMaster = -1; fWriteCounter = 0; fConditionnal = false; fPendingPos = false; fNetworkSync = false; } // compute the number of cycle for timeout void JackTransportEngine::SyncTimeout(jack_nframes_t frame_rate, jack_nframes_t buffer_size) { long buf_usecs = (long)((buffer_size * (jack_time_t)1000000) / frame_rate); fSyncTimeLeft = fSyncTimeout / buf_usecs; jack_log("SyncTimeout fSyncTimeout = %ld fSyncTimeLeft = %ld", (long)fSyncTimeout, (long)fSyncTimeLeft); } // Server int JackTransportEngine::ResetTimebase(int refnum) { if (fTimeBaseMaster == refnum) { jack_position_t* request = WriteNextStateStart(2); // To check request->valid = (jack_position_bits_t)0; WriteNextStateStop(2); fTimeBaseMaster = -1; return 0; } else { return EINVAL; } } // Server int JackTransportEngine::SetTimebaseMaster(int refnum, bool conditionnal) { if (conditionnal && fTimeBaseMaster > 0) { if (refnum != fTimeBaseMaster) { jack_log("conditional timebase for ref = %ld failed: %ld is already the master", refnum, fTimeBaseMaster); return EBUSY; } else { jack_log("ref = %ld was already timebase master", refnum); return 0; } } else { fTimeBaseMaster = refnum; fConditionnal = conditionnal; jack_log("new timebase master: ref = %ld", refnum); return 0; } } // RT bool JackTransportEngine::CheckAllRolling(JackClientInterface** table) { for (int i = GetEngineControl()->fDriverNum; i < CLIENT_NUM; i++) { JackClientInterface* client = table[i]; if (client && client->GetClientControl()->fTransportState != JackTransportRolling) { jack_log("CheckAllRolling ref = %ld is not rolling", i); return false; } } jack_log("CheckAllRolling"); return true; } // RT void JackTransportEngine::MakeAllStartingLocating(JackClientInterface** table) { for (int i = GetEngineControl()->fDriverNum; i < CLIENT_NUM; i++) { JackClientInterface* client = table[i]; if (client) { JackClientControl* control = client->GetClientControl(); // Inactive clients don't have their process function called at all, so they must appear as already "rolling" for the transport.... control->fTransportState = (control->fActive && control->fCallback[kRealTimeCallback]) ? JackTransportStarting : JackTransportRolling; control->fTransportSync = true; control->fTransportTimebase = true; jack_log("MakeAllStartingLocating ref = %ld", i); } } } // RT void JackTransportEngine::MakeAllStopping(JackClientInterface** table) { for (int i = GetEngineControl()->fDriverNum; i < CLIENT_NUM; i++) { JackClientInterface* client = table[i]; if (client) { JackClientControl* control = client->GetClientControl(); control->fTransportState = JackTransportStopped; control->fTransportSync = false; control->fTransportTimebase = false; jack_log("MakeAllStopping ref = %ld", i); } } } // RT void JackTransportEngine::MakeAllLocating(JackClientInterface** table) { for (int i = GetEngineControl()->fDriverNum; i < CLIENT_NUM; i++) { JackClientInterface* client = table[i]; if (client) { JackClientControl* control = client->GetClientControl(); control->fTransportState = JackTransportStopped; control->fTransportSync = true; control->fTransportTimebase = true; jack_log("MakeAllLocating ref = %ld", i); } } } // RT void JackTransportEngine::CycleBegin(jack_nframes_t frame_rate, jack_time_t time) { jack_position_t* pending = WriteNextStateStart(1); // Update "pending" state pending->usecs = time; pending->frame_rate = frame_rate; WriteNextStateStop(1); } // RT void JackTransportEngine::CycleEnd(JackClientInterface** table, jack_nframes_t frame_rate, jack_nframes_t buffer_size) { TrySwitchState(1); // Switch from "pending" to "current", it always works since there is always a pending state /* Handle any new transport command from the last cycle. */ transport_command_t cmd = fTransportCmd; if (cmd != fPreviousCmd) { fPreviousCmd = cmd; jack_log("transport command: %s", (cmd == TransportCommandStart ? "Transport start" : "Transport stop")); } else { cmd = TransportCommandNone; } /* state transition switch */ switch (fTransportState) { case JackTransportStopped: // Set a JackTransportStarting for the current cycle, if all clients are ready (no slow_sync) ==> JackTransportRolling next state if (cmd == TransportCommandStart) { jack_log("transport stopped ==> starting frame = %d", ReadCurrentState()->frame); fTransportState = JackTransportStarting; MakeAllStartingLocating(table); SyncTimeout(frame_rate, buffer_size); } else if (fPendingPos) { jack_log("transport stopped ==> stopped (locating) frame = %d", ReadCurrentState()->frame); MakeAllLocating(table); } break; case JackTransportStarting: if (cmd == TransportCommandStop) { jack_log("transport starting ==> stopped frame = %d", ReadCurrentState()->frame); fTransportState = JackTransportStopped; MakeAllStopping(table); } else if (fPendingPos) { jack_log("transport starting ==> starting frame = %d"), ReadCurrentState()->frame; fTransportState = JackTransportStarting; MakeAllStartingLocating(table); SyncTimeout(frame_rate, buffer_size); } else if (--fSyncTimeLeft == 0 || CheckAllRolling(table)) { // Slow clients may still catch up if (fNetworkSync) { jack_log("transport starting ==> netstarting frame = %d"); fTransportState = JackTransportNetStarting; } else { jack_log("transport starting ==> rolling fSyncTimeLeft = %ld", fSyncTimeLeft); fTransportState = JackTransportRolling; } } break; case JackTransportRolling: if (cmd == TransportCommandStop) { jack_log("transport rolling ==> stopped"); fTransportState = JackTransportStopped; MakeAllStopping(table); } else if (fPendingPos) { jack_log("transport rolling ==> starting"); fTransportState = JackTransportStarting; MakeAllStartingLocating(table); SyncTimeout(frame_rate, buffer_size); } break; case JackTransportNetStarting: break; default: jack_error("Invalid JACK transport state: %d", fTransportState); } /* Update timebase, if needed. */ if (fTransportState == JackTransportRolling) { jack_position_t* pending = WriteNextStateStart(1); // Update "pending" state pending->frame += buffer_size; WriteNextStateStop(1); } /* See if an asynchronous position request arrived during the last cycle. */ jack_position_t* request = WriteNextStateStart(2, &fPendingPos); if (fPendingPos) { jack_log("New pos = %ld", request->frame); jack_position_t* pending = WriteNextStateStart(1); CopyPosition(request, pending); WriteNextStateStop(1); } } // Client void JackTransportEngine::ReadCurrentPos(jack_position_t* pos) { UInt16 next_index = GetCurrentIndex(); UInt16 cur_index; do { cur_index = next_index; memcpy(pos, ReadCurrentState(), sizeof(jack_position_t)); next_index = GetCurrentIndex(); } while (cur_index != next_index); // Until a coherent state has been read } void JackTransportEngine::RequestNewPos(jack_position_t* pos) { jack_position_t* request = WriteNextStateStart(2); pos->unique_1 = pos->unique_2 = GenerateUniqueID(); CopyPosition(pos, request); jack_log("RequestNewPos pos = %ld", pos->frame); WriteNextStateStop(2); } jack_transport_state_t JackTransportEngine::Query(jack_position_t* pos) { if (pos) ReadCurrentPos(pos); return GetState(); } jack_nframes_t JackTransportEngine::GetCurrentFrame() { jack_position_t pos; ReadCurrentPos(&pos); if (fTransportState == JackTransportRolling) { float usecs = GetMicroSeconds() - pos.usecs; jack_nframes_t elapsed = (jack_nframes_t)floor((((float) pos.frame_rate) / 1000000.0f) * usecs); return pos.frame + elapsed; } else { return pos.frame; } } // RT, client void JackTransportEngine::CopyPosition(jack_position_t* from, jack_position_t* to) { int tries = 0; long timeout = 1000; do { /* throttle the busy wait if we don't get the answer * very quickly. See comment above about this * design. */ if (tries > 10) { JackSleep(20); tries = 0; /* debug code to avoid system hangs... */ if (--timeout == 0) { jack_error("hung in loop copying position B"); abort(); } } *to = *from; tries++; } while (to->unique_1 != to->unique_2); } } // end of namespace
34.34375
146
0.640673
KimJeongYeon
fdcf3d399da1a78d1940530acc33237666850875
686
hpp
C++
src/common/interfaces/views/itoplevelview.hpp
squeevee/Addle
20ec4335669fbd88d36742f586899d8416920959
[ "MIT" ]
3
2020-03-05T06:36:51.000Z
2020-06-20T03:25:02.000Z
src/common/interfaces/views/itoplevelview.hpp
squeevee/Addle
20ec4335669fbd88d36742f586899d8416920959
[ "MIT" ]
13
2020-03-11T17:43:42.000Z
2020-12-11T03:36:05.000Z
src/common/interfaces/views/itoplevelview.hpp
squeevee/Addle
20ec4335669fbd88d36742f586899d8416920959
[ "MIT" ]
1
2020-09-28T06:53:46.000Z
2020-09-28T06:53:46.000Z
/** * Addle source code * @file * @copyright Copyright 2020 Eleanor Hawk * @copyright Modification and distribution permitted under the terms of the * MIT License. See "LICENSE" for full details. */ #ifndef ITOPLEVELVIEW_HPP #define ITOPLEVELVIEW_HPP #include "interfaces/traits.hpp" #include "interfaces/iamqobject.hpp" namespace Addle { class ITopLevelView : public virtual IAmQObject { public: virtual ~ITopLevelView() = default; public slots: virtual void show() = 0; virtual void close() = 0; signals: virtual void closed() = 0; }; } // namespace Addle Q_DECLARE_INTERFACE(Addle::ITopLevelView, "org.addle.ITopLevelView") #endif // ITOPLEVELVIEW_HPP
19.6
76
0.731778
squeevee
fdcf8e556d2283a11ab0938f33def374734f62d3
251
cpp
C++
Ejercicio_Ciclos/ejercicio1.cpp
memo0p2/Programas-cpp
f78f283886e478be12b3636992dbf922199ae5f1
[ "MIT" ]
null
null
null
Ejercicio_Ciclos/ejercicio1.cpp
memo0p2/Programas-cpp
f78f283886e478be12b3636992dbf922199ae5f1
[ "MIT" ]
null
null
null
Ejercicio_Ciclos/ejercicio1.cpp
memo0p2/Programas-cpp
f78f283886e478be12b3636992dbf922199ae5f1
[ "MIT" ]
null
null
null
#include<iostream> using namespace std; int main(){ float num,suma; num=0; suma=0; do{ cout<<"Ingrese un numero"<<endl; cin>>num; if(num>=0) suma=suma+num; }while(num>=0); cout<<"La suma total es de: "<<suma; return 0; }
15.6875
38
0.585657
memo0p2
fdd1e443a28ba5d48a2f05168948fa9c7aad94d7
1,005
cpp
C++
source/data_model/hdf5/src/issues.cpp
OliverSchmitz/lue
da097e8c1de30724bfe7667cc04344b6535b40cd
[ "MIT" ]
2
2021-02-26T22:45:56.000Z
2021-05-02T10:28:48.000Z
source/data_model/hdf5/src/issues.cpp
OliverSchmitz/lue
da097e8c1de30724bfe7667cc04344b6535b40cd
[ "MIT" ]
262
2016-08-11T10:12:02.000Z
2020-10-13T18:09:16.000Z
source/data_model/hdf5/src/issues.cpp
computationalgeography/lue
71993169bae67a9863d7bd7646d207405dc6f767
[ "MIT" ]
1
2020-03-11T09:49:41.000Z
2020-03-11T09:49:41.000Z
#include "lue/hdf5/issues.hpp" namespace lue { namespace hdf5 { /*! @brief Return collection of errors */ Errors const& Issues::errors() const { return _errors; } /*! @brief Return collection of warnings */ Warnings const& Issues::warnings() const { return _warnings; } /*! @brief Add an issue to the collection of errors */ void Issues::add_error( Identifier const& id, std::string const& message) { _errors.emplace_back(Issue(id, message)); } /*! @brief Add an issue to the collection of warnings */ void Issues::add_warning( Identifier const& id, std::string const& message) { _warnings.emplace_back(Issue(id, message)); } /*! @brief Returns whether errors where found */ bool Issues::errors_found() const { return !_errors.empty(); } /*! @brief Returns whether warnings where found */ bool Issues::warnings_found() const { return !_warnings.empty(); } } // namespace hdf5 } // namespace lue
15.227273
58
0.645771
OliverSchmitz
fdd4fc8dee74bb8111412440a859a47925af6837
5,097
inl
C++
WildMagic4/LibFoundation/ComputationalGeometry/Wm4Query2Filtered.inl
rms80/libgeometry
e60ec7d34968573a9cda3f3bf56d2d4717385dc9
[ "BSL-1.0" ]
23
2015-08-13T07:36:00.000Z
2022-01-24T19:00:04.000Z
WildMagic4/LibFoundation/ComputationalGeometry/Wm4Query2Filtered.inl
rms80/libgeometry
e60ec7d34968573a9cda3f3bf56d2d4717385dc9
[ "BSL-1.0" ]
null
null
null
WildMagic4/LibFoundation/ComputationalGeometry/Wm4Query2Filtered.inl
rms80/libgeometry
e60ec7d34968573a9cda3f3bf56d2d4717385dc9
[ "BSL-1.0" ]
6
2015-07-06T21:37:31.000Z
2020-07-01T04:07:50.000Z
// Geometric Tools, LLC // Copyright (c) 1998-2010 // Distributed under the Boost Software License, Version 1.0. // http://www.boost.org/LICENSE_1_0.txt // http://www.geometrictools.com/License/Boost/LICENSE_1_0.txt // // File Version: 4.10.0 (2009/11/18) //---------------------------------------------------------------------------- template <class Real> Query2Filtered<Real>::Query2Filtered (int iVQuantity, const Vector2<Real>* akVertex, Real fUncertainty) : Query2<Real>(iVQuantity,akVertex), m_kRQuery(iVQuantity,akVertex) { assert((Real)0 <= fUncertainty && fUncertainty <= (Real)1); m_fUncertainty = fUncertainty; } //---------------------------------------------------------------------------- template <class Real> Query2Filtered<Real>::~Query2Filtered () { } //---------------------------------------------------------------------------- template <class Real> Query::Type Query2Filtered<Real>::GetType () const { return Query::QT_FILTERED; } //---------------------------------------------------------------------------- template <class Real> int Query2Filtered<Real>::ToLine (const Vector2<Real>& rkP, int iV0, int iV1) const { // Order the points so that ToLine(p,v0,v1) and ToLine(p,v1,v0) return // the same geometric result. bool bPositive = Sort(iV0,iV1); if (m_fUncertainty < (Real)1) { const Vector2<Real>& rkV0 = m_akVertex[iV0]; const Vector2<Real>& rkV1 = m_akVertex[iV1]; Real fX0 = rkP[0] - rkV0[0]; Real fY0 = rkP[1] - rkV0[1]; Real fX1 = rkV1[0] - rkV0[0]; Real fY1 = rkV1[1] - rkV0[1]; Real fDet2 = Det2(fX0,fY0,fX1,fY1); if (!bPositive) { fDet2 = -fDet2; } if (m_fUncertainty == (Real)0) { // Compute the sign test using floating-point arithmetic. return (fDet2 > (Real)0 ? +1 : (fDet2 < (Real)0 ? -1 : 0)); } // Use filtered predicates. Real fLen0 = Math<Real>::Sqrt(fX0*fX0 + fY0*fY0); Real fLen1 = Math<Real>::Sqrt(fX1*fX1 + fY1*fY1); Real fScaledUncertainty = m_fUncertainty*fLen0*fLen1; if (Math<Real>::FAbs(fDet2) >= fScaledUncertainty) { // The floating-point sign test is deemed to be certain. return (fDet2 > (Real)0 ? +1 : (fDet2 < (Real)0 ? -1 : 0)); } } // Compute the determinant using exact rational arithmetic. int iResult = m_kRQuery.ToLine(rkP,iV0,iV1); if (!bPositive) { iResult = -iResult; } return iResult; } //---------------------------------------------------------------------------- template <class Real> int Query2Filtered<Real>::ToCircumcircle (const Vector2<Real>& rkP, int iV0, int iV1, int iV2) const { // Order the points so that ToCircumcircle(p,v[i0],v[i1],v[i2]) returns // the same geometric result no matter which permutation (i0,i1,i2) of // (0,1,2) is used. bool bPositive = Sort(iV0,iV1,iV2); if (m_fUncertainty < (Real)1) { const Vector2<Real>& rkV0 = m_akVertex[iV0]; const Vector2<Real>& rkV1 = m_akVertex[iV1]; const Vector2<Real>& rkV2 = m_akVertex[iV2]; Real fS0x = rkV0[0] + rkP[0]; Real fD0x = rkV0[0] - rkP[0]; Real fS0y = rkV0[1] + rkP[1]; Real fD0y = rkV0[1] - rkP[1]; Real fS1x = rkV1[0] + rkP[0]; Real fD1x = rkV1[0] - rkP[0]; Real fS1y = rkV1[1] + rkP[1]; Real fD1y = rkV1[1] - rkP[1]; Real fS2x = rkV2[0] + rkP[0]; Real fD2x = rkV2[0] - rkP[0]; Real fS2y = rkV2[1] + rkP[1]; Real fD2y = rkV2[1] - rkP[1]; Real fZ0 = fS0x*fD0x + fS0y*fD0y; Real fZ1 = fS1x*fD1x + fS1y*fD1y; Real fZ2 = fS2x*fD2x + fS2y*fD2y; Real fDet3 = Det3(fD0x,fD0y,fZ0,fD1x,fD1y,fZ1,fD2x,fD2y,fZ2); if (!bPositive) { fDet3 = -fDet3; } if (m_fUncertainty == (Real)0) { // Compute the sign test using floating-point arithmetic. return (fDet3 > (Real)0 ? +1 : (fDet3 < (Real)0 ? -1 : 0)); } // Use filtered predicates. Real fLen0 = Math<Real>::Sqrt(fD0x*fD0x + fD0y*fD0y + fZ0*fZ0); Real fLen1 = Math<Real>::Sqrt(fD1x*fD1x + fD1y*fD1y + fZ1*fZ1); Real fLen2 = Math<Real>::Sqrt(fD2x*fD2x + fD2y*fD2y + fZ2*fZ2); Real fScaledUncertainty = m_fUncertainty*fLen0*fLen1*fLen2; if (Math<Real>::FAbs(fDet3) >= fScaledUncertainty) { // The floating-point sign test is deemed to be certain. return (fDet3 < (Real)0 ? 1 : (fDet3 > (Real)0 ? -1 : 0)); } } // Compute the determinant using exact rational arithmetic. int iResult = m_kRQuery.ToCircumcircle(rkP,iV0,iV1,iV2); if (!bPositive) { iResult = -iResult; } return iResult; } //----------------------------------------------------------------------------
35.395833
79
0.5103
rms80
fdd87f7c87c161db0d67467a35259c2bdea6cf86
925
hh
C++
zookeeper/server/auth/ProviderRegistry.hh
cxxjava/CxxZookeeper
149677c785627aff839b2102ab265c745882fa52
[ "Apache-2.0" ]
16
2018-03-05T02:42:00.000Z
2020-11-30T12:57:19.000Z
zookeeper/server/auth/ProviderRegistry.hh
cxxjava/CxxZookeeper
149677c785627aff839b2102ab265c745882fa52
[ "Apache-2.0" ]
1
2021-06-04T03:25:59.000Z
2021-08-06T13:54:28.000Z
zookeeper/server/auth/ProviderRegistry.hh
cxxjava/CxxZookeeper
149677c785627aff839b2102ab265c745882fa52
[ "Apache-2.0" ]
10
2018-03-18T14:33:09.000Z
2021-05-24T05:56:28.000Z
/* * ProviderRegistry.hh * * Created on: 2017-11-22 * Author: cxxjava@163.com */ #ifndef ProviderRegistry_HH_ #define ProviderRegistry_HH_ #include "Efc.hh" #include "ELog.hh" #include "./AuthenticationProvider.hh" namespace efc { namespace ezk { class ProviderRegistry { private: static sp<ELogger> LOG;// = LoggerFactory.getLogger(ProviderRegistry.class); static EHashMap<EString*, AuthenticationProvider*>* authenticationProviders; public: DECLARE_STATIC_INITZZ; static AuthenticationProvider* getProvider(EString scheme) { return authenticationProviders->get(&scheme); } static EString listProviders() { EString sb; auto iter = authenticationProviders->keySet()->iterator(); while (iter->hasNext()) { EString* s = iter->next(); sb.append(s); sb.append(" "); } return sb; } }; } /* namespace ezk */ } /* namespace efc */ #endif /* ProviderRegistry_HH_ */
19.680851
80
0.696216
cxxjava
fdd8dfe4845d9a3aae325122d7b588d638b2d73f
58,897
cpp
C++
Tests/ApiExplorer/APIs/apis_xblc_multiplayer_manager.cpp
natiskan/xbox-live-api
9e7e51e0863b5983c2aa334a7b0db579b3bdf1de
[ "MIT" ]
1
2021-08-14T15:37:15.000Z
2021-08-14T15:37:15.000Z
Tests/ApiExplorer/APIs/apis_xblc_multiplayer_manager.cpp
aspavlov/xbox-live-api
4bec6f92347d0ad6c85463b601821333de631e3a
[ "MIT" ]
null
null
null
Tests/ApiExplorer/APIs/apis_xblc_multiplayer_manager.cpp
aspavlov/xbox-live-api
4bec6f92347d0ad6c85463b601821333de631e3a
[ "MIT" ]
null
null
null
// Copyright (c) Microsoft Corporation // Licensed under the MIT license. See LICENSE file in the project root for full license information. #include "pch.h" #include <atomic> #if HC_PLATFORM_IS_MICROSOFT #pragma warning( push ) #pragma warning( disable : 4365 ) #pragma warning( disable : 4061 ) #pragma warning( disable : 4996 ) #endif #include "rapidjson/document.h" static std::thread s_doWorkThread{}; static std::atomic<bool> s_doWork{ false }; void CheckMemberFound(XblMultiplayerSessionType sessionType, uint64_t xuid) { size_t count{}; std::vector<XblMultiplayerManagerMember> members{}; if (sessionType == XblMultiplayerSessionType::LobbySession) { count = XblMultiplayerManagerLobbySessionMembersCount(); assert(count > 0); members = std::vector<XblMultiplayerManagerMember>(count); XblMultiplayerManagerLobbySessionMembers(count, members.data()); } else { count = XblMultiplayerManagerGameSessionMembersCount(); assert(count > 0); members = std::vector<XblMultiplayerManagerMember>(count); XblMultiplayerManagerGameSessionMembers(count, members.data()); } bool memberFound{ false }; for (auto member : members) { if (member.Xuid == xuid) { memberFound = true; break; } } assert(memberFound); } std::vector<XblMultiplayerManagerMember> GetSessionMembers(XblMultiplayerSessionType sessionType) { size_t count{}; std::vector<XblMultiplayerManagerMember> members{}; if (sessionType == XblMultiplayerSessionType::LobbySession) { count = XblMultiplayerManagerLobbySessionMembersCount(); members = std::vector<XblMultiplayerManagerMember>(count); if (count > 0) { XblMultiplayerManagerLobbySessionMembers(count, members.data()); } } else { count = XblMultiplayerManagerGameSessionMembersCount(); members = std::vector<XblMultiplayerManagerMember>(count); if (count > 0) { XblMultiplayerManagerGameSessionMembers(count, members.data()); } } return members; } HRESULT MultiplayerManagerDoWork() { // CODE SNIPPET START: XblMultiplayerManagerDoWork_C size_t eventCount{ 0 }; const XblMultiplayerEvent* events{ nullptr }; HRESULT hr = XblMultiplayerManagerDoWork(&events, &eventCount); if (FAILED(hr)) { // Handle failure return hr; // CODE SNIP SKIP } for (auto i = 0u; i < eventCount; ++i) { switch (events[i].EventType) { case XblMultiplayerEventType::MemberJoined: { // Handle MemberJoined size_t memberCount = 0; hr = XblMultiplayerEventArgsMembersCount(events[i].EventArgsHandle, &memberCount); assert(SUCCEEDED(hr)); std::vector<XblMultiplayerManagerMember> eventMembers(memberCount); hr = XblMultiplayerEventArgsMembers(events[i].EventArgsHandle, memberCount, eventMembers.data()); assert(SUCCEEDED(hr)); // DOTS auto sessionMembers{ GetSessionMembers(events[i].SessionType) }; assert(memberCount <= sessionMembers.size()); for (auto eventMember : eventMembers) { bool memberFound{ false }; for (auto sessionMember : sessionMembers) { if (eventMember.Xuid == sessionMember.Xuid) { memberFound = true; break; } } assert(memberFound); } LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::MemberJoined"); // CODE SNIP SKIP for (auto& member : eventMembers) { LogToScreen(" member %llu", static_cast<unsigned long long>(member.Xuid)); } CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_MemberJoined"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::SessionPropertyChanged: { // Handle SessionPropertyChanged const char* changedProperty{ nullptr }; hr = XblMultiplayerEventArgsPropertiesJson(events[i].EventArgsHandle, &changedProperty); assert(SUCCEEDED(hr)); // DOTS rapidjson::Document changedDoc; changedDoc.Parse(changedProperty); rapidjson::Document doc; if (events[i].SessionType == XblMultiplayerSessionType::LobbySession) { doc.Parse(XblMultiplayerManagerLobbySessionPropertiesJson()); } else { doc.Parse(XblMultiplayerManagerGameSessionPropertiesJson()); } for (auto& member : changedDoc.GetObject()) { assert(doc.HasMember(member.name)); assert(doc[member.name] == member.value); UNREFERENCED_PARAMETER(member); } // CODE SKIP START LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::SessionPropertyChanged"); // CODE SNIP SKIP if (events[i].SessionType == XblMultiplayerSessionType::GameSession) { CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_GameSessionPropertyChanged"); // CODE SNIP SKIP } else { CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_LobbySessionPropertyChanged"); // CODE SNIP SKIP } // CODE SKIP END break; } // DOTS // CODE SKIP START case XblMultiplayerEventType::UserAdded: { auto h = events[i].Result; if (SUCCEEDED(h)) { // Handle UserAdded uint64_t xuid = 0; hr = XblMultiplayerEventArgsXuid(events[i].EventArgsHandle, &xuid); assert(SUCCEEDED(hr)); CheckMemberFound(events[i].SessionType, xuid); LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::UserAdded. XUID: %llu", static_cast<unsigned long long>(xuid)); // CODE SNIP SKIP } CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_UserAdded"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::UserRemoved: { // Handle UserRemoved hr = events[i].Result == __HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND) ? S_OK : events[i].Result; if (SUCCEEDED(hr)) { uint64_t xuid = 0; hr = XblMultiplayerEventArgsXuid(events[i].EventArgsHandle, &xuid); assert(SUCCEEDED(hr)); auto members{ GetSessionMembers(events[i].SessionType) }; for (auto member : members) { assert(xuid != member.Xuid); } } LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::UserRemoved"); // CODE SNIP SKIP CallLuaFunctionWithHr(hr, "OnXblMultiplayerEventType_UserRemoved"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::JoinLobbyCompleted: { // Handle JoinLobbyCompleted uint64_t xuid = 0; hr = XblMultiplayerEventArgsXuid(events[i].EventArgsHandle, &xuid); assert(SUCCEEDED(hr)); if (SUCCEEDED(events[i].Result)) { CheckMemberFound(events[i].SessionType, xuid); hr = events[i].Result == __HRESULT_FROM_WIN32(ERROR_RESOURCE_DATA_NOT_FOUND) ? S_OK : events[i].Result; LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::JoinLobbyCompleted"); // CODE SNIP SKIP } CallLuaFunctionWithHr(hr, "OnXblMultiplayerEventType_JoinLobbyCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::JoinGameCompleted: { // Handle JoinGameCompleted LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::JoinGameCompleted"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_JoinGameCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::LeaveGameCompleted: { // Handle LeaveGameCompleted LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::LeaveGameCompleted"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_LeaveGameCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::LocalMemberPropertyWriteCompleted: { // Handle LocalMemberPropertyWriteCompleted LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::LocalMemberPropertyWriteCompleted"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_LocalMemberPropertyWriteCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::InviteSent: { // Handle InviteSent LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::InviteSent"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_InviteSent"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::MemberLeft: { // Handle MemberLeft size_t memberCount = 0; hr = XblMultiplayerEventArgsMembersCount(events[i].EventArgsHandle, &memberCount); assert(SUCCEEDED(hr)); assert(memberCount > 0); std::vector<XblMultiplayerManagerMember> members(memberCount); hr = XblMultiplayerEventArgsMembers(events[i].EventArgsHandle, memberCount, members.data()); assert(SUCCEEDED(hr)); auto sessionMembers{ GetSessionMembers(events[i].SessionType) }; for (auto remainingMember : sessionMembers) { for (auto member : members) { assert(member.Xuid != remainingMember.Xuid); } } LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::MemberLeft"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_MemberLeft"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::JoinabilityStateChanged: { // Handle JoinabilityStateChanged LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::JoinabilityStateChanged"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_JoinabilityStateChanged"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::HostChanged: { XblMultiplayerManagerMember member; hr = XblMultiplayerEventArgsMember(events[i].EventArgsHandle, &member); assert(SUCCEEDED(hr)); XblMultiplayerManagerMember host{}; XblMultiplayerManagerLobbySessionHost(&host); assert(member.Xuid == host.Xuid); LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::HostChanged"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_HostChanged"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::MemberPropertyChanged: { XblMultiplayerManagerMember member; hr = XblMultiplayerEventArgsMember(events[i].EventArgsHandle, &member); assert(SUCCEEDED(hr)); const char* propertiesJson = nullptr; hr = XblMultiplayerEventArgsPropertiesJson(events[i].EventArgsHandle, &propertiesJson); assert(SUCCEEDED(hr)); auto sessionMembers{ GetSessionMembers(events[i].SessionType) }; XblMultiplayerManagerMember sessionMember{}; for (size_t j = 0; j < sessionMembers.size(); ++j) { if (member.Xuid == sessionMembers[j].Xuid) { sessionMember = sessionMembers[j]; break; } } assert(sessionMember.Xuid == member.Xuid); assert(strcmp(sessionMember.PropertiesJson, member.PropertiesJson) == 0); LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::MemberPropertyChanged"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_MemberPropertyChanged"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::FindMatchCompleted: { XblMultiplayerMatchStatus matchStatus; XblMultiplayerMeasurementFailure initializationFailureCause; hr = XblMultiplayerEventArgsFindMatchCompleted(events[i].EventArgsHandle, &matchStatus, &initializationFailureCause); assert(SUCCEEDED(hr)); assert(initializationFailureCause == XblMultiplayerMeasurementFailure::None); assert(matchStatus == XblMultiplayerMatchStatus::Completed); assert(XblMultiplayerManagerMatchStatus() == matchStatus); LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::FindMatchCompleted"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_FindMatchCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::PerformQosMeasurements: { XblMultiplayerPerformQoSMeasurementsArgs performQoSMeasurementsArgs; hr = XblMultiplayerEventArgsPerformQoSMeasurements(events[i].EventArgsHandle, &performQoSMeasurementsArgs); assert(SUCCEEDED(hr)); auto sessionMembers{ GetSessionMembers(events[i].SessionType) }; assert(performQoSMeasurementsArgs.remoteClientsSize == sessionMembers.size() - 1); for (size_t j = 0; j < performQoSMeasurementsArgs.remoteClientsSize; ++j) { bool clientFound{ false }; for (size_t k = 0; k < sessionMembers.size(); ++k) { if (strcmp(sessionMembers[k].ConnectionAddress, performQoSMeasurementsArgs.remoteClients[j].connectionAddress) == 0) { clientFound = true; assert(strcmp(sessionMembers[k].DeviceToken, performQoSMeasurementsArgs.remoteClients[j].deviceToken.Value) == 0); } } assert(clientFound); } LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::PerformQosMeasurements"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_PerformQosMeasurements"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::LocalMemberConnectionAddressWriteCompleted: { LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::LocalMemberConnectionAddressWriteCompleted"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_LocalMemberConnectionAddressWriteCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::SessionPropertyWriteCompleted: { LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::SessionPropertyWriteCompleted"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_SessionPropertyWriteCompleted"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::SessionSynchronizedPropertyWriteCompleted: { LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::SessionSynchronizedPropertyWriteCompleted"); // CODE SNIP SKIP if (events[i].Result == HTTP_E_STATUS_PRECOND_FAILED) { // Request rejected due to session conflict. Evaluate the need to write again and re-submit if needed. auto fnName = events[i].SessionType == XblMultiplayerSessionType::LobbySession ? "OnXblMultiplayerEventType_SessionSynchronizedPropertyWriteCompleted_412_LobbySession" // CODE SNIP SKIP : "OnXblMultiplayerEventType_SessionSynchronizedPropertyWriteCompleted_412_GameSession"; // CODE SNIP SKIP CallLuaFunctionWithHr(S_OK, fnName); // CODE SNIP SKIP } else { CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_SessionSynchronizedPropertyWriteCompleted"); // CODE SNIP SKIP } break; } case XblMultiplayerEventType::SynchronizedHostWriteCompleted: { LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::SynchronizedHostWriteCompleted"); // CODE SNIP SKIP if (events[i].Result == HTTP_E_STATUS_PRECOND_FAILED) { // Request rejected due to session conflict. Evaluate the need to write again and re-submit if needed. auto fnName = events[i].SessionType == XblMultiplayerSessionType::LobbySession ? "OnXblMultiplayerEventType_SynchronizedHostWriteCompleted_412_LobbySession" // CODE SNIP SKIP : "OnXblMultiplayerEventType_SynchronizedHostWriteCompleted_412_GameSession"; // CODE SNIP SKIP CallLuaFunctionWithHr(S_OK, fnName); // CODE SNIP SKIP } else { CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_SynchronizedHostWriteCompleted"); // CODE SNIP SKIP } break; } case XblMultiplayerEventType::ClientDisconnectedFromMultiplayerService: { LogToScreen("XblMultiplayerManagerDoWork event XblMultiplayerEventType::ClientDisconnectedFromMultiplayerService"); // CODE SNIP SKIP CallLuaFunctionWithHr(events[i].Result, "OnXblMultiplayerEventType_ClientDisconnectedFromMultiplayerService"); // CODE SNIP SKIP break; } case XblMultiplayerEventType::TournamentRegistrationStateChanged: case XblMultiplayerEventType::TournamentGameSessionReady: case XblMultiplayerEventType::ArbitrationComplete: default: { LogToScreen("Received MPM event of type %u, hr=%s", events[i].EventType, ConvertHR(events[i].Result).data()); // CODE SNIP SKIP LogToScreen("XblMultiplayerManagerDoWork event Other"); // CODE SNIP SKIP break; } // CODE SKIP END } } // CODE SNIPPET END return hr; } int StartDoWorkLoop_Lua(lua_State* L) { if (!s_doWork) { s_doWork = true; s_doWorkThread = std::thread([]() { Data()->m_mpmDoWorkDone = false; while (s_doWork && !Data()->m_quit) { MultiplayerManagerDoWork(); pal::Sleep(10); } Data()->m_mpmDoWorkDone = true; LogToScreen("Exiting MPM DoWork thread"); }); } return LuaReturnHR(L, S_OK); } void MPMStopDoWorkHelper() { if (s_doWork) { s_doWork = false; s_doWorkThread.join(); } } int StopDoWorkLoop_Lua(lua_State* L) { MPMStopDoWorkHelper(); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerInitialize_Lua(lua_State* L) { const char* lobbySessionTemplateName = "LobbySession"; auto queueUsedByMultiplayerManager = Data()->queue; // CODE SNIPPET START: XblMultiplayerManagerInitialize_C HRESULT hr = XblMultiplayerManagerInitialize(lobbySessionTemplateName, queueUsedByMultiplayerManager); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerInitialize: hr=%s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerDoWork_Lua(lua_State* L) { HRESULT hr = MultiplayerManagerDoWork(); LogToScreen("XblMultiplayerManagerDoWork: hr=%s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionAddLocalUser_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionAddLocalUser HRESULT hr = XblMultiplayerManagerLobbySessionAddLocalUser(Data()->xalUser); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionAddLocalUser: hr=%s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionRemoveLocalUser_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionAddLocalUser HRESULT hr = XblMultiplayerManagerLobbySessionRemoveLocalUser(Data()->xalUser); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionRemoveLocalUser: hr=%s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionCorrelationId_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionAddLocalUser XblGuid correlationId; HRESULT hr = XblMultiplayerManagerLobbySessionCorrelationId(&correlationId); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionCorrelationId: id=%s", correlationId.value); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionSessionReference_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionAddLocalUser XblMultiplayerSessionReference sessionReference{}; HRESULT hr = XblMultiplayerManagerLobbySessionSessionReference(&sessionReference); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionSessionReference: scid = %s, sessionName = %s", sessionReference.Scid, sessionReference.SessionName); return LuaReturnHR(L, hr); } void LogMultiplayerSessionMember(const XblMultiplayerManagerMember& member) { LogToScreen("XblMultiplayerManagerMember: \n\tMemberId = %u\n\tXuid = %llu\n\tDebugGamertag = %s\n\tIsLocal = %u\n\tIsInLobby = %u\n\tIsInGame = %u\n\tStatus = %u", member.MemberId, static_cast<unsigned long long>(member.Xuid), member.DebugGamertag, member.IsLocal, member.IsInLobby, member.IsInGame, member.Status ); } int XblMultiplayerManagerLobbySessionLocalMembers_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionLocalMembers size_t localMembersCount = XblMultiplayerManagerLobbySessionLocalMembersCount(); std::vector<XblMultiplayerManagerMember> localMembers(localMembersCount, XblMultiplayerManagerMember{}); HRESULT hr = XblMultiplayerManagerLobbySessionLocalMembers(localMembersCount, localMembers.data()); // CODE SNIPPET END if (SUCCEEDED(hr)) { for (const auto& member : localMembers) { LogMultiplayerSessionMember(member); } } LogToScreen("XblMultiplayerManagerLobbySessionLocalMembers: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionSetLocalMemberProperties_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionSetLocalMemberProperties HRESULT hr = XblMultiplayerManagerLobbySessionSetLocalMemberProperties(Data()->xalUser, "Health", "1", nullptr); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionSetLocalMemberProperties: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionInviteFriends_Lua(lua_State* L) { #if HC_PLATFORM == HC_PLATFORM_WIN32 HRESULT hr = XblMultiplayerManagerLobbySessionInviteFriends(Data()->xalUser, nullptr, "Join my game!"); #else HRESULT hr = S_OK; #endif LogToScreen("XblMultiplayerManagerLobbySessionInviteFriends: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerJoinGameFromLobby_Lua(lua_State* L) { const char* gameSessionTemplateName = "GameSession"; // CODE SNIPPET START: XblMultiplayerManagerJoinGameFromLobby_C HRESULT hr = XblMultiplayerManagerJoinGameFromLobby(gameSessionTemplateName); if (!SUCCEEDED(hr)) { // Handle error } // CODE SNIPPET END LogToScreen("XblMultiplayerManagerJoinGameFromLobby: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerGameSessionActive_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionActive bool isGameSessionAcive = XblMultiplayerManagerGameSessionActive(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionActive: active = %d", isGameSessionAcive); lua_pushboolean(L, isGameSessionAcive); return 1; } int XblMultiplayerManagerGameSessionMembers_Lua(lua_State* L) { HRESULT hr = S_OK; // CODE SNIPPET START: XblMultiplayerManagerGameSessionMembers size_t memberCount = XblMultiplayerManagerGameSessionMembersCount(); if (memberCount > 0) { std::vector<XblMultiplayerManagerMember> gameSessionMembers(memberCount, XblMultiplayerManagerMember{}); hr = XblMultiplayerManagerGameSessionMembers(memberCount, gameSessionMembers.data()); if (SUCCEEDED(hr)) { for (const auto& member : gameSessionMembers) { LogMultiplayerSessionMember(member); } } } // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionMembers: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerGameSessionSetProperties_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionSetProperties HRESULT hr = XblMultiplayerManagerGameSessionSetProperties("CustomProperty", "\"CustomPropertyValue\"", nullptr); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionSetProperties: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLeaveGame_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLeaveGame HRESULT hr = XblMultiplayerManagerLeaveGame(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLeaveGame: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerJoinLobbyViaActivity_Lua(lua_State* L) { uint64_t xuid1 = GetUint64FromLua(L, 1, Data()->m_multiDeviceManager->GetRemoteXuid()); auto asyncBlock = std::make_unique<XAsyncBlock>(); asyncBlock->queue = Data()->queue; asyncBlock->context = nullptr; asyncBlock->callback = [](XAsyncBlock* asyncBlock) { std::unique_ptr<XAsyncBlock> asyncBlockPtr{ asyncBlock }; // Take over ownership of the XAsyncBlock* HRESULT hr = XAsyncGetStatus(asyncBlock, false); if (SUCCEEDED(hr)) { size_t resultSize{ 0 }; hr = XblMultiplayerGetActivitiesWithPropertiesForUsersResultSize(asyncBlock, &resultSize); if (SUCCEEDED(hr)) { size_t count{ 0 }; std::vector<char> buffer(resultSize, 0); XblMultiplayerActivityDetails* activityDetails{}; hr = XblMultiplayerGetActivitiesWithPropertiesForUsersResult(asyncBlock, resultSize, buffer.data(), &activityDetails, &count, nullptr); if (SUCCEEDED(hr)) { if (resultSize > 0) { std::string handleIdStr = activityDetails[0].HandleId; LogToScreen("Joining lobby via handle %s", handleIdStr.c_str()); auto handleId = handleIdStr.c_str(); auto xblUserHandle = Data()->xalUser; // CODE SNIPPET START: XblMultiplayerManagerJoinLobby_C hr = XblMultiplayerManagerJoinLobby(handleId, xblUserHandle); // CODE SNIPPET END } else { LogToScreen("No activity handle to join. Failing..."); hr = E_FAIL; } } } } CallLuaFunctionWithHr(hr, "OnXblMultiplayerGetActivitiesForUsersAsync"); }; uint64_t xuids[1] = {}; xuids[0] = xuid1; size_t xuidsCount = 1; HRESULT hr = XblMultiplayerGetActivitiesWithPropertiesForUsersAsync( Data()->xboxLiveContext, Data()->scid, xuids, xuidsCount, asyncBlock.get()); if (SUCCEEDED(hr)) { // The call succeeded, so release the std::unique_ptr ownership of XAsyncBlock* since the callback will take over ownership. // If the call fails, the std::unique_ptr will keep ownership and delete the XAsyncBlock* asyncBlock.release(); } return LuaReturnHR(L, hr); } int XblMultiplayerManagerJoinLobby_lua(lua_State* L) { std::string handleId = { GetStringFromLua(L, 1, "GameSessionName") }; HRESULT hr = XblMultiplayerManagerJoinLobby(handleId.c_str(), Data()->xalUser); LogToScreen("XblMultiplayerManagerJoinLobby: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerJoinGame_Lua(lua_State* L) { // Params: // 1) Session name // 2) Session template name auto sessionName{ GetStringFromLua(L, 1, "GameSessionName") }; auto sessionTemplateName{ GetStringFromLua(L, 2, "GameSession") }; // CODE SNIPPET START: XblMultiplayerManagerJoinGame HRESULT hr = XblMultiplayerManagerJoinGame(sessionName.data(), sessionTemplateName.data(), &Data()->xboxUserId, 1); // CODE SNIPPET END return LuaReturnHR(L, hr); } int XblMultiplayerManagerSetJoinability_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerSetJoinability HRESULT hr = XblMultiplayerManagerSetJoinability(XblMultiplayerJoinability::JoinableByFriends, nullptr); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerSetJoinability: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerMemberAreMembersOnSameDevice_Lua(lua_State* L) { const XblMultiplayerManagerMember* first = nullptr; const XblMultiplayerManagerMember* second = nullptr; // CODE SNIPPET START: XblMultiplayerManagerMemberAreMembersOnSameDevice bool areOnSameDevice = XblMultiplayerManagerMemberAreMembersOnSameDevice(first, second); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerMemberAreMembersOnSameDevice"); LogToScreen("areOnSameDevice: %d", areOnSameDevice); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerLobbySessionMembersCount_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionMembersCount size_t count = XblMultiplayerManagerLobbySessionMembersCount(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionMembersCount"); LogToScreen("count: %d", count); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerLobbySessionMembers_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionMembers size_t count = XblMultiplayerManagerLobbySessionMembersCount(); std::vector<XblMultiplayerManagerMember> members(count); HRESULT hr = XblMultiplayerManagerLobbySessionMembers(count, members.data()); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionMembers: hr = %s", ConvertHR(hr).c_str()); LogToScreen("count: %d", count); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionHost_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionHost XblMultiplayerManagerMember hostMember; HRESULT hr = XblMultiplayerManagerLobbySessionHost(&hostMember); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionHost: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionPropertiesJson_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionPropertiesJson const char* json = XblMultiplayerManagerLobbySessionPropertiesJson(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionPropertiesJson"); LogToScreen("json: %s", json); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerLobbySessionConstants_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionConstants const XblMultiplayerSessionConstants* consts = XblMultiplayerManagerLobbySessionConstants(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionConstants:\n" "ClientMatchmakingCapable = %d\n" "EnableMetricsBandwidthDown = %d\n" "EnableMetricsBandwidthUp = %d\n" "EnableMetricsCustom = %d\n" "EnableMetricsLatency = %d\n" "MaxMembersInSession = %d\n" "Visibility = %d\n" "InitiatorXuidsCount = %z\n" "MemberInactiveTimeout = %l\n" "MemberReadyTimeout = %l\n" "MemberReservedTimeout = %l\n" "SessionEmptyTimeout = %l\n" "MeasurementServerAddressesJson = %s\n" "SessionCloudComputePackageConstantsJson = %s\n" "CustomJson = %s", consts->ClientMatchmakingCapable, consts->EnableMetricsBandwidthDown, consts->EnableMetricsBandwidthUp, consts->EnableMetricsCustom, consts->EnableMetricsLatency, consts->MaxMembersInSession, consts->InitiatorXuidsCount, consts->MemberInactiveTimeout, consts->MemberReadyTimeout, consts->MemberReservedTimeout, consts->SessionEmptyTimeout, consts->Visibility, consts->MeasurementServerAddressesJson, consts->SessionCloudComputePackageConstantsJson, consts->CustomJson); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerLobbySessionDeleteLocalMemberProperties_Lua(lua_State* L) { std::string name = "name"; void* context = nullptr; #if HC_PLATFORM != HC_PLATFORM_UWP // CODE SNIPPET START: XblMultiplayerManagerLobbySessionDeleteLocalMemberProperties HRESULT hr = XblMultiplayerManagerLobbySessionDeleteLocalMemberProperties( Data()->xalUser, name.c_str(), context); // CODE SNIPPET END #else HRESULT hr = S_OK; #endif LogToScreen("XblMultiplayerManagerLobbySessionDeleteLocalMemberProperties: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress_Lua(lua_State* L) { auto connectionAddressStr = GetStringFromLua(L, 1, "connectionAddress1"); auto connectionAddress = connectionAddressStr.c_str(); void* context = nullptr; auto xblUserHandle = Data()->xalUser; // CODE SNIPPET START: XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress_C HRESULT hr = XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress( xblUserHandle, connectionAddress, context); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionIsHost_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerLobbySessionIsHost bool isHost = XblMultiplayerManagerLobbySessionIsHost(Data()->xboxUserId); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionIsHost: isHost = %d", isHost); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerLobbySessionSetProperties_Lua(lua_State* L) { std::string name = GetStringFromLua(L, 1, "role"); std::string valueJson = GetStringFromLua(L, 1, "{\"class\":\"fighter\"}"); void* context = nullptr; // CODE SNIPPET START: XblMultiplayerManagerLobbySessionSetProperties HRESULT hr = XblMultiplayerManagerLobbySessionSetProperties(name.c_str(), valueJson.c_str(), context); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionSetProperties: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionSetSynchronizedProperties_Lua(lua_State* L) { std::string name = GetStringFromLua(L, 1, "name1"); std::string valueJson = GetStringFromLua(L, 1, "{}"); void* context = nullptr; // CODE SNIPPET START: XblMultiplayerManagerLobbySessionSetSynchronizedProperties HRESULT hr = XblMultiplayerManagerLobbySessionSetSynchronizedProperties(name.c_str(), valueJson.c_str(), context); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionSetSynchronizedProperties: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionSetSynchronizedHost_Lua(lua_State* L) { size_t membersCount = XblMultiplayerManagerLobbySessionMembersCount(); std::vector<XblMultiplayerManagerMember> members(membersCount); XblMultiplayerManagerLobbySessionMembers(membersCount, members.data()); std::string defaultDeviceToken = ""; for (auto member : members) { if (member.Xuid == Data()->xboxUserId) { defaultDeviceToken = member.DeviceToken; break; } } std::string deviceToken = GetStringFromLua(L, 1, defaultDeviceToken.empty() ? "deviceToken1" : defaultDeviceToken); void* context = nullptr; // CODE SNIPPET START: XblMultiplayerManagerLobbySessionSetSynchronizedHost HRESULT hr = XblMultiplayerManagerLobbySessionSetSynchronizedHost(deviceToken.c_str(), context); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionSetSynchronizedHost: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerLobbySessionInviteUsers_Lua(lua_State* L) { //TODOs: Change XUID to whatever account is used in XblGameInviteAddNotificationHandler_Lua // to test sending and receiving invites auto xblUserHandle = Data()->xalUser; // CODE SNIPPET START: XblMultiplayerManagerLobbySessionInviteUsers_C size_t xuidsCount = 1; uint64_t xuids[1] = {}; xuids[0] = 1234567891234567; xuids[0] = 2814620188564745; // CODE SNIP SKIP HRESULT hr = XblMultiplayerManagerLobbySessionInviteUsers( xblUserHandle, xuids, xuidsCount, nullptr, // ContextStringId nullptr // CustomActivationContext ); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerLobbySessionInviteUsers: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerGameSessionCorrelationId_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionCorrelationId const char* id = XblMultiplayerManagerGameSessionCorrelationId(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionCorrelationId: id = %s", id); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerGameSessionSessionReference_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionSessionReference const XblMultiplayerSessionReference* session = XblMultiplayerManagerGameSessionSessionReference(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionSessionReference: scid = %s", session->Scid); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerGameSessionHost_Lua(lua_State* L) { XblMultiplayerManagerMember hostMember; // CODE SNIPPET START: XblMultiplayerManagerGameSessionHost HRESULT hr = XblMultiplayerManagerGameSessionHost(&hostMember); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionHost: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerGameSessionPropertiesJson_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionPropertiesJson const char* json = XblMultiplayerManagerGameSessionPropertiesJson(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionPropertiesJson: json = %s", json); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerGameSessionConstants_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionConstants const XblMultiplayerSessionConstants* consts = XblMultiplayerManagerGameSessionConstants(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionConstants:\n" "ClientMatchmakingCapable = %d\n" "EnableMetricsBandwidthDown = %d\n" "EnableMetricsBandwidthUp = %d\n" "EnableMetricsCustom = %d\n" "EnableMetricsLatency = %d\n" "MaxMembersInSession = %d", consts->ClientMatchmakingCapable, consts->EnableMetricsBandwidthDown, consts->EnableMetricsBandwidthUp, consts->EnableMetricsCustom, consts->EnableMetricsLatency, consts->MaxMembersInSession ); LogToScreen( "InitiatorXuidsCount = %llu\n" "MemberInactiveTimeout = %llu\n" "MemberReadyTimeout = %llu\n" "MemberReservedTimeout = %llu\n" "SessionEmptyTimeout = %llu", static_cast<unsigned long long>(consts->InitiatorXuidsCount), static_cast<unsigned long long>(consts->MemberInactiveTimeout), static_cast<unsigned long long>(consts->MemberReadyTimeout), static_cast<unsigned long long>(consts->MemberReservedTimeout), static_cast<unsigned long long>(consts->SessionEmptyTimeout) ); LogToScreen("MeasurementServerAddressesJson = %s", consts->MeasurementServerAddressesJson); LogToScreen("SessionCloudComputePackageConstantsJson = %s", consts->SessionCloudComputePackageConstantsJson); LogToScreen("CustomJson = %s", consts->CustomJson); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerGameSessionIsHost_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionIsHost bool isHost = XblMultiplayerManagerGameSessionIsHost(Data()->xboxUserId); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionIsHost: isHost = %d", isHost); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerGameSessionSetSynchronizedProperties_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerGameSessionSetSynchronizedProperties HRESULT hr = XblMultiplayerManagerGameSessionSetSynchronizedProperties("CustomSyncProperty", "\"CustomSyncPropertyValue\"", nullptr); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionSetSynchronizedProperties: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerGameSessionSetSynchronizedHost_Lua(lua_State* L) { std::string deviceToken = GetStringFromLua(L, 1, "deviceToken1"); void* context = nullptr; // CODE SNIPPET START: XblMultiplayerManagerGameSessionSetSynchronizedHost HRESULT hr = XblMultiplayerManagerGameSessionSetSynchronizedHost(deviceToken.c_str(), context); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerGameSessionSetSynchronizedHost: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerFindMatch_Lua(lua_State* L) { // Params: // 1) matchmaking hopper name // 2) attributes json auto hopperNameStr{ GetStringFromLua(L, 1, "") }; auto attributesJsonStr{ GetStringFromLua(L, 2, "") }; const char* hopperName = hopperNameStr.c_str(); const char* attributesJson = attributesJsonStr.c_str(); // CODE SNIPPET START: XblMultiplayerManagerFindMatch_C uint32_t timeoutInSeconds = 30; HRESULT hr = XblMultiplayerManagerFindMatch(hopperName, attributesJson, timeoutInSeconds); if (!SUCCEEDED(hr)) { // Handle failure } // CODE SNIPPET END LogToScreen("XblMultiplayerManagerFindMatch: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerCancelMatch_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerCancelMatch XblMultiplayerManagerCancelMatch(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerCancelMatch"); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerMatchStatus_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerMatchStatus XblMultiplayerMatchStatus status = XblMultiplayerManagerMatchStatus(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerMatchStatus: status = %d", status); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerEstimatedMatchWaitTime_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerEstimatedMatchWaitTime uint32_t waitTime = XblMultiplayerManagerEstimatedMatchWaitTime(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerEstimatedMatchWaitTime: waitTime = %d", waitTime); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerAutoFillMembersDuringMatchmaking_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerAutoFillMembersDuringMatchmaking bool autoFill = XblMultiplayerManagerAutoFillMembersDuringMatchmaking(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerAutoFillMembersDuringMatchmaking: autoFill = %d", autoFill); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerSetAutoFillMembersDuringMatchmaking_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerSetAutoFillMembersDuringMatchmaking XblMultiplayerManagerSetAutoFillMembersDuringMatchmaking(true); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerSetAutoFillMembersDuringMatchmaking"); return LuaReturnHR(L, S_OK); } int XblMultiplayerManagerSetQosMeasurements_Lua(lua_State* L) { const char* qosJson = "{\"e69c43a8\": {" "\"latency\": 5953," "\"bandwidthDown\" : 19342," "\"bandwidthUp\" : 944," "\"customProperty\" : \"customVal\"}}"; // CODE SNIPPET START: XblMultiplayerManagerSetQosMeasurements HRESULT hr = XblMultiplayerManagerSetQosMeasurements(qosJson); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerSetQosMeasurements: hr = %s", ConvertHR(hr).c_str()); return LuaReturnHR(L, hr); } int XblMultiplayerManagerJoinability_Lua(lua_State* L) { // CODE SNIPPET START: XblMultiplayerManagerJoinability XblMultiplayerJoinability joinability = XblMultiplayerManagerJoinability(); // CODE SNIPPET END LogToScreen("XblMultiplayerManagerJoinability: joinability = %d", joinability); return LuaReturnHR(L, S_OK); } int VerifyMPMGameSessionProperites_Lua(lua_State* L) { bool isActive = XblMultiplayerManagerGameSessionActive(); assert(isActive); UNREFERENCED_PARAMETER(isActive); const XblMultiplayerSessionConstants* consts = XblMultiplayerManagerGameSessionConstants(); assert(consts != nullptr); assert(consts->MaxMembersInSession == 20); // defined by template UNREFERENCED_PARAMETER(consts); const char* corr = XblMultiplayerManagerGameSessionCorrelationId(); assert(corr != nullptr); assert(strlen(corr) > 0); UNREFERENCED_PARAMETER(corr); XblMultiplayerManagerMember hostMember; HRESULT hr = XblMultiplayerManagerGameSessionHost(&hostMember); assert(SUCCEEDED(hr) || hr == __HRESULT_FROM_WIN32(ERROR_NO_SUCH_USER)); UNREFERENCED_PARAMETER(hr); bool isHost = XblMultiplayerManagerGameSessionIsHost(Data()->xboxUserId); UNREFERENCED_PARAMETER(isHost); size_t membersCount = XblMultiplayerManagerGameSessionMembersCount(); std::vector<XblMultiplayerManagerMember> members(membersCount); hr = XblMultiplayerManagerGameSessionMembers(membersCount, members.data()); assert(SUCCEEDED(hr)); assert(membersCount == 2); assert(strlen(members[0].DebugGamertag) > 0); assert(strlen(members[1].DebugGamertag) > 0); UNREFERENCED_PARAMETER(membersCount); UNREFERENCED_PARAMETER(members); bool sameDevice = XblMultiplayerManagerMemberAreMembersOnSameDevice(&members[0], &members[1]); assert(sameDevice == false); UNREFERENCED_PARAMETER(sameDevice); const char* props = XblMultiplayerManagerGameSessionPropertiesJson(); assert(props != nullptr); assert(strlen(props) > 0); UNREFERENCED_PARAMETER(props); const XblMultiplayerSessionReference* sessionRef = XblMultiplayerManagerGameSessionSessionReference(); assert(sessionRef != nullptr); assert(strlen(sessionRef->Scid) > 0); assert(strlen(sessionRef->SessionName) > 0); assert(strlen(sessionRef->SessionTemplateName) > 0); UNREFERENCED_PARAMETER(sessionRef); return LuaReturnHR(L, S_OK); } int VerifyMPMLobbySessionProperites_Lua(lua_State* L) { const XblMultiplayerSessionConstants* consts = XblMultiplayerManagerGameSessionConstants(); assert(consts != nullptr); assert(consts->MaxMembersInSession == 20); // defined by template UNREFERENCED_PARAMETER(consts); XblGuid correlationId; HRESULT hr = XblMultiplayerManagerLobbySessionCorrelationId(&correlationId); assert(SUCCEEDED(hr)); assert(correlationId.value[0] != 0); UNREFERENCED_PARAMETER(correlationId); XblMultiplayerManagerMember hostMember; hr = XblMultiplayerManagerLobbySessionHost(&hostMember); assert(SUCCEEDED(hr) || hr == __HRESULT_FROM_WIN32(ERROR_NO_SUCH_USER)); bool isHost = XblMultiplayerManagerLobbySessionIsHost(Data()->xboxUserId); UNREFERENCED_PARAMETER(isHost); size_t localMembersCount = XblMultiplayerManagerLobbySessionLocalMembersCount(); std::vector<XblMultiplayerManagerMember> localmembers(localMembersCount); hr = XblMultiplayerManagerLobbySessionLocalMembers(localMembersCount, localmembers.data()); assert(SUCCEEDED(hr)); assert(localMembersCount == 1); assert(strlen(localmembers[0].DebugGamertag) > 0); UNREFERENCED_PARAMETER(localmembers); size_t membersCount = XblMultiplayerManagerLobbySessionMembersCount(); std::vector<XblMultiplayerManagerMember> members(membersCount); hr = XblMultiplayerManagerLobbySessionMembers(membersCount, members.data()); assert(SUCCEEDED(hr)); assert(membersCount >= 1); assert(strlen(members[0].DebugGamertag) > 0); UNREFERENCED_PARAMETER(members); const char* props = XblMultiplayerManagerLobbySessionPropertiesJson(); assert(props != nullptr); assert(strlen(props) > 0); UNREFERENCED_PARAMETER(props); XblMultiplayerSessionReference sessionRef{}; hr = XblMultiplayerManagerLobbySessionSessionReference(&sessionRef); assert(SUCCEEDED(hr)); assert(strlen(sessionRef.Scid) > 0); assert(strlen(sessionRef.SessionName) > 0); assert(strlen(sessionRef.SessionTemplateName) > 0); UNREFERENCED_PARAMETER(sessionRef); return LuaReturnHR(L, S_OK); } void SetupAPIs_XblMultiplayerManager() { // Non XSAPI APIs lua_register(Data()->L, "StartDoWorkLoop", StartDoWorkLoop_Lua); lua_register(Data()->L, "StopDoWorkLoop", StopDoWorkLoop_Lua); // XSAPI MPM APIs lua_register(Data()->L, "XblMultiplayerManagerMemberAreMembersOnSameDevice", XblMultiplayerManagerMemberAreMembersOnSameDevice_Lua); lua_register(Data()->L, "XblMultiplayerManagerInitialize", XblMultiplayerManagerInitialize_Lua); lua_register(Data()->L, "XblMultiplayerManagerDoWork", XblMultiplayerManagerDoWork_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionCorrelationId", XblMultiplayerManagerLobbySessionCorrelationId_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionSessionReference", XblMultiplayerManagerLobbySessionSessionReference_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionLocalMembers", XblMultiplayerManagerLobbySessionLocalMembers_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionMembersCount", XblMultiplayerManagerLobbySessionMembersCount_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionMembers", XblMultiplayerManagerLobbySessionMembers_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionHost", XblMultiplayerManagerLobbySessionHost_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionPropertiesJson", XblMultiplayerManagerLobbySessionPropertiesJson_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionConstants", XblMultiplayerManagerLobbySessionConstants_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionAddLocalUser", XblMultiplayerManagerLobbySessionAddLocalUser_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionRemoveLocalUser", XblMultiplayerManagerLobbySessionRemoveLocalUser_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionSetLocalMemberProperties", XblMultiplayerManagerLobbySessionSetLocalMemberProperties_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionDeleteLocalMemberProperties", XblMultiplayerManagerLobbySessionDeleteLocalMemberProperties_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress", XblMultiplayerManagerLobbySessionSetLocalMemberConnectionAddress_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionIsHost", XblMultiplayerManagerLobbySessionIsHost_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionSetProperties", XblMultiplayerManagerLobbySessionSetProperties_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionSetSynchronizedProperties", XblMultiplayerManagerLobbySessionSetSynchronizedProperties_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionSetSynchronizedHost", XblMultiplayerManagerLobbySessionSetSynchronizedHost_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionInviteFriends", XblMultiplayerManagerLobbySessionInviteFriends_Lua); lua_register(Data()->L, "XblMultiplayerManagerLobbySessionInviteUsers", XblMultiplayerManagerLobbySessionInviteUsers_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionActive", XblMultiplayerManagerGameSessionActive_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionCorrelationId", XblMultiplayerManagerGameSessionCorrelationId_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionSessionReference", XblMultiplayerManagerGameSessionSessionReference_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionMembers", XblMultiplayerManagerGameSessionMembers_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionHost", XblMultiplayerManagerGameSessionHost_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionPropertiesJson", XblMultiplayerManagerGameSessionPropertiesJson_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionConstants", XblMultiplayerManagerGameSessionConstants_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionIsHost", XblMultiplayerManagerGameSessionIsHost_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionSetProperties", XblMultiplayerManagerGameSessionSetProperties_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionSetSynchronizedProperties", XblMultiplayerManagerGameSessionSetSynchronizedProperties_Lua); lua_register(Data()->L, "XblMultiplayerManagerGameSessionSetSynchronizedHost", XblMultiplayerManagerGameSessionSetSynchronizedHost_Lua); lua_register(Data()->L, "XblMultiplayerManagerJoinLobby", XblMultiplayerManagerJoinLobby_lua); lua_register(Data()->L, "XblMultiplayerManagerJoinLobbyViaActivity", XblMultiplayerManagerJoinLobbyViaActivity_Lua); lua_register(Data()->L, "XblMultiplayerManagerJoinGameFromLobby", XblMultiplayerManagerJoinGameFromLobby_Lua); lua_register(Data()->L, "XblMultiplayerManagerJoinGame", XblMultiplayerManagerJoinGame_Lua); lua_register(Data()->L, "XblMultiplayerManagerLeaveGame", XblMultiplayerManagerLeaveGame_Lua); lua_register(Data()->L, "XblMultiplayerManagerFindMatch", XblMultiplayerManagerFindMatch_Lua); lua_register(Data()->L, "XblMultiplayerManagerCancelMatch", XblMultiplayerManagerCancelMatch_Lua); lua_register(Data()->L, "XblMultiplayerManagerMatchStatus", XblMultiplayerManagerMatchStatus_Lua); lua_register(Data()->L, "XblMultiplayerManagerEstimatedMatchWaitTime", XblMultiplayerManagerEstimatedMatchWaitTime_Lua); lua_register(Data()->L, "XblMultiplayerManagerAutoFillMembersDuringMatchmaking", XblMultiplayerManagerAutoFillMembersDuringMatchmaking_Lua); lua_register(Data()->L, "XblMultiplayerManagerSetAutoFillMembersDuringMatchmaking", XblMultiplayerManagerSetAutoFillMembersDuringMatchmaking_Lua); lua_register(Data()->L, "XblMultiplayerManagerSetQosMeasurements", XblMultiplayerManagerSetQosMeasurements_Lua); lua_register(Data()->L, "XblMultiplayerManagerJoinability", XblMultiplayerManagerJoinability_Lua); lua_register(Data()->L, "XblMultiplayerManagerSetJoinability", XblMultiplayerManagerSetJoinability_Lua); lua_register(Data()->L, "VerifyMPMGameSessionProperites", VerifyMPMGameSessionProperites_Lua); lua_register(Data()->L, "VerifyMPMLobbySessionProperites", VerifyMPMLobbySessionProperites_Lua); } #if HC_PLATFORM_IS_MICROSOFT #pragma warning( pop ) #endif
43.887481
205
0.695299
natiskan
fdd9b9095728c53706dc0d8905db4f5a41112b19
187,544
cpp
C++
vis_milk2/milkdropfs.cpp
WACUP/vis_milk2
50cbd69c69497f22baa521066e04ee05d5940ea4
[ "BSD-3-Clause" ]
9
2018-11-19T02:46:07.000Z
2022-02-12T18:10:10.000Z
vis_milk2/milkdropfs.cpp
WACUP/vis_milk2
50cbd69c69497f22baa521066e04ee05d5940ea4
[ "BSD-3-Clause" ]
null
null
null
vis_milk2/milkdropfs.cpp
WACUP/vis_milk2
50cbd69c69497f22baa521066e04ee05d5940ea4
[ "BSD-3-Clause" ]
1
2018-11-02T17:32:38.000Z
2018-11-02T17:32:38.000Z
/* LICENSE ------- Copyright 2005-2013 Nullsoft, Inc. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of Nullsoft nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "api.h" #include "plugin.h" #include "resource.h" #include "support.h" //#include "evallib\eval.h" // for math. expr. eval - thanks Francis! (in SourceOffSite, it's the 'vis_avs\evallib' project.) //#include "evallib\compiler.h" #include "../ns-eel2/ns-eel.h" #include "utility.h" #include <assert.h> #include <math.h> #include <shlwapi.h> #define D3DCOLOR_RGBA_01(r,g,b,a) D3DCOLOR_RGBA(((int)(r*255)),((int)(g*255)),((int)(b*255)),((int)(a*255))) #define FRAND ((warand() % 7381)/7380.0f) #define VERT_CLIP 0.75f // warning: top/bottom can get clipped if you go < 0.65! int g_title_font_sizes[] = { // NOTE: DO NOT EXCEED 64 FONTS HERE. 6, 8, 10, 12, 14, 16, 20, 26, 32, 38, 44, 50, 56, 64, 72, 80, 88, 96, 104, 112, 120, 128, 136, 144, 160, 192, 224, 256, 288, 320, 352, 384, 416, 448, 480, 512 /**/ }; //#define COMPILE_MULTIMON_STUBS 1 //#include <multimon.h> // This function evaluates whether the floating-point // control Word is set to single precision/round to nearest/ // exceptions disabled. If not, the // function changes the control Word to set them and returns // TRUE, putting the old control Word value in the passback // location pointed to by pwOldCW. static void MungeFPCW( WORD *pwOldCW ) { #if 0 BOOL ret = FALSE; WORD wTemp, wSave; __asm fstcw wSave if (wSave & 0x300 || // Not single mode 0x3f != (wSave & 0x3f) || // Exceptions enabled wSave & 0xC00) // Not round to nearest mode { __asm { mov ax, wSave and ax, not 300h ;; single mode or ax, 3fh ;; disable all exceptions and ax, not 0xC00 ;; round to nearest mode mov wTemp, ax fldcw wTemp } ret = TRUE; } if (pwOldCW) *pwOldCW = wSave; // return ret; #else _controlfp(_PC_24, _MCW_PC); // single precision _controlfp(_RC_NEAR, _MCW_RC); // round to nearest mode _controlfp(_EM_ZERODIVIDE, _EM_ZERODIVIDE); // disable divide-by-zero #endif } void RestoreFPCW(WORD wSave) { __asm fldcw wSave } int GetNumToSpawn(float fTime, float fDeltaT, float fRate, float fRegularity, int iNumSpawnedSoFar) { // PARAMETERS // ------------ // fTime: sum of all fDeltaT's so far (excluding this one) // fDeltaT: time window for this frame // fRate: avg. rate (spawns per second) of generation // fRegularity: regularity of generation // 0.0: totally chaotic // 0.2: getting chaotic / very jittered // 0.4: nicely jittered // 0.6: slightly jittered // 0.8: almost perfectly regular // 1.0: perfectly regular // iNumSpawnedSoFar: the total number of spawnings so far // // RETURN VALUE // ------------ // The number to spawn for this frame (add this to your net count!). // // COMMENTS // ------------ // The spawn values returned will, over time, match // (within 1%) the theoretical totals expected based on the // amount of time passed and the average generation rate. // // UNRESOLVED ISSUES // ----------------- // actual results of mixed gen. (0 < reg < 1) are about 1% too low // in the long run (vs. analytical expectations). Decided not // to bother fixing it since it's only 1% (and VERY consistent). float fNumToSpawnReg; float fNumToSpawnIrreg; float fNumToSpawn; // compute # spawned based on regular generation fNumToSpawnReg = ((fTime + fDeltaT) * fRate) - iNumSpawnedSoFar; // compute # spawned based on irregular (random) generation if (fDeltaT <= 1.0f / fRate) { // case 1: avg. less than 1 spawn per frame if ((warand() % 16384)/16384.0f < fDeltaT * fRate) fNumToSpawnIrreg = 1.0f; else fNumToSpawnIrreg = 0.0f; } else { // case 2: avg. more than 1 spawn per frame fNumToSpawnIrreg = fDeltaT * fRate; fNumToSpawnIrreg *= 2.0f*(warand() % 16384)/16384.0f; } // get linear combo. of regular & irregular fNumToSpawn = fNumToSpawnReg*fRegularity + fNumToSpawnIrreg*(1.0f - fRegularity); // round to nearest integer for result return (int)(fNumToSpawn + 0.49f); } /*bool CPlugin::OnResizeTextWindow() { /* if (!m_hTextWnd) return false; RECT rect; GetClientRect(m_hTextWnd, &rect); if (rect.right - rect.left != m_nTextWndWidth || rect.bottom - rect.top != m_nTextWndHeight) { m_nTextWndWidth = rect.right - rect.left; m_nTextWndHeight = rect.bottom - rect.top; // first, resize fonts if necessary //if (!InitFont()) //return false; // then resize the memory bitmap used for double buffering if (m_memDC) { SelectObject(m_memDC, m_oldBM); // delete our doublebuffer DeleteObject(m_memDC); DeleteObject(m_memBM); m_memDC = NULL; m_memBM = NULL; m_oldBM = NULL; } HDC hdc = GetDC(m_hTextWnd); if (!hdc) return false; m_memDC = CreateCompatibleDC(hdc); m_memBM = CreateCompatibleBitmap(hdc, rect.right - rect.left, rect.bottom - rect.top); m_oldBM = (HBITMAP)SelectObject(m_memDC,m_memBM); ReleaseDC(m_hTextWnd, hdc); // save new window pos WriteRealtimeConfig(); }*/ /* return true; }*/ /*void CPlugin::ClearGraphicsWindow() { // clear the window contents, to avoid a 1-pixel-thick border of noise that sometimes sticks around /* RECT rect; GetClientRect(GetPluginWindow(), &rect); HDC hdc = GetDC(GetPluginWindow()); FillRect(hdc, &rect, m_hBlackBrush); ReleaseDC(GetPluginWindow(), hdc); */ /*}*/ bool CPlugin::RenderStringToTitleTexture() // m_szSongMessage { if (!m_lpDDSTitle) // this *can* be NULL, if not much video mem! return false; if (m_supertext.szTextW[0]==0) return false; LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return false; wchar_t szTextToDraw[512] = {0}; _snwprintf(szTextToDraw, ARRAYSIZE(szTextToDraw), L" %s ", m_supertext.szTextW); //add a space @ end for italicized fonts; and at start, too, because it's centered! // Remember the original backbuffer and zbuffer LPDIRECT3DSURFACE9 pBackBuffer=NULL;//, pZBuffer=NULL; lpDevice->GetRenderTarget( 0, &pBackBuffer ); //lpDevice->GetDepthStencilSurface( &pZBuffer ); // set render target to m_lpDDSTitle { lpDevice->SetTexture(0, NULL); IDirect3DSurface9* pNewTarget = NULL; if (m_lpDDSTitle->GetSurfaceLevel(0, &pNewTarget) != D3D_OK) { SafeRelease(pBackBuffer); //SafeRelease(pZBuffer); return false; } lpDevice->SetRenderTarget(0, pNewTarget); //lpDevice->SetDepthStencilSurface( NULL ); pNewTarget->Release(); lpDevice->SetTexture(0, NULL); } // clear the texture to black { lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( WFVERTEX_FORMAT ); lpDevice->SetTexture(0, NULL); lpDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE ); // set up a quad WFVERTEX verts[4] = {0}; for (int i=0; i<4; i++) { verts[i].x = (i%2==0) ? -1.f : 1.f; verts[i].y = (i/2==0) ? -1.f : 1.f; //verts[i].z = 0; verts[i].Diffuse = 0xFF000000; } lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, verts, sizeof(WFVERTEX)); } /*// 1. clip title if too many chars if (m_supertext.bIsSongTitle) { // truncate song title if too long; don't clip custom messages, though! int clip_chars = 32; int user_title_size = GetFontHeight(SONGTITLE_FONT); #define MIN_CHARS 8 // max clip_chars *for BIG FONTS* #define MAX_CHARS 64 // max clip chars *for tiny fonts* float t = (user_title_size-10)/(float)(128-10); t = min(1,max(0,t)); clip_chars = (int)(MAX_CHARS - (MAX_CHARS-MIN_CHARS)*t); if ((int)strlen(szTextToDraw) > clip_chars+3) strcpy(&szTextToDraw[clip_chars], "..."); }*/ bool ret = true; // use 2 lines; must leave room for bottom of 'g' characters and such! RECT rect; rect.left = 0; rect.right = m_nTitleTexSizeX; rect.top = m_nTitleTexSizeY* 1/21; // otherwise, top of '%' could be cut off (1/21 seems safe) rect.bottom = m_nTitleTexSizeY*17/21; // otherwise, bottom of 'g' could be cut off (18/21 seems safe, but we want some leeway) if (!m_supertext.bIsSongTitle) { // custom msg -> pick font to use that will best fill the texture LPD3DXFONT d3dx_font = NULL; int lo = 0, hi = ARRAYSIZE(g_title_font_sizes) - 1; // limit the size of the font used: //int user_title_size = GetFontHeight(SONGTITLE_FONT); //while (g_title_font_sizes[hi] > user_title_size*2 && hi>4) // --hi; RECT temp; while (1)//(lo < hi-1) { int mid = (lo+hi)/2; // create new d3dx font at 'mid' size: if (pCreateFontW( lpDevice, g_title_font_sizes[mid], 0, m_supertext.bBold ? 900 : 400, 1, m_supertext.bItal, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, ANTIALIASED_QUALITY,//m_fontinfo[SONGTITLE_FONT].bAntiAliased ? ANTIALIASED_QUALITY : DEFAULT_QUALITY, DEFAULT_PITCH, m_supertext.nFontFace, &d3dx_font ) == D3D_OK) { if (lo == hi-1) break; // DONE; but the 'lo'-size font is ready for use! // compute size of text if drawn w/font of THIS size: temp = rect; int h = d3dx_font->DrawTextW(NULL, szTextToDraw, -1, &temp, DT_SINGLELINE | DT_CALCRECT /*| DT_NOPREFIX*/, 0xFFFFFFFF); // adjust & prepare to reiterate: if (temp.right >= rect.right || h > rect.bottom-rect.top) hi = mid; else lo = mid; SafeRelease(d3dx_font); } } if (d3dx_font) { // do actual drawing + set m_supertext.nFontSizeUsed; use 'lo' size int h = d3dx_font->DrawTextW(NULL, szTextToDraw, -1, &temp, DT_SINGLELINE | DT_CALCRECT /*| DT_NOPREFIX*/ | DT_CENTER, 0xFFFFFFFF); temp.left = 0; temp.right = m_nTitleTexSizeX; // now allow text to go all the way over, since we're actually drawing! temp.top = m_nTitleTexSizeY/2 - h/2; temp.bottom = m_nTitleTexSizeY/2 + h/2; m_supertext.nFontSizeUsed = d3dx_font->DrawTextW(NULL, szTextToDraw, -1, &temp, DT_SINGLELINE /*| DT_NOPREFIX*/ | DT_CENTER, 0xFFFFFFFF); ret = true; } else { ret = false; } // clean up font: SafeRelease(d3dx_font); } else // song title { wchar_t* str = m_supertext.szTextW; // clip the text manually... // NOTE: DT_END_ELLIPSIS CAUSES NOTHING TO DRAW, IF YOU USE W/D3DX9! int h = 0; int max_its = 6; int it = 0; while ((++it) < max_its) { if (!str[0]) break; RECT temp = rect; h = m_d3dx_title_font_doublesize->DrawTextW(NULL, str, -1, &temp, DT_SINGLELINE | DT_CALCRECT /*| DT_NOPREFIX | DT_END_ELLIPSIS*/, 0xFFFFFFFF); if (temp.right-temp.left <= m_nTitleTexSizeX) break; // 11/01/2009 DO - disabled as it was causing to users 'random' titles against // what is expected so we now just work on the ellipse at the end approach which // manually clip the text... chop segments off the front /*wchar_t* p = wcsstr(str, L" - "); if (p) { str = p+3; continue; }*/ // no more stuff to chop off the front; chop off the end w/ ... int len = wcslen(str); float fPercentToKeep = 0.95f * m_nTitleTexSizeX / (float)(temp.right-temp.left); if (len > 8) wcscpy( &str[ (int)(len*fPercentToKeep) ], L"..."); break; } // now actually draw it RECT temp; temp.left = 0; temp.right = m_nTitleTexSizeX; // now allow text to go all the way over, since we're actually drawing! temp.top = m_nTitleTexSizeY/2 - h/2; temp.bottom = m_nTitleTexSizeY/2 + h/2; // NOTE: DT_END_ELLIPSIS CAUSES NOTHING TO DRAW, IF YOU USE W/D3DX9! m_supertext.nFontSizeUsed = m_d3dx_title_font_doublesize->DrawTextW(NULL, str, -1, &temp, DT_SINGLELINE /*| DT_NOPREFIX | DT_END_ELLIPSIS*/ | DT_CENTER , 0xFFFFFFFF); } // Change the rendertarget back to the original setup lpDevice->SetTexture(0, NULL); lpDevice->SetRenderTarget( 0, pBackBuffer ); //lpDevice->SetDepthStencilSurface( pZBuffer ); SafeRelease(pBackBuffer); //SafeRelease(pZBuffer); return ret; } void CPlugin::LoadPerFrameEvallibVars(CState* pState) const { // load the 'var_pf_*' variables in this CState object with the correct values. // for vars that affect pixel motion, that means evaluating them at time==-1, // (i.e. no blending w/blendto value); the blending of the file dx/dy // will be done *after* execution of the per-vertex code. // for vars that do NOT affect pixel motion, evaluate them at the current time, // so that if they're blending, both states see the blended value. // 1. vars that affect pixel motion: (eval at time==-1) *pState->var_pf_zoom = (double)pState->m_fZoom.eval(-1);//GetTime()); *pState->var_pf_zoomexp = (double)pState->m_fZoomExponent.eval(-1);//GetTime()); *pState->var_pf_rot = (double)pState->m_fRot.eval(-1);//GetTime()); *pState->var_pf_warp = (double)pState->m_fWarpAmount.eval(-1);//GetTime()); *pState->var_pf_cx = (double)pState->m_fRotCX.eval(-1);//GetTime()); *pState->var_pf_cy = (double)pState->m_fRotCY.eval(-1);//GetTime()); *pState->var_pf_dx = (double)pState->m_fXPush.eval(-1);//GetTime()); *pState->var_pf_dy = (double)pState->m_fYPush.eval(-1);//GetTime()); *pState->var_pf_sx = (double)pState->m_fStretchX.eval(-1);//GetTime()); *pState->var_pf_sy = (double)pState->m_fStretchY.eval(-1);//GetTime()); // read-only: *pState->var_pf_time = (double)(GetTime() - m_fStartTime); *pState->var_pf_fps = (double)GetFps(); *pState->var_pf_bass = (double)mysound.imm_rel[0]; *pState->var_pf_mid = (double)mysound.imm_rel[1]; *pState->var_pf_treb = (double)mysound.imm_rel[2]; *pState->var_pf_bass_att = (double)mysound.avg_rel[0]; *pState->var_pf_mid_att = (double)mysound.avg_rel[1]; *pState->var_pf_treb_att = (double)mysound.avg_rel[2]; *pState->var_pf_frame = (double)GetFrame(); //*pState->var_pf_monitor = 0; -leave this as it was set in the per-frame INIT code! for (int vi=0; vi<NUM_Q_VAR; vi++) *pState->var_pf_q[vi] = pState->q_values_after_init_code[vi];//0.0f; *pState->var_pf_monitor = pState->monitor_after_init_code; *pState->var_pf_progress = (GetTime() - m_fPresetStartTime) / (m_fNextPresetTime - m_fPresetStartTime); // 2. vars that do NOT affect pixel motion: (eval at time==now) *pState->var_pf_decay = (double)pState->m_fDecay.eval(GetTime()); *pState->var_pf_wave_a = (double)pState->m_fWaveAlpha.eval(GetTime()); *pState->var_pf_wave_r = (double)pState->m_fWaveR.eval(GetTime()); *pState->var_pf_wave_g = (double)pState->m_fWaveG.eval(GetTime()); *pState->var_pf_wave_b = (double)pState->m_fWaveB.eval(GetTime()); *pState->var_pf_wave_x = (double)pState->m_fWaveX.eval(GetTime()); *pState->var_pf_wave_y = (double)pState->m_fWaveY.eval(GetTime()); *pState->var_pf_wave_mystery= (double)pState->m_fWaveParam.eval(GetTime()); *pState->var_pf_wave_mode = (double)pState->m_nWaveMode; //?!?! -why won't it work if set to pState->m_nWaveMode??? *pState->var_pf_ob_size = (double)pState->m_fOuterBorderSize.eval(GetTime()); *pState->var_pf_ob_r = (double)pState->m_fOuterBorderR.eval(GetTime()); *pState->var_pf_ob_g = (double)pState->m_fOuterBorderG.eval(GetTime()); *pState->var_pf_ob_b = (double)pState->m_fOuterBorderB.eval(GetTime()); *pState->var_pf_ob_a = (double)pState->m_fOuterBorderA.eval(GetTime()); *pState->var_pf_ib_size = (double)pState->m_fInnerBorderSize.eval(GetTime()); *pState->var_pf_ib_r = (double)pState->m_fInnerBorderR.eval(GetTime()); *pState->var_pf_ib_g = (double)pState->m_fInnerBorderG.eval(GetTime()); *pState->var_pf_ib_b = (double)pState->m_fInnerBorderB.eval(GetTime()); *pState->var_pf_ib_a = (double)pState->m_fInnerBorderA.eval(GetTime()); *pState->var_pf_mv_x = (double)pState->m_fMvX.eval(GetTime()); *pState->var_pf_mv_y = (double)pState->m_fMvY.eval(GetTime()); *pState->var_pf_mv_dx = (double)pState->m_fMvDX.eval(GetTime()); *pState->var_pf_mv_dy = (double)pState->m_fMvDY.eval(GetTime()); *pState->var_pf_mv_l = (double)pState->m_fMvL.eval(GetTime()); *pState->var_pf_mv_r = (double)pState->m_fMvR.eval(GetTime()); *pState->var_pf_mv_g = (double)pState->m_fMvG.eval(GetTime()); *pState->var_pf_mv_b = (double)pState->m_fMvB.eval(GetTime()); *pState->var_pf_mv_a = (double)pState->m_fMvA.eval(GetTime()); *pState->var_pf_echo_zoom = (double)pState->m_fVideoEchoZoom.eval(GetTime()); *pState->var_pf_echo_alpha = (double)pState->m_fVideoEchoAlpha.eval(GetTime()); *pState->var_pf_echo_orient = (double)pState->m_nVideoEchoOrientation; // new in v1.04: *pState->var_pf_wave_usedots = (double)pState->m_bWaveDots; *pState->var_pf_wave_thick = (double)pState->m_bWaveThick; *pState->var_pf_wave_additive = (double)pState->m_bAdditiveWaves; *pState->var_pf_wave_brighten = (double)pState->m_bMaximizeWaveColor; *pState->var_pf_darken_center = (double)pState->m_bDarkenCenter; *pState->var_pf_gamma = (double)pState->m_fGammaAdj.eval(GetTime()); *pState->var_pf_wrap = (double)pState->m_bTexWrap; *pState->var_pf_invert = (double)pState->m_bInvert; *pState->var_pf_brighten = (double)pState->m_bBrighten; *pState->var_pf_darken = (double)pState->m_bDarken; *pState->var_pf_solarize = (double)pState->m_bSolarize; *pState->var_pf_meshx = (double)m_nGridX; *pState->var_pf_meshy = (double)m_nGridY; *pState->var_pf_pixelsx = (double)GetWidth(); *pState->var_pf_pixelsy = (double)GetHeight(); *pState->var_pf_aspectx = (double)m_fInvAspectX; *pState->var_pf_aspecty = (double)m_fInvAspectY; // new in v2.0: *pState->var_pf_blur1min = (double)pState->m_fBlur1Min.eval(GetTime()); *pState->var_pf_blur2min = (double)pState->m_fBlur2Min.eval(GetTime()); *pState->var_pf_blur3min = (double)pState->m_fBlur3Min.eval(GetTime()); *pState->var_pf_blur1max = (double)pState->m_fBlur1Max.eval(GetTime()); *pState->var_pf_blur2max = (double)pState->m_fBlur2Max.eval(GetTime()); *pState->var_pf_blur3max = (double)pState->m_fBlur3Max.eval(GetTime()); *pState->var_pf_blur1_edge_darken = (double)pState->m_fBlur1EdgeDarken.eval(GetTime()); } void CPlugin::RunPerFrameEquations(int code) { // run per-frame calculations /* code is only valid when blending. OLDcomp ~ blend-from preset has a composite shader; NEWwarp ~ blend-to preset has a warp shader; etc. code OLDcomp NEWcomp OLDwarp NEWwarp 0 1 1 2 1 3 1 1 4 1 5 1 1 6 1 1 7 1 1 1 8 1 9 1 1 10 1 1 11 1 1 1 12 1 1 13 1 1 1 14 1 1 1 15 1 1 1 1 */ // when blending booleans (like darken, invert, etc) for pre-shader presets, // if blending to/from a pixel-shader preset, we can tune the snap point // (when it changes during the blend) for a less jumpy transition: m_fSnapPoint = 0.5f; if (m_pState->m_bBlending) { switch(code) { case 4: case 6: case 12: case 14: // old preset (only) had a comp shader m_fSnapPoint = -0.01f; break; case 1: case 3: case 9: case 11: // new preset (only) has a comp shader m_fSnapPoint = 1.01f; break; case 0: case 2: case 8: case 10: // neither old or new preset had a comp shader m_fSnapPoint = 0.5f; break; case 5: case 7: case 13: case 15: // both old and new presets use a comp shader - so it won't matter m_fSnapPoint = 0.5f; break; } } int num_reps = (m_pState->m_bBlending) ? 2 : 1; for (int rep=0; rep<num_reps; rep++) { CState *pState; if (rep==0) pState = m_pState; else pState = m_pOldState; // values that will affect the pixel motion (and will be automatically blended // LATER, when the results of 2 sets of these params creates 2 different U/V // meshes that get blended together.) LoadPerFrameEvallibVars(pState); // also do just a once-per-frame init for the *per-**VERTEX*** *READ-ONLY* variables // (the non-read-only ones will be reset/restored at the start of each vertex) *pState->var_pv_time = *pState->var_pf_time; *pState->var_pv_fps = *pState->var_pf_fps; *pState->var_pv_frame = *pState->var_pf_frame; *pState->var_pv_progress = *pState->var_pf_progress; *pState->var_pv_bass = *pState->var_pf_bass; *pState->var_pv_mid = *pState->var_pf_mid; *pState->var_pv_treb = *pState->var_pf_treb; *pState->var_pv_bass_att = *pState->var_pf_bass_att; *pState->var_pv_mid_att = *pState->var_pf_mid_att; *pState->var_pv_treb_att = *pState->var_pf_treb_att; *pState->var_pv_meshx = (double)m_nGridX; *pState->var_pv_meshy = (double)m_nGridY; *pState->var_pv_pixelsx = (double)GetWidth(); *pState->var_pv_pixelsy = (double)GetHeight(); *pState->var_pv_aspectx = (double)m_fInvAspectX; *pState->var_pv_aspecty = (double)m_fInvAspectY; //*pState->var_pv_monitor = *pState->var_pf_monitor; // execute once-per-frame expressions: #ifndef _NO_EXPR_ if (pState->m_pf_codehandle) { NSEEL_code_execute(pState->m_pf_codehandle); } #endif // save some things for next frame: pState->monitor_after_init_code = *pState->var_pf_monitor; // save some things for per-vertex code: for (int vi=0; vi<NUM_Q_VAR; vi++) *pState->var_pv_q[vi] = *pState->var_pf_q[vi]; // (a few range checks:) *pState->var_pf_gamma = max(0 , min( 8, *pState->var_pf_gamma )); *pState->var_pf_echo_zoom = max(0.001, min( 1000, *pState->var_pf_echo_zoom)); /* if (m_pState->m_bRedBlueStereo || m_bAlways3D) { // override wave colors *pState->var_pf_wave_r = 0.35f*(*pState->var_pf_wave_r) + 0.65f; *pState->var_pf_wave_g = 0.35f*(*pState->var_pf_wave_g) + 0.65f; *pState->var_pf_wave_b = 0.35f*(*pState->var_pf_wave_b) + 0.65f; } */ } if (m_pState->m_bBlending) { // For all variables that do NOT affect pixel motion, blend them NOW, // so later the user can just access m_pState->m_pf_whatever. double mix = (double)CosineInterp(m_pState->m_fBlendProgress); double mix2 = 1.0 - mix; *m_pState->var_pf_decay = mix*(*m_pState->var_pf_decay ) + mix2*(*m_pOldState->var_pf_decay ); *m_pState->var_pf_wave_a = mix*(*m_pState->var_pf_wave_a ) + mix2*(*m_pOldState->var_pf_wave_a ); *m_pState->var_pf_wave_r = mix*(*m_pState->var_pf_wave_r ) + mix2*(*m_pOldState->var_pf_wave_r ); *m_pState->var_pf_wave_g = mix*(*m_pState->var_pf_wave_g ) + mix2*(*m_pOldState->var_pf_wave_g ); *m_pState->var_pf_wave_b = mix*(*m_pState->var_pf_wave_b ) + mix2*(*m_pOldState->var_pf_wave_b ); *m_pState->var_pf_wave_x = mix*(*m_pState->var_pf_wave_x ) + mix2*(*m_pOldState->var_pf_wave_x ); *m_pState->var_pf_wave_y = mix*(*m_pState->var_pf_wave_y ) + mix2*(*m_pOldState->var_pf_wave_y ); *m_pState->var_pf_wave_mystery = mix*(*m_pState->var_pf_wave_mystery) + mix2*(*m_pOldState->var_pf_wave_mystery); // wave_mode: exempt (integer) *m_pState->var_pf_ob_size = mix*(*m_pState->var_pf_ob_size ) + mix2*(*m_pOldState->var_pf_ob_size ); *m_pState->var_pf_ob_r = mix*(*m_pState->var_pf_ob_r ) + mix2*(*m_pOldState->var_pf_ob_r ); *m_pState->var_pf_ob_g = mix*(*m_pState->var_pf_ob_g ) + mix2*(*m_pOldState->var_pf_ob_g ); *m_pState->var_pf_ob_b = mix*(*m_pState->var_pf_ob_b ) + mix2*(*m_pOldState->var_pf_ob_b ); *m_pState->var_pf_ob_a = mix*(*m_pState->var_pf_ob_a ) + mix2*(*m_pOldState->var_pf_ob_a ); *m_pState->var_pf_ib_size = mix*(*m_pState->var_pf_ib_size ) + mix2*(*m_pOldState->var_pf_ib_size ); *m_pState->var_pf_ib_r = mix*(*m_pState->var_pf_ib_r ) + mix2*(*m_pOldState->var_pf_ib_r ); *m_pState->var_pf_ib_g = mix*(*m_pState->var_pf_ib_g ) + mix2*(*m_pOldState->var_pf_ib_g ); *m_pState->var_pf_ib_b = mix*(*m_pState->var_pf_ib_b ) + mix2*(*m_pOldState->var_pf_ib_b ); *m_pState->var_pf_ib_a = mix*(*m_pState->var_pf_ib_a ) + mix2*(*m_pOldState->var_pf_ib_a ); *m_pState->var_pf_mv_x = mix*(*m_pState->var_pf_mv_x ) + mix2*(*m_pOldState->var_pf_mv_x ); *m_pState->var_pf_mv_y = mix*(*m_pState->var_pf_mv_y ) + mix2*(*m_pOldState->var_pf_mv_y ); *m_pState->var_pf_mv_dx = mix*(*m_pState->var_pf_mv_dx ) + mix2*(*m_pOldState->var_pf_mv_dx ); *m_pState->var_pf_mv_dy = mix*(*m_pState->var_pf_mv_dy ) + mix2*(*m_pOldState->var_pf_mv_dy ); *m_pState->var_pf_mv_l = mix*(*m_pState->var_pf_mv_l ) + mix2*(*m_pOldState->var_pf_mv_l ); *m_pState->var_pf_mv_r = mix*(*m_pState->var_pf_mv_r ) + mix2*(*m_pOldState->var_pf_mv_r ); *m_pState->var_pf_mv_g = mix*(*m_pState->var_pf_mv_g ) + mix2*(*m_pOldState->var_pf_mv_g ); *m_pState->var_pf_mv_b = mix*(*m_pState->var_pf_mv_b ) + mix2*(*m_pOldState->var_pf_mv_b ); *m_pState->var_pf_mv_a = mix*(*m_pState->var_pf_mv_a ) + mix2*(*m_pOldState->var_pf_mv_a ); *m_pState->var_pf_echo_zoom = mix*(*m_pState->var_pf_echo_zoom ) + mix2*(*m_pOldState->var_pf_echo_zoom ); *m_pState->var_pf_echo_alpha = mix*(*m_pState->var_pf_echo_alpha ) + mix2*(*m_pOldState->var_pf_echo_alpha ); *m_pState->var_pf_echo_orient = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_echo_orient : *m_pState->var_pf_echo_orient; // added in v1.04: *m_pState->var_pf_wave_usedots = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_wave_usedots : *m_pState->var_pf_wave_usedots ; *m_pState->var_pf_wave_thick = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_wave_thick : *m_pState->var_pf_wave_thick ; *m_pState->var_pf_wave_additive= (mix < m_fSnapPoint) ? *m_pOldState->var_pf_wave_additive : *m_pState->var_pf_wave_additive; *m_pState->var_pf_wave_brighten= (mix < m_fSnapPoint) ? *m_pOldState->var_pf_wave_brighten : *m_pState->var_pf_wave_brighten; *m_pState->var_pf_darken_center= (mix < m_fSnapPoint) ? *m_pOldState->var_pf_darken_center : *m_pState->var_pf_darken_center; *m_pState->var_pf_gamma = mix*(*m_pState->var_pf_gamma ) + mix2*(*m_pOldState->var_pf_gamma ); *m_pState->var_pf_wrap = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_wrap : *m_pState->var_pf_wrap ; *m_pState->var_pf_invert = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_invert : *m_pState->var_pf_invert ; *m_pState->var_pf_brighten = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_brighten : *m_pState->var_pf_brighten ; *m_pState->var_pf_darken = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_darken : *m_pState->var_pf_darken ; *m_pState->var_pf_solarize = (mix < m_fSnapPoint) ? *m_pOldState->var_pf_solarize : *m_pState->var_pf_solarize ; // added in v2.0: *m_pState->var_pf_blur1min = mix*(*m_pState->var_pf_blur1min ) + mix2*(*m_pOldState->var_pf_blur1min ); *m_pState->var_pf_blur2min = mix*(*m_pState->var_pf_blur2min ) + mix2*(*m_pOldState->var_pf_blur2min ); *m_pState->var_pf_blur3min = mix*(*m_pState->var_pf_blur3min ) + mix2*(*m_pOldState->var_pf_blur3min ); *m_pState->var_pf_blur1max = mix*(*m_pState->var_pf_blur1max ) + mix2*(*m_pOldState->var_pf_blur1max ); *m_pState->var_pf_blur2max = mix*(*m_pState->var_pf_blur2max ) + mix2*(*m_pOldState->var_pf_blur2max ); *m_pState->var_pf_blur3max = mix*(*m_pState->var_pf_blur3max ) + mix2*(*m_pOldState->var_pf_blur3max ); *m_pState->var_pf_blur1_edge_darken = mix*(*m_pState->var_pf_blur1_edge_darken) + mix2*(*m_pOldState->var_pf_blur1_edge_darken); } } void CPlugin::RenderFrame(const int bRedraw) { const float fDeltaT = 1.0f/GetFps(); if (bRedraw) { // pre-un-flip buffers, so we are redoing the same work as we did last frame... IDirect3DTexture9* pTemp = m_lpVS[0]; m_lpVS[0] = m_lpVS[1]; m_lpVS[1] = pTemp; } // update time /* float fDeltaT = (GetFrame()==0) ? 1.0f/30.0f : GetTime() - m_prev_time; DWORD dwTime = GetTickCount(); float fDeltaT = (dwTime - m_dwPrevTickCount)*0.001f; if (GetFrame() > 64) { fDeltaT = (fDeltaT)*0.2f + 0.8f*(1.0f/m_fps); if (fDeltaT > 2.0f/m_fps) { char buf[64] = {0}; _snprintf(buf, ARRAYSIZE(buf), "fixing time gap of %5.3f seconds", fDeltaT); dumpmsg(buf); fDeltaT = 1.0f/m_fps; } } m_dwPrevTickCount = dwTime; GetTime() += fDeltaT; */ if (GetFrame()==0) { m_fStartTime = GetTime(); m_fPresetStartTime = GetTime(); } if (m_fNextPresetTime < 0) { float dt = m_fTimeBetweenPresetsRand * (warand()%1000)*0.001f; m_fNextPresetTime = GetTime() + m_fBlendTimeAuto + m_fTimeBetweenPresets + dt; } /* if (m_bPresetLockedByUser || m_bPresetLockedByCode) { // if the user has the preset LOCKED, or if they're in the middle of // saving it, then keep extending the time at which the auto-switch will occur // (by the length of this frame). m_fPresetStartTime += fDeltaT; m_fNextPresetTime += fDeltaT; }*/ // update fps /* if (GetFrame() < 4) { m_fps = 0.0f; } else if (GetFrame() <= 64) { m_fps = GetFrame() / (float)(GetTime() - m_fTimeHistory[0]); } else { m_fps = 64.0f / (float)(GetTime() - m_fTimeHistory[m_nTimeHistoryPos]); } m_fTimeHistory[m_nTimeHistoryPos] = GetTime(); m_nTimeHistoryPos = (m_nTimeHistoryPos + 1) % 64; */ // limit fps, if necessary /* if (m_nFpsLimit > 0 && (GetFrame() % 64) == 0 && GetFrame() > 64) { float spf_now = 1.0f / m_fps; float spf_desired = 1.0f / (float)m_nFpsLimit; float new_sleep = m_fFPSLimitSleep + (spf_desired - spf_now)*1000.0f; if (GetFrame() <= 128) m_fFPSLimitSleep = new_sleep; else m_fFPSLimitSleep = m_fFPSLimitSleep*0.8f + 0.2f*new_sleep; if (m_fFPSLimitSleep < 0) m_fFPSLimitSleep = 0; if (m_fFPSLimitSleep > 100) m_fFPSLimitSleep = 100; //_snprintf(m_szUserMessage, ARRAYSIZE(m_szUserMessage), "sleep=%f", m_fFPSLimitSleep); //m_fShowUserMessageUntilThisTime = GetTime() + 3.0f; } static float deficit; if (GetFrame()==0) deficit = 0; float ideal_sleep = (m_fFPSLimitSleep + deficit); int actual_sleep = (int)ideal_sleep; if (actual_sleep > 0) Sleep(actual_sleep); deficit = ideal_sleep - actual_sleep; if (deficit < 0) deficit = 0; // just in case if (deficit > 1) deficit = 1; // just in case */ if (!bRedraw) { m_rand_frame = D3DXVECTOR4(FRAND, FRAND, FRAND, FRAND); // randomly change the preset, if it's time if (m_fNextPresetTime < GetTime()) { if (m_nLoadingPreset==0) // don't start a load if one is already underway! LoadRandomPreset(m_fBlendTimeAuto); } // randomly spawn Song Title, if time if (m_fTimeBetweenRandomSongTitles > 0 && !m_supertext.bRedrawSuperText && GetTime() >= m_supertext.fStartTime + m_supertext.fDuration + 1.0f/GetFps()) { int n = GetNumToSpawn(GetTime(), fDeltaT, 1.0f/m_fTimeBetweenRandomSongTitles, 0.5f, m_nSongTitlesSpawned); if (n > 0) { LaunchSongTitleAnim(); m_nSongTitlesSpawned += n; } } // randomly spawn Custom Message, if time if (m_fTimeBetweenRandomCustomMsgs > 0 && !m_supertext.bRedrawSuperText && GetTime() >= m_supertext.fStartTime + m_supertext.fDuration + 1.0f/GetFps()) { const int n = GetNumToSpawn(GetTime(), fDeltaT, 1.0f/m_fTimeBetweenRandomCustomMsgs, 0.5f, m_nCustMsgsSpawned); if (n > 0) { LaunchCustomMessage(-1); m_nCustMsgsSpawned += n; } } // update m_fBlendProgress; if (m_pState->m_bBlending) { m_pState->m_fBlendProgress = (GetTime() - m_pState->m_fBlendStartTime) / m_pState->m_fBlendDuration; if (m_pState->m_fBlendProgress > 1.0f) { m_pState->m_bBlending = false; } } // handle hard cuts here (just after new sound analysis) static float s_fHardCutThresh; if (GetFrame() == 0) s_fHardCutThresh = m_fHardCutLoudnessThresh*2.0f; if (GetFps() > 1.0f && !m_bHardCutsDisabled && !m_bPresetLockedByUser && !m_bPresetLockedByCode) { if (mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2] > s_fHardCutThresh*3.0f) { if (m_nLoadingPreset==0) // don't start a load if one is already underway! LoadRandomPreset(0.0f); s_fHardCutThresh *= 2.0f; } else { /* float halflife_modified = m_fHardCutHalflife*0.5f; //thresh = (thresh - 1.5f)*0.99f + 1.5f; float k = -0.69315f / halflife_modified;*/ float k = -1.3863f / (m_fHardCutHalflife*GetFps()); //float single_frame_multiplier = powf(2.7183f, k / GetFps()); float single_frame_multiplier = expf(k); s_fHardCutThresh = (s_fHardCutThresh - m_fHardCutLoudnessThresh)*single_frame_multiplier + m_fHardCutLoudnessThresh; } } // smooth & scale the audio data, according to m_state, for display purposes float scale = m_pState->m_fWaveScale.eval(GetTime()) / 128.0f; mysound.fWaveform[0][0] *= scale; mysound.fWaveform[1][0] *= scale; float mix2 = m_pState->m_fWaveSmoothing.eval(GetTime()); float mix1 = scale*(1.0f - mix2); for (int i=1; i<576; i++) { mysound.fWaveform[0][i] = mysound.fWaveform[0][i]*mix1 + mysound.fWaveform[0][i-1]*mix2; mysound.fWaveform[1][i] = mysound.fWaveform[1][i]*mix1 + mysound.fWaveform[1][i-1]*mix2; } } const bool bOldPresetUsesWarpShader = (m_pOldState->m_nWarpPSVersion > 0); const bool bNewPresetUsesWarpShader = (m_pState->m_nWarpPSVersion > 0); const bool bOldPresetUsesCompShader = (m_pOldState->m_nCompPSVersion > 0); const bool bNewPresetUsesCompShader = (m_pState->m_nCompPSVersion > 0); // note: 'code' is only meaningful if we are BLENDING. const int code = (bOldPresetUsesWarpShader ? 8 : 0) | (bOldPresetUsesCompShader ? 4 : 0) | (bNewPresetUsesWarpShader ? 2 : 0) | (bNewPresetUsesCompShader ? 1 : 0); RunPerFrameEquations(code); // restore any lost surfaces //m_lpDD->RestoreAllSurfaces(); LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; // Remember the original backbuffer and zbuffer LPDIRECT3DSURFACE9 pBackBuffer=NULL;//, pZBuffer=NULL; lpDevice->GetRenderTarget( 0, &pBackBuffer ); //lpDevice->GetDepthStencilSurface( &pZBuffer ); // set up render state { //DWORD texaddr = (*m_pState->var_pf_wrap > m_fSnapPoint) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP; lpDevice->SetRenderState(D3DRS_WRAP0, 0);//D3DWRAPCOORD_0|D3DWRAPCOORD_1|D3DWRAPCOORD_2|D3DWRAPCOORD_3); //lpDevice->SetRenderState(D3DRS_WRAP0, (*m_pState->var_pf_wrap) ? D3DWRAP_U|D3DWRAP_V|D3DWRAP_W : 0); //lpDevice->SetRenderState(D3DRS_WRAP1, (*m_pState->var_pf_wrap) ? D3DWRAP_U|D3DWRAP_V|D3DWRAP_W : 0); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);//texaddr); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);//texaddr); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSW, D3DTADDRESS_WRAP);//texaddr); lpDevice->SetSamplerState(1, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); lpDevice->SetSamplerState(1, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); lpDevice->SetSamplerState(1, D3DSAMP_ADDRESSW, D3DTADDRESS_WRAP); lpDevice->SetRenderState( D3DRS_SHADEMODE, D3DSHADE_GOURAUD ); lpDevice->SetRenderState( D3DRS_SPECULARENABLE, FALSE ); lpDevice->SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE ); lpDevice->SetRenderState( D3DRS_ZENABLE, FALSE ); lpDevice->SetRenderState( D3DRS_ZWRITEENABLE, FALSE ); lpDevice->SetRenderState( D3DRS_LIGHTING, FALSE ); lpDevice->SetRenderState( D3DRS_COLORVERTEX, TRUE ); lpDevice->SetRenderState( D3DRS_FILLMODE, D3DFILL_SOLID ); lpDevice->SetRenderState( D3DRS_ALPHABLENDENABLE, FALSE ); lpDevice->SetRenderState( D3DRS_AMBIENT, 0xFFFFFFFF ); //? lpDevice->SetRenderState( D3DRS_CLIPPING, TRUE ); // stages 0 and 1 always just use bilinear filtering. lpDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); // note: this texture stage state setup works for 0 or 1 texture. // if you set a texture, it will be modulated with the current diffuse color. // if you don't set a texture, it will just use the current diffuse color. lpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); // NOTE: don't forget to call SetTexture and SetVertexShader before drawing! // Examples: // SPRITEVERTEX verts[4]; // has texcoords // lpDevice->SetTexture(0, m_sprite_tex); // lpDevice->SetVertexShader( SPRITEVERTEX_FORMAT ); // // WFVERTEX verts[4]; // no texcoords // lpDevice->SetTexture(0, NULL); // lpDevice->SetVertexShader( WFVERTEX_FORMAT ); } // render string to m_lpDDSTitle, if necessary if (m_supertext.bRedrawSuperText) { if (!RenderStringToTitleTexture()) m_supertext.fStartTime = -1.0f; m_supertext.bRedrawSuperText = false; } // set up to render [from NULL] to VS0 (for motion vectors). { lpDevice->SetTexture(0, NULL); IDirect3DSurface9* pNewTarget = NULL; if (!m_lpVS[0] || m_lpVS[0]->GetSurfaceLevel(0, &pNewTarget) != D3D_OK) return; lpDevice->SetRenderTarget(0, pNewTarget ); //lpDevice->SetDepthStencilSurface( NULL ); pNewTarget->Release(); lpDevice->SetTexture(0, NULL); } // draw motion vectors to VS0 DrawMotionVectors(); lpDevice->SetTexture(0, NULL); lpDevice->SetTexture(1, NULL); // on first frame, clear OLD VS. if (m_nFramesSinceResize == 0) { IDirect3DSurface9* pNewTarget = NULL; if (m_lpVS[0]->GetSurfaceLevel(0, &pNewTarget) != D3D_OK) return; lpDevice->SetRenderTarget(0, pNewTarget ); //lpDevice->SetDepthStencilSurface( NULL ); pNewTarget->Release(); lpDevice->Clear(0, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0); } // set up to render [from VS0] to VS1. { IDirect3DSurface9* pNewTarget = NULL; if (m_lpVS[1]->GetSurfaceLevel(0, &pNewTarget) != D3D_OK) return; lpDevice->SetRenderTarget(0, pNewTarget ); //lpDevice->SetDepthStencilSurface( NULL ); pNewTarget->Release(); } if (m_bAutoGamma && GetFrame()==0) { /*if (strstr(GetDriverDescription(), "nvidia") || strstr(GetDriverDescription(), "nVidia") || strstr(GetDriverDescription(), "NVidia") || strstr(GetDriverDescription(), "NVIDIA")) m_n16BitGamma = 2; else if (strstr(GetDriverDescription(), "ATI RAGE MOBILITY M")) m_n16BitGamma = 2; else m_n16BitGamma = 0;*/ LPCSTR driver_desc = GetDriverDescription(); m_n16BitGamma = ((driver_desc && *driver_desc && strstr(driver_desc, "ATI RAGE MOBILITY M") || StrStrIA(driver_desc, "nVidia")) ? 2 : 0); } ComputeGridAlphaValues(); // do the warping for this frame [warp shader] if (!m_pState->m_bBlending) { // no blend if (bNewPresetUsesWarpShader) WarpedBlit_Shaders(1, false, false, false, false); else WarpedBlit_NoShaders(1, false, false, false, false); } else { // blending // WarpedBlit( nPass, bAlphaBlend, bFlipAlpha, bCullTiles, bFlipCulling ) // note: alpha values go from 0..1 during a blend. // note: bFlipCulling==false means tiles with alpha>0 will draw. // bFlipCulling==true means tiles with alpha<255 will draw. if (bOldPresetUsesWarpShader && bNewPresetUsesWarpShader) { WarpedBlit_Shaders (0, false, false, true, true); WarpedBlit_Shaders (1, true, false, true, false); } else if (!bOldPresetUsesWarpShader && bNewPresetUsesWarpShader) { WarpedBlit_NoShaders(0, false, false, true, true); WarpedBlit_Shaders (1, true, false, true, false); } else if (bOldPresetUsesWarpShader && !bNewPresetUsesWarpShader) { WarpedBlit_Shaders (0, false, false, true, true); WarpedBlit_NoShaders(1, true, false, true, false); } else if (!bOldPresetUsesWarpShader && !bNewPresetUsesWarpShader) { //WarpedBlit_NoShaders(0, false, false, true, true); //WarpedBlit_NoShaders(1, true, false, true, false); // special case - all the blending just happens in the vertex UV's, so just pretend there's no blend. WarpedBlit_NoShaders(1, false, false, false, false); } } if (m_nMaxPSVersion > 0) BlurPasses(); // draw audio data DrawCustomShapes(); // draw these first; better for feedback if the waves draw *over* them. DrawCustomWaves(); DrawWave(); DrawSprites(); const float fProgress = (GetTime() - m_supertext.fStartTime) / m_supertext.fDuration; // if song title animation just ended, burn it into the VS: if (m_supertext.fStartTime >= 0 && fProgress >= 1.0f && !m_supertext.bRedrawSuperText) { ShowSongTitleAnim(m_nTexSizeX, m_nTexSizeY, 1.0f); } // Change the rendertarget back to the original setup lpDevice->SetTexture(0, NULL); lpDevice->SetRenderTarget(0, pBackBuffer ); //lpDevice->SetDepthStencilSurface( pZBuffer ); SafeRelease(pBackBuffer); //SafeRelease(pZBuffer); // show it to the user [composite shader] if (!m_pState->m_bBlending) { // no blend if (bNewPresetUsesCompShader) ShowToUser_Shaders(1, false, false, false, false); else ShowToUser_NoShaders();//1, false, false, false, false); } else { // blending // ShowToUser( nPass, bAlphaBlend, bFlipAlpha, bCullTiles, bFlipCulling ) // note: alpha values go from 0..1 during a blend. // note: bFlipCulling==false means tiles with alpha>0 will draw. // bFlipCulling==true means tiles with alpha<255 will draw. // NOTE: ShowToUser_NoShaders() must always come before ShowToUser_Shaders(), // because it always draws the full quad (it can't do tile culling or alpha blending). // [third case here] if (bOldPresetUsesCompShader && bNewPresetUsesCompShader) { ShowToUser_Shaders (0, false, false, true, true); ShowToUser_Shaders (1, true, false, true, false); } else if (!bOldPresetUsesCompShader && bNewPresetUsesCompShader) { ShowToUser_NoShaders(); ShowToUser_Shaders (1, true, false, true, false); } else if (bOldPresetUsesCompShader && !bNewPresetUsesCompShader) { // THA FUNKY REVERSAL //ShowToUser_Shaders (0); //ShowToUser_NoShaders(1); ShowToUser_NoShaders(); ShowToUser_Shaders (0, true, true, true, true); } else if (!bOldPresetUsesCompShader && !bNewPresetUsesCompShader) { // special case - all the blending just happens in the blended state vars, so just pretend there's no blend. ShowToUser_NoShaders();//1, false, false, false, false); } } // finally, render song title animation to back buffer if (m_supertext.fStartTime >= 0 && !m_supertext.bRedrawSuperText) { ShowSongTitleAnim(GetWidth(), GetHeight(), min(fProgress, 0.9999f)); if (fProgress >= 1.0f) m_supertext.fStartTime = -1.0f; // 'off' state } DrawUserSprites(); // flip buffers IDirect3DTexture9* pTemp = m_lpVS[0]; m_lpVS[0] = m_lpVS[1]; m_lpVS[1] = pTemp; /* // FIXME - remove EnforceMaxFPS() if never used //EnforceMaxFPS(!(m_nLoadingPreset==1 || m_nLoadingPreset==2 || m_nLoadingPreset==4 || m_nLoadingPreset==5)); // this call just turns it on or off; doesn't do it now... //EnforceMaxFPS(!(m_nLoadingPreset==2 || m_nLoadingPreset==5)); // this call just turns it on or off; doesn't do it now... // FIXME - remove this stuff, and change 'm_last_raw_time' in pluginshell (and others) back to private. static float fOldTime = 0; float fNewTime = (float)((double)m_last_raw_time/(double)m_high_perf_timer_freq.QuadPart); float dt = fNewTime-fOldTime; if (m_nLoadingPreset != 0) { char buf[256] = {0}; _snprintf(buf, ARRAYSIZE(buf), "m_nLoadingPreset==%d: dt=%d ms\n", m_nLoadingPreset, (int)(dt*1000) ); OutputDebugString(buf); } fOldTime = fNewTime; */ #ifdef SPOUT_SUPPORT // ========================================================= // SPOUT output // // Adapted from : https://gist.github.com/karlgluck/8467971 // if (bSpoutOut) { // Spout is started or stopped with CTRL-Z // Grab the backbuffer from the Direct3D device LPDIRECT3DSURFACE9 back_buffer = NULL; HRESULT hr = lpDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_TYPE_MONO, &back_buffer); if (SUCCEEDED(hr)) { // Get the buffer's description and make an offscreen surface in system memory. // We need to do this because the backbuffer is in video memory and can't be locked // unless the device was created with a special flag (D3DPRESENTFLAG_LOCKABLE_BACKBUFFER). // Unfortunately, a video-memory buffer CAN be locked with LockRect. The effect is // that it crashes your app when you try to read or write to it. D3DSURFACE_DESC desc = { 0 }; back_buffer->GetDesc(&desc); // Check backbuffer size against sender initialized size // which should correctly detect render size changes so // unlike the original patch it won't need to store the // prior window size & using that to determine a change. if (bInitialized == false || m_nFramesSinceResize == 0) { // If initialized already, update the sender to the new size // There is no shared texture in this app but there will be in the // spoutsender object when we create a sender and we can send pixels to it if (bInitialized) { spoutsender.UpdateSender("WACUPSpoutSender", desc.Width, desc.Height); } else { bInitialized = OpenSender(desc.Width, desc.Height); } back_buffer->Release(); return; } if (!bInitialized) { back_buffer->Release(); return; // safety } LPDIRECT3DSURFACE9 offscreen_surface = NULL; hr = lpDevice->CreateOffscreenPlainSurface(desc.Width, desc.Height, desc.Format, D3DPOOL_SYSTEMMEM, &offscreen_surface, NULL); if (SUCCEEDED(hr)) { // Copy from video memory to system memory hr = lpDevice->GetRenderTargetData(back_buffer, offscreen_surface); if (SUCCEEDED(hr)) { // Lock the surface using some flags for optimization D3DLOCKED_RECT d3dlr = { 0 }; hr = offscreen_surface->LockRect(&d3dlr, NULL, D3DLOCK_NO_DIRTY_UPDATE | D3DLOCK_READONLY); if (SUCCEEDED(hr)) { // Can find the backbuffer format here, but a variable format // isn't implemented so the user has to set up for X8R8G8B8. // Clear alpha to white so that rgba can be used in Processing unsigned char *src = (unsigned char *)d3dlr.pBits; for (unsigned int i = 0; i < desc.Height; i++) { for (unsigned int j = 0; j < desc.Width * 4; j += 4) { src += 3; *src++ = 255; } } // Pass the pixels to spout spoutsender.SendImage((const unsigned char *)d3dlr.pBits, desc.Width, desc.Height, GL_BGRA_EXT); } } offscreen_surface->UnlockRect(); offscreen_surface->Release(); } // Release all of our references back_buffer->Release(); } // // ====================================================================== } #endif } void CPlugin::DrawMotionVectors() const { // FLEXIBLE MOTION VECTOR FIELD if ((float)*m_pState->var_pf_mv_a >= 0.001f) { //------------------------------------------------------- LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader(NULL); lpDevice->SetFVF(WFVERTEX_FORMAT); //------------------------------------------------------- int nX = (int)(*m_pState->var_pf_mv_x);// + 0.999f); int nY = (int)(*m_pState->var_pf_mv_y);// + 0.999f); float dx = (float)*m_pState->var_pf_mv_x - nX; float dy = (float)*m_pState->var_pf_mv_y - nY; if (nX > 64) { nX = 64; dx = 0; } if (nY > 48) { nY = 48; dy = 0; } if (nX > 0 && nY > 0) { /* float dx2 = m_fMotionVectorsTempDx;//(*m_pState->var_pf_mv_dx) * 0.05f*GetTime(); // 0..1 range float dy2 = m_fMotionVectorsTempDy;//(*m_pState->var_pf_mv_dy) * 0.05f*GetTime(); // 0..1 range if (GetFps() > 2.0f && GetFps() < 300.0f) { dx2 += (float)(*m_pState->var_pf_mv_dx) * 0.05f / GetFps(); dy2 += (float)(*m_pState->var_pf_mv_dy) * 0.05f / GetFps(); } if (dx2 > 1.0f) dx2 -= (int)dx2; if (dy2 > 1.0f) dy2 -= (int)dy2; if (dx2 < 0.0f) dx2 = 1.0f - (-dx2 - (int)(-dx2)); if (dy2 < 0.0f) dy2 = 1.0f - (-dy2 - (int)(-dy2)); // hack: when there is only 1 motion vector on the screem, to keep it in // the center, we gradually migrate it toward 0.5. dx2 = dx2*0.995f + 0.5f*0.005f; dy2 = dy2*0.995f + 0.5f*0.005f; // safety catch if (dx2 < 0 || dx2 > 1 || dy2 < 0 || dy2 > 1) { dx2 = 0.5f; dy2 = 0.5f; } m_fMotionVectorsTempDx = dx2; m_fMotionVectorsTempDy = dy2;*/ float dx2 = (float)(*m_pState->var_pf_mv_dx); float dy2 = (float)(*m_pState->var_pf_mv_dy); float len_mult = (float)*m_pState->var_pf_mv_l; if (dx < 0) dx = 0; if (dy < 0) dy = 0; if (dx > 1) dx = 1; if (dy > 1) dy = 1; //dx = dx * 1.0f/(float)nX; //dy = dy * 1.0f/(float)nY; float inv_texsize = 1.0f/(float)m_nTexSizeX; float min_len = 1.0f*inv_texsize; WFVERTEX v[(64+1)*2] = {0}; v[0].Diffuse = D3DCOLOR_RGBA_01((float)*m_pState->var_pf_mv_r,(float)*m_pState->var_pf_mv_g,(float)*m_pState->var_pf_mv_b,(float)*m_pState->var_pf_mv_a); for (int x=1; x<(nX+1)*2; x++) v[x].Diffuse = v[0].Diffuse; lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); for (int y=0; y<nY; y++) { float fy = (y + 0.25f)/(float)(nY + dy + 0.25f - 1.0f); // now move by offset fy -= dy2; if (fy > 0.0001f && fy < 0.9999f) { int n = 0; for (int x=0; x<nX; x++) { //float fx = (x + 0.25f)/(float)(nX + dx + 0.25f - 1.0f); float fx = (x + 0.25f)/(float)(nX + dx + 0.25f - 1.0f); // now move by offset fx += dx2; if (fx > 0.0001f && fx < 0.9999f) { float fx2, fy2; ReversePropagatePoint(fx, fy, &fx2, &fy2); // NOTE: THIS IS REALLY A REVERSE-PROPAGATION //fx2 = fx*2 - fx2; //fy2 = fy*2 - fy2; //fx2 = fx + 1.0f/(float)m_nTexSize; //fy2 = 1-(fy + 1.0f/(float)m_nTexSize); // enforce minimum trail lengths: { float _dx = (fx2 - fx); float _dy = (fy2 - fy); _dx *= len_mult; _dy *= len_mult; float len = sqrtf(_dx*_dx + _dy*_dy); if (len > min_len) { } else if (len > 0.00000001f) { len = min_len/len; _dx *= len; _dy *= len; } else { _dx = min_len; _dy = min_len; } fx2 = fx + _dx; fy2 = fy + _dy; } /**/ v[n].x = fx * 2.0f - 1.0f; v[n].y = fy * 2.0f - 1.0f; v[n+1].x = fx2 * 2.0f - 1.0f; v[n+1].y = fy2 * 2.0f - 1.0f; // actually, project it in the reverse direction //v[n+1].x = v[n].x*2.0f - v[n+1].x;// + dx*2; //v[n+1].y = v[n].y*2.0f - v[n+1].y;// + dy*2; //v[n].x += dx*2; //v[n].y += dy*2; n += 2; } } // draw it lpDevice->DrawPrimitiveUP(D3DPT_LINELIST, n/2, v, sizeof(WFVERTEX)); } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); } } } /* void CPlugin::UpdateSongInfo() { if (m_bShowSongTitle || m_bSongTitleAnims) { char szOldSongMessage[512] = {0}; strcpy(szOldSongMessage, m_szSongMessage); if (::GetWindowText(m_hWndParent, m_szSongMessage, sizeof(m_szSongMessage))) { // remove ' - Winamp' at end if (strlen(m_szSongMessage) > 9) { int check_pos = strlen(m_szSongMessage) - 9; if (wcscmp(" - Winamp", (char *)(m_szSongMessage + check_pos)) == 0) m_szSongMessage[check_pos] = 0; } // remove ' - Winamp [Paused]' at end if (strlen(m_szSongMessage) > 18) { int check_pos = strlen(m_szSongMessage) - 18; if (wcscmp(" - Winamp [Paused]", (char *)(m_szSongMessage + check_pos)) == 0) m_szSongMessage[check_pos] = 0; } // remove song # and period from beginning char *p = m_szSongMessage; while (*p >= '0' && *p <= '9') ++p; if (*p == '.' && *(p+1) == ' ') { p += 2; int pos = 0; while (*p != 0) { m_szSongMessage[pos++] = *p; ++p; } m_szSongMessage[pos++] = 0; } // fix &'s for display /* { int pos = 0; int len = strlen(m_szSongMessage); while (m_szSongMessage[pos]) { if (m_szSongMessage[pos] == '&') { for (int x=len; x>=pos; x--) m_szSongMessage[x+1] = m_szSongMessage[x]; ++len; ++pos; } ++pos; } }*/ /* if (m_bSongTitleAnims && ((wcscmp(szOldSongMessage, m_szSongMessage) != 0) || (GetFrame()==0))) { // launch song title animation LaunchSongTitleAnim(); /* m_supertext.bRedrawSuperText = true; m_supertext.bIsSongTitle = true; strcpy(m_supertext.szText, m_szSongMessage); strcpy(m_supertext.nFontFace, m_szTitleFontFace); m_supertext.fFontSize = (float)m_nTitleFontSize; m_supertext.bBold = m_bTitleFontBold; m_supertext.bItal = m_bTitleFontItalic; m_supertext.fX = 0.5f; m_supertext.fY = 0.5f; m_supertext.fGrowth = 1.0f; m_supertext.fDuration = m_fSongTitleAnimDuration; m_supertext.nColorR = 255; m_supertext.nColorG = 255; m_supertext.nColorB = 255; m_supertext.fStartTime = GetTime(); */ /* } } else { _snprintf(m_szSongMessage, ARRAYSIZE(m_szSongMessage), "<couldn't get song title>"); } } m_nTrackPlaying = GetPlaylistPosition(); // append song time if (m_bShowSongTime && m_nSongPosMS >= 0) { float time_s = m_nSongPosMS*0.001f; int minutes = (int)(time_s/60); time_s -= minutes*60; int seconds = (int)time_s; time_s -= seconds; int dsec = (int)(time_s*100); _snprintf(m_szSongTime, ARRAYSIZE(m_szSongTime), "%d:%02d.%02d", minutes, seconds, dsec); } // append song length if (m_bShowSongLen && m_nSongLenMS > 0) { int len_s = m_nSongLenMS/1000; int minutes = len_s/60; int seconds = len_s - minutes*60; char buf[512] = {0}; _snprintf(buf, ARRAYSIZE(buf), " / %d:%02d", minutes, seconds); strncat(m_szSongTime, buf, ARRAYSIZE(buf)); } } */ bool CPlugin::ReversePropagatePoint(float fx, float fy, float *fx2, float *fy2) const { //float fy = y/(float)nMotionVectorsY; int y0 = (int)(fy*m_nGridY); float dy = fy*m_nGridY - y0; //float fx = x/(float)nMotionVectorsX; int x0 = (int)(fx*m_nGridX); float dx = fx*m_nGridX - x0; int x1 = x0 + 1; int y1 = y0 + 1; if (x0 < 0) return false; if (y0 < 0) return false; //if (x1 < 0) return false; //if (y1 < 0) return false; //if (x0 > m_nGridX) return false; //if (y0 > m_nGridY) return false; if (x1 > m_nGridX) return false; if (y1 > m_nGridY) return false; float tu, tv; tu = m_verts[y0*(m_nGridX+1)+x0].tu * (1-dx)*(1-dy); tv = m_verts[y0*(m_nGridX+1)+x0].tv * (1-dx)*(1-dy); tu += m_verts[y0*(m_nGridX+1)+x1].tu * (dx)*(1-dy); tv += m_verts[y0*(m_nGridX+1)+x1].tv * (dx)*(1-dy); tu += m_verts[y1*(m_nGridX+1)+x0].tu * (1-dx)*(dy); tv += m_verts[y1*(m_nGridX+1)+x0].tv * (1-dx)*(dy); tu += m_verts[y1*(m_nGridX+1)+x1].tu * (dx)*(dy); tv += m_verts[y1*(m_nGridX+1)+x1].tv * (dx)*(dy); *fx2 = tu; *fy2 = 1.0f - tv; return true; } void CPlugin::GetSafeBlurMinMax(CState* pState, float* blur_min, float* blur_max) { blur_min[0] = (float)*pState->var_pf_blur1min; blur_min[1] = (float)*pState->var_pf_blur2min; blur_min[2] = (float)*pState->var_pf_blur3min; blur_max[0] = (float)*pState->var_pf_blur1max; blur_max[1] = (float)*pState->var_pf_blur2max; blur_max[2] = (float)*pState->var_pf_blur3max; // check that precision isn't wasted in later blur passes [...min-max gap can't grow!] // also, if min-max are close to each other, push them apart: const float fMinDist = 0.1f; if (blur_max[0] - blur_min[0] < fMinDist) { float avg = (blur_min[0] + blur_max[0])*0.5f; blur_min[0] = avg - fMinDist*0.5f; blur_max[0] = avg - fMinDist*0.5f; } blur_max[1] = min(blur_max[0], blur_max[1]); blur_min[1] = max(blur_min[0], blur_min[1]); if (blur_max[1] - blur_min[1] < fMinDist) { float avg = (blur_min[1] + blur_max[1])*0.5f; blur_min[1] = avg - fMinDist*0.5f; blur_max[1] = avg - fMinDist*0.5f; } blur_max[2] = min(blur_max[1], blur_max[2]); blur_min[2] = max(blur_min[1], blur_min[2]); if (blur_max[2] - blur_min[2] < fMinDist) { float avg = (blur_min[2] + blur_max[2])*0.5f; blur_min[2] = avg - fMinDist*0.5f; blur_max[2] = avg - fMinDist*0.5f; } } void CPlugin::BlurPasses() { #if (NUM_BLUR_TEX>0) // Note: Blur is currently a little funky. It blurs the *current* frame after warp; // this way, it lines up well with the composite pass. However, if you switch // presets instantly, to one whose *warp* shader uses the blur texture, // it will be outdated (just for one frame). Oh well. // This also means that when sampling the blurred textures in the warp shader, // they are one frame old. This isn't too big a deal. Getting them to match // up for the composite pass is probably more important. LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; int passes = min(NUM_BLUR_TEX, m_nHighestBlurTexUsedThisFrame*2); if (passes==0) return; LPDIRECT3DSURFACE9 pBackBuffer=NULL;//, pZBuffer=NULL; lpDevice->GetRenderTarget( 0, &pBackBuffer ); //lpDevice->SetFVF( MYVERTEX_FORMAT ); lpDevice->SetVertexShader( m_BlurShaders[0].vs.ptr ); lpDevice->SetVertexDeclaration(m_pMyVertDecl); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); DWORD wrap = D3DTADDRESS_CLAMP;//D3DTADDRESS_WRAP;// : D3DTADDRESS_CLAMP; lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, wrap); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, wrap); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSW, wrap); lpDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MAXANISOTROPY, 1); IDirect3DSurface9* pNewTarget = NULL; // clear texture bindings for (int i=0; i<16; i++) lpDevice->SetTexture(i, NULL); // set up fullscreen quad MYVERTEX v[4] = {0}; v[0].x = -1; v[0].y = -1; v[1].x = 1; v[1].y = -1; v[2].x = -1; v[2].y = 1; v[3].x = 1; v[3].y = 1; v[0].tu = 0; //kiv: upside-down? v[0].tv = 0; v[1].tu = 1; v[1].tv = 0; v[2].tu = 0; v[2].tv = 1; v[3].tu = 1; v[3].tv = 1; const float w[8] = { 4.0f, 3.8f, 3.5f, 2.9f, 1.9f, 1.2f, 0.7f, 0.3f }; //<- user can specify these float edge_darken = (float)*m_pState->var_pf_blur1_edge_darken; float blur_min[3] = {0}, blur_max[3] = {0}; GetSafeBlurMinMax(m_pState, blur_min, blur_max); float fscale[3] = {0}; float fbias[3] = {0}; // figure out the progressive scale & bias needed, at each step, // to go from one [min..max] range to the next. float temp_min, temp_max; fscale[0] = 1.0f / (blur_max[0] - blur_min[0]); fbias [0] = -blur_min[0] * fscale[0]; temp_min = (blur_min[1] - blur_min[0]) / (blur_max[0] - blur_min[0]); temp_max = (blur_max[1] - blur_min[0]) / (blur_max[0] - blur_min[0]); fscale[1] = 1.0f / (temp_max - temp_min); fbias [1] = -temp_min * fscale[1]; temp_min = (blur_min[2] - blur_min[1]) / (blur_max[1] - blur_min[1]); temp_max = (blur_max[2] - blur_min[1]) / (blur_max[1] - blur_min[1]); fscale[2] = 1.0f / (temp_max - temp_min); fbias [2] = -temp_min * fscale[2]; // note: warped blit just rendered from VS0 to VS1. for (int i=0; i<passes; i++) { // hook up correct render target if (m_lpBlur[i]->GetSurfaceLevel(0, &pNewTarget) != D3D_OK) return; lpDevice->SetRenderTarget(0, pNewTarget); pNewTarget->Release(); // hook up correct source texture - assume there is only one, at stage 0 lpDevice->SetTexture(0, (i==0) ? m_lpVS[0] : m_lpBlur[i-1]); // set pixel shader lpDevice->SetPixelShader (m_BlurShaders[i%2].ps.ptr); // set constants LPD3DXCONSTANTTABLE pCT = m_BlurShaders[i%2].ps.CT; D3DXHANDLE* h = m_BlurShaders[i%2].ps.params.const_handles; int srcw = (i==0) ? GetWidth() : m_nBlurTexW[i-1]; int srch = (i==0) ? GetHeight() : m_nBlurTexH[i-1]; D3DXVECTOR4 srctexsize = D3DXVECTOR4( (float)srcw, (float)srch, 1.0f/(float)srcw, 1.0f/(float)srch ); float fscale_now = fscale[i/2]; float fbias_now = fbias[i/2]; if (i%2==0) { // pass 1 (long horizontal pass) //------------------------------------- const float w1 = w[0] + w[1]; const float w2 = w[2] + w[3]; const float w3 = w[4] + w[5]; const float w4 = w[6] + w[7]; const float d1 = 0 + 2*w[1]/w1; const float d2 = 2 + 2*w[3]/w2; const float d3 = 4 + 2*w[5]/w3; const float d4 = 6 + 2*w[7]/w4; const float w_div = 0.5f/(w1+w2+w3+w4); //------------------------------------- //float4 _c0; // source texsize (.xy), and inverse (.zw) //float4 _c1; // w1..w4 //float4 _c2; // d1..d4 //float4 _c3; // scale, bias, w_div, 0 //------------------------------------- if (h[0]) pCT->SetVector( lpDevice, h[0], &srctexsize ); if (h[1]) pCT->SetVector( lpDevice, h[1], &D3DXVECTOR4( w1,w2,w3,w4 )); if (h[2]) pCT->SetVector( lpDevice, h[2], &D3DXVECTOR4( d1,d2,d3,d4 )); if (h[3]) pCT->SetVector( lpDevice, h[3], &D3DXVECTOR4( fscale_now,fbias_now,w_div,0)); } else { // pass 2 (short vertical pass) //------------------------------------- const float w1 = w[0]+w[1] + w[2]+w[3]; const float w2 = w[4]+w[5] + w[6]+w[7]; const float d1 = 0 + 2*((w[2]+w[3])/w1); const float d2 = 2 + 2*((w[6]+w[7])/w2); const float w_div = 1.0f/((w1+w2)*2); //------------------------------------- //float4 _c0; // source texsize (.xy), and inverse (.zw) //float4 _c5; // w1,w2,d1,d2 //float4 _c6; // w_div, edge_darken_c1, edge_darken_c2, edge_darken_c3 //------------------------------------- if (h[0]) pCT->SetVector( lpDevice, h[0], &srctexsize ); if (h[5]) pCT->SetVector( lpDevice, h[5], &D3DXVECTOR4( w1,w2,d1,d2 )); if (h[6]) { // note: only do this first time; if you do it many times, // then the super-blurred levels will have big black lines along the top & left sides. if (i==1) pCT->SetVector( lpDevice, h[6], &D3DXVECTOR4( w_div,(1-edge_darken),edge_darken,5.0f )); //darken edges else pCT->SetVector( lpDevice, h[6], &D3DXVECTOR4( w_div,1.0f,0.0f,5.0f )); // don't darken } } // draw fullscreen quad lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, v, sizeof(MYVERTEX)); // clear texture bindings lpDevice->SetTexture(0, NULL); } lpDevice->SetRenderTarget(0, pBackBuffer); pBackBuffer->Release(); lpDevice->SetPixelShader( NULL ); lpDevice->SetVertexShader( NULL ); lpDevice->SetTexture(0, NULL); lpDevice->SetFVF( MYVERTEX_FORMAT ); #endif m_nHighestBlurTexUsedThisFrame = 0; } void CPlugin::ComputeGridAlphaValues() { float fBlend = m_pState->m_fBlendProgress;//max(0,min(1,(m_pState->m_fBlendProgress*1.6f - 0.3f))); /*switch(code) //if (nPassOverride==0) { //case 8: //case 9: //case 12: //case 13: // note - these are the 4 cases where the old preset uses a warp shader, but new preset doesn't. fBlend = 1-fBlend; // <-- THIS IS THE KEY - FLIPS THE ALPHAS AND EVERYTHING ELSE JUST WORKS. break; }*/ //fBlend = 1-fBlend; // <-- THIS IS THE KEY - FLIPS THE ALPHAS AND EVERYTHING ELSE JUST WORKS. //bool bBlending = m_pState->m_bBlending;//(fBlend >= 0.0001f && fBlend <= 0.9999f); // warp stuff float fWarpTime = GetTime() * m_pState->m_fWarpAnimSpeed; float fWarpScaleInv = 1.0f / m_pState->m_fWarpScale.eval(GetTime()); float f[4] = {0}; f[0] = 11.68f + 4.0f*cosf(fWarpTime*1.413f + 10); f[1] = 8.77f + 3.0f*cosf(fWarpTime*1.113f + 7); f[2] = 10.54f + 3.0f*cosf(fWarpTime*1.233f + 3); f[3] = 11.49f + 4.0f*cosf(fWarpTime*0.933f + 5); // texel alignment float texel_offset_x = 0.5f / (float)m_nTexSizeX; float texel_offset_y = 0.5f / (float)m_nTexSizeY; int num_reps = (m_pState->m_bBlending) ? 2 : 1; int start_rep = 0; // FIRST WE HAVE 1-2 PASSES FOR CRUNCHING THE PER-VERTEX EQUATIONS for (int rep=start_rep; rep<num_reps; rep++) { // to blend the two PV equations together, we simulate both to get the final UV coords, // then we blend those final UV coords. We also write out an alpha value so that // the second DRAW pass below (which might use a different shader) can do blending. CState *pState; if (rep==0) pState = m_pState; else pState = m_pOldState; // cache the doubles as floats so that computations are a bit faster float fZoom = (float)(*pState->var_pf_zoom); float fZoomExp = (float)(*pState->var_pf_zoomexp); float fRot = (float)(*pState->var_pf_rot); float fWarp = (float)(*pState->var_pf_warp); float fCX = (float)(*pState->var_pf_cx); float fCY = (float)(*pState->var_pf_cy); float fDX = (float)(*pState->var_pf_dx); float fDY = (float)(*pState->var_pf_dy); float fSX = (float)(*pState->var_pf_sx); float fSY = (float)(*pState->var_pf_sy); int n = 0; for (int y=0; y<=m_nGridY; y++) { for (int x=0; x<=m_nGridX; x++) { // Note: x, y, z are now set at init. time - no need to mess with them! //m_verts[n].x = i/(float)m_nGridX*2.0f - 1.0f; //m_verts[n].y = j/(float)m_nGridY*2.0f - 1.0f; //m_verts[n].z = 0.0f; if (pState->m_pp_codehandle) { // restore all the variables to their original states, // run the user-defined equations, // then move the results into local vars for computation as floats *pState->var_pv_x = (double)(m_verts[n].x* 0.5f*m_fAspectX + 0.5f); *pState->var_pv_y = (double)(m_verts[n].y*-0.5f*m_fAspectY + 0.5f); *pState->var_pv_rad = (double)m_vertinfo[n].rad; *pState->var_pv_ang = (double)m_vertinfo[n].ang; *pState->var_pv_zoom = *pState->var_pf_zoom; *pState->var_pv_zoomexp = *pState->var_pf_zoomexp; *pState->var_pv_rot = *pState->var_pf_rot; *pState->var_pv_warp = *pState->var_pf_warp; *pState->var_pv_cx = *pState->var_pf_cx; *pState->var_pv_cy = *pState->var_pf_cy; *pState->var_pv_dx = *pState->var_pf_dx; *pState->var_pv_dy = *pState->var_pf_dy; *pState->var_pv_sx = *pState->var_pf_sx; *pState->var_pv_sy = *pState->var_pf_sy; //*pState->var_pv_time = *pState->var_pv_time; // (these are all now initialized //*pState->var_pv_bass = *pState->var_pv_bass; // just once per frame) //*pState->var_pv_mid = *pState->var_pv_mid; //*pState->var_pv_treb = *pState->var_pv_treb; //*pState->var_pv_bass_att = *pState->var_pv_bass_att; //*pState->var_pv_mid_att = *pState->var_pv_mid_att; //*pState->var_pv_treb_att = *pState->var_pv_treb_att; #ifndef _NO_EXPR_ NSEEL_code_execute(pState->m_pp_codehandle); #endif fZoom = (float)(*pState->var_pv_zoom); fZoomExp = (float)(*pState->var_pv_zoomexp); fRot = (float)(*pState->var_pv_rot); fWarp = (float)(*pState->var_pv_warp); fCX = (float)(*pState->var_pv_cx); fCY = (float)(*pState->var_pv_cy); fDX = (float)(*pState->var_pv_dx); fDY = (float)(*pState->var_pv_dy); fSX = (float)(*pState->var_pv_sx); fSY = (float)(*pState->var_pv_sy); } float fZoom2 = powf(fZoom, powf(fZoomExp, m_vertinfo[n].rad*2.0f - 1.0f)); // initial texcoords, w/built-in zoom factor float fZoom2Inv = 1.0f/fZoom2; float u = m_verts[n].x*m_fAspectX*0.5f*fZoom2Inv + 0.5f; float v = -m_verts[n].y*m_fAspectY*0.5f*fZoom2Inv + 0.5f; //float u_orig = u; //float v_orig = v; //m_verts[n].tr = u_orig + texel_offset_x; //m_verts[n].ts = v_orig + texel_offset_y; // stretch on X, Y: u = (u - fCX)/fSX + fCX; v = (v - fCY)/fSY + fCY; // warping: //if (fWarp > 0.001f || fWarp < -0.001f) //{ u += fWarp*0.0035f*sinf(fWarpTime*0.333f + fWarpScaleInv*(m_verts[n].x*f[0] - m_verts[n].y*f[3])); v += fWarp*0.0035f*cosf(fWarpTime*0.375f - fWarpScaleInv*(m_verts[n].x*f[2] + m_verts[n].y*f[1])); u += fWarp*0.0035f*cosf(fWarpTime*0.753f - fWarpScaleInv*(m_verts[n].x*f[1] - m_verts[n].y*f[2])); v += fWarp*0.0035f*sinf(fWarpTime*0.825f + fWarpScaleInv*(m_verts[n].x*f[0] + m_verts[n].y*f[3])); //} // rotation: float u2 = u - fCX; float v2 = v - fCY; float cos_rot = cosf(fRot); float sin_rot = sinf(fRot); u = u2*cos_rot - v2*sin_rot + fCX; v = u2*sin_rot + v2*cos_rot + fCY; // translation: u -= fDX; v -= fDY; // undo aspect ratio fix: u = (u-0.5f)*m_fInvAspectX + 0.5f; v = (v-0.5f)*m_fInvAspectY + 0.5f; // final half-texel-offset translation: u += texel_offset_x; v += texel_offset_y; if (rep==0) { // UV's for m_pState m_verts[n].tu = u; m_verts[n].tv = v; m_verts[n].Diffuse = 0xFFFFFFFF; } else { // blend to UV's for m_pOldState float mix2 = m_vertinfo[n].a*fBlend + m_vertinfo[n].c;//fCosineBlend2; mix2 = max(0,min(1,mix2)); // if fBlend un-flipped, then mix2 is 0 at the beginning of a blend, 1 at the end... // and alphas are 0 at the beginning, 1 at the end. m_verts[n].tu = m_verts[n].tu*(mix2) + u*(1-mix2); m_verts[n].tv = m_verts[n].tv*(mix2) + v*(1-mix2); // this sets the alpha values for blending between two presets: m_verts[n].Diffuse = 0x00FFFFFF | (((DWORD)(mix2*255))<<24); } ++n; } } } } void CPlugin::WarpedBlit_NoShaders(int nPass, bool bAlphaBlend, bool bFlipAlpha, bool bCullTiles, bool bFlipCulling) { MungeFPCW(NULL); // puts us in single-precision mode & disables exceptions LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; if (!wcscmp(m_pState->m_szDesc, INVALID_PRESET_DESC)) { // if no valid preset loaded, clear the target to black, and return lpDevice->Clear(0, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0); return; } lpDevice->SetTexture(0, m_lpVS[0]); lpDevice->SetVertexShader( NULL ); lpDevice->SetPixelShader( NULL ); lpDevice->SetFVF( MYVERTEX_FORMAT ); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); // stages 0 and 1 always just use bilinear filtering. lpDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); // note: this texture stage state setup works for 0 or 1 texture. // if you set a texture, it will be modulated with the current diffuse color. // if you don't set a texture, it will just use the current diffuse color. lpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); DWORD texaddr = (*m_pState->var_pf_wrap > m_fSnapPoint) ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP; lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, texaddr); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, texaddr); lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSW, texaddr); // decay float fDecay = (float)(*m_pState->var_pf_decay); //if (m_pState->m_bBlending) // fDecay = fDecay*(fCosineBlend) + (1.0f-fCosineBlend)*((float)(*m_pOldState->var_pf_decay)); if (m_n16BitGamma > 0 && (GetBackBufFormat()==D3DFMT_R5G6B5 || GetBackBufFormat()==D3DFMT_X1R5G5B5 || GetBackBufFormat()==D3DFMT_A1R5G5B5 || GetBackBufFormat()==D3DFMT_A4R4G4B4) && fDecay < 0.9999f) { fDecay = min(fDecay, (32.0f - m_n16BitGamma)/32.0f); } D3DCOLOR cDecay = D3DCOLOR_RGBA_01(fDecay,fDecay,fDecay,1); // hurl the triangle strips at the video card int poly; for (poly=0; poly<(m_nGridX+1)*2; poly++) m_verts_temp[poly].Diffuse = cDecay; if (bAlphaBlend) { lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); if (bFlipAlpha) { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA); } else { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); } } else lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); int nAlphaTestValue = 0; if (bFlipCulling) nAlphaTestValue = 1-nAlphaTestValue; // Hurl the triangles at the video card. // We're going to un-index it, so that we don't stress any crappy (AHEM intel g33) // drivers out there. // If we're blending, we'll skip any polygon that is all alpha-blended out. // This also respects the MaxPrimCount limit of the video card. MYVERTEX tempv[1024 * 3] = {0}; int max_prims_per_batch = min( GetCaps()->MaxPrimitiveCount, (ARRAYSIZE(tempv))/3) - 4; int primCount = m_nGridX*m_nGridY*2; int src_idx = 0; while (src_idx < primCount*3) { int prims_queued = 0; int i=0; while (prims_queued < max_prims_per_batch && src_idx < primCount*3) { // copy 3 verts for (int j=0; j<3; j++) { tempv[i++] = m_verts[ m_indices_list[src_idx++] ]; // don't forget to flip sign on Y and factor in the decay color!: tempv[i-1].y *= -1; tempv[i-1].Diffuse = (cDecay & 0x00FFFFFF) | (tempv[i-1].Diffuse & 0xFF000000); } if (bCullTiles) { DWORD d1 = (tempv[i-3].Diffuse >> 24); DWORD d2 = (tempv[i-2].Diffuse >> 24); DWORD d3 = (tempv[i-1].Diffuse >> 24); bool bIsNeeded; if (nAlphaTestValue) bIsNeeded = ((d1 & d2 & d3) < 255);//(d1 < 255) || (d2 < 255) || (d3 < 255); else bIsNeeded = ((d1|d2|d3) > 0);//(d1 > 0) || (d2 > 0) || (d3 > 0); if (!bIsNeeded) i -= 3; else ++prims_queued; } else ++prims_queued; } if (prims_queued > 0) lpDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, prims_queued, tempv, sizeof(MYVERTEX) ); } /* if (!bCullTiles) { assert(!bAlphaBlend); //not handled yet // draw normally - just a full triangle strip for each half-row of cells // (even if we are blending, it is between two pre-pixel-shader presets, // so the blend all happens exclusively in the per-vertex equations.) for (int strip=0; strip<m_nGridY*2; strip++) { int index = strip * (m_nGridX+2); for (poly=0; poly<m_nGridX+2; poly++) { int ref_vert = m_indices_strip[index]; m_verts_temp[poly].x = m_verts[ref_vert].x; m_verts_temp[poly].y = -m_verts[ref_vert].y; m_verts_temp[poly].z = m_verts[ref_vert].z; m_verts_temp[poly].tu = m_verts[ref_vert].tu; m_verts_temp[poly].tv = m_verts[ref_vert].tv; //m_verts_temp[poly].Diffuse = cDecay; this is done just once - see jsut above ++index; } lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, m_nGridX, (void*)m_verts_temp, sizeof(MYVERTEX)); } } else { // we're blending to/from a new pixel-shader enabled preset; // only draw the cells needed! (an optimization) int nAlphaTestValue = 0; if (bFlipCulling) nAlphaTestValue = 1-nAlphaTestValue; int idx[2048] = {0}; for (int y=0; y<m_nGridY; y++) { // copy verts & flip sign on Y int ref_vert = y*(m_nGridX+1); for (int i=0; i<(m_nGridX+1)*2; i++) { m_verts_temp[i].x = m_verts[ref_vert].x; m_verts_temp[i].y = -m_verts[ref_vert].y; m_verts_temp[i].z = m_verts[ref_vert].z; m_verts_temp[i].tu = m_verts[ref_vert].tu; m_verts_temp[i].tv = m_verts[ref_vert].tv; m_verts_temp[i].Diffuse = (cDecay & 0x00FFFFFF) | (m_verts[ref_vert].Diffuse & 0xFF000000); ++ref_vert; } // create (smart) indices int count = 0; int nVert = 0; bool bWasNeeded; ref_vert = (y)*(m_nGridX+1); DWORD d1 = (m_verts[ref_vert ].Diffuse >> 24); DWORD d2 = (m_verts[ref_vert+m_nGridX+1].Diffuse >> 24); if (nAlphaTestValue) bWasNeeded = (d1 < 255) || (d2 < 255); else bWasNeeded = (d1 > 0) || (d2 > 0); for (i=0; i<m_nGridX; i++) { bool bIsNeeded; DWORD d1 = (m_verts[ref_vert+1 ].Diffuse >> 24); DWORD d2 = (m_verts[ref_vert+1+m_nGridX+1].Diffuse >> 24); if (nAlphaTestValue) bIsNeeded = (d1 < 255) || (d2 < 255); else bIsNeeded = (d1 > 0) || (d2 > 0); if (bIsNeeded || bWasNeeded) { idx[count++] = nVert; idx[count++] = nVert+1; idx[count++] = nVert+m_nGridX+1; idx[count++] = nVert+m_nGridX+1; idx[count++] = nVert+1; idx[count++] = nVert+m_nGridX+2; } bWasNeeded = bIsNeeded; ++nVert; ++ref_vert; } lpDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, (m_nGridX+1)*2, count/3, (void*)idx, D3DFMT_INDEX32, (void*)m_verts_temp, sizeof(MYVERTEX)); } }/**/ lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); } void CPlugin::WarpedBlit_Shaders(int nPass, bool bAlphaBlend, bool bFlipAlpha, bool bCullTiles, bool bFlipCulling) { // if nPass==0, it draws old preset (blending 1 of 2). // if nPass==1, it draws new preset (blending 2 of 2, OR done blending) MungeFPCW(NULL); // puts us in single-precision mode & disables exceptions LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; if (!wcscmp(m_pState->m_szDesc, INVALID_PRESET_DESC)) { // if no valid preset loaded, clear the target to black, and return lpDevice->Clear(0, NULL, D3DCLEAR_TARGET, 0x00000000, 1.0f, 0); return; } //float fBlend = m_pState->m_fBlendProgress;//max(0,min(1,(m_pState->m_fBlendProgress*1.6f - 0.3f))); //if (nPassOverride==0) // fBlend = 1-fBlend; // <-- THIS IS THE KEY - FLIPS THE ALPHAS AND EVERYTHING ELSE JUST WORKS. //bool bBlending = m_pState->m_bBlending;//(fBlend >= 0.0001f && fBlend <= 0.9999f); //lpDevice->SetTexture(0, m_lpVS[0]); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( MYVERTEX_FORMAT ); // texel alignment int nAlphaTestValue = 0; if (bFlipCulling) nAlphaTestValue = 1-nAlphaTestValue; if (bAlphaBlend) { lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); if (bFlipAlpha) { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA); } else { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); } } else lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); int pass = nPass; { // PASS 0: draw using *blended per-vertex motion vectors*, but with the OLD warp shader. // PASS 1: draw using *blended per-vertex motion vectors*, but with the NEW warp shader. PShaderInfo* si = (pass==0) ? &m_OldShaders.warp : &m_shaders.warp; CState* state = (pass==0) ? m_pOldState : m_pState; lpDevice->SetVertexDeclaration(m_pMyVertDecl); lpDevice->SetVertexShader(m_fallbackShaders_vs.warp.ptr); lpDevice->SetPixelShader (si->ptr); ApplyShaderParams( &(si->params), si->CT, state ); // Hurl the triangles at the video card. // We're going to un-index it, so that we don't stress any crappy (AHEM intel g33) // drivers out there. // We divide it into the two halves of the screen (top/bottom) so we can hack // the 'ang' values along the angle-wrap seam, halfway through the draw. // If we're blending, we'll skip any polygon that is all alpha-blended out. // This also respects the MaxPrimCount limit of the video card. MYVERTEX tempv[1024 * 3] = {0}; int max_prims_per_batch = min( GetCaps()->MaxPrimitiveCount, (ARRAYSIZE(tempv))/3) - 4; for (int half=0; half<2; half++) { // hack / restore the ang values along the angle-wrap [0 <-> 2pi] seam... float new_ang = half ? 3.1415926535897932384626433832795f : -3.1415926535897932384626433832795f; int y_offset = (m_nGridY/2) * (m_nGridX+1); for (int x=0; x<m_nGridX/2; x++) m_verts[y_offset + x].ang = new_ang; // send half of the polys int primCount = m_nGridX*m_nGridY*2 / 2; // in this case, to draw HALF the polys int src_idx = 0; int src_idx_offset = half * primCount*3; while (src_idx < primCount*3) { int prims_queued = 0; int i=0; while (prims_queued < max_prims_per_batch && src_idx < primCount*3) { // copy 3 verts for (int j=0; j<3; j++) tempv[i++] = m_verts[ m_indices_list[src_idx_offset + src_idx++] ]; if (bCullTiles) { DWORD d1 = (tempv[i-3].Diffuse >> 24); DWORD d2 = (tempv[i-2].Diffuse >> 24); DWORD d3 = (tempv[i-1].Diffuse >> 24); bool bIsNeeded; if (nAlphaTestValue) bIsNeeded = ((d1 & d2 & d3) < 255);//(d1 < 255) || (d2 < 255) || (d3 < 255); else bIsNeeded = ((d1|d2|d3) > 0);//(d1 > 0) || (d2 > 0) || (d3 > 0); if (!bIsNeeded) i -= 3; else ++prims_queued; } else ++prims_queued; } if (prims_queued > 0) lpDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, prims_queued, tempv, sizeof(MYVERTEX) ); } } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); RestoreShaderParams(); } void CPlugin::DrawCustomShapes() const { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; //lpDevice->SetTexture(0, m_lpVS[0]);//NULL); //lpDevice->SetVertexShader( SPRITEVERTEX_FORMAT ); int num_reps = (m_pState->m_bBlending) ? 2 : 1; for (int rep=0; rep<num_reps; rep++) { CState *pState = (rep==0) ? m_pState : m_pOldState; float alpha_mult = 1; if (num_reps==2) alpha_mult = (rep==0) ? m_pState->m_fBlendProgress : (1-m_pState->m_fBlendProgress); for (int i=0; i<MAX_CUSTOM_SHAPES; i++) { if (pState->m_shape[i].enabled) { /* int bAdditive = 0; int nSides = 3;//3 + ((int)GetTime() % 8); int bThickOutline = 0; float x = 0.5f + 0.1f*cosf(GetTime()*0.8f+1); float y = 0.5f + 0.1f*sinf(GetTime()*0.8f+1); float rad = 0.15f + 0.07f*sinf(GetTime()*1.1f+3); float ang = GetTime()*1.5f; // inside colors float r = 1; float g = 0; float b = 0; float a = 0.4f;//0.1f + 0.1f*sinf(GetTime()*0.31f); // outside colors float r2 = 0; float g2 = 1; float b2 = 0; float a2 = 0; // border colors float border_r = 1; float border_g = 1; float border_b = 1; float border_a = 0.5f; */ for (int instance=0; instance<pState->m_shape[i].instances; instance++) { // 1. execute per-frame code LoadCustomShapePerFrameEvallibVars(pState, i, instance); #ifndef _NO_EXPR_ if (pState->m_shape[i].m_pf_codehandle) { NSEEL_code_execute(pState->m_shape[i].m_pf_codehandle); } #endif // save changes to t1-t8 this frame /* pState->m_shape[i].t_values_after_init_code[0] = *pState->m_shape[i].var_pf_t1; pState->m_shape[i].t_values_after_init_code[1] = *pState->m_shape[i].var_pf_t2; pState->m_shape[i].t_values_after_init_code[2] = *pState->m_shape[i].var_pf_t3; pState->m_shape[i].t_values_after_init_code[3] = *pState->m_shape[i].var_pf_t4; pState->m_shape[i].t_values_after_init_code[4] = *pState->m_shape[i].var_pf_t5; pState->m_shape[i].t_values_after_init_code[5] = *pState->m_shape[i].var_pf_t6; pState->m_shape[i].t_values_after_init_code[6] = *pState->m_shape[i].var_pf_t7; pState->m_shape[i].t_values_after_init_code[7] = *pState->m_shape[i].var_pf_t8; */ int sides = (int)(*pState->m_shape[i].var_pf_sides); if (sides<3) sides=3; if (sides>100) sides=100; lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, ((int)(*pState->m_shape[i].var_pf_additive) != 0) ? D3DBLEND_ONE : D3DBLEND_INVSRCALPHA); SPRITEVERTEX v[512] = {0}; // for textured shapes (has texcoords) WFVERTEX v2[512] = {0}; // for untextured shapes + borders v[0].x = (float)(*pState->m_shape[i].var_pf_x* 2-1);// * ASPECT; v[0].y = (float)(*pState->m_shape[i].var_pf_y*-2+1); v[0].z = 0; v[0].tu = 0.5f; v[0].tv = 0.5f; v[0].Diffuse = ((((int)(*pState->m_shape[i].var_pf_a * 255 * alpha_mult)) & 0xFF) << 24) | ((((int)(*pState->m_shape[i].var_pf_r * 255)) & 0xFF) << 16) | ((((int)(*pState->m_shape[i].var_pf_g * 255)) & 0xFF) << 8) | ((((int)(*pState->m_shape[i].var_pf_b * 255)) & 0xFF) ); v[1].Diffuse = ((((int)(*pState->m_shape[i].var_pf_a2 * 255 * alpha_mult)) & 0xFF) << 24) | ((((int)(*pState->m_shape[i].var_pf_r2 * 255)) & 0xFF) << 16) | ((((int)(*pState->m_shape[i].var_pf_g2 * 255)) & 0xFF) << 8) | ((((int)(*pState->m_shape[i].var_pf_b2 * 255)) & 0xFF) ); for (int j=1; j<sides+1; j++) { float t = (j-1)/(float)sides; v[j].x = v[0].x + (float)*pState->m_shape[i].var_pf_rad*cosf(t*3.1415927f*2 + (float)*pState->m_shape[i].var_pf_ang + 3.1415927f*0.25f)*m_fAspectY; // DON'T TOUCH! v[j].y = v[0].y + (float)*pState->m_shape[i].var_pf_rad*sinf(t*3.1415927f*2 + (float)*pState->m_shape[i].var_pf_ang + 3.1415927f*0.25f); // DON'T TOUCH! v[j].z = 0; v[j].tu = 0.5f + 0.5f*cosf(t*3.1415927f*2 + (float)*pState->m_shape[i].var_pf_tex_ang + 3.1415927f*0.25f)/((float)*pState->m_shape[i].var_pf_tex_zoom) * m_fAspectY; // DON'T TOUCH! v[j].tv = 0.5f + 0.5f*sinf(t*3.1415927f*2 + (float)*pState->m_shape[i].var_pf_tex_ang + 3.1415927f*0.25f)/((float)*pState->m_shape[i].var_pf_tex_zoom); // DON'T TOUCH! v[j].Diffuse = v[1].Diffuse; } v[sides+1] = v[1]; if ((int)(*pState->m_shape[i].var_pf_textured) != 0) { // draw textured version lpDevice->SetTexture(0, m_lpVS[0]); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( SPRITEVERTEX_FORMAT ); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, sides, (void*)v, sizeof(SPRITEVERTEX)); } else { // no texture for (int j=0; j < sides+2; j++) { v2[j].x = v[j].x; v2[j].y = v[j].y; v2[j].z = v[j].z; v2[j].Diffuse = v[j].Diffuse; } lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( WFVERTEX_FORMAT ); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, sides, (void*)v2, sizeof(WFVERTEX)); } // DRAW BORDER if (*pState->m_shape[i].var_pf_border_a > 0) { lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( WFVERTEX_FORMAT ); v2[0].Diffuse = ((((int)(*pState->m_shape[i].var_pf_border_a * 255 * alpha_mult)) & 0xFF) << 24) | ((((int)(*pState->m_shape[i].var_pf_border_r * 255)) & 0xFF) << 16) | ((((int)(*pState->m_shape[i].var_pf_border_g * 255)) & 0xFF) << 8) | ((((int)(*pState->m_shape[i].var_pf_border_b * 255)) & 0xFF) ); for (int j=0; j<sides+2; j++) { v2[j].x = v[j].x; v2[j].y = v[j].y; v2[j].z = v[j].z; v2[j].Diffuse = v2[0].Diffuse; } int its = ((int)(*pState->m_shape[i].var_pf_thick) != 0) ? 4 : 1; float x_inc = 2.0f / (float)m_nTexSizeX; float y_inc = 2.0f / (float)m_nTexSizeY; for (int it=0; it<its; it++) { switch(it) { case 0: break; case 1: for (int j=0; j<sides+2; j++) v2[j].x += x_inc; break; // draw fat dots case 2: for (int j=0; j<sides+2; j++) v2[j].y += y_inc; break; // draw fat dots case 3: for (int j=0; j<sides+2; j++) v2[j].x -= x_inc; break; // draw fat dots } lpDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, sides, (void*)&v2[1], sizeof(WFVERTEX)); } } lpDevice->SetTexture(0, m_lpVS[0]); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( SPRITEVERTEX_FORMAT ); } } } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); } void CPlugin::LoadCustomShapePerFrameEvallibVars(CState* pState, int i, int instance) const { *pState->m_shape[i].var_pf_time = (double)(GetTime() - m_fStartTime); *pState->m_shape[i].var_pf_frame = (double)GetFrame(); *pState->m_shape[i].var_pf_fps = (double)GetFps(); *pState->m_shape[i].var_pf_progress = (GetTime() - m_fPresetStartTime) / (m_fNextPresetTime - m_fPresetStartTime); *pState->m_shape[i].var_pf_bass = (double)mysound.imm_rel[0]; *pState->m_shape[i].var_pf_mid = (double)mysound.imm_rel[1]; *pState->m_shape[i].var_pf_treb = (double)mysound.imm_rel[2]; *pState->m_shape[i].var_pf_bass_att = (double)mysound.avg_rel[0]; *pState->m_shape[i].var_pf_mid_att = (double)mysound.avg_rel[1]; *pState->m_shape[i].var_pf_treb_att = (double)mysound.avg_rel[2]; for (int vi=0; vi<NUM_Q_VAR; vi++) *pState->m_shape[i].var_pf_q[vi] = *pState->var_pf_q[vi]; for (int vi=0; vi<NUM_T_VAR; vi++) *pState->m_shape[i].var_pf_t[vi] = pState->m_shape[i].t_values_after_init_code[vi]; *pState->m_shape[i].var_pf_x = pState->m_shape[i].x; *pState->m_shape[i].var_pf_y = pState->m_shape[i].y; *pState->m_shape[i].var_pf_rad = pState->m_shape[i].rad; *pState->m_shape[i].var_pf_ang = pState->m_shape[i].ang; *pState->m_shape[i].var_pf_tex_zoom = pState->m_shape[i].tex_zoom; *pState->m_shape[i].var_pf_tex_ang = pState->m_shape[i].tex_ang; *pState->m_shape[i].var_pf_sides = pState->m_shape[i].sides; *pState->m_shape[i].var_pf_additive = pState->m_shape[i].additive; *pState->m_shape[i].var_pf_textured = pState->m_shape[i].textured; *pState->m_shape[i].var_pf_instances = pState->m_shape[i].instances; *pState->m_shape[i].var_pf_instance = instance; *pState->m_shape[i].var_pf_thick = pState->m_shape[i].thickOutline; *pState->m_shape[i].var_pf_r = pState->m_shape[i].r; *pState->m_shape[i].var_pf_g = pState->m_shape[i].g; *pState->m_shape[i].var_pf_b = pState->m_shape[i].b; *pState->m_shape[i].var_pf_a = pState->m_shape[i].a; *pState->m_shape[i].var_pf_r2 = pState->m_shape[i].r2; *pState->m_shape[i].var_pf_g2 = pState->m_shape[i].g2; *pState->m_shape[i].var_pf_b2 = pState->m_shape[i].b2; *pState->m_shape[i].var_pf_a2 = pState->m_shape[i].a2; *pState->m_shape[i].var_pf_border_r = pState->m_shape[i].border_r; *pState->m_shape[i].var_pf_border_g = pState->m_shape[i].border_g; *pState->m_shape[i].var_pf_border_b = pState->m_shape[i].border_b; *pState->m_shape[i].var_pf_border_a = pState->m_shape[i].border_a; } void CPlugin::LoadCustomWavePerFrameEvallibVars(CState* pState, int i) const { *pState->m_wave[i].var_pf_time = (double)(GetTime() - m_fStartTime); *pState->m_wave[i].var_pf_frame = (double)GetFrame(); *pState->m_wave[i].var_pf_fps = (double)GetFps(); *pState->m_wave[i].var_pf_progress = (GetTime() - m_fPresetStartTime) / (m_fNextPresetTime - m_fPresetStartTime); *pState->m_wave[i].var_pf_bass = (double)mysound.imm_rel[0]; *pState->m_wave[i].var_pf_mid = (double)mysound.imm_rel[1]; *pState->m_wave[i].var_pf_treb = (double)mysound.imm_rel[2]; *pState->m_wave[i].var_pf_bass_att = (double)mysound.avg_rel[0]; *pState->m_wave[i].var_pf_mid_att = (double)mysound.avg_rel[1]; *pState->m_wave[i].var_pf_treb_att = (double)mysound.avg_rel[2]; for (int vi=0; vi<NUM_Q_VAR; vi++) *pState->m_wave[i].var_pf_q[vi] = *pState->var_pf_q[vi]; for (int vi=0; vi<NUM_T_VAR; vi++) *pState->m_wave[i].var_pf_t[vi] = pState->m_wave[i].t_values_after_init_code[vi]; *pState->m_wave[i].var_pf_r = pState->m_wave[i].r; *pState->m_wave[i].var_pf_g = pState->m_wave[i].g; *pState->m_wave[i].var_pf_b = pState->m_wave[i].b; *pState->m_wave[i].var_pf_a = pState->m_wave[i].a; *pState->m_wave[i].var_pf_samples = pState->m_wave[i].samples; } // does a better-than-linear smooth on a wave. Roughly doubles the # of points. int SmoothWave(WFVERTEX* vi, int nVertsIn, WFVERTEX* vo) { const float c1 = -0.15f; const float c2 = 1.15f; const float c3 = 1.15f; const float c4 = -0.15f; const float inv_sum = 1.0f/(c1+c2+c3+c4); int j = 0; int i_below = 0; int i_above2 = 1; for (int i=0; i<nVertsIn-1; i++) { int i_above = i_above2; i_above2 = min(nVertsIn-1,i+2); vo[j] = vi[i]; vo[j+1].x = (c1*vi[i_below].x + c2*vi[i].x + c3*vi[i_above].x + c4*vi[i_above2].x)*inv_sum; vo[j+1].y = (c1*vi[i_below].y + c2*vi[i].y + c3*vi[i_above].y + c4*vi[i_above2].y)*inv_sum; vo[j+1].z = 0; vo[j+1].Diffuse = vi[i].Diffuse;//0xFFFF0080; i_below = i; j += 2; } vo[j++] = vi[nVertsIn-1]; return j; } void CPlugin::DrawCustomWaves() const { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( WFVERTEX_FORMAT ); // note: read in all sound data from CPluginShell's m_sound int num_reps = (m_pState->m_bBlending) ? 2 : 1; for (int rep=0; rep<num_reps; rep++) { CState *pState = (rep==0) ? m_pState : m_pOldState; float alpha_mult = 1; if (num_reps==2) alpha_mult = (rep==0) ? m_pState->m_fBlendProgress : (1-m_pState->m_fBlendProgress); for (int i=0; i<MAX_CUSTOM_WAVES; i++) { if (pState->m_wave[i].enabled) { //int nSamples = pState->m_wave[i].samples; int max_samples = pState->m_wave[i].bSpectrum ? 512 : NUM_WAVEFORM_SAMPLES; /*if (nSamples > max_samples) nSamples = max_samples; nSamples -= pState->m_wave[i].sep;*/ // 1. execute per-frame code LoadCustomWavePerFrameEvallibVars(pState, i); // 2.a. do just a once-per-frame init for the *per-point* *READ-ONLY* variables // (the non-read-only ones will be reset/restored at the start of each vertex) *pState->m_wave[i].var_pp_time = *pState->m_wave[i].var_pf_time; *pState->m_wave[i].var_pp_fps = *pState->m_wave[i].var_pf_fps; *pState->m_wave[i].var_pp_frame = *pState->m_wave[i].var_pf_frame; *pState->m_wave[i].var_pp_progress = *pState->m_wave[i].var_pf_progress; *pState->m_wave[i].var_pp_bass = *pState->m_wave[i].var_pf_bass; *pState->m_wave[i].var_pp_mid = *pState->m_wave[i].var_pf_mid; *pState->m_wave[i].var_pp_treb = *pState->m_wave[i].var_pf_treb; *pState->m_wave[i].var_pp_bass_att = *pState->m_wave[i].var_pf_bass_att; *pState->m_wave[i].var_pp_mid_att = *pState->m_wave[i].var_pf_mid_att; *pState->m_wave[i].var_pp_treb_att = *pState->m_wave[i].var_pf_treb_att; NSEEL_code_execute(pState->m_wave[i].m_pf_codehandle); for (int vi=0; vi<NUM_Q_VAR; vi++) *pState->m_wave[i].var_pp_q[vi] = *pState->m_wave[i].var_pf_q[vi]; for (int vi=0; vi<NUM_T_VAR; vi++) *pState->m_wave[i].var_pp_t[vi] = *pState->m_wave[i].var_pf_t[vi]; int nSamples = min(512, (int)*pState->m_wave[i].var_pf_samples); if ((nSamples >= 2) || (pState->m_wave[i].bUseDots && nSamples >= 1)) { int j; float tempdata[2][512]; float mult = ((pState->m_wave[i].bSpectrum) ? 0.15f : 0.004f) * pState->m_wave[i].scaling * pState->m_fWaveScale.eval(-1); const float *pdata1 = (pState->m_wave[i].bSpectrum) ? m_sound.fSpectrum[0] : m_sound.fWaveform[0]; const float *pdata2 = (pState->m_wave[i].bSpectrum) ? m_sound.fSpectrum[1] : m_sound.fWaveform[1]; // initialize tempdata[2][512] int j0 = (pState->m_wave[i].bSpectrum) ? 0 : (max_samples - nSamples)/2/**(1-pState->m_wave[i].bSpectrum)*/ - pState->m_wave[i].sep/2; int j1 = (pState->m_wave[i].bSpectrum) ? 0 : (max_samples - nSamples)/2/**(1-pState->m_wave[i].bSpectrum)*/ + pState->m_wave[i].sep/2; float t = (pState->m_wave[i].bSpectrum) ? (max_samples - pState->m_wave[i].sep)/(float)nSamples : 1; float mix1 = powf(pState->m_wave[i].smoothing*0.98f, 0.5f); // lower exponent -> more default smoothing float mix2 = 1-mix1; // SMOOTHING: tempdata[0][0] = pdata1[j0]; tempdata[1][0] = pdata2[j1]; for (j=1; j<nSamples; j++) { tempdata[0][j] = pdata1[(int)(j*t)+j0]*mix2 + tempdata[0][j-1]*mix1; tempdata[1][j] = pdata2[(int)(j*t)+j1]*mix2 + tempdata[1][j-1]*mix1; } // smooth again, backwards: [this fixes the asymmetry of the beginning & end..] for (j=nSamples-2; j>=0; j--) { tempdata[0][j] = tempdata[0][j]*mix2 + tempdata[0][j+1]*mix1; tempdata[1][j] = tempdata[1][j]*mix2 + tempdata[1][j+1]*mix1; } // finally, scale to final size: for (j=0; j<nSamples; j++) { tempdata[0][j] *= mult; tempdata[1][j] *= mult; } // 2. for each point, execute per-point code // to do: // -add any of the m_wave[i].xxx menu-accessible vars to the code? WFVERTEX v[1024] = {0}; float j_mult = 1.0f/(float)(nSamples-1); for (j=0; j<nSamples; j++) { t = j*j_mult; float value1 = tempdata[0][j]; float value2 = tempdata[1][j]; *pState->m_wave[i].var_pp_sample = t; *pState->m_wave[i].var_pp_value1 = value1; *pState->m_wave[i].var_pp_value2 = value2; *pState->m_wave[i].var_pp_x = 0.5f + value1; *pState->m_wave[i].var_pp_y = 0.5f + value2; *pState->m_wave[i].var_pp_r = *pState->m_wave[i].var_pf_r; *pState->m_wave[i].var_pp_g = *pState->m_wave[i].var_pf_g; *pState->m_wave[i].var_pp_b = *pState->m_wave[i].var_pf_b; *pState->m_wave[i].var_pp_a = *pState->m_wave[i].var_pf_a; #ifndef _NO_EXPR_ NSEEL_code_execute(pState->m_wave[i].m_pp_codehandle); #endif v[j].x = (float)(*pState->m_wave[i].var_pp_x* 2-1)*m_fInvAspectX; v[j].y = (float)(*pState->m_wave[i].var_pp_y*-2+1)*m_fInvAspectY; v[j].z = 0; v[j].Diffuse = ((((int)(*pState->m_wave[i].var_pp_a * 255 * alpha_mult)) & 0xFF) << 24) | ((((int)(*pState->m_wave[i].var_pp_r * 255)) & 0xFF) << 16) | ((((int)(*pState->m_wave[i].var_pp_g * 255)) & 0xFF) << 8) | ((((int)(*pState->m_wave[i].var_pp_b * 255)) & 0xFF) ); } // save changes to t1-t8 this frame /* pState->m_wave[i].t_values_after_init_code[0] = *pState->m_wave[i].var_pp_t1; pState->m_wave[i].t_values_after_init_code[1] = *pState->m_wave[i].var_pp_t2; pState->m_wave[i].t_values_after_init_code[2] = *pState->m_wave[i].var_pp_t3; pState->m_wave[i].t_values_after_init_code[3] = *pState->m_wave[i].var_pp_t4; pState->m_wave[i].t_values_after_init_code[4] = *pState->m_wave[i].var_pp_t5; pState->m_wave[i].t_values_after_init_code[5] = *pState->m_wave[i].var_pp_t6; pState->m_wave[i].t_values_after_init_code[6] = *pState->m_wave[i].var_pp_t7; pState->m_wave[i].t_values_after_init_code[7] = *pState->m_wave[i].var_pp_t8; */ // 3. smooth it WFVERTEX v2[2048] = {0}; WFVERTEX *pVerts = v; if (!pState->m_wave[i].bUseDots) { nSamples = SmoothWave(v, nSamples, v2); pVerts = v2; } // 4. draw it lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, pState->m_wave[i].bAdditive ? D3DBLEND_ONE : D3DBLEND_INVSRCALPHA); float ptsize = (float)((m_nTexSizeX >= 1024) ? 2 : 1) + (pState->m_wave[i].bDrawThick ? 1 : 0); if (pState->m_wave[i].bUseDots) lpDevice->SetRenderState(D3DRS_POINTSIZE, *((DWORD*)&ptsize) ); int its = (pState->m_wave[i].bDrawThick && !pState->m_wave[i].bUseDots) ? 4 : 1; float x_inc = 2.0f / (float)m_nTexSizeX; float y_inc = 2.0f / (float)m_nTexSizeY; for (int it=0; it<its; it++) { switch(it) { case 0: break; case 1: for (j=0; j<nSamples; j++) pVerts[j].x += x_inc; break; // draw fat dots case 2: for (j=0; j<nSamples; j++) pVerts[j].y += y_inc; break; // draw fat dots case 3: for (j=0; j<nSamples; j++) pVerts[j].x -= x_inc; break; // draw fat dots } lpDevice->DrawPrimitiveUP(pState->m_wave[i].bUseDots ? D3DPT_POINTLIST : D3DPT_LINESTRIP, nSamples - (pState->m_wave[i].bUseDots ? 0 : 1), (void*)pVerts, sizeof(WFVERTEX)); } ptsize = 1.0f; if (pState->m_wave[i].bUseDots) lpDevice->SetRenderState(D3DRS_POINTSIZE, *((DWORD*)&ptsize) ); } } } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); } void CPlugin::DrawWave() { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( WFVERTEX_FORMAT ); int i; WFVERTEX v1[576+1] = {0}, v2[576+1] = {0}; /* m_lpD3DDev->SetRenderState(D3DRENDERSTATE_SHADEMODE, D3DSHADE_GOURAUD); //D3DSHADE_FLAT m_lpD3DDev->SetRenderState(D3DRENDERSTATE_SPECULARENABLE, FALSE); m_lpD3DDev->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE); if (m_D3DDevDesc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER) m_lpD3DDev->SetRenderState(D3DRENDERSTATE_DITHERENABLE, TRUE); m_lpD3DDev->SetRenderState(D3DRENDERSTATE_ZENABLE, D3DZB_FALSE); m_lpD3DDev->SetRenderState(D3DRENDERSTATE_LIGHTING, FALSE); m_lpD3DDev->SetRenderState(D3DRENDERSTATE_COLORVERTEX, TRUE); m_lpD3DDev->SetRenderState(D3DRENDERSTATE_FILLMODE, D3DFILL_WIREFRAME); // vs. SOLID m_lpD3DDev->SetRenderState(D3DRENDERSTATE_AMBIENT, D3DCOLOR_RGBA_01(1,1,1,1)); hr = m_lpD3DDev->SetTexture(0, NULL); if (hr != D3D_OK) { //dumpmsg("Draw(): ERROR: SetTexture"); //IdentifyD3DError(hr); } */ lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, (*m_pState->var_pf_wave_additive) ? D3DBLEND_ONE : D3DBLEND_INVSRCALPHA); //float cr = m_pState->m_waveR.eval(GetTime()); //float cg = m_pState->m_waveG.eval(GetTime()); //float cb = m_pState->m_waveB.eval(GetTime()); float cr = (float)(*m_pState->var_pf_wave_r); float cg = (float)(*m_pState->var_pf_wave_g); float cb = (float)(*m_pState->var_pf_wave_b); float cx = (float)(*m_pState->var_pf_wave_x); float cy = (float)(*m_pState->var_pf_wave_y); // note: it was backwards (top==1) in the original milkdrop, so we keep it that way! float fWaveParam = (float)(*m_pState->var_pf_wave_mystery); /*if (m_pState->m_bBlending) { cr = cr*(m_pState->m_fBlendProgress) + (1.0f-m_pState->m_fBlendProgress)*((float)(*m_pOldState->var_pf_wave_r)); cg = cg*(m_pState->m_fBlendProgress) + (1.0f-m_pState->m_fBlendProgress)*((float)(*m_pOldState->var_pf_wave_g)); cb = cb*(m_pState->m_fBlendProgress) + (1.0f-m_pState->m_fBlendProgress)*((float)(*m_pOldState->var_pf_wave_b)); cx = cx*(m_pState->m_fBlendProgress) + (1.0f-m_pState->m_fBlendProgress)*((float)(*m_pOldState->var_pf_wave_x)); cy = cy*(m_pState->m_fBlendProgress) + (1.0f-m_pState->m_fBlendProgress)*((float)(*m_pOldState->var_pf_wave_y)); fWaveParam = fWaveParam*(m_pState->m_fBlendProgress) + (1.0f-m_pState->m_fBlendProgress)*((float)(*m_pOldState->var_pf_wave_mystery)); }*/ if (cr < 0) cr = 0; if (cg < 0) cg = 0; if (cb < 0) cb = 0; if (cr > 1) cr = 1; if (cg > 1) cg = 1; if (cb > 1) cb = 1; // maximize color: if (*m_pState->var_pf_wave_brighten) { float fMaximizeWaveColorAmount = 1.0f; float max = cr; if (max < cg) max = cg; if (max < cb) max = cb; if (max > 0.01f) { cr = cr/max*fMaximizeWaveColorAmount + cr*(1.0f - fMaximizeWaveColorAmount); cg = cg/max*fMaximizeWaveColorAmount + cg*(1.0f - fMaximizeWaveColorAmount); cb = cb/max*fMaximizeWaveColorAmount + cb*(1.0f - fMaximizeWaveColorAmount); } } float fWavePosX = cx*2.0f - 1.0f; // go from 0..1 user-range to -1..1 D3D range float fWavePosY = cy*2.0f - 1.0f; float treble_rel = mysound.imm[2]; int sample_offset = 0; int new_wavemode = (int)(*m_pState->var_pf_wave_mode) % NUM_WAVES; // since it can be changed from per-frame code! int its = (m_pState->m_bBlending && (new_wavemode != m_pState->m_nOldWaveMode)) ? 2 : 1; int nVerts1 = 0; int nVerts2 = 0; int nBreak1 = -1; int nBreak2 = -1; float alpha1 = 0, alpha2 = 0; float *fL = mysound.fWaveform[0], *fR = mysound.fWaveform[1]; for (int it=0; it<its; it++) { int wave = (it==0) ? new_wavemode : m_pState->m_nOldWaveMode; int nVerts = NUM_WAVEFORM_SAMPLES; // allowed to peek ahead 64 (i.e. left is [i], right is [i+64]) int nBreak = -1; float fWaveParam2 = fWaveParam; //std::string fWaveParam; // kill its scope if ((wave==0 || wave==1 || wave==4) && (fWaveParam2 < -1 || fWaveParam2 > 1)) { //fWaveParam2 = max(fWaveParam2, -1.0f); //fWaveParam2 = min(fWaveParam2, 1.0f); fWaveParam2 = fWaveParam2*0.5f + 0.5f; fWaveParam2 -= floorf(fWaveParam2); fWaveParam2 = fabsf(fWaveParam2); fWaveParam2 = fWaveParam2*2-1; } WFVERTEX *v = (it==0) ? v1 : v2; memset(v, 0, sizeof(WFVERTEX)*nVerts); float alpha = (float)(*m_pState->var_pf_wave_a);//m_pState->m_fWaveAlpha.eval(GetTime()); switch(wave) { case 0: // circular wave nVerts /= 2; sample_offset = (NUM_WAVEFORM_SAMPLES-nVerts)/2;//mysound.GoGoAlignatron(nVerts * 12/10); // only call this once nVerts is final! if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); { float inv_nverts_minus_one = 1.0f/(float)(nVerts-1); for (i=0; i<nVerts; i++) { float rad = 0.5f + 0.4f*fR[i+sample_offset] + fWaveParam2; float ang = (i)*inv_nverts_minus_one*6.28f + GetTime()*0.2f; if (i < nVerts/10) { float mix = i/(nVerts*0.1f); mix = 0.5f - 0.5f*cosf(mix * 3.1416f); float rad_2 = 0.5f + 0.4f*fR[i + nVerts + sample_offset] + fWaveParam2; rad = rad_2*(1.0f-mix) + rad*(mix); } v[i].x = rad*cosf(ang) *m_fAspectY + fWavePosX; // 0.75 = adj. for aspect ratio v[i].y = rad*sinf(ang) *m_fAspectX + fWavePosY; //v[i].Diffuse = color; } } // dupe last vertex to connect the lines; skip if blending if (!m_pState->m_bBlending) { ++nVerts; memcpy(&v[nVerts-1], &v[0], sizeof(WFVERTEX)); } break; case 1: // x-y osc. that goes around in a spiral, in time alpha *= 1.25f; if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); nVerts /= 2; for (i=0; i<nVerts; i++) { float rad = 0.53f + 0.43f*fR[i] + fWaveParam2; float ang = fL[i+32] * 1.57f + GetTime()*2.3f; v[i].x = rad*cosf(ang) *m_fAspectY + fWavePosX; // 0.75 = adj. for aspect ratio v[i].y = rad*sinf(ang) *m_fAspectX + fWavePosY; //v[i].Diffuse = color;//(D3DCOLOR_RGBA_01(cr, cg, cb, alpha*min(1, max(0, fL[i]))); } break; case 2: // centered spiro (alpha constant) // aimed at not being so sound-responsive, but being very "nebula-like" // difference is that alpha is constant (and faint), and waves a scaled way up switch(m_nTexSizeX) { case 256: alpha *= 0.07f; break; case 512: alpha *= 0.09f; break; case 1024: alpha *= 0.11f; break; case 2048: alpha *= 0.13f; break; } if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); for (i=0; i<nVerts; i++) { v[i].x = fR[i ] *m_fAspectY + fWavePosX;//((pR[i] ^ 128) - 128)/90.0f * ASPECT; // 0.75 = adj. for aspect ratio v[i].y = fL[i+32] *m_fAspectX + fWavePosY;//((pL[i+32] ^ 128) - 128)/90.0f; //v[i].Diffuse = color; } break; case 3: // centered spiro (alpha tied to volume) // aimed at having a strong audio-visual tie-in // colors are always bright (no darks) switch(m_nTexSizeX) { case 256: alpha = 0.075f; break; case 512: alpha = 0.150f; break; case 1024: alpha = 0.220f; break; case 2048: alpha = 0.330f; break; } alpha *= 1.3f; alpha *= powf(treble_rel, 2.0f); if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); for (i=0; i<nVerts; i++) { v[i].x = fR[i ] *m_fAspectY + fWavePosX;//((pR[i] ^ 128) - 128)/90.0f * ASPECT; // 0.75 = adj. for aspect ratio v[i].y = fL[i+32] *m_fAspectX + fWavePosY;//((pL[i+32] ^ 128) - 128)/90.0f; //v[i].Diffuse = color; } break; case 4: // horizontal "script", left channel if (nVerts > m_nTexSizeX/3) nVerts = m_nTexSizeX/3; sample_offset = (NUM_WAVEFORM_SAMPLES-nVerts)/2;//mysound.GoGoAlignatron(nVerts + 25); // only call this once nVerts is final! /* if (treble_rel > treb_thresh_for_wave6) { //alpha = 1.0f; treb_thresh_for_wave6 = treble_rel * 1.025f; } else { alpha *= 0.2f; treb_thresh_for_wave6 *= 0.996f; // fixme: make this fps-independent } */ if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); { float w1 = 0.45f + 0.5f*(fWaveParam2*0.5f + 0.5f); // 0.1 - 0.9 float w2 = 1.0f - w1; float inv_nverts = 1.0f/(float)(nVerts); for (i=0; i<nVerts; i++) { v[i].x = -1.0f + 2.0f*(i*inv_nverts) + fWavePosX; v[i].y = fL[i+sample_offset]*0.47f + fWavePosY;//((pL[i] ^ 128) - 128)/270.0f; v[i].x += fR[i+25+sample_offset]*0.44f;//((pR[i+25] ^ 128) - 128)/290.0f; //v[i].Diffuse = color; // momentum if (i>1) { v[i].x = v[i].x*w2 + w1*(v[i-1].x*2.0f - v[i-2].x); v[i].y = v[i].y*w2 + w1*(v[i-1].y*2.0f - v[i-2].y); } } /* // center on Y float avg_y = 0; for (i=0; i<nVerts; i++) avg_y += v[i].y; avg_y /= (float)nVerts; avg_y *= 0.5f; // damp the movement for (i=0; i<nVerts; i++) v[i].y -= avg_y; */ } break; case 5: // weird explosive complex # thingy switch(m_nTexSizeX) { case 256: alpha *= 0.07f; break; case 512: alpha *= 0.09f; break; case 1024: alpha *= 0.11f; break; case 2048: alpha *= 0.13f; break; } if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); { float cos_rot = cosf(GetTime()*0.3f); float sin_rot = sinf(GetTime()*0.3f); for (i=0; i<nVerts; i++) { float x0 = (fR[i]*fL[i+32] + fL[i]*fR[i+32]); float y0 = (fR[i]*fR[i] - fL[i+32]*fL[i+32]); v[i].x = (x0*cos_rot - y0*sin_rot)*m_fAspectY + fWavePosX; v[i].y = (x0*sin_rot + y0*cos_rot)*m_fAspectX + fWavePosY; //v[i].Diffuse = color; } } break; case 6: case 7: case 8: // 6: angle-adjustable left channel, with temporal wave alignment; // fWaveParam2 controls the angle at which it's drawn // fWavePosX slides the wave away from the center, transversely. // fWavePosY does nothing // // 7: same, except there are two channels shown, and // fWavePosY determines the separation distance. // // 8: same as 6, except using the spectrum analyzer (UNFINISHED) // nVerts /= 2; if (nVerts > m_nTexSizeX/3) nVerts = m_nTexSizeX/3; if (wave==8) nVerts = 256; else sample_offset = (NUM_WAVEFORM_SAMPLES-nVerts)/2;//mysound.GoGoAlignatron(nVerts); // only call this once nVerts is final! if (m_pState->m_bModWaveAlphaByVolume) alpha *= ((mysound.imm_rel[0] + mysound.imm_rel[1] + mysound.imm_rel[2])*0.333f - m_pState->m_fModWaveAlphaStart.eval(GetTime()))/(m_pState->m_fModWaveAlphaEnd.eval(GetTime()) - m_pState->m_fModWaveAlphaStart.eval(GetTime())); if (alpha < 0) alpha = 0; if (alpha > 1) alpha = 1; //color = D3DCOLOR_RGBA_01(cr, cg, cb, alpha); { float ang = 1.57f*fWaveParam2; // from -PI/2 to PI/2 float dx = cosf(ang); float dy = sinf(ang); float edge_x[2] = {0}, edge_y[2] = {0}; //edge_x[0] = fWavePosX - dx*3.0f; //edge_y[0] = fWavePosY - dy*3.0f; //edge_x[1] = fWavePosX + dx*3.0f; //edge_y[1] = fWavePosY + dy*3.0f; edge_x[0] = fWavePosX*cosf(ang + 1.57f) - dx*3.0f; edge_y[0] = fWavePosX*sinf(ang + 1.57f) - dy*3.0f; edge_x[1] = fWavePosX*cosf(ang + 1.57f) + dx*3.0f; edge_y[1] = fWavePosX*sinf(ang + 1.57f) + dy*3.0f; for (i=0; i<2; i++) // for each point defining the line { // clip the point against 4 edges of screen // be a bit lenient (use +/-1.1 instead of +/-1.0) // so the dual-wave doesn't end too soon, after the channels are moved apart for (int j=0; j<4; j++) { float t = 0; bool bClip = false; switch(j) { case 0: if (edge_x[i] > 1.1f) { t = (1.1f - edge_x[1-i]) / (edge_x[i] - edge_x[1-i]); bClip = true; } break; case 1: if (edge_x[i] < -1.1f) { t = (-1.1f - edge_x[1-i]) / (edge_x[i] - edge_x[1-i]); bClip = true; } break; case 2: if (edge_y[i] > 1.1f) { t = (1.1f - edge_y[1-i]) / (edge_y[i] - edge_y[1-i]); bClip = true; } break; case 3: if (edge_y[i] < -1.1f) { t = (-1.1f - edge_y[1-i]) / (edge_y[i] - edge_y[1-i]); bClip = true; } break; } if (bClip) { float _dx = edge_x[i] - edge_x[1-i]; float _dy = edge_y[i] - edge_y[1-i]; edge_x[i] = edge_x[1-i] + _dx*t; edge_y[i] = edge_y[1-i] + _dy*t; } } } dx = (edge_x[1] - edge_x[0]) / (float)nVerts; dy = (edge_y[1] - edge_y[0]) / (float)nVerts; float ang2 = atan2f(dy,dx); float perp_dx = cosf(ang2 + 1.57f); float perp_dy = sinf(ang2 + 1.57f); if (wave == 6) for (i=0; i<nVerts; i++) { v[i].x = edge_x[0] + dx*i + perp_dx*0.25f*fL[i + sample_offset]; v[i].y = edge_y[0] + dy*i + perp_dy*0.25f*fL[i + sample_offset]; //v[i].Diffuse = color; } else if (wave == 8) //256 verts for (i=0; i<nVerts; i++) { float f = 0.1f*logf(mysound.fSpecLeft[i*2] + mysound.fSpecLeft[i*2+1]); v[i].x = edge_x[0] + dx*i + perp_dx*f; v[i].y = edge_y[0] + dy*i + perp_dy*f; //v[i].Diffuse = color; } else { float sep = powf(fWavePosY*0.5f + 0.5f, 2.0f); for (i=0; i<nVerts; i++) { v[i].x = edge_x[0] + dx*i + perp_dx*(0.25f*fL[i + sample_offset] + sep); v[i].y = edge_y[0] + dy*i + perp_dy*(0.25f*fL[i + sample_offset] + sep); //v[i].Diffuse = color; } //D3DPRIMITIVETYPE primtype = (*m_pState->var_pf_wave_usedots) ? D3DPT_POINTLIST : D3DPT_LINESTRIP; //m_lpD3DDev->DrawPrimitive(primtype, D3DFVF_LVERTEX, (LPVOID)v, nVerts, NULL); for (i=0; i<nVerts; i++) { v[i+nVerts].x = edge_x[0] + dx*i + perp_dx*(0.25f*fR[i + sample_offset] - sep); v[i+nVerts].y = edge_y[0] + dy*i + perp_dy*(0.25f*fR[i + sample_offset] - sep); //v[i+nVerts].Diffuse = color; } nBreak = nVerts; nVerts *= 2; } } break; } if (it==0) { nVerts1 = nVerts; nBreak1 = nBreak; alpha1 = alpha; } else { nVerts2 = nVerts; nBreak2 = nBreak; alpha2 = alpha; } } // v1[] is for the current waveform // v2[] is for the old waveform (from prev. preset - only used if blending) // nVerts1 is the # of vertices in v1 // nVerts2 is the # of vertices in v2 // nBreak1 is the index of the point at which to break the solid line in v1[] (-1 if no break) // nBreak2 is the index of the point at which to break the solid line in v2[] (-1 if no break) float mix = CosineInterp(m_pState->m_fBlendProgress); float mix2 = 1.0f - mix; // blend 2 waveforms if (nVerts2 > 0) { // note: this won't yet handle the case where (nBreak1 > 0 && nBreak2 > 0) // in this case, code must break wave into THREE segments float m = (nVerts2-1)/(float)nVerts1; float x,y; for (i=0; i<nVerts1; i++) { float fIdx = i*m; int nIdx = (int)fIdx; float t = fIdx - nIdx; if (nIdx == nBreak2-1) { x = v2[nIdx].x; y = v2[nIdx].y; nBreak1 = i+1; } else { x = v2[nIdx].x*(1-t) + v2[nIdx+1].x*(t); y = v2[nIdx].y*(1-t) + v2[nIdx+1].y*(t); } v1[i].x = v1[i].x*(mix) + x*(mix2); v1[i].y = v1[i].y*(mix) + y*(mix2); } /*} // determine alpha if (nVerts2 > 0) {*/ alpha1 = alpha1*(mix) + alpha2*(1.0f-mix); } // apply color & alpha // ALSO reverse all y values, to stay consistent with the pre-VMS milkdrop, // which DIDN'T: v1[0].Diffuse = D3DCOLOR_RGBA_01(cr, cg, cb, alpha1); for (i=0; i<nVerts1; i++) { v1[i].Diffuse = v1[0].Diffuse; v1[i].y = -v1[i].y; } // don't draw wave if (possibly blended) alpha is less than zero. if (alpha1 < 0.004f) goto SKIP_DRAW_WAVE; // TESSELLATE - smooth the wave, one time. WFVERTEX* pVerts = v1; WFVERTEX vTess[(576+3)*2] = {0}; if (1) { if (nBreak1==-1) { nVerts1 = SmoothWave(v1, nVerts1, vTess); } else { int oldBreak = nBreak1; nBreak1 = SmoothWave(v1, nBreak1, vTess); nVerts1 = SmoothWave(&v1[oldBreak], nVerts1-oldBreak, &vTess[nBreak1]) + nBreak1; } pVerts = vTess; } // draw primitives { //D3DPRIMITIVETYPE primtype = (*m_pState->var_pf_wave_usedots) ? D3DPT_POINTLIST : D3DPT_LINESTRIP; float x_inc = 2.0f / (float)m_nTexSizeX; float y_inc = 2.0f / (float)m_nTexSizeY; int drawing_its = ((*m_pState->var_pf_wave_thick || *m_pState->var_pf_wave_usedots) && (m_nTexSizeX >= 512)) ? 4 : 1; for (int it=0; it<drawing_its; it++) { int j; switch(it) { case 0: break; case 1: for (j=0; j<nVerts1; j++) pVerts[j].x += x_inc; break; // draw fat dots case 2: for (j=0; j<nVerts1; j++) pVerts[j].y += y_inc; break; // draw fat dots case 3: for (j=0; j<nVerts1; j++) pVerts[j].x -= x_inc; break; // draw fat dots } if (nBreak1 == -1) { if (*m_pState->var_pf_wave_usedots) lpDevice->DrawPrimitiveUP(D3DPT_POINTLIST, nVerts1, (void*)pVerts, sizeof(WFVERTEX)); else lpDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, nVerts1-1, (void*)pVerts, sizeof(WFVERTEX)); } else { if (*m_pState->var_pf_wave_usedots) { lpDevice->DrawPrimitiveUP(D3DPT_POINTLIST, nBreak1, (void*)pVerts, sizeof(WFVERTEX)); lpDevice->DrawPrimitiveUP(D3DPT_POINTLIST, nVerts1-nBreak1, (void*)&pVerts[nBreak1], sizeof(WFVERTEX)); } else { lpDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, nBreak1-1, (void*)pVerts, sizeof(WFVERTEX)); lpDevice->DrawPrimitiveUP(D3DPT_LINESTRIP, nVerts1-nBreak1-1, (void*)&pVerts[nBreak1], sizeof(WFVERTEX)); } } } } SKIP_DRAW_WAVE: lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); } void CPlugin::DrawSprites() const { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( WFVERTEX_FORMAT ); if (*m_pState->var_pf_darken_center) { lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA);//SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); WFVERTEX v3[6] = {0}; // colors: v3[0].Diffuse = D3DCOLOR_RGBA_01(0, 0, 0, 3.0f/32.0f); v3[1].Diffuse = D3DCOLOR_RGBA_01(0, 0, 0, 0.0f/32.0f); v3[2].Diffuse = v3[1].Diffuse; v3[3].Diffuse = v3[1].Diffuse; v3[4].Diffuse = v3[1].Diffuse; v3[5].Diffuse = v3[1].Diffuse; // positioning: float fHalfSize = 0.05f; v3[0].x = 0.0f; v3[1].x = 0.0f - fHalfSize*m_fAspectY; v3[2].x = 0.0f; v3[3].x = 0.0f + fHalfSize*m_fAspectY; v3[4].x = 0.0f; v3[5].x = v3[1].x; v3[0].y = 0.0f; v3[1].y = 0.0f; v3[2].y = 0.0f - fHalfSize; v3[3].y = 0.0f; v3[4].y = 0.0f + fHalfSize; v3[5].y = v3[1].y; //v3[0].tu = 0; v3[1].tu = 1; v3[2].tu = 0; v3[3].tu = 1; //v3[0].tv = 1; v3[1].tv = 1; v3[2].tv = 0; v3[3].tv = 0; lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 4, (LPVOID)v3, sizeof(WFVERTEX)); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); } // do borders { float fOuterBorderSize = (float)*m_pState->var_pf_ob_size; float fInnerBorderSize = (float)*m_pState->var_pf_ib_size; lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); for (int it=0; it<2; it++) { WFVERTEX v3[4] = {0}; // colors: float r = (it==0) ? (float)*m_pState->var_pf_ob_r : (float)*m_pState->var_pf_ib_r; float g = (it==0) ? (float)*m_pState->var_pf_ob_g : (float)*m_pState->var_pf_ib_g; float b = (it==0) ? (float)*m_pState->var_pf_ob_b : (float)*m_pState->var_pf_ib_b; float a = (it==0) ? (float)*m_pState->var_pf_ob_a : (float)*m_pState->var_pf_ib_a; if (a > 0.001f) { v3[0].Diffuse = D3DCOLOR_RGBA_01(r,g,b,a); v3[1].Diffuse = v3[0].Diffuse; v3[2].Diffuse = v3[0].Diffuse; v3[3].Diffuse = v3[0].Diffuse; // positioning: float fInnerRad = (it==0) ? 1.0f - fOuterBorderSize : 1.0f - fOuterBorderSize - fInnerBorderSize; float fOuterRad = (it==0) ? 1.0f : 1.0f - fOuterBorderSize; v3[0].x = fInnerRad; v3[1].x = fOuterRad; v3[2].x = fOuterRad; v3[3].x = fInnerRad; v3[0].y = fInnerRad; v3[1].y = fOuterRad; v3[2].y = -fOuterRad; v3[3].y = -fInnerRad; for (int rot=0; rot<4; rot++) { lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLEFAN, 2, (LPVOID)v3, sizeof(WFVERTEX)); // rotate by 90 degrees for (int v=0; v<4; v++) { float t = 1.570796327f; float x = v3[v].x; float y = v3[v].y; v3[v].x = x*cosf(t) - y*sinf(t); v3[v].y = x*sinf(t) + y*cosf(t); } } } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); } } /* bool CPlugin::SetMilkdropRenderTarget(LPDIRECTDRAWSURFACE7 lpSurf, int w, int h, char *szErrorMsg) { HRESULT hr = m_lpD3DDev->SetRenderTarget(0, lpSurf, 0); if (hr != D3D_OK) { //if (szErrorMsg && szErrorMsg[0]) dumpmsg(szErrorMsg); //IdentifyD3DError(hr); return false; } //DDSURFACEDESC2 ddsd; //ddsd.dwSize = sizeof(ddsd); //lpSurf->GetSurfaceDesc(&ddsd); D3DVIEWPORT7 viewData; memset(&viewData, 0, sizeof(D3DVIEWPORT7)); viewData.dwWidth = w; // not: in windowed mode, when lpSurf is the back buffer, chances are good that w,h are smaller than the full surface size (since real size is fullscreen, but we're only using a portion of it as big as the window). viewData.dwHeight = h; hr = m_lpD3DDev->SetViewport(&viewData); return true; } */ void CPlugin::DrawUserSprites() // from system memory, to back buffer. { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, NULL); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( SPRITEVERTEX_FORMAT ); //lpDevice->SetRenderState(D3DRS_WRAP0, 0); //lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP); //lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP); //lpDevice->SetSamplerState(0, D3DSAMP_ADDRESSW, D3DTADDRESS_WRAP); // reset these to the standard safe mode: lpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); /* lpDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_GOURAUD); //D3DSHADE_GOURAUD lpDevice->SetRenderState(D3DRS_SPECULARENABLE, FALSE); lpDevice->SetRenderState(D3DRS_CULLMODE, D3DCULL_NONE); if (m_D3DDevDesc.dpcTriCaps.dwRasterCaps & D3DPRASTERCAPS_DITHER) lpDevice->SetRenderState(D3DRS_DITHERENABLE, TRUE); lpDevice->SetRenderState(D3DRS_ZENABLE, D3DZB_FALSE); lpDevice->SetRenderState(D3DRS_LIGHTING, FALSE); lpDevice->SetRenderState(D3DRS_COLORVERTEX, TRUE); lpDevice->SetRenderState(D3DRS_FILLMODE, D3DFILL_SOLID); // vs. wireframe lpDevice->SetRenderState(D3DRS_AMBIENT, D3DCOLOR_RGBA_01(1,1,1,1)); lpDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTFG_LINEAR ); lpDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTFN_LINEAR ); lpDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTFP_LINEAR ); */ for (int iSlot=0; iSlot < NUM_TEX; iSlot++) { if (m_texmgr.m_tex[iSlot].pSurface) { int k; // set values of input variables: *(m_texmgr.m_tex[iSlot].var_time) = (double)(GetTime() - m_texmgr.m_tex[iSlot].fStartTime); *(m_texmgr.m_tex[iSlot].var_frame) = (double)(GetFrame() - m_texmgr.m_tex[iSlot].nStartFrame); *(m_texmgr.m_tex[iSlot].var_fps) = (double)GetFps(); *(m_texmgr.m_tex[iSlot].var_progress) = (double)m_pState->m_fBlendProgress; *(m_texmgr.m_tex[iSlot].var_bass) = (double)mysound.imm_rel[0]; *(m_texmgr.m_tex[iSlot].var_mid) = (double)mysound.imm_rel[1]; *(m_texmgr.m_tex[iSlot].var_treb) = (double)mysound.imm_rel[2]; *(m_texmgr.m_tex[iSlot].var_bass_att) = (double)mysound.avg_rel[0]; *(m_texmgr.m_tex[iSlot].var_mid_att) = (double)mysound.avg_rel[1]; *(m_texmgr.m_tex[iSlot].var_treb_att) = (double)mysound.avg_rel[2]; // evaluate expressions #ifndef _NO_EXPR_ if (m_texmgr.m_tex[iSlot].m_codehandle) { NSEEL_code_execute(m_texmgr.m_tex[iSlot].m_codehandle); } #endif bool bKillSprite = (*m_texmgr.m_tex[iSlot].var_done != 0.0); bool bBurnIn = (*m_texmgr.m_tex[iSlot].var_burn != 0.0); // Remember the original backbuffer and zbuffer LPDIRECT3DSURFACE9 pBackBuffer=NULL;//, pZBuffer=NULL; lpDevice->GetRenderTarget( 0, &pBackBuffer ); //lpDevice->GetDepthStencilSurface( &pZBuffer ); if (/*bKillSprite &&*/ bBurnIn) { // set up to render [from NULL] to VS1 (for burn-in). lpDevice->SetTexture(0, NULL); IDirect3DSurface9* pNewTarget = NULL; if (m_lpVS[1]->GetSurfaceLevel(0, &pNewTarget) != D3D_OK) return; lpDevice->SetRenderTarget(0, pNewTarget ); //lpDevice->SetDepthStencilSurface( NULL ); pNewTarget->Release(); lpDevice->SetTexture(0, NULL); } // finally, use the results to draw the sprite. if (lpDevice->SetTexture(0, m_texmgr.m_tex[iSlot].pSurface) != D3D_OK) return; SPRITEVERTEX v3[4] = {0}; /* int dest_w, dest_h; { LPDIRECT3DSURFACE9 pRT; lpDevice->GetRenderTarget( 0, &pRT ); D3DSURFACE_DESC desc; pRT->GetDesc(&desc); dest_w = desc.Width; dest_h = desc.Height; pRT->Release(); }*/ float x = min(1000.0f, max(-1000.0f, (float)(*m_texmgr.m_tex[iSlot].var_x) * 2.0f - 1.0f )); float y = min(1000.0f, max(-1000.0f, (float)(*m_texmgr.m_tex[iSlot].var_y) * 2.0f - 1.0f )); float sx = min(1000.0f, max(-1000.0f, (float)(*m_texmgr.m_tex[iSlot].var_sx) )); float sy = min(1000.0f, max(-1000.0f, (float)(*m_texmgr.m_tex[iSlot].var_sy) )); float rot = (float)(*m_texmgr.m_tex[iSlot].var_rot); int flipx = (*m_texmgr.m_tex[iSlot].var_flipx == 0.0) ? 0 : 1; int flipy = (*m_texmgr.m_tex[iSlot].var_flipy == 0.0) ? 0 : 1; float repeatx = min(100.0f, max(0.01f, (float)(*m_texmgr.m_tex[iSlot].var_repeatx) )); float repeaty = min(100.0f, max(0.01f, (float)(*m_texmgr.m_tex[iSlot].var_repeaty) )); int blendmode = min(4, max(0, ((int)(*m_texmgr.m_tex[iSlot].var_blendmode)))); float r = min(1.0f, max(0.0f, ((float)(*m_texmgr.m_tex[iSlot].var_r)))); float g = min(1.0f, max(0.0f, ((float)(*m_texmgr.m_tex[iSlot].var_g)))); float b = min(1.0f, max(0.0f, ((float)(*m_texmgr.m_tex[iSlot].var_b)))); float a = min(1.0f, max(0.0f, ((float)(*m_texmgr.m_tex[iSlot].var_a)))); // set x,y coords v3[0+flipx].x = -sx; v3[1-flipx].x = sx; v3[2+flipx].x = -sx; v3[3-flipx].x = sx; v3[0+flipy*2].y = -sy; v3[1+flipy*2].y = -sy; v3[2-flipy*2].y = sy; v3[3-flipy*2].y = sy; // first aspect ratio: adjust for non-1:1 images { float aspect = m_texmgr.m_tex[iSlot].img_h / (float)m_texmgr.m_tex[iSlot].img_w; if (aspect < 1) for (k=0; k<4; k++) v3[k].y *= aspect; // wide image else for (k=0; k<4; k++) v3[k].x /= aspect; // tall image } // 2D rotation { float cos_rot = cosf(rot); float sin_rot = sinf(rot); for (k=0; k<4; k++) { float x2 = v3[k].x*cos_rot - v3[k].y*sin_rot; float y2 = v3[k].x*sin_rot + v3[k].y*cos_rot; v3[k].x = x2; v3[k].y = y2; } } // translation for (k=0; k<4; k++) { v3[k].x += x; v3[k].y += y; } // second aspect ratio: normalize to width of screen { float aspect = GetWidth() / (float)(GetHeight()); if (aspect > 1) for (k=0; k<4; k++) v3[k].y *= aspect; else for (k=0; k<4; k++) v3[k].x /= aspect; } // third aspect ratio: adjust for burn-in if (bKillSprite && bBurnIn) // final render-to-VS1 { float aspect = GetWidth()/(float)(GetHeight()*4.0f/3.0f); if (aspect < 1.0f) for (k=0; k<4; k++) v3[k].x *= aspect; else for (k=0; k<4; k++) v3[k].y /= aspect; } // finally, flip 'y' for annoying DirectX //for (k=0; k<4; k++) v3[k].y *= -1.0f; // set u,v coords { float dtu = 0.5f;// / (float)m_texmgr.m_tex[iSlot].tex_w; float dtv = 0.5f;// / (float)m_texmgr.m_tex[iSlot].tex_h; v3[0].tu = -dtu; v3[1].tu = dtu;///*m_texmgr.m_tex[iSlot].img_w / (float)m_texmgr.m_tex[iSlot].tex_w*/ - dtu; v3[2].tu = -dtu; v3[3].tu = dtu;///*m_texmgr.m_tex[iSlot].img_w / (float)m_texmgr.m_tex[iSlot].tex_w*/ - dtu; v3[0].tv = -dtv; v3[1].tv = -dtv; v3[2].tv = dtv;///*m_texmgr.m_tex[iSlot].img_h / (float)m_texmgr.m_tex[iSlot].tex_h*/ - dtv; v3[3].tv = dtv;///*m_texmgr.m_tex[iSlot].img_h / (float)m_texmgr.m_tex[iSlot].tex_h*/ - dtv; // repeat on x,y for (k=0; k<4; k++) { v3[k].tu = (v3[k].tu - 0.0f)*repeatx + 0.5f; v3[k].tv = (v3[k].tv - 0.0f)*repeaty + 0.5f; } } // blendmodes src alpha: dest alpha: // 0 blend r,g,b=modulate a=opacity SRCALPHA INVSRCALPHA // 1 decal r,g,b=modulate a=modulate D3DBLEND_ONE D3DBLEND_ZERO // 2 additive r,g,b=modulate a=modulate D3DBLEND_ONE D3DBLEND_ONE // 3 srccolor r,g,b=no effect a=no effect SRCCOLOR INVSRCCOLOR // 4 colorkey r,g,b=modulate a=no effect switch(blendmode) { case 0: default: // alpha blend /* Q. I am rendering with alpha blending and setting the alpha of the diffuse vertex component to determine the opacity. It works when there is no texture set, but as soon as I set a texture the alpha that I set is no longer applied. Why? The problem originates in the texture blending stages, rather than in the subsequent alpha blending. Alpha can come from several possible sources. If this has not been specified, then the alpha will be taken from the texture, if one is selected. If no texture is selected, then the default will use the alpha channel of the diffuse vertex component. Explicitly specifying the diffuse vertex component as the source for alpha will insure that the alpha is drawn from the alpha value you set, whether a texture is selected or not: pDevice->SetSamplerState(D3DSAMP_ALPHAOP,D3DTOP_SELECTARG1); pDevice->SetSamplerState(D3DSAMP_ALPHAARG1,D3DTA_DIFFUSE); If you later need to use the texture alpha as the source, set D3DSAMP_ALPHAARG1 to D3DTA_TEXTURE. */ lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); for (k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(r,g,b,a); break; case 1: // decal lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); //lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); //lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); for (k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(r*a,g*a,b*a,1); break; case 2: // additive lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); for (k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(r*a,g*a,b*a,1); break; case 3: // srccolor lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCCOLOR); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR); for (k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(1,1,1,1); break; case 4: // color keyed texture: use the alpha value in the texture to // determine which texels get drawn. /*lpDevice->SetRenderState(D3DRS_ALPHAREF, 0); lpDevice->SetRenderState(D3DRS_ALPHAFUNC, D3DCMP_NOTEQUAL); lpDevice->SetRenderState(D3DRS_ALPHATESTENABLE, TRUE); */ lpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); // also, smoothly blend this in-between texels: lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); for (k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(r,g,b,a); break; } lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (LPVOID)v3, sizeof(SPRITEVERTEX)); if (/*bKillSprite &&*/ bBurnIn) // final render-to-VS1 { // Change the rendertarget back to the original setup lpDevice->SetTexture(0, NULL); lpDevice->SetRenderTarget( 0, pBackBuffer ); //lpDevice->SetDepthStencilSurface( pZBuffer ); lpDevice->SetTexture(0, m_texmgr.m_tex[iSlot].pSurface); // undo aspect ratio changes (that were used to fit it to VS1): { float aspect = GetWidth()/(float)(GetHeight()*4.0f/3.0f); if (aspect < 1.0f) for (k=0; k<4; k++) v3[k].x /= aspect; else for (k=0; k<4; k++) v3[k].y *= aspect; } lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (LPVOID)v3, sizeof(SPRITEVERTEX)); } SafeRelease(pBackBuffer); //SafeRelease(pZBuffer); if (bKillSprite) { KillSprite(iSlot); } lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); // reset these to the standard safe mode: lpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); } void CPlugin::UvToMathSpace(float u, float v, float* rad, float* ang) { // (screen space = -1..1 on both axes; corresponds to UV space) // uv space = [0..1] on both axes // "math" space = what the preset authors are used to: // upper left = [0,0] // bottom right = [1,1] // rad == 1 at corners of screen // ang == 0 at three o'clock, and increases counter-clockwise (to 6.28). float px = (u*2-1) * m_fAspectX; // probably 1.0 float py = (v*2-1) * m_fAspectY; // probably <1 *rad = sqrtf(px*px + py*py) / sqrtf(m_fAspectX*m_fAspectX + m_fAspectY*m_fAspectY); *ang = atan2f(py, px); if (*ang < 0) *ang += 6.2831853071796f; } void CPlugin::RestoreShaderParams() const { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); for (int i=0; i<2; i++) { lpDevice->SetSamplerState(i, D3DSAMP_ADDRESSU, D3DTADDRESS_WRAP);//texaddr); lpDevice->SetSamplerState(i, D3DSAMP_ADDRESSV, D3DTADDRESS_WRAP);//texaddr); lpDevice->SetSamplerState(i, D3DSAMP_ADDRESSW, D3DTADDRESS_WRAP);//texaddr); lpDevice->SetSamplerState(i, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(i, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(i, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); } for (int i=0; i<4; i++) lpDevice->SetTexture( i, NULL ); lpDevice->SetVertexShader(NULL); //lpDevice->SetVertexDeclaration(NULL); -directx debug runtime complains heavily about this lpDevice->SetPixelShader(NULL); } void CPlugin::ApplyShaderParams(CShaderParams* p, LPD3DXCONSTANTTABLE pCT, CState* pState) { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); //if (p->texbind_vs >= 0) lpDevice->SetTexture( p->texbind_vs , m_lpVS[0] ); //if (p->texbind_noise >= 0) lpDevice->SetTexture( p->texbind_noise, m_pTexNoise ); // bind textures for (int i=0; i<ARRAYSIZE(p->m_texture_bindings); i++) { if (p->m_texcode[i] == TEX_VS) lpDevice->SetTexture(i, m_lpVS[0]); else lpDevice->SetTexture(i, p->m_texture_bindings[i].texptr); // also set up sampler stage, if anything is bound here... if (p->m_texcode[i]==TEX_VS || p->m_texture_bindings[i].texptr) { const bool bAniso = false; DWORD HQFilter = bAniso ? D3DTEXF_ANISOTROPIC : D3DTEXF_LINEAR; DWORD wrap = p->m_texture_bindings[i].bWrap ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP; DWORD filter = p->m_texture_bindings[i].bBilinear ? HQFilter : D3DTEXF_POINT; lpDevice->SetSamplerState(i, D3DSAMP_ADDRESSU, wrap); lpDevice->SetSamplerState(i, D3DSAMP_ADDRESSV, wrap); lpDevice->SetSamplerState(i, D3DSAMP_ADDRESSW, wrap); lpDevice->SetSamplerState(i, D3DSAMP_MAGFILTER, filter); lpDevice->SetSamplerState(i, D3DSAMP_MINFILTER, filter); lpDevice->SetSamplerState(i, D3DSAMP_MIPFILTER, filter); //lpDevice->SetSamplerState(i, D3DSAMP_MAXANISOTROPY, bAniso ? 4 : 1); //FIXME:ANISO } // finally, if it was a blur texture, note that if (p->m_texcode[i] >= TEX_BLUR1 && p->m_texcode[i] <= TEX_BLUR_LAST) m_nHighestBlurTexUsedThisFrame = max(m_nHighestBlurTexUsedThisFrame, ((int)p->m_texcode[i] - (int)TEX_BLUR1) + 1); } // bind "texsize_XYZ" params int N = p->texsize_params.size(); for (int i=0; i<N; i++) { TexSizeParamInfo* q = &(p->texsize_params[i]); pCT->SetVector( lpDevice, q->texsize_param, &D3DXVECTOR4((float)q->w,(float)q->h,1.0f/q->w,1.0f/q->h)); } float time_since_preset_start = GetTime() - pState->GetPresetStartTime(); float time_since_preset_start_wrapped = time_since_preset_start - (int)(time_since_preset_start/10000)*10000; float time = GetTime() - m_fStartTime; float progress = (GetTime() - m_fPresetStartTime) / (m_fNextPresetTime - m_fPresetStartTime); float mip_x = logf((float)GetWidth())/logf(2.0f); float mip_y = logf((float)GetWidth())/logf(2.0f); float mip_avg = 0.5f*(mip_x + mip_y); float aspect_x = 1; float aspect_y = 1; if (GetWidth() > GetHeight()) aspect_y = GetHeight()/(float)GetWidth(); else aspect_x = GetWidth()/(float)GetHeight(); float blur_min[3] = {0}, blur_max[3] = {0}; GetSafeBlurMinMax(pState, blur_min, blur_max); // bind float4's if (p->rand_frame ) pCT->SetVector( lpDevice, p->rand_frame , &m_rand_frame ); if (p->rand_preset) pCT->SetVector( lpDevice, p->rand_preset, &pState->m_rand_preset ); D3DXHANDLE* h = p->const_handles; if (h[0]) pCT->SetVector( lpDevice, h[0], &D3DXVECTOR4( aspect_x, aspect_y, 1.0f/aspect_x, 1.0f/aspect_y )); if (h[1]) pCT->SetVector( lpDevice, h[1], &D3DXVECTOR4(0, 0, 0, 0 )); if (h[2]) pCT->SetVector( lpDevice, h[2], &D3DXVECTOR4(time_since_preset_start_wrapped, GetFps(), (float)GetFrame(), progress)); if (h[3]) pCT->SetVector( lpDevice, h[3], &D3DXVECTOR4(mysound.imm_rel[0], mysound.imm_rel[1], mysound.imm_rel[2], 0.3333f*(mysound.imm_rel[0], mysound.imm_rel[1], mysound.imm_rel[2]) )); if (h[4]) pCT->SetVector( lpDevice, h[4], &D3DXVECTOR4(mysound.avg_rel[0], mysound.avg_rel[1], mysound.avg_rel[2], 0.3333f*(mysound.avg_rel[0], mysound.avg_rel[1], mysound.avg_rel[2]) )); if (h[5]) pCT->SetVector( lpDevice, h[5], &D3DXVECTOR4( blur_max[0]-blur_min[0], blur_min[0], blur_max[1]-blur_min[1], blur_min[1] )); if (h[6]) pCT->SetVector( lpDevice, h[6], &D3DXVECTOR4( blur_max[2]-blur_min[2], blur_min[2], blur_min[0], blur_max[0] )); if (h[7]) pCT->SetVector( lpDevice, h[7], &D3DXVECTOR4((float)m_nTexSizeX, (float)m_nTexSizeY, 1.0f/(float)m_nTexSizeX, 1.0f/(float)m_nTexSizeY )); if (h[8]) pCT->SetVector( lpDevice, h[8], &D3DXVECTOR4( 0.5f+0.5f*cosf(time* 0.329f+1.2f), 0.5f+0.5f*cosf(time* 1.293f+3.9f), 0.5f+0.5f*cosf(time* 5.070f+2.5f), 0.5f+0.5f*cosf(time*20.051f+5.4f) )); if (h[9]) pCT->SetVector( lpDevice, h[9], &D3DXVECTOR4( 0.5f+0.5f*sinf(time* 0.329f+1.2f), 0.5f+0.5f*sinf(time* 1.293f+3.9f), 0.5f+0.5f*sinf(time* 5.070f+2.5f), 0.5f+0.5f*sinf(time*20.051f+5.4f) )); if (h[10]) pCT->SetVector( lpDevice, h[10], &D3DXVECTOR4( 0.5f+0.5f*cosf(time*0.0050f+2.7f), 0.5f+0.5f*cosf(time*0.0085f+5.3f), 0.5f+0.5f*cosf(time*0.0133f+4.5f), 0.5f+0.5f*cosf(time*0.0217f+3.8f) )); if (h[11]) pCT->SetVector( lpDevice, h[11], &D3DXVECTOR4( 0.5f+0.5f*sinf(time*0.0050f+2.7f), 0.5f+0.5f*sinf(time*0.0085f+5.3f), 0.5f+0.5f*sinf(time*0.0133f+4.5f), 0.5f+0.5f*sinf(time*0.0217f+3.8f) )); if (h[12]) pCT->SetVector( lpDevice, h[12], &D3DXVECTOR4( mip_x, mip_y, mip_avg, 0 )); if (h[13]) pCT->SetVector( lpDevice, h[13], &D3DXVECTOR4( blur_min[1], blur_max[1], blur_min[2], blur_max[2] )); // write q vars int num_q_float4s = ARRAYSIZE(p->q_const_handles); for (int i=0; i<num_q_float4s; i++) { if (p->q_const_handles[i]) pCT->SetVector( lpDevice, p->q_const_handles[i], &D3DXVECTOR4( (float)*pState->var_pf_q[i*4+0], (float)*pState->var_pf_q[i*4+1], (float)*pState->var_pf_q[i*4+2], (float)*pState->var_pf_q[i*4+3] )); } // write matrices for (int i=0; i<20; i++) { if (p->rot_mat[i]) { D3DXMATRIX mx,my,mz,mxlate,temp; pMatrixRotationX(&mx, pState->m_rot_base[i].x + pState->m_rot_speed[i].x*time); pMatrixRotationY(&my, pState->m_rot_base[i].y + pState->m_rot_speed[i].y*time); pMatrixRotationZ(&mz, pState->m_rot_base[i].z + pState->m_rot_speed[i].z*time); pMatrixTranslation(&mxlate, pState->m_xlate[i].x, pState->m_xlate[i].y, pState->m_xlate[i].z); pMatrixMultiply(&temp, &mx, &mxlate); pMatrixMultiply(&temp, &temp, &mz); pMatrixMultiply(&temp, &temp, &my); pCT->SetMatrix(lpDevice, p->rot_mat[i], &temp); } } // the last 4 are totally random, each frame for (int i=20; i<24; i++) { if (p->rot_mat[i]) { D3DXMATRIX mx,my,mz,mxlate,temp; pMatrixRotationX(&mx, FRAND * 6.28f); pMatrixRotationY(&my, FRAND * 6.28f); pMatrixRotationZ(&mz, FRAND * 6.28f); pMatrixTranslation(&mxlate, FRAND, FRAND, FRAND); pMatrixMultiply(&temp, &mx, &mxlate); pMatrixMultiply(&temp, &temp, &mz); pMatrixMultiply(&temp, &temp, &my); pCT->SetMatrix(lpDevice, p->rot_mat[i], &temp); } } } void CPlugin::ShowToUser_NoShaders()//int bRedraw, int nPassOverride) { // note: this one has to draw the whole screen! (one big quad) LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, m_lpVS[1]); lpDevice->SetVertexShader( NULL ); lpDevice->SetPixelShader( NULL ); lpDevice->SetFVF( SPRITEVERTEX_FORMAT ); // stages 0 and 1 always just use bilinear filtering. lpDevice->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MINFILTER, D3DTEXF_LINEAR); lpDevice->SetSamplerState(1, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); // note: this texture stage state setup works for 0 or 1 texture. // if you set a texture, it will be modulated with the current diffuse color. // if you don't set a texture, it will just use the current diffuse color. lpDevice->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE); lpDevice->SetTextureStageState(0, D3DTSS_COLORARG2, D3DTA_TEXTURE); lpDevice->SetTextureStageState(1, D3DTSS_COLOROP, D3DTOP_DISABLE); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_SELECTARG1 ); lpDevice->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE ); lpDevice->SetTextureStageState(1, D3DTSS_ALPHAOP, D3DTOP_DISABLE); SPRITEVERTEX v3[4] = {0}; // extend the poly we draw by 1 pixel around the viewable image area, // in case the video card wraps u/v coords with a +0.5-texel offset // (otherwise, a 1-pixel-wide line of the image would wrap at the top and left edges). float fOnePlusInvWidth = 1.0f + 1.0f/(float)GetWidth(); float fOnePlusInvHeight = 1.0f + 1.0f/(float)GetHeight(); v3[0].x = -fOnePlusInvWidth; v3[1].x = fOnePlusInvWidth; v3[2].x = -fOnePlusInvWidth; v3[3].x = fOnePlusInvWidth; v3[0].y = fOnePlusInvHeight; v3[1].y = fOnePlusInvHeight; v3[2].y = -fOnePlusInvHeight; v3[3].y = -fOnePlusInvHeight; //float aspect = GetWidth() / (float)(GetHeight()/(ASPECT)/**4.0f/3.0f*/); float aspect = GetWidth() / (float)(GetHeight()*m_fInvAspectY/**4.0f/3.0f*/); float x_aspect_mult = 1.0f; float y_aspect_mult = 1.0f; if (aspect>1) y_aspect_mult = aspect; else x_aspect_mult = 1.0f/aspect; for (int n=0; n<4; n++) { v3[n].x *= x_aspect_mult; v3[n].y *= y_aspect_mult; } { float shade[4][3] = { { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f } }; // for each vertex, then each comp. float fShaderAmount = m_pState->m_fShader.eval(GetTime()); if (fShaderAmount > 0.001f) { for (int i=0; i<4; i++) { shade[i][0] = 0.6f + 0.3f*sinf(GetTime()*30.0f*0.0143f + 3 + i*21 + m_fRandStart[3]); shade[i][1] = 0.6f + 0.3f*sinf(GetTime()*30.0f*0.0107f + 1 + i*13 + m_fRandStart[1]); shade[i][2] = 0.6f + 0.3f*sinf(GetTime()*30.0f*0.0129f + 6 + i*9 + m_fRandStart[2]); float max = ((shade[i][0] > shade[i][1]) ? shade[i][0] : shade[i][1]); if (shade[i][2] > max) max = shade[i][2]; for (int k=0; k<3; k++) { shade[i][k] /= max; shade[i][k] = 0.5f + 0.5f*shade[i][k]; } for (int k=0; k<3; k++) { shade[i][k] = shade[i][k]*(fShaderAmount) + 1.0f*(1.0f - fShaderAmount); } v3[i].Diffuse = D3DCOLOR_RGBA_01(shade[i][0],shade[i][1],shade[i][2],1); } } float fVideoEchoZoom = (float)(*m_pState->var_pf_echo_zoom);//m_pState->m_fVideoEchoZoom.eval(GetTime()); float fVideoEchoAlpha = (float)(*m_pState->var_pf_echo_alpha);//m_pState->m_fVideoEchoAlpha.eval(GetTime()); int nVideoEchoOrientation = (int) (*m_pState->var_pf_echo_orient) % 4;//m_pState->m_nVideoEchoOrientation; float fGammaAdj = (float)(*m_pState->var_pf_gamma);//m_pState->m_fGammaAdj.eval(GetTime()); if (m_pState->m_bBlending && m_pState->m_fVideoEchoAlpha.eval(GetTime()) > 0.01f && m_pState->m_fVideoEchoAlphaOld > 0.01f && m_pState->m_nVideoEchoOrientation != m_pState->m_nVideoEchoOrientationOld) { if (m_pState->m_fBlendProgress < m_fSnapPoint) { nVideoEchoOrientation = m_pState->m_nVideoEchoOrientationOld; fVideoEchoAlpha *= 1.0f - 2.0f*CosineInterp(m_pState->m_fBlendProgress); } else { fVideoEchoAlpha *= 2.0f*CosineInterp(m_pState->m_fBlendProgress) - 1.0f; } } if (fVideoEchoAlpha > 0.001f) { // video echo lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); for (int i=0; i<2; i++) { float fZoom = (i==0) ? 1.0f : fVideoEchoZoom; float temp_lo = 0.5f - 0.5f/fZoom; float temp_hi = 0.5f + 0.5f/fZoom; v3[0].tu = temp_lo; v3[0].tv = temp_hi; v3[1].tu = temp_hi; v3[1].tv = temp_hi; v3[2].tu = temp_lo; v3[2].tv = temp_lo; v3[3].tu = temp_hi; v3[3].tv = temp_lo; // flipping if (i==1) { for (int j=0; j<4; j++) { if (nVideoEchoOrientation % 2) v3[j].tu = 1.0f - v3[j].tu; if (nVideoEchoOrientation >= 2) v3[j].tv = 1.0f - v3[j].tv; } } float mix = (i==1) ? fVideoEchoAlpha : 1.0f - fVideoEchoAlpha; for (int k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(mix*shade[k][0],mix*shade[k][1],mix*shade[k][2],1); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); if (i==0) { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); } if (fGammaAdj > 0.001f) { // draw layer 'i' a 2nd (or 3rd, or 4th...) time, additively int nRedraws = (int)(fGammaAdj - 0.0001f); float gamma; for (int nRedraw=0; nRedraw < nRedraws; nRedraw++) { if (nRedraw == nRedraws-1) gamma = fGammaAdj - (int)(fGammaAdj - 0.0001f); else gamma = 1.0f; for (int k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(gamma*mix*shade[k][0],gamma*mix*shade[k][1],gamma*mix*shade[k][2],1); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); } } } } else { // no video echo v3[0].tu = 0; v3[1].tu = 1; v3[2].tu = 0; v3[3].tu = 1; v3[0].tv = 1; v3[1].tv = 1; v3[2].tv = 0; v3[3].tv = 0; lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); // draw it iteratively, solid the first time, and additively after that int nPasses = (int)(fGammaAdj - 0.001f) + 1; float gamma; for (int nPass=0; nPass < nPasses; nPass++) { if (nPass == nPasses - 1) gamma = fGammaAdj - (float)nPass; else gamma = 1.0f; for (int k=0; k<4; k++) v3[k].Diffuse = D3DCOLOR_RGBA_01(gamma*shade[k][0],gamma*shade[k][1],gamma*shade[k][2],1); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); if (nPass==0) { lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); } } } //SPRITEVERTEX v3[4]; memset(v3, 0, sizeof(SPRITEVERTEX)*4); fOnePlusInvWidth = 1.0f + 1.0f/(float)GetWidth(); fOnePlusInvHeight = 1.0f + 1.0f/(float)GetHeight(); v3[0].x = -fOnePlusInvWidth; v3[1].x = fOnePlusInvWidth; v3[2].x = -fOnePlusInvWidth; v3[3].x = fOnePlusInvWidth; v3[0].y = fOnePlusInvHeight; v3[1].y = fOnePlusInvHeight; v3[2].y = -fOnePlusInvHeight; v3[3].y = -fOnePlusInvHeight; for (int i=0; i<4; i++) v3[i].Diffuse = D3DCOLOR_RGBA_01(1,1,1,1); if (*m_pState->var_pf_brighten && (GetCaps()->SrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR ) && (GetCaps()->DestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) ) { // square root filter //lpDevice->SetRenderState(D3DRS_COLORVERTEX, FALSE); //? //lpDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); //? lpDevice->SetTexture(0, NULL); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); // first, a perfect invert lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVDESTCOLOR); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); // then modulate by self (square it) lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); // then another perfect invert lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVDESTCOLOR); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); } if (*m_pState->var_pf_darken && (GetCaps()->DestBlendCaps & D3DPBLENDCAPS_DESTCOLOR) ) { // squaring filter //lpDevice->SetRenderState(D3DRS_COLORVERTEX, FALSE); //? //lpDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); //? lpDevice->SetTexture(0, NULL); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_DESTCOLOR); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); //lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_DESTCOLOR); //lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); //lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); } if (*m_pState->var_pf_solarize && (GetCaps()->SrcBlendCaps & D3DPBLENDCAPS_DESTCOLOR ) && (GetCaps()->DestBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR) ) { //lpDevice->SetRenderState(D3DRS_COLORVERTEX, FALSE); //? //lpDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); //? lpDevice->SetTexture(0, NULL); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVDESTCOLOR); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_DESTCOLOR); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); } if (*m_pState->var_pf_invert && (GetCaps()->SrcBlendCaps & D3DPBLENDCAPS_INVDESTCOLOR ) ) { //lpDevice->SetRenderState(D3DRS_COLORVERTEX, FALSE); //? //lpDevice->SetRenderState(D3DRS_SHADEMODE, D3DSHADE_FLAT); //? lpDevice->SetTexture(0, NULL); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVDESTCOLOR); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ZERO); lpDevice->DrawPrimitiveUP(D3DPT_TRIANGLESTRIP, 2, (void*)v3, sizeof(SPRITEVERTEX)); } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); } } void CPlugin::ShowToUser_Shaders(int nPass, bool bAlphaBlend, bool bFlipAlpha, bool bCullTiles, bool bFlipCulling)//int bRedraw, int nPassOverride, bool bFlipAlpha) { LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; //lpDevice->SetTexture(0, m_lpVS[1]); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( MYVERTEX_FORMAT ); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); #if 0 // DISABLED float aspect = GetWidth() / (float)(GetHeight()*m_fInvAspectY/**4.0f/3.0f*/); float x_aspect_mult = 1.0f; float y_aspect_mult = 1.0f; if (aspect>1) y_aspect_mult = aspect; else x_aspect_mult = 1.0f/aspect; #endif // hue shader float shade[4][3] = { { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f }, { 1.0f, 1.0f, 1.0f } }; // for each vertex, then each comp. /*const float fShaderAmount = 1;//since we don't know if shader uses it or not! m_pState->m_fShader.eval(GetTime()); if (fShaderAmount > 0.001f || m_pState->m_bBlending)*/ { // pick 4 colors for the 4 corners for (int i=0; i<4; i++) { shade[i][0] = 0.6f + 0.3f*sinf(GetTime()*30.0f*0.0143f + 3 + i*21 + m_fRandStart[3]); shade[i][1] = 0.6f + 0.3f*sinf(GetTime()*30.0f*0.0107f + 1 + i*13 + m_fRandStart[1]); shade[i][2] = 0.6f + 0.3f*sinf(GetTime()*30.0f*0.0129f + 6 + i*9 + m_fRandStart[2]); float max = ((shade[i][0] > shade[i][1]) ? shade[i][0] : shade[i][1]); if (shade[i][2] > max) max = shade[i][2]; for (int k=0; k<3; k++) { shade[i][k] /= max; shade[i][k] = 0.5f + 0.5f*shade[i][k]; } // note: we now pass the raw hue shader colors down; the shader can only use a certain % if it wants. //for (k=0; k<3; k++) // shade[i][k] = shade[i][k]*(fShaderAmount) + 1.0f*(1.0f - fShaderAmount); //m_comp_verts[i].Diffuse = D3DCOLOR_RGBA_01(shade[i][0],shade[i][1],shade[i][2],1); } // interpolate the 4 colors & apply to all the verts for (int j=0; j<FCGSY; j++) { for (int i=0; i<FCGSX; i++) { MYVERTEX* p = &m_comp_verts[i + j*FCGSX]; float x = p->x*0.5f + 0.5f; float y = p->y*0.5f + 0.5f; float col[3] = { 1, 1, 1 }; //if (fShaderAmount > 0.001f) { for (int c=0; c<3; c++) col[c] = shade[0][c]*( x)*( y) + shade[1][c]*(1-x)*( y) + shade[2][c]*( x)*(1-y) + shade[3][c]*(1-x)*(1-y); } // TO DO: improve interp here? // TO DO: during blend, only send the triangles needed // if blending, also set up the alpha values - pull them from the alphas used for the Warped Blit double alpha = 1; if (m_pState->m_bBlending) { x *= (m_nGridX + 1); y *= (m_nGridY + 1); x = max(min(x,m_nGridX-1),0); y = max(min(y,m_nGridY-1),0); int nx = (int)x; int ny = (int)y; double dx = x - nx; double dy = y - ny; double alpha00 = (m_verts[(ny )*(m_nGridX+1) + (nx )].Diffuse >> 24); double alpha01 = (m_verts[(ny )*(m_nGridX+1) + (nx+1)].Diffuse >> 24); double alpha10 = (m_verts[(ny+1)*(m_nGridX+1) + (nx )].Diffuse >> 24); double alpha11 = (m_verts[(ny+1)*(m_nGridX+1) + (nx+1)].Diffuse >> 24); alpha = alpha00*(1-dx)*(1-dy) + alpha01*( dx)*(1-dy) + alpha10*(1-dx)*( dy) + alpha11*( dx)*( dy); alpha /= 255.0f; //if (bFlipAlpha) // alpha = 1-alpha; //alpha = (m_verts[y*(m_nGridX+1) + x].Diffuse >> 24) / 255.0f; } p->Diffuse = D3DCOLOR_RGBA_01(col[0],col[1],col[2],alpha); } } } int nAlphaTestValue = 0; if (bFlipCulling) nAlphaTestValue = 1-nAlphaTestValue; if (bAlphaBlend) { lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); if (bFlipAlpha) { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_INVSRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_SRCALPHA); } else { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCALPHA); } } else lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); // Now do the final composite blit, fullscreen; // or do it twice, alpha-blending, if we're blending between two sets of shaders. int pass = nPass; { // PASS 0: draw using *blended per-vertex motion vectors*, but with the OLD comp shader. // PASS 1: draw using *blended per-vertex motion vectors*, but with the NEW comp shader. PShaderInfo* si = (pass==0) ? &m_OldShaders.comp : &m_shaders.comp; CState* state = (pass==0) ? m_pOldState : m_pState; lpDevice->SetVertexDeclaration(m_pMyVertDecl); lpDevice->SetVertexShader(m_fallbackShaders_vs.comp.ptr); lpDevice->SetPixelShader (si->ptr); ApplyShaderParams( &(si->params), si->CT, state ); // Hurl the triangles at the video card. // We're going to un-index it, so that we don't stress any crappy (AHEM intel g33) // drivers out there. Not a big deal - only ~800 polys / 24kb of data. // If we're blending, we'll skip any polygon that is all alpha-blended out. // This also respects the MaxPrimCount limit of the video card. MYVERTEX tempv[1024 * 3] = {0}; int primCount = (FCGSX-2)*(FCGSY-2)*2; // although, some might not be drawn! int max_prims_per_batch = min( GetCaps()->MaxPrimitiveCount, (ARRAYSIZE(tempv))/3) - 4; int src_idx = 0; while (src_idx < primCount*3) { int prims_queued = 0; int i=0; while (prims_queued < max_prims_per_batch && src_idx < primCount*3) { // copy 3 verts for (int j=0; j<3; j++) tempv[i++] = m_comp_verts[ m_comp_indices[src_idx++] ]; if (bCullTiles) { DWORD d1 = (tempv[i-3].Diffuse >> 24); DWORD d2 = (tempv[i-2].Diffuse >> 24); DWORD d3 = (tempv[i-1].Diffuse >> 24); bool bIsNeeded; if (nAlphaTestValue) bIsNeeded = ((d1 & d2 & d3) < 255);//(d1 < 255) || (d2 < 255) || (d3 < 255); else bIsNeeded = ((d1|d2|d3) > 0);//(d1 > 0) || (d2 > 0) || (d3 > 0); if (!bIsNeeded) i -= 3; else ++prims_queued; } else ++prims_queued; } if (prims_queued > 0) lpDevice->DrawPrimitiveUP( D3DPT_TRIANGLELIST, prims_queued, tempv, sizeof(MYVERTEX) ); } } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); RestoreShaderParams(); } void CPlugin::ShowSongTitleAnim(int w, int h, float fProgress) { int i,x,y; if (!m_lpDDSTitle) // this *can* be NULL, if not much video mem! return; LPDIRECT3DDEVICE9 lpDevice = GetDevice(); if (!lpDevice) return; lpDevice->SetTexture(0, m_lpDDSTitle); lpDevice->SetVertexShader( NULL ); lpDevice->SetFVF( SPRITEVERTEX_FORMAT ); lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, TRUE); lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); SPRITEVERTEX v3[128] = {0}; if (m_supertext.bIsSongTitle) { // positioning: float fSizeX = 50.0f / (float)m_supertext.nFontSizeUsed * powf(1.5f, m_supertext.fFontSize - 2.0f); float fSizeY = fSizeX * m_nTitleTexSizeY/(float)m_nTitleTexSizeX;// * m_nWidth/(float)m_nHeight; if (fSizeX > 0.88f) { fSizeY *= 0.88f/fSizeX; fSizeX = 0.88f; } //fixme if (fProgress < 1.0f)//(w!=h) // regular render-to-backbuffer { //float aspect = w/(float)(h*4.0f/3.0f); //fSizeY *= aspect; } else // final render-to-VS0 { //float aspect = GetWidth()/(float)(GetHeight()*4.0f/3.0f); //if (aspect < 1.0f) //{ // fSizeX *= aspect; // fSizeY *= aspect; //} //fSizeY *= -1; } //if (fSizeX > 0.92f) fSizeX = 0.92f; //if (fSizeY > 0.92f) fSizeY = 0.92f; i = 0; float vert_clip = VERT_CLIP;//1.0f;//0.45f; // warning: visible clipping has been observed at 0.4! for (y=0; y<8; y++) { for (x=0; x<16; x++) { v3[i].tu = x/15.0f; v3[i].tv = (y/7.0f - 0.5f)*vert_clip + 0.5f; v3[i].x = (v3[i].tu*2.0f - 1.0f)*fSizeX; v3[i].y = (v3[i].tv*2.0f - 1.0f)*fSizeY; if (fProgress >= 1.0f) v3[i].y += 1.0f/(float)m_nTexSizeY; //this is a pretty hacky guess @ getting it to align... ++i; } } // warping float ramped_progress = max(0.0f, 1-fProgress*1.5f); float t2 = powf(ramped_progress, 1.8f)*1.3f; for (y=0; y<8; y++) { for (x=0; x<16; x++) { i = y*16+x; v3[i].x += t2*0.070f*sinf(GetTime()*0.31f + v3[i].x*0.39f - v3[i].y*1.94f); v3[i].x += t2*0.044f*sinf(GetTime()*0.81f - v3[i].x*1.91f + v3[i].y*0.27f); v3[i].x += t2*0.061f*sinf(GetTime()*1.31f + v3[i].x*0.61f + v3[i].y*0.74f); v3[i].y += t2*0.061f*sinf(GetTime()*0.37f + v3[i].x*1.83f + v3[i].y*0.69f); v3[i].y += t2*0.070f*sinf(GetTime()*0.67f + v3[i].x*0.42f - v3[i].y*1.39f); v3[i].y += t2*0.087f*sinf(GetTime()*1.07f + v3[i].x*3.55f + v3[i].y*0.89f); } } // scale down over time float scale = 1.01f/(powf(fProgress, 0.21f) + 0.01f); for (i=0; i<128; i++) { v3[i].x *= scale; v3[i].y *= scale; } } else { // positioning: float fSizeX = (float)m_nTexSizeX/1024.0f * 100.0f / (float)m_supertext.nFontSizeUsed * powf(1.033f, m_supertext.fFontSize - 50.0f); float fSizeY = fSizeX * m_nTitleTexSizeY/(float)m_nTitleTexSizeX; //fixme if (fProgress < 1.0f)//w!=h) // regular render-to-backbuffer { //float aspect = w/(float)(h*4.0f/3.0f); //fSizeY *= aspect; } else // final render-to-VS0 { //float aspect = GetWidth()/(float)(GetHeight()*4.0f/3.0f); //if (aspect < 1.0f) //{ // fSizeX *= aspect; // fSizeY *= aspect; //} //fSizeY *= -1; } //if (fSize > 0.92f) fSize = 0.92f; i = 0; float vert_clip = VERT_CLIP;//0.67f; // warning: visible clipping has been observed at 0.5 (for very short strings) and even 0.6 (for wingdings)! for (y=0; y<8; y++) { for (x=0; x<16; x++) { v3[i].tu = x/15.0f; v3[i].tv = (y/7.0f - 0.5f)*vert_clip + 0.5f; v3[i].x = (v3[i].tu*2.0f - 1.0f)*fSizeX; v3[i].y = (v3[i].tv*2.0f - 1.0f)*fSizeY; if (fProgress >= 1.0f) v3[i].y += 1.0f/(float)m_nTexSizeY; //this is a pretty hacky guess @ getting it to align... ++i; } } // apply 'growth' factor and move to user-specified (x,y) //if (fabsf(m_supertext.fGrowth-1.0f) > 0.001f) { float t = (1.0f)*(1-fProgress) + (fProgress)*(m_supertext.fGrowth); float dx = (m_supertext.fX*2-1); float dy = (m_supertext.fY*2-1); if (w!=h) // regular render-to-backbuffer { float aspect = w/(float)(h*4.0f/3.0f); if (aspect < 1) dx /= aspect; else dy *= aspect; } for (i=0; i<128; i++) { // note: (x,y) are in (-1,1) range, but m_supertext.f{X|Y} are in (0..1) range v3[i].x = (v3[i].x)*t + dx; v3[i].y = (v3[i].y)*t + dy; } } } WORD indices[7*15*6] = {0}; i = 0; for (y=0; y<7; y++) { for (x=0; x<15; x++) { indices[i++] = (WORD)(y*16 + x); indices[i++] = (WORD)(y*16 + x + 1); indices[i++] = (WORD)(y*16 + x + 16); indices[i++] = (WORD)(y*16 + x + 1); indices[i++] = (WORD)(y*16 + x + 16); indices[i++] = (WORD)(y*16 + x + 17); } } // final flip on y //for (i=0; i<128; i++) // v3[i].y *= -1.0f; for (i=0; i<128; i++) //v3[i].y /= ASPECT_Y; v3[i].y *= m_fInvAspectY; for (int it=0; it<2; it++) { // colors { float t; if (m_supertext.bIsSongTitle) t = powf(fProgress, 0.3f)*1.0f; else t = CosineInterp(min(1.0f, (fProgress/m_supertext.fFadeTime))); if (it==0) v3[0].Diffuse = D3DCOLOR_RGBA_01(t,t,t,t); else v3[0].Diffuse = D3DCOLOR_RGBA_01(t*m_supertext.nColorR/255.0f,t*m_supertext.nColorG/255.0f,t*m_supertext.nColorB/255.0f,t); for (i=1; i<128; i++) v3[i].Diffuse = v3[0].Diffuse; } // nudge down & right for shadow, up & left for solid text float offset_x = 0, offset_y = 0; switch(it) { case 0: offset_x = 2.0f/(float)m_nTitleTexSizeX; offset_y = 2.0f/(float)m_nTitleTexSizeY; break; case 1: offset_x = -4.0f/(float)m_nTitleTexSizeX; offset_y = -4.0f/(float)m_nTitleTexSizeY; break; } for (i=0; i<128; i++) { v3[i].x += offset_x; v3[i].y += offset_y; } if (it == 0) { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ZERO);//SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_INVSRCCOLOR); } else { lpDevice->SetRenderState(D3DRS_SRCBLEND, D3DBLEND_ONE);//SRCALPHA); lpDevice->SetRenderState(D3DRS_DESTBLEND, D3DBLEND_ONE); } lpDevice->DrawIndexedPrimitiveUP(D3DPT_TRIANGLELIST, 0, 128, 15*7*6/3, indices, D3DFMT_INDEX16, v3, sizeof(SPRITEVERTEX)); } lpDevice->SetRenderState(D3DRS_ALPHABLENDENABLE, FALSE); }
38.756768
238
0.592426
WACUP
fdda3ea736e8d17de0f4b5bdb405c1941dd32e80
613
cpp
C++
simulator/risc_v/riscv_register/riscv_register.cpp
trexxet/mipt-mips
200bb67dfedf0dd24dd442c4605f9265078c21d8
[ "MIT" ]
10
2021-03-10T13:22:15.000Z
2021-03-12T23:09:42.000Z
simulator/risc_v/riscv_register/riscv_register.cpp
jamzrob/mipt-mips
1ae47ac16967d4132d5f4a2ac486b18147660c16
[ "MIT" ]
null
null
null
simulator/risc_v/riscv_register/riscv_register.cpp
jamzrob/mipt-mips
1ae47ac16967d4132d5f4a2ac486b18147660c16
[ "MIT" ]
null
null
null
/* riscv_register.cpp - RISCV register info class * @author Alexandr Misevich * Copyright 2018 MIPT-MIPS */ #include "riscv_register.h" const RISCVRegister RISCVRegister::zero = RISCVRegister( RISCV_REG_zero); const RISCVRegister RISCVRegister::return_address = RISCVRegister( RISCV_REG_rs); const RISCVRegister RISCVRegister::mips_hi = RISCVRegister( MAX_VAL_RegNum); const RISCVRegister RISCVRegister::mips_lo = RISCVRegister( MAX_VAL_RegNum); std::array<std::string_view, RISCVRegister::MAX_REG> RISCVRegister::regTable = {{ #define REGISTER(X) # X #include "riscv_register.def" #undef REGISTER }};
32.263158
81
0.786297
trexxet
fddbfa631ff1648d3f23422f12ded461ccfb3cc2
701
hpp
C++
lib/STL+/subsystems/subsystems.hpp
knela96/Game-Engine
06659d933c4447bd8d6c8536af292825ce4c2ab1
[ "Unlicense" ]
3
2018-05-07T19:09:23.000Z
2019-05-03T14:19:38.000Z
deps/stlplus/subsystems/subsystems.hpp
evpo/libencryptmsg
fa1ea59c014c0a9ce339d7046642db4c80fc8701
[ "BSD-2-Clause-FreeBSD", "BSD-3-Clause" ]
null
null
null
deps/stlplus/subsystems/subsystems.hpp
evpo/libencryptmsg
fa1ea59c014c0a9ce339d7046642db4c80fc8701
[ "BSD-2-Clause-FreeBSD", "BSD-3-Clause" ]
null
null
null
#ifndef STLPLUS_SUBSYSTEMS #define STLPLUS_SUBSYSTEMS //////////////////////////////////////////////////////////////////////////////// // Author: Andy Rushton // Copyright: (c) Southampton University 1999-2004 // (c) Andy Rushton 2004 onwards // License: BSD License, see ../docs/license.html // Allows all the STLplus subsystems to be included in one go //////////////////////////////////////////////////////////////////////////////// #include "cli_parser.hpp" #include "ini_manager.hpp" #include "library_manager.hpp" #include "message_handler.hpp" #include "timer.hpp" //////////////////////////////////////////////////////////////////////////////// #endif
31.863636
80
0.457917
knela96
fddcb14854d8ccc02f73819b19dad0ae822d9237
336
cpp
C++
solved/==coin chage(674).cpp
goutomroy/uva.onlinejudge
5ce09d9e370ad78eabd0fd500ef77ce804e2d0f2
[ "MIT" ]
null
null
null
solved/==coin chage(674).cpp
goutomroy/uva.onlinejudge
5ce09d9e370ad78eabd0fd500ef77ce804e2d0f2
[ "MIT" ]
null
null
null
solved/==coin chage(674).cpp
goutomroy/uva.onlinejudge
5ce09d9e370ad78eabd0fd500ef77ce804e2d0f2
[ "MIT" ]
null
null
null
#include <stdio.h> long ways[7500]; void main() { long value,i,j; const long coin[5] = {50,25,10,5,1}; ways[0] = 1; for (i=0;i<5;i++) for (j=coin[i];j<=7500;j++) ways[j] += ways[j - coin[i]]; while (scanf("%ld",&value)==1) printf("%ld\n",ways[value]) ; }
17.684211
42
0.434524
goutomroy
fddd61de5b9641c65e7c3337bcf52e6ba4b48a0b
4,818
cc
C++
lmctfy/controllers/eventfd_notifications.cc
adamvduke/lmctfy
c66398571759758ed273675398e4b37091aa7a89
[ "Apache-2.0" ]
null
null
null
lmctfy/controllers/eventfd_notifications.cc
adamvduke/lmctfy
c66398571759758ed273675398e4b37091aa7a89
[ "Apache-2.0" ]
null
null
null
lmctfy/controllers/eventfd_notifications.cc
adamvduke/lmctfy
c66398571759758ed273675398e4b37091aa7a89
[ "Apache-2.0" ]
null
null
null
// Copyright 2013 Google Inc. All Rights Reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. #include "lmctfy/controllers/eventfd_notifications.h" #include "util/eventfd_listener.h" #include "strings/substitute.h" #include "util/gtl/stl_util.h" using ::util::EventReceiverInterface; using ::util::EventfdListener; using ::std::unique_ptr; using ::strings::Substitute; using ::util::Status; using ::util::StatusOr; namespace containers { namespace lmctfy { // Custom receiver for eventfd-based notifications. Delivers notifications if // they are still active. // // Class is thread-safe. class EventReceiver : public EventReceiverInterface { public: // Does not take ownership of active_notificaitons. Takes ownership of // notification_callback which must be a repeatable callback. EventReceiver(ActiveNotifications::Handle id, const ActiveNotifications *active_notifications, Callback1<Status> *notification_callback) : id_(id), active_notifications_(CHECK_NOTNULL(active_notifications)), notification_callback_(CHECK_NOTNULL(notification_callback)) { notification_callback_->IsRepeatable(); } ~EventReceiver() {} // Deliver the event to the user. Stop reporting the event if the notification // was unregistered. bool ReportEvent(const string &name, const string &args) { // If not active anymore, return false (unregisters notification). if (!active_notifications_->Contains(id_)) { return false; } // Deliver event to the user. notification_callback_->Run(Status::OK); return true; } // Report the error to the user. void ReportError(const string &name, EventfdListener *listener) { // Error, report it. This is de-registered. LOG(WARNING) << "No longer notifying for event with Handle: " << id_ << " due to error"; // Notify the user of the error. notification_callback_->Run( Status(::util::error::CANCELLED, Substitute("Failed to register event with Handle \"$0\"", id_))); } // Log the exit. void ReportExit(const string &name, EventfdListener *listener) { // We shut ourselves down. LOG(INFO) << "No longer notifying for event with Handle: " << id_; } private: // The Handle of the notification this listener listens for. const ActiveNotifications::Handle id_; // Notifications active in the system. const ActiveNotifications *active_notifications_; // The callback used to deliver notificaitons to the user. unique_ptr<Callback1<Status>> notification_callback_; DISALLOW_COPY_AND_ASSIGN(EventReceiver); }; EventFdNotifications::EventFdNotifications( ActiveNotifications *active_notifications, ::util::EventfdListener *event_listener) : active_notifications_(CHECK_NOTNULL(active_notifications)), event_listener_(CHECK_NOTNULL(event_listener)) {} EventFdNotifications::~EventFdNotifications() { event_listener_->Stop(); event_listener_.reset(); // TODO(vmarmol): Use something that doesn't require us to keep track of the // receivers since they're staying around for longer than they need to be. STLDeleteElements(&event_receivers_); } StatusOr<ActiveNotifications::Handle> EventFdNotifications::RegisterNotification(const string &cgroup_basepath, const string &cgroup_file, const string &args, EventCallback *callback) { CHECK_NOTNULL(callback); callback->CheckIsRepeatable(); // Get a Handle for this event. ActiveNotifications::Handle id = active_notifications_->Add(); // Register the event with the eventfd-based listener. unique_ptr<EventReceiver> receiver( new EventReceiver(id, active_notifications_, callback)); if (!event_listener_->Add(cgroup_basepath, cgroup_file, args, "", receiver.get())) { return Status(::util::error::INTERNAL, "Failed to register listener for the event"); } event_receivers_.push_back(receiver.release()); // Start listener thread if it was not already running. if (event_listener_->IsNotRunning()) { event_listener_->Start(); } return id; } } // namespace lmctfy } // namespace containers
34.661871
80
0.705064
adamvduke
fde00de7afb7446b527feabd06af7024736a0273
178
hpp
C++
include/public/BlackBox/Renderer/ITechniqueManager.hpp
kovdennik/TestEngine
43e8d51f64c1a576ff812126d44ee43d8e25bdef
[ "MIT" ]
null
null
null
include/public/BlackBox/Renderer/ITechniqueManager.hpp
kovdennik/TestEngine
43e8d51f64c1a576ff812126d44ee43d8e25bdef
[ "MIT" ]
null
null
null
include/public/BlackBox/Renderer/ITechniqueManager.hpp
kovdennik/TestEngine
43e8d51f64c1a576ff812126d44ee43d8e25bdef
[ "MIT" ]
null
null
null
#pragma once struct ITechnique; struct ITechniqueManager { virtual ITechnique* get(std::string name) = 0; virtual ITechnique* add(std::string name, ITechnique* tech) = 0; };
22.25
66
0.735955
kovdennik
fde5464a51277b1d31d6f727571fff89b661e231
7,468
cpp
C++
sferes/modules/nn2/test_hyper_nn.cpp
Evolving-AI-Lab/innovation-engine
58c7fcc3cbe3d6f8f59f87d95bdb5f2302f425ba
[ "MIT" ]
31
2015-09-20T03:03:29.000Z
2022-01-25T06:50:20.000Z
sferes/modules/nn2/test_hyper_nn.cpp
Evolving-AI-Lab/innovation-engine
58c7fcc3cbe3d6f8f59f87d95bdb5f2302f425ba
[ "MIT" ]
1
2016-08-11T07:24:50.000Z
2016-08-17T01:19:57.000Z
sferes/modules/nn2/test_hyper_nn.cpp
Evolving-AI-Lab/innovation-engine
58c7fcc3cbe3d6f8f59f87d95bdb5f2302f425ba
[ "MIT" ]
10
2015-11-15T01:52:25.000Z
2018-06-11T23:42:58.000Z
//| This file is a part of the sferes2 framework. //| Copyright 2009, ISIR / Universite Pierre et Marie Curie (UPMC) //| Main contributor(s): Jean-Baptiste Mouret, mouret@isir.fr //| //| This software is a computer program whose purpose is to facilitate //| experiments in evolutionary computation and evolutionary robotics. //| //| This software is governed by the CeCILL license under French law //| and abiding by the rules of distribution of free software. You //| can use, modify and/ or redistribute the software under the terms //| of the CeCILL license as circulated by CEA, CNRS and INRIA at the //| following URL "http://www.cecill.info". //| //| As a counterpart to the access to the source code and rights to //| copy, modify and redistribute granted by the license, users are //| provided only with a limited warranty and the software's author, //| the holder of the economic rights, and the successive licensors //| have only limited liability. //| //| In this respect, the user's attention is drawn to the risks //| associated with loading, using, modifying and/or developing or //| reproducing the software by the user in light of its specific //| status of free software, that may mean that it is complicated to //| manipulate, and that also therefore means that it is reserved for //| developers and experienced professionals having in-depth computer //| knowledge. Users are therefore encouraged to load and test the //| software's suitability as regards their requirements in conditions //| enabling the security of their systems and/or data to be ensured //| and, more generally, to use and operate it in the same conditions //| as regards security. //| //| The fact that you are presently reading this means that you have //| had knowledge of the CeCILL license and that you accept its terms. #define BOOST_TEST_DYN_LINK #define BOOST_TEST_MODULE dnn #include <boost/test/unit_test.hpp> #include <iostream> #include <sferes/fit/fitness.hpp> #include <sferes/phen/parameters.hpp> #include "gen_dnn.hpp" #include "gen_hyper_nn.hpp" #include "phen_hyper_nn.hpp" using namespace sferes; using namespace sferes::gen::dnn; using namespace sferes::gen::evo_float; struct Params1 { struct dnn { SFERES_CONST size_t nb_inputs = 3; SFERES_CONST size_t nb_outputs = 1; SFERES_CONST float m_rate_add_conn = 1.0f; SFERES_CONST float m_rate_del_conn = 0.3f; SFERES_CONST float m_rate_change_conn = 1.0f; SFERES_CONST float m_rate_add_neuron = 1.0f; SFERES_CONST float m_rate_del_neuron = 0.2f; SFERES_CONST init_t init = ff; }; struct evo_float { SFERES_CONST float mutation_rate = 0.1f; SFERES_CONST float cross_rate = 0.1f; SFERES_CONST mutation_t mutation_type = polynomial; SFERES_CONST cross_over_t cross_over_type = sbx; SFERES_CONST float eta_m = 15.0f; SFERES_CONST float eta_c = 15.0f; }; struct parameters { SFERES_CONST float min = -2.0f; SFERES_CONST float max = 2.0f; }; struct cppn { // params of the CPPN struct sampled { SFERES_ARRAY(float, values, 0, 1, 2); SFERES_CONST float mutation_rate = 0.1f; SFERES_CONST float cross_rate = 0.25f; SFERES_CONST bool ordered = false; }; struct evo_float { SFERES_CONST float mutation_rate = 0.1f; SFERES_CONST float cross_rate = 0.1f; SFERES_CONST mutation_t mutation_type = polynomial; SFERES_CONST cross_over_t cross_over_type = sbx; SFERES_CONST float eta_m = 15.0f; SFERES_CONST float eta_c = 15.0f; }; }; }; struct Params2 { struct dnn { SFERES_CONST size_t nb_inputs = 4; SFERES_CONST size_t nb_outputs = 1; SFERES_CONST float m_rate_add_conn = 1.0f; SFERES_CONST float m_rate_del_conn = 0.3f; SFERES_CONST float m_rate_change_conn = 1.0f; SFERES_CONST float m_rate_add_neuron = 1.0f; SFERES_CONST float m_rate_del_neuron = 0.2f; SFERES_CONST float weight_sigma = 0.5f; SFERES_CONST float vect_sigma = 0.5f; SFERES_CONST float m_rate_weight = 1.0f; SFERES_CONST float m_rate_fparams = 1.0f; SFERES_CONST init_t init = ff; }; struct evo_float { SFERES_CONST float mutation_rate = 0.1f; SFERES_CONST float cross_rate = 0.1f; SFERES_CONST mutation_t mutation_type = polynomial; SFERES_CONST cross_over_t cross_over_type = sbx; SFERES_CONST float eta_m = 15.0f; SFERES_CONST float eta_c = 15.0f; }; struct parameters { SFERES_CONST float min = -2.0f; SFERES_CONST float max = 2.0f; }; struct cppn { // params of the CPPN struct sampled { SFERES_ARRAY(float, values, 0, 1, 2); SFERES_CONST float mutation_rate = 0.1f; SFERES_CONST float cross_rate = 0.25f; SFERES_CONST bool ordered = false; }; struct evo_float { SFERES_CONST float mutation_rate = 0.1f; SFERES_CONST float cross_rate = 0.1f; SFERES_CONST mutation_t mutation_type = polynomial; SFERES_CONST cross_over_t cross_over_type = sbx; SFERES_CONST float eta_m = 15.0f; SFERES_CONST float eta_c = 15.0f; }; }; struct hyper_nn { SFERES_ARRAY(float, substrate, 0.2f, 0.2f, // in 1 0.2f, 0.8f, // in 2 0.5f, 0.5f, // out 1 0.8f, 0.8f, // hidden 1 0.8f, 0.2f, // hidden 2 0.2f, 0.5f, // hidden 3 0.5f, 0.2f // hidden 4 ); SFERES_ARRAY(float, weights, -1, 0, 1); SFERES_ARRAY(float, bias, -1, 0, 1); SFERES_CONST size_t nb_inputs = 2; SFERES_CONST size_t nb_outputs = 1; SFERES_CONST size_t nb_hidden = 4; SFERES_CONST size_t nb_pfparams = 0; SFERES_CONST size_t nb_afparams = 1; SFERES_CONST float conn_threshold = 0.2f; SFERES_CONST float max_y = 10.0f; typedef nn::Neuron<nn::PfWSum<>, nn::AfTanh<nn::params::Vectorf<1> > > neuron_t; typedef nn::Connection<> connection_t; }; }; BOOST_AUTO_TEST_CASE(gen_cppn) { srand(time(0)); typedef phen::Parameters<gen::EvoFloat<1, Params1>, fit::FitDummy<>, Params1> weight_t; typedef gen::HyperNn<weight_t, Params1> cppn_t; cppn_t gen1, gen2, gen3, gen4; gen1.random(); for (size_t i = 0; i < 20; ++i) gen1.mutate(); gen1.init(); BOOST_CHECK(gen1.get_depth() >= 1); std::ofstream ofs2("/tmp/nn.dot"); gen1.write(ofs2); // generate a picture char*pic = new char[256 * 256]; std::vector<float> in(3); in[0] = 1; for (size_t i = 0; i < 256; ++i) for (size_t j = 0; j < 256; ++j) { in[1] = i / 128.0f - 1.0; in[2] = j / 128.0f - 1.0; for (size_t k = 0; k < gen1.get_depth(); ++k) gen1.step(in); pic[256 * i + j] = (int)(gen1.get_outf(0) * 256 + 255); } std::ofstream ofs("/tmp/pic.pgm"); ofs << "P5" << std::endl; ofs << "256 256" << std::endl; ofs << "255" << std::endl; ofs.write(pic, 256 * 256); } BOOST_AUTO_TEST_CASE(phen_hyper_nn) { srand(time(0)); typedef fit::FitDummy<> fit_t; typedef phen::Parameters<gen::EvoFloat<1, Params2>, fit::FitDummy<>, Params2> weight_t; typedef gen::HyperNn<weight_t, Params2> gen_t; typedef phen::HyperNn<gen_t, fit_t, Params2> phen_t; phen_t indiv; indiv.random(); for (size_t i = 0; i < 5; ++i) indiv.mutate(); std::ofstream ofs("/tmp/nn_substrate.svg"); indiv.develop(); indiv.show(ofs); // BOOST_CHECK_EQUAL(indiv.nn().get_nb_neurons(), 7); }
30.987552
89
0.670059
Evolving-AI-Lab
fde9eee03eeb6f473829260cb8843f49c5fcd53d
1,874
hpp
C++
pythran/pythonic/include/utils/iterator.hpp
xmar/pythran
dbf2e8b70ed1e4d4ac6b5f26ead4add940a72592
[ "BSD-3-Clause" ]
null
null
null
pythran/pythonic/include/utils/iterator.hpp
xmar/pythran
dbf2e8b70ed1e4d4ac6b5f26ead4add940a72592
[ "BSD-3-Clause" ]
null
null
null
pythran/pythonic/include/utils/iterator.hpp
xmar/pythran
dbf2e8b70ed1e4d4ac6b5f26ead4add940a72592
[ "BSD-3-Clause" ]
null
null
null
#ifndef PYTHONIC_INCLUDE_UTILS_ITERATOR_HPP #define PYTHONIC_INCLUDE_UTILS_ITERATOR_HPP namespace pythonic { namespace utils { template <class T> struct comparable_iterator : T { comparable_iterator(); comparable_iterator(T const &t); bool operator<(comparable_iterator<T> other); }; // Utility class to remind sequence we are iterating on to avoid dangling // reference template <bool as_tuple, class T, class... Others> struct iterator_reminder; template <class T, class... Others> struct iterator_reminder<true, T, Others...> { std::tuple<T, Others...> value; // FIXME : It works only because template arguments are not references // so it trigger a copy. iterator_reminder() = default; iterator_reminder(T const &v, Others const &... o); }; template <class T> struct iterator_reminder<false, T> { T value; iterator_reminder() = default; iterator_reminder(T const &v); }; template <class T> struct iterator_reminder<true, T> { std::tuple<T> value; iterator_reminder() = default; iterator_reminder(T const &v); }; /* Get the "minimum" of all iterators : - only random => random - at least one forward => forward */ template <typename... Iters> struct iterator_min; template <typename T> struct iterator_min<T> { using type = typename std::iterator_traits<T>::iterator_category; }; template <typename T, typename... Iters> struct iterator_min<T, Iters...> { using type = typename std::conditional< std::is_same<typename std::iterator_traits<T>::iterator_category, std::forward_iterator_tag>::value, std::forward_iterator_tag, typename iterator_min<Iters...>::type>::type; }; } } #endif
27.15942
77
0.639274
xmar
fdec27847fd91c4c5b7588a12a7dee288c084793
848
cpp
C++
test/test_float.cpp
janisozaur/safe_numerics
c494e9d6bddc47292b1bb1552469196b01fcdc55
[ "BSL-1.0" ]
null
null
null
test/test_float.cpp
janisozaur/safe_numerics
c494e9d6bddc47292b1bb1552469196b01fcdc55
[ "BSL-1.0" ]
null
null
null
test/test_float.cpp
janisozaur/safe_numerics
c494e9d6bddc47292b1bb1552469196b01fcdc55
[ "BSL-1.0" ]
null
null
null
// Copyright (c) 2012 Robert Ramey // // Distributed under the Boost Software License, Version 1.0. (See // accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) // testing floating point // this is a compile only test - but since many build systems // can't handle a compile-only test - make sure it passes trivially. #include <cassert> #include "../include/safe_integer.hpp" template<typename T, typename U> void test(){ T t; U u; float x = t; t = x; t + u; t - u; t * u; t / u; /**/ // the operators below are restricted to integral types } int main(){ using namespace boost::numeric; /* test<safe<std::int8_t>, float>(); test<safe<std::int16_t>,float>(); test<safe<std::int32_t>, float>(); test<safe<std::int64_t>, float>(); */ return 0; }
22.918919
68
0.629717
janisozaur
fdf0fa1d49599f577183ca4f392c5daa0e4d1676
8,367
hh
C++
gazebo/physics/Actor.hh
thomas-moulard/gazebo-deb
456da84cfb7b0bdac53241f6c4e86ffe1becfa7d
[ "ECL-2.0", "Apache-2.0" ]
8
2015-07-02T08:23:30.000Z
2020-11-17T19:00:38.000Z
gazebo/physics/Actor.hh
thomas-moulard/gazebo-deb
456da84cfb7b0bdac53241f6c4e86ffe1becfa7d
[ "ECL-2.0", "Apache-2.0" ]
null
null
null
gazebo/physics/Actor.hh
thomas-moulard/gazebo-deb
456da84cfb7b0bdac53241f6c4e86ffe1becfa7d
[ "ECL-2.0", "Apache-2.0" ]
10
2015-04-22T18:33:15.000Z
2021-11-16T10:17:45.000Z
/* * Copyright 2012 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef _ACTOR_HH_ #define _ACTOR_HH_ #include <string> #include <map> #include <vector> #include "physics/Model.hh" #include "common/Time.hh" #include "common/Skeleton.hh" #include "common/Animation.hh" namespace gazebo { namespace common { class Mesh; class Color; } namespace physics { struct TrajectoryInfo { unsigned int id; std::string type; double duration; double startTime; double endTime; bool translated; }; /// \addtogroup gazebo_physics /// \{ /// \class Actor Actor.hh physics/physics.hh /// \brief Actor class enables GPU based mesh model / skeleton /// scriptable animation. class Actor : public Model { /// \brief Constructor /// \param[in] _parent Parent object public: explicit Actor(BasePtr _parent); /// \brief Destructor public: virtual ~Actor(); /// \brief Load the actor /// \param[in] _sdf SDF parameters public: void Load(sdf::ElementPtr _sdf); /// \brief Initialize the actor public: virtual void Init(); /// \brief Start playing the script public: virtual void Play(); /// \brief Stop playing the script public: virtual void Stop(); /// \brief Returns true when actor is playing animation public: virtual bool IsActive(); /// \brief Update the actor public: void Update(); /// \brief Finalize the actor public: virtual void Fini(); /// \brief update the parameters using new sdf values. /// \param[in] _sdf SDF values to update from. public: virtual void UpdateParameters(sdf::ElementPtr _sdf); /// \brief Get the SDF values for the actor. /// \return Pointer to the SDF values. public: virtual const sdf::ElementPtr GetSDF(); /// \brief Add inertia for a sphere. /// \param[in] _linkSdf The link to add the inertia to. /// \param[in] _pose Pose of the inertia. /// \param[in] _mass Mass of the inertia. /// \param[in] _radiau Radius of the sphere. private: void AddSphereInertia(sdf::ElementPtr _linkSdf, const math::Pose &_pose, double _mass, double _radius); /// \brief Add a spherical collision object. /// \param[in] _linkSdf Link to add the collision to. /// \param[in] _name Name of the collision object. /// \param[in] _pose Pose of the collision object. /// \param[in] _radius Radius of the collision object. private: void AddSphereCollision(sdf::ElementPtr _linkSdf, const std::string &_name, const math::Pose &_pose, double _radius); /// \brief Add a spherical visual object. /// \param[in] _linkSdf Link to add the visual to. /// \param[in] _name Name of the visual object. /// \param[in] _pose Pose of the visual object. /// \param[in] _radius Radius of the visual object. /// \param[in] _material Name of the visual material. /// \param[in] _ambient Ambient color. private: void AddSphereVisual(sdf::ElementPtr _linkSdf, const std::string &_name, const math::Pose &_pose, double _radius, const std::string &_material, const common::Color &_ambient); /// \brief Add a box visual object. /// \param[in] _linkSdf Link to add the visual to. /// \param[in] _name Name of the visual object. /// \param[in] _pose Pose of the visual object. /// \param[in] _size Dimensions of the visual object. /// \param[in] _material Name of the visual material. /// \param[in] _ambient Ambient color. private: void AddBoxVisual(sdf::ElementPtr _linkSdf, const std::string &_name, const math::Pose &_pose, const math::Vector3 &_size, const std::string &_material, const common::Color &_ambient); /// \brief Add an actor visual to a link. /// \param[in] _linkSdf Link to add the visual to. /// \param[in] _name Name of the visual. /// \param[in] _pose Pose of the visual. private: void AddActorVisual(sdf::ElementPtr _linkSdf, const std::string &_name, const math::Pose &_pose); /// \brief Load an animation from SDF. /// \param[in] _sdf SDF element containing the animation. private: void LoadAnimation(sdf::ElementPtr _sdf); /// \brief Load an animation script from SDF. /// \param[in] _sdf SDF element containing the animation script. private: void LoadScript(sdf::ElementPtr _sdf); /// \brief Set the actor's pose. /// \param[in] _frame Each frame name and transform. /// \param[in] _skelMap Map of bone relationships. /// \param[in] _time Time over which to animate the set pose. private: void SetPose(std::map<std::string, math::Matrix4> _frame, std::map<std::string, std::string> _skelMap, double _time); /// \brief Pointer to the actor's mesh. protected: const common::Mesh *mesh; /// \brief The actor's skeleton. protected: common::Skeleton *skeleton; /// \brief Filename for the skin. protected: std::string skinFile; /// \brief Scaling factor to apply to the skin. protected: double skinScale; /// \brief Amount of time to delay start by. protected: double startDelay; /// \brief Time length of a scipt. protected: double scriptLength; /// \brief Time the scipt was last updated. protected: double lastScriptTime; /// \brief True if the animation should loop. protected: bool loop; /// \brief True if the actor is being updated. protected: bool active; /// \brief True if the actor should start running automatically. protected: bool autoStart; /// \brief Base link. protected: LinkPtr mainLink; /// \brief Time of the previous frame. protected: common::Time prevFrameTime; /// \brief Time when the animation was started. protected: common::Time playStartTime; /// \brief All the trajectories. protected: std::map<unsigned int, common::PoseAnimation*> trajectories; /// \brief Trajectory information protected: std::vector<TrajectoryInfo> trajInfo; /// \brief Skeleton animations protected: std::map<std::string, common::SkeletonAnimation*> skelAnimation; /// \brief Skeleton to naode map protected: std::map<std::string, std::map<std::string, std::string> > skelNodesMap; /// \brief True to interpolate along x direction. protected: std::map<std::string, bool> interpolateX; /// \brief Last position of the actor protected: math::Vector3 lastPos; /// \brief Length of the actor's path. protected: double pathLength; /// \brief THe last trajectory protected: unsigned int lastTraj; /// \brief Name of the visual protected: std::string visualName; /// \brief Where to send bone info. protected: transport::PublisherPtr bonePosePub; /// \brief THe old action. protected: std::string oldAction; }; /// \} } } #endif
34.57438
80
0.594239
thomas-moulard