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
using System.Text; | |
namespace Whatever | |
{ | |
public static class HexDumper | |
{ | |
public static string HexDump(byte[] data) | |
{ | |
var sb = new StringBuilder(); |
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
Color4 Lerp(Color4 a, Color4 b, float t) | |
{ | |
// nice branchless SIMD color lerp | |
__m128 one = _mm_set1_ps(1); | |
__m128 t4 = _mm_set1_ps(t); | |
t4 = _mm_max_ps(t4, _mm_setzero_ps()); | |
t4 = _mm_min_ps(t4, one); |
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 <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include "emmintrin.h" | |
struct Color4 | |
{ | |
uint8_t red; | |
uint8_t green; |
OlderNewer