Skip to content

Instantly share code, notes, and snippets.

View pwnrazr's full-sized avatar

Amir pwnrazr

  • Malaysia
View GitHub Profile
@pwnrazr
pwnrazr / DC_dim_lut_calibration.py
Created January 24, 2023 07:55
Modded from Cosmin's fod-dim-lut script
#!/usr/bin/env python3
import bisect
import subprocess
import sys
import time
from threading import Thread
def run_shell_cmd(*args):
@pwnrazr
pwnrazr / calculate_dc_dim_pairs.c
Created January 22, 2023 02:30
Quick C program to calculate brightness to alpha pairs based on exposure adjustment driver (raphael values). Pretty sure there's an easier way but this was the only thing I thought of in the middle of the night
// Online C compiler to run C program online
// https://www.programiz.com/c-programming/online-compiler/
#include <stdio.h>
int main() {
// Formula to map value from A to B is (value - A_min) * (B_max - B_min) / (A_max - A_min) + B_min
// A is coeffs 768 32768
// B is dimming range 0 255
// Below alues got from exposure adjustment driver