This file contains hidden or 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
// from https://code.google.com/p/googletest/source/browse/trunk/include/gtest/internal/gtest-internal.h | |
#pragma once | |
#include <ctype.h> | |
#include <float.h> | |
#include <string.h> | |
#include <iomanip> | |
#include <limits> | |
#include <set> |
This file contains hidden or 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
#include <string> | |
#include <array> | |
#include <algorithm> | |
#include <functional> | |
using namespace std; | |
// assumes that values returned by data is normalized between 0.0 and 1.0 | |
string get_grayscale_image(int width, int height, function<float(int,int)> data){ | |
const int size = 10; |
This file contains hidden or 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
#define RAND48_SEED_0 (0x330e) | |
#define RAND48_SEED_1 (0xabcd) | |
#define RAND48_SEED_2 (0x1234) | |
#define RAND48_MULT_0 (0xe66d) | |
#define RAND48_MULT_1 (0xdeec) | |
#define RAND48_MULT_2 (0x0005) | |
#define RAND48_ADD (0x000b) | |
unsigned short _rand48_seed[3] = { |
This file contains hidden or 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
// Simple oldskool "plasma effect", a bunch of combined sine waves | |
// input x,y (uv-coordinates), t (time) | |
int vv = int( | |
(127.0f + (127.0f * sinf(x/7.0f+t))) + | |
(127.0f + (127.0f * sinf(y/5.0f-t))) + | |
(127.0f + (127.0f * sinf((x+y)/6.0f-t))) + | |
(127.0f + (127.0f * sinf(sqrtf(float(x*x + y*y))/4.0f-t))) | |
) / 4; |
This file contains hidden or 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
// | |
// Event.h | |
// | |
// Created by Morten Nobel-Jørgensen on 8/18/13. | |
// Copyright (c) 2013 morten. All rights reserved. | |
// Open Source under New BSD License (http://opensource.org/licenses/BSD-3-Clause) | |
#pragma once | |
#include <iostream> |
This file contains hidden or 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
// | |
// cpp11shim.h | |
// | |
// Created by Morten Nobel-Jørgensen on 7/19/13. | |
// Copyright (c) 2013 Morten Nobel-Joergensen. All rights reserved. | |
// | |
#ifndef __CPP11_SHIM__ | |
#define __CPP11_SHIM__ |
This file contains hidden or 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
#------------------------------------------------- | |
# | |
# Project created by QtCreator 2013-07-08T13:26:39 | |
# | |
#------------------------------------------------- | |
QT += core gui widgets opengl network | |
TARGET = QtImageCompressionTest | |
CONFIG += console |
This file contains hidden or 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
#include <functional> | |
#include <deque> | |
#include <mutex> | |
// Reuseable blocking queue | |
template <typename T> class BlockingQueue { | |
std::deque<T> q; | |
std::mutex m; | |
std::condition_variable cv; | |
public: |
This file contains hidden or 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
// | |
// main.cpp | |
// Observer pattern in C++11 | |
// | |
// Created by Morten Nobel-Jørgensen on 9/21/12. | |
// Copyright (c) 2012 Morten Nobel-Joergensen. All rights reserved. | |
// | |
#include <iostream> |
This file contains hidden or 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
#ifdef _WIN32 | |
#include <GL/glut.h> | |
#else | |
#include <GLUT/glut.h> | |
#endif | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <png.h> | |
#include <iostream> |