Skip to content

Instantly share code, notes, and snippets.

View prabindh's full-sized avatar
💭
I may be slow to respond.

Prabindh Sundareson prabindh

💭
I may be slow to respond.
View GitHub Profile
//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));
<html>
<head>
<script>
function loadImage(ctx)
{
alert("Image is loaded, context is = ");
alert(ctx);
}
</script>
</head>
@prabindh
prabindh / eglswap
Created January 17, 2014 03:37
Usage of eglswapinterval in OpenGL ES2.0. Taken from https://github.com/prabindh/sgxperf/blob/master/sgxperf_gles20_vg.cpp
//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;
//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 August 29, 2015 13:57
This is the output of ./configure --help at this time, for the Graphics SDK package. Request comments.
`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:
@prabindh
prabindh / gist:524ddd79ae6c9815a97c8d43239bb9f5
Last active December 13, 2016 15:05
JsDialogHandler crash on Prompt dialog and callback continue
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 August 22, 2017 01:53
Fix for CUDA 8 build error
#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
// ** 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
@prabindh
prabindh / arapaho-Detect-func.cpp
Created August 27, 2018 12:15
Resize changes
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 October 7, 2018 14:30
CMake wrapper script for darknet-cpp
###
### 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
###