Skip to content

Instantly share code, notes, and snippets.

View mntone's full-sized avatar
🏠

monotone mntone

🏠
View GitHub Profile
@mntone
mntone / win-dshow.cpp.diff
Created April 16, 2017 02:39
OBS Studio: DirectShow RGB source を使って,12-bit RGB をテストするコード diff
diff --git a/plugins/win-dshow/win-dshow.cpp b/plugins/win-dshow/win-dshow.cpp
index bc980ff1..786baeb3 100644
--- a/plugins/win-dshow/win-dshow.cpp
+++ b/plugins/win-dshow/win-dshow.cpp
@@ -435,6 +435,10 @@ void DShowInput::OnEncodedVideoData(enum AVCodecID id,
}
}
+static uint8_t data2[(1280 * 36) / 8 * 720] =
+{
@mntone
mntone / memo.md
Last active December 27, 2016 22:54
SylphyHorn 改造メモ

SylphyHorn 改造メモ

今後

  • UWP の設定 UI を改良し,設定だけ UWP に移す (根幹の部分はすべて Win32+WPF なのでメリットは薄い, UWP のガワになるぐらいのメリットしかない。ただし,今後 UWP 上で通知ウィンドウなどが実現できるようになれば,話は 180度 変わるが……; 技術的に実現不可能ではないので,すぐにできる)
  • ウィンドウ,ディスプレイ の総合ショートカット キー アプリとして実装していく (本家が受け入れるかがわからない; たとえばウィンドウならスナップ,最大化/最小化の追加のショートカット キー,ディスプレイならモニター間の移動やモニターの回転の追加のショートカット キーをいれる)
  • Gist sync (UWP 化した場合,システムの機能による sync をしたほうがいいので,実装に思いとどまってしまった。たぶん一生作れない)

マウスフレンドリーの機能を実装。

@mntone
mntone / csharp7try2.cs
Created November 27, 2016 07:46
switch 文に `ValueTuple<int, int>` 以外を使って書く方法はないのだろうか?
using System;
namespace CSharp7Try
{
class Program
{
static void Main(string[] args)
{
TrySwitchFeature((x: 1, y: 2));
TrySwitchFeature((x: 7, y: 2));
using System;
namespace CSharp7Try
{
class Program
{
static void Main(string[] args)
{
TrySwitchFeature(2);
TrySwitchFeature(7);

ダイオウイカから逃げよ!

ルール:

アルファ側はダイオウイカを持つ装備、ブラボー側はダイオウイカから逃れてみたいブキ、を使用。

アルファ側制約:

  • メイン、サブは塗りのみ使用してよい。
  • キルはダイオウイカのみ
  • ダイオウイカが終了したらリスポーンジャンプ
// The MIT License (MIT)
// Copyright (c) 2015- mntone
using System;
using System.Collections;
using System.Collections.Concurrent;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.ComponentModel;
using System.Linq;
using System.Threading;
using System;
using System.Linq;
using System.Reactive.Linq;
using System.Reactive.Subjects;
using System.Threading.Tasks;
namespace RxTest
{
class Program
{
@mntone
mntone / test.py
Created August 21, 2015 23:13
これをforじゃなくてnumpyで書いたらどうなるかわかる人教えて
#!python
import copy
import numpy as np
image = cv2.imread('x.png', cv2.IMREAD_UNCHANGED)
height, width = image.shape[:2]
cimage = np.empty((height, width, 3), dtype = np.uint8)
for h in range(height):
for w in range(width):
@mntone
mntone / log.txt
Created August 16, 2015 16:19
IkaLog を実行したときにでたログ。
>python IkaLog.py
OpenCV Error: Assertion failed (scn == 3 || scn == 4) in cv::cvtColor, file ..\.
.\..\opencv-3.0.0\modules\imgproc\src\color.cpp, line 7564
Traceback (most recent call last):
File "D:\Desktop\IkaLog\IkaLog.py", line 92, in <module>
core()
File "D:\Desktop\IkaLog\IkaLog.py", line 20, in core
scn_gamestart = IkaScene_GameStart()
File "D:\Desktop\IkaLog\IkaScene_GameStart.py", line 50, in __init__
self.map_list.append(self.load_mapname_mask(data1, 'タチウオパーキング'))
@mntone
mntone / VideoHost.cs
Created June 25, 2015 01:31
HwndHostを継承してHWND (native window handle)を作ってみたサンプル! 別プロセスから描画したりもできるので、自由なことができる(にやにや)。プロセス間通信は別途必須。 ちなみにほぼコピペ https://msdn.microsoft.com/ja-jp/library/ms752055.aspx
using System;
using System.Runtime.InteropServices;
using System.Windows.Interop;
namespace Testsuruo
{
public sealed class VideoHost : HwndHost
{
private IntPtr hwndHost;
internal const int