Skip to content

Instantly share code, notes, and snippets.

View artm's full-sized avatar

Artem Baguinski artm

  • Performation B.V.
  • Emmen, NL
  • 06:14 (UTC +01:00)
View GitHub Profile
@artm
artm / groupwrap.rb
Created March 10, 2012 21:35
Subpattern wrapper
class GroupWrap
def initialize(&block)
@wrap = block
@transformers = []
end
def handle(pattern, *tags)
@transformers << [pattern, *tags]
end
@artm
artm / brew-install.patch
Created July 5, 2011 16:39
Brew compliant install target for mpeg_stat
diff --git a/Makefile b/Makefile
index 48aedd1..a6c5be2 100644
--- a/Makefile
+++ b/Makefile
@@ -23,7 +23,7 @@ CFLAGS = $(DEBUGFLAG) $(INCLUDEDIR)
# for SunOS cc, just use the above
# for cc on HPUX:
-HP-CC-FLAGS = -Aa $(CFLAGS) -D_HPUX_SOURCE -DBSD -DNONANSI_INCLUDES
+# HP-CC-FLAGS = -Aa $(CFLAGS) -D_HPUX_SOURCE -DBSD -DNONANSI_INCLUDES
@artm
artm / opencv-ffmpeg-0.8.patch
Created June 25, 2011 18:17
building OpenCV-2.3 against ffmpeg-0.8 (both their latest stable)
diff --git a/modules/highgui/src/cap_ffmpeg.cpp b/modules/highgui/src/cap_ffmpeg.cpp
index ec44548..9c48f96 100644
--- a/modules/highgui/src/cap_ffmpeg.cpp
+++ b/modules/highgui/src/cap_ffmpeg.cpp
@@ -468,7 +468,7 @@ bool CvCapture_FFMPEG::open( const char* _filename )
AVCodecContext *enc = &ic->streams[i]->codec;
#endif
- if( CODEC_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
+ if( AVMEDIA_TYPE_VIDEO == enc->codec_type && video_stream < 0) {
@artm
artm / PointLib.cginc
Created June 25, 2011 09:49
Manual Billboarding
// Shift a billboard corner size pixels along its corner
inline void Billboard(inout float4 pos, in float2 corner, float size)
{
pos.xy += (size * 2.0 / _ScreenParams.xy) * corner * pos.w;
}
// structures used to pass input output between shader stages
struct PointVIn {
float4 vertex : POSITION;
float4 texcoord : TEXCOORD;