This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
HRESULT loadTextureFromMemory(unsigned char* image, int w, int h, LPCSTR shaderTextureName, ID3D11Device* pd3dDevice, ID3DX11Effect* effect) | |
{ | |
D3D11_TEXTURE2D_DESC desc; | |
D3D11_SUBRESOURCE_DATA initialData; | |
ID3D11Texture2D* texture = NULL; | |
ZeroMemory(&desc, sizeof(D3D11_TEXTURE2D_DESC)); | |
desc.Width = w; | |
desc.Height = h; | |
desc.MipLevels = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void ARListener::detectMarker(unsigned char* buffer) | |
{ | |
int thresh = 150; | |
ARMarkerInfo* marker_info; | |
int marker_num; | |
arDetectMarker(const_cast<ARUint8*>(buffer), thresh, &marker_info, &marker_num); | |
// check for object visibility | |
for (int i = 0; i < MARKER_NUM; i ++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 構造体を用意して | |
struct MaxSceneData { | |
miBoolean IsMtlEdit; | |
miColor AmbientLight; | |
miColor GlobalLightLevel; | |
miBoolean ForceDoubleSided; | |
miScalar GammaCorrection; | |
miScalar NearRange; | |
miScalar FarRange; | |
miScalar PhysicalScale; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import itertools | |
l4 = ['aaa', 'bbb', 'ccc'] | |
l3 = ['kk', 'aa', 'bb', 'cc'] | |
l2 = ['axc', 'gGGe'] | |
l1 = ['000'] | |
for a in itertools.product(l1, l2, l3): | |
print a, os.path.join(*a) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bg_color = (200, 100, 100) | |
label.setAutoFillBackground(True) | |
palette = label.palette() | |
palette.setColor(label.backgroundRole(), QtGui.QColor(*bg_color)) | |
label.setPalette(palette) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function padding3(num) { | |
var res; | |
if (eval(num) < 999) { | |
res = ("00"+num).slice(-3); | |
} else { | |
res = ""+num; //文字列に変換 | |
} | |
return res; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
List<Mat> src = new ArrayList<Mat>(); | |
src.add(rgb); | |
src.add(alpha); | |
MatOfInt fromTo = new MatOfInt(0,0, 1,1, 2,2, 4,3); | |
List<Mat> dst = new ArrayList<Mat>(); | |
dst.add(comp); | |
Core.mixChannels(src, dst, fromTo); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
byte b = 200; | |
int i = b & 0xFF; | |
System.out.println( i ); // 200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include "windows.h" | |
#include "stdafx.h" | |
#include "FreeImage.h" | |
#include "boost/foreach.hpp" | |
#include "boost/filesystem/path.hpp" | |
#include "boost/filesystem/operations.hpp" | |
void MakeStraight(boost::filesystem::path in_file_path, boost::filesystem::path out_path) | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cTID = function(s) { return app.charIDToTypeID(s); }; | |
sTID = function(s) { return app.stringIDToTypeID(s); }; | |
fileImportDataSets = function(file) { | |
var desc = new ActionDescriptor(); | |
var ref = new ActionReference(); | |
ref.putClass( sTID( "dataSetClass" ) ); | |
desc.putReference( cTID( "null" ), ref ); | |
desc.putPath( cTID( "Usng" ), new File( file ) ); | |
desc.putEnumerated( cTID( "Encd" ), sTID( "dataSetEncoding" ), sTID( "dataSetEncodingAuto" ) ); |
OlderNewer