Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

Prabindh Sundareson prabindh

💭
I may be slow to respond.
View GitHub Profile
View fbo summary
//Creation of FBO
glGenFramebuffers(NUM_FBO, fboId);
//fbo texture
glGenTextures(NUM_FBO, fboTextureId);
//Regular first texture
glGenTextures(1, &regularTextureId);
//Bind offscreen texture
GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0));
GL_CHECK(glBindTexture(GL_TEXTURE_2D, fboTextureId[i]));
GL_CHECK(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, inTextureWidth, inTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
@prabindh
prabindh / configure-output
Last active Aug 29, 2015
This is the output of ./configure --help at this time, for the Graphics SDK package. Request comments.
View configure-output
`configure' configures TI Graphics SDK 4.09.00.01 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE. See below for descriptions of some of the useful variables.
Defaults for the options are specified in brackets.
Configuration:
View offscreen sgxperf
//Bind offscreen texture
GL_CHECK(glBindTexture(GL_TEXTURE_2D, 0));
GL_CHECK(glBindTexture(GL_TEXTURE_2D, fboTextureId[i]));
GL_CHECK(glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, inTextureWidth, inTextureHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL));
GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR));
GL_CHECK(glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR));
GL_CHECK(glBindFramebuffer(GL_FRAMEBUFFER, fboId[i]));
GL_CHECK(glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, fboTextureId[i], 0));
View gist:8177375
<html>
<head>
<script>
function loadImage(ctx)
{
alert("Image is loaded, context is = ");
alert(ctx);
}
</script>
</head>
View eglswap
//egl init
int common_eglinit(int testID, int surfaceType, NATIVE_PIXMAP_STRUCT** pNativePixmapPtr)
{
EGLint iMajorVersion, iMinorVersion;
EGLint ai32ContextAttribs[] = { EGL_CONTEXT_CLIENT_VERSION, 2, EGL_NONE };
eglDisplay = eglGetDisplay((int)0);
if (!eglInitialize(eglDisplay, &iMajorVersion, &iMinorVersion))
return 1;
@prabindh
prabindh / gist:524ddd79ae6c9815a97c8d43239bb9f5
Last active Dec 13, 2016
JsDialogHandler crash on Prompt dialog and callback continue
View gist:524ddd79ae6c9815a97c8d43239bb9f5
public class JsDialogHandler : IJsDialogHandler
{
string result = "default";
public bool OnJSDialog(IWebBrowser browserControl, IBrowser browser, string originUrl,
CefJsDialogType dialogType, string messageText, string defaultPromptText,
IJsDialogCallback callback, ref bool suppressMessage)
{
suppressMessage = true;
if (dialogType == CefJsDialogType.Prompt)
{
@prabindh
prabindh / convolutional_layer.c
Created Aug 22, 2017
Fix for CUDA 8 build error
View convolutional_layer.c
#if CUDNN_MAJOR >= 6
cudnnSetConvolution2dDescriptor(l->convDesc, l->pad, l->pad, l->stride, l->stride, 1, 1, CUDNN_CROSS_CORRELATION, CUDNN_DATA_FLOAT);
#else
cudnnSetConvolution2dDescriptor(l->convDesc, l->pad, l->pad, l->stride, l->stride, 1, 1, CUDNN_CROSS_CORRELATION);
#endif
View arapaho.cpp
// ** NOTE: You would need to perform a "cudaSetDevice(gpuId)" with this same gpuId before any CUDA operations are performed on this gpuId
bool ArapahoV2::Setup(
ArapahoV2Params & p,
int & expectedWidth,
int & expectedHeight
int gpuId
)
{
/// All old stuff
View arapaho-Detect-func.cpp
bool ArapahoV2::Detect(
const cv::Mat & inputMat,
float thresh,
float hier_thresh,
int & objectCount)
{
int count = 0;
objectCount = 0;
threshold = thresh;
@prabindh
prabindh / CMakeLists.txt
Created Oct 7, 2018
CMake wrapper script for darknet-cpp
View CMakeLists.txt
###
### CMake wrapper script for building darknet-cpp as ExternalProject
###
### Platforms supported: Only Linux, perhaps Mac. Windows not supported.
### Refer to the darknet/Makefile for the GPU/OPENCV flag options
### Options have to be set in the darknet/Makefile before invoking this script.
### All requirements (CUDA, CUDNN) need to be installed before invoking this script.
###
### Read https://github.com/prabindh/darknet for further details on build
###