exposurses

Check-in [c663824d67]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix order of arguements in exposure functions
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: c663824d67ce341008ac201bd6e686d5fde8c52e78df94e2f591baec71ea4fa4
User & Date: base@atomicules.co.uk 2013-08-27 12:00:41
Context
2013-08-29
23:24
Implement functionality to calc req'd and then sel nearest match in menu So far only implemented on Shutter menu, i.e. have to select ISO and Aperture, it will then use the equations to calculate the exact required shutter speed, but then select the nearest value in the menu. In order to do that added these two functions: - nearest_match - fraction_to_double The latter needed, because need to convert "1/1000", etc into float. For Aperture menu items can just strip off the "f/". Seems to work for Sunny 16. check-in: 6513b427e7 user: base@atomicules.co.uk tags: origin/master, trunk
2013-08-27
12:00
Fix order of arguements in exposure functions check-in: c663824d67 user: base@atomicules.co.uk tags: origin/master, trunk
11:37
Whoopsie! Can't re-arrange equations it seems. check-in: 1e61137082 user: base@atomicules.co.uk tags: origin/master, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to exposurses.c.

52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
WINDOW *shutter_win;
WINDOW *aperture_win;

void selection(char *name);
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
int exposure(int iso);
int selection_counter;
double shutter(int exposure, int aperture);
double aperture(int exposure, int shutter);

char iso_sel[5] = "";
char shutter_sel[7] = "";
char aperture_sel[6] = "";
int menu_counter = 1;

................................................................................

int exposure (int iso) {
	int ev100;
	ev100 = 15;
	return ev100 + (log (iso / 100) / log (2));
}

double shutter (int aperture, int exposure) {
	/* EV = log2 (N^2/t) */
	return pow(aperture, 2) / pow(2, exposure);
}

double aperture (int shutter, int exposure) {
	/* EV = log2 (N^2/t) */
	return sqrt(pow(2, exposure) * shutter);
}







|







 







|




|



52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
...
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
WINDOW *shutter_win;
WINDOW *aperture_win;

void selection(char *name);
void print_in_middle(WINDOW *win, int starty, int startx, int width, char *string, chtype color);
int exposure(int iso);
int selection_counter;
double shutter(int exposure, double aperture);
double aperture(int exposure, int shutter);

char iso_sel[5] = "";
char shutter_sel[7] = "";
char aperture_sel[6] = "";
int menu_counter = 1;

................................................................................

int exposure (int iso) {
	int ev100;
	ev100 = 15;
	return ev100 + (log (iso / 100) / log (2));
}

double shutter (int exposure, double aperture) {
	/* EV = log2 (N^2/t) */
	return pow(aperture, 2) / pow(2, exposure);
}

double aperture (int exposure, int shutter) {
	/* EV = log2 (N^2/t) */
	return sqrt(pow(2, exposure) * shutter);
}