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
#!python3 | |
# -*- coding: utf-8 -*- | |
import math | |
import pyaudio | |
import time | |
import argparse | |
import struct | |
from pythonosc import osc_message_builder |
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
def read_image(img_file): | |
with open(img_file, 'rb') as img: | |
(format, nll, xres, yres, verson) = unpack('>BBHHH', img.read(8)) | |
pixels = np.zeros([yres, xres, 3]) # y,xでアクセスする | |
for iy in range(yres): | |
line = unpack('>{0}f'.format(xres*3), img.read(4*xres*3)) | |
for lx, ix in enumerate(range(0, xres*3, 3)): | |
pixels[iy][lx] = line[ix:ix+3] |
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
gPhoto2をcygwinでビルドする | |
cygwinにpopt-devlをインストールしておく | |
公式サイトからgphotoとlibgphotoをダウンロード | |
libgphotoをビルド | |
sh configure | |
make | |
make install |
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
ffmpeg -i VTS_01_1.VOB -b:v 1500k -r 30 -vcodec h264 -strict -2 -acodec aac -ar 44100 -f mp4 out.mp4 | |
ffmpeg -i "concat:VTS_01_1.VOB|VTS_01_2.VOB" -b:v 1500k -r 30 -vcodec h264 -strict -2 -acodec aac -ar 44100 -f mp4 out.mp4 |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows.Forms; | |
namespace TaskCtrl | |
{ | |
class Program |
OlderNewer