Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
noiseprofile.c File Reference
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include "../../src/common/dttypes.h"
+ Include dependency graph for noiseprofile.c:

Macros

#define ELEM_SWAP(a, b)   { elem_type t=(a);(a)=(b);(b)=t; }
 
#define median(a, n)   kth_smallest(a,n,(((n)&1)?((n)/2):(((n)/2)-1)))
 
#define MIN(a, b)   ((a>b)?b:a)
 
#define MAX(a, b)   ((a>b)?a:b)
 
#define N   300
 

Typedefs

typedef float elem_type
 

Functions

static elem_type kth_smallest (elem_type a[], int n, int k)
 
static float * read_pfm (const char *filename, int *wd, int *ht)
 
static float * read_histogram (const char *filename, int *bins)
 
static void invert_histogram (const float *const hist, float *const inv_hist, const int bins)
 
static float clamp (float f, float m, float M)
 
int compare_llhh (const void *a, const void *b)
 
int main (int argc, char *arg[])
 

Macro Definition Documentation

◆ ELEM_SWAP

#define ELEM_SWAP (   a,
 
)    { elem_type t=(a);(a)=(b);(b)=t; }

◆ MAX

#define MAX (   a,
 
)    ((a>b)?a:b)

◆ median

#define median (   a,
 
)    kth_smallest(a,n,(((n)&1)?((n)/2):(((n)/2)-1)))

◆ MIN

#define MIN (   a,
 
)    ((a>b)?b:a)

◆ N

#define N   300

Typedef Documentation

◆ elem_type

typedef float elem_type

Function Documentation

◆ clamp()

static float clamp ( float  f,
float  m,
float  M 
)
inlinestatic

◆ compare_llhh()

int compare_llhh ( const void a,
const void b 
)

References clamp(), and N.

Referenced by main().

◆ invert_histogram()

static void invert_histogram ( const float *const  hist,
float *const  inv_hist,
const int  bins 
)
static

Referenced by main().

◆ kth_smallest()

static elem_type kth_smallest ( elem_type  a[],
int  n,
int  k 
)
static

References ELEM_SWAP, and m.

◆ main()

int main ( int  argc,
char *  arg[] 
)
Todo:
: test if file with replaced ext exists
Todo:
: add a callback to set the bpp without going through the config
Todo:
: have a parameter in command line to get the export presets

References clamp(), compare_llhh(), f(), invert_histogram(), median, N, read_histogram(), read_pfm(), and write_pfm().

Referenced by wmain().

◆ read_histogram()

static float * read_histogram ( const char *  filename,
int *  bins 
)
static

References f().

Referenced by main().

◆ read_pfm()

static float * read_pfm ( const char *  filename,
int *  wd,
int *  ht 
)
static

References f().

Referenced by main().