source: trunk/platform/ixus960_sd950/shooting.c @ 847

Revision 847, 3.1 KB checked in by reyalp, 3 years ago (diff)

Mode override support. See http://chdk.kernreaktor.org/mantis/view.php?id=64
All cameras except ixus40_sd400 should be supported

rec_mode_active (checks play_rec_mode, weak, can be overriden on cameras that need it)
screen_opened, screen_rotated: only defined on swivel screen cams, check phsw_ bits for screen pos

  • move old play/rec checking code to rec_switch_state. #ifdef'd out for now
  • move mode enum into it's own header file: modelist.h to allow easy lua generation.
  • use playrec_mode on tx1

+ add new generated lua file LUALIB/GEN/modelist.lua
+ add lua library LUALIB/capmode.lua see http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Lualib/Capmode
+ add test scripts see

http://chdk.wikia.com/wiki/UBASIC/Scripts:Standard/Test/Setmode
http://chdk.wikia.com/wiki/LUA/Scripts:Standard/Test/Setmode

  • Property svn:eol-style set to native
Line 
1#define PARAM_FILE_COUNTER      0x38
2#include "platform.h"
3const ApertureSize aperture_sizes_table[] = {
4{  9, 293, "2.8" },
5{ 10, 324, "3.2" },
6{ 11, 352, "3.5" },
7{ 12, 380, "4.0" },
8{ 13, 408, "4.5" },
9{ 14, 436, "5.0" },
10{ 15, 464, "5.6" },
11{ 16, 512, "6.3" },
12{ 17, 544, "7.1" },
13{ 18, 576, "8.0" },
14};
15const ShutterSpeed shutter_speeds_table[] = {
16{ -12, -384, "15", 15000000 },
17{ -11, -352, "13", 13000000 },
18{ -10, -320, "10", 10000000 },
19{  -9, -288, "8",   8000000 },
20{  -8, -256, "6",   6000000 },
21{  -7, -224, "5",   5000000 },
22{  -6, -192, "4",   4000000 },
23{  -5, -160, "3.2", 3200000 },
24{  -4, -128, "2.5", 2500000 },
25{  -3,  -96, "2",   2000000 },
26{  -2,  -64, "1.6", 1600000 },
27{  -1,  -32, "1.3", 1300000 },
28{   0,    0, "1",   1000000 },
29{   1,   32, "0.8",  800000 },
30{   2,   64, "0.6",  600000 },
31{   3,   96, "0.5",  500000 },
32{   4,  128, "0.4",  400000 },
33{   5,  160, "0.3",  300000 },
34{   6,  192, "1/4",  250000 },
35{   7,  224, "1/5",  200000 },
36{   8,  256, "1/6",  166667 },
37{   9,  288, "1/8",  125000 },
38{  10,  320, "1/10", 100000 },
39{  11,  352, "1/13",  76923 },
40{  12,  384, "1/15",  66667 },
41{  13,  416, "1/20",  50000 },
42{  14,  448, "1/25",  40000 },
43{  15,  480, "1/30",  33333 },
44{  16,  512, "1/40",  25000 },
45{  17,  544, "1/50",  20000 },
46{  18,  576, "1/60",  16667 },
47{  19,  608, "1/80",  12500 },
48{  20,  640, "1/100", 10000 },
49{  21,  672, "1/125",  8000 },
50{  22,  704, "1/160",  6250 },
51{  23,  736, "1/200",  5000 },
52{  24,  768, "1/250",  4000 },
53{  25,  800, "1/320",  3125 },
54{  26,  832, "1/400",  2500 },
55{  27,  864, "1/500",  2000 },
56{  28,  896, "1/640",  1563 },
57{  29,  928, "1/800",  1250 },
58{  30,  960, "1/1000", 1000 },
59{  31,  992, "1/1250",  800 },
60{  32, 1021, "1/1600",  625 },
61{  33, 1053, "1/2000",  500 },
62};
63const ISOTable iso_table[] = {
64{ -1,    1,   "HI", -1},
65{  0,    0, "Auto", -1},
66{  1,   80,   "80", -1},
67{  2,  100,  "100", -1},
68{  3,  200,  "200", -1},
69{  4,  400,  "400", -1},
70{  5,  800,  "800", -1},
71{  6, 1600, "1600", -1},
72};         
73
74static const CapturemodeMap modemap[] = {
75        { MODE_AUTO,               32768 },
76        { MODE_P,                  32772 },
77        { MODE_DIGITAL_MACRO,      33288 },
78        { MODE_PORTRAIT,           16397 },
79        { MODE_NIGHT_SNAPSHOT,     16395 },
80        { MODE_COLOR_ACCENT,       33306 },
81        { MODE_MY_COLORS,          33307 },
82        { MODE_SCN_KIDS_PETS,      16400 },
83        { MODE_SCN_INDOOR,         16401 },
84        { MODE_SCN_FOLIAGE,        16402 },
85        { MODE_SCN_SNOW,           16403 },
86        { MODE_SCN_BEACH,          16404 },
87        { MODE_SCN_FIREWORK,       16405 },
88        { MODE_SCN_AQUARIUM,       16407 },
89        { MODE_SCN_WATER,          16406 },
90        { MODE_VIDEO_STD,          2597  },
91        { MODE_VIDEO_COMPACT,      2599  },
92        { MODE_VIDEO_COLOR_ACCENT, 2595  },
93        { MODE_VIDEO_MY_COLORS,    2596  },
94        { MODE_VIDEO_TIME_LAPSE,   2601  },
95        { MODE_STITCH,             33290 },
96};
97
98#include "../generic/shooting.c"
99long get_file_next_counter() {
100return get_file_counter();
101}
102long get_target_file_num() {
103long n;
104 
105n = get_file_next_counter();
106n = (n>>4)&0x3FFF;
107return n;
108}
109long get_target_dir_num() {
110long n;
111 
112n = get_file_next_counter();
113n = (n>>18)&0x3FF;
114return n;
115}
116int circle_of_confusion = 5;
Note: See TracBrowser for help on using the repository browser.