source: trunk/platform/ixus900_sd900/shooting.c @ 974

Revision 974, 6.7 KB checked in by pixeldoc2000, 3 years ago (diff)

sd900: some comments fix and cleanup

  • Property svn:eol-style set to native
Line 
1#include "platform.h"
2
3// Camera Parameter of Image Filenumber
4// wrong PARAM_FILE_COUNTER cause camera shutdown if RAW is enabled or wrong number in RAW filename (for example always CRW_0001.CRW)
5// use "Debug Paramenters -> Debug data display -> Params" to verify
6// 0x6D = 109, count of available Camera Parameter
7#define PARAM_FILE_COUNTER      0x34
8
9// PROPCASE_AV (68)
10// Take a picture with the camera at every zoom step and note each PROPCASE_AV value. Repeat former steps but focus at an very bright light source where camera puts in ND filter (focus a lamp bulp for example). Look at EXIF data from your picture to get correspondig Aperture value.
11const ApertureSize aperture_sizes_table[] = {
12    { 9, 294, "2.8"},   // Zoom 2.8x, without ND
13    {10, 309, "3.2"},
14    {11, 328, "3.5"},
15    {12, 353, "3.5"},
16    {13, 385, "4.0"},
17    {14, 416, "4.5"},
18    {15, 449, "4.9"},   // Zoom 4.9x, without ND
19    {16, 556, "8.0 ND"},   // Zoom 2.8x , with ND (very bright)
20    {17, 571, "8.0 ND"},
21    {18, 590, "9.0 ND"},
22    {19, 615, "10.0 ND"},
23    {20, 647, "11.0 ND"},
24    {21, 678, "13.0 ND"},
25    {22, 711, "14.1 ND"},   // Zoom 4.9x , with canon ND (very bright)
26};
27
28// PROPCASE_TV (69)
29// This values are more or less generic. Look for max. supported Shutter speed "1/2000" at technical specs for the camera.
30// ROM:FF9AFCCC
31const ShutterSpeed shutter_speeds_table[] = {
32    // # , PropCase value, displayed string, shutter value
33    {-12, -384, "15", 15000000},   // PROPCASE_TV = 65152, 1000000 * 15 = 15000000
34    {-11, -352, "13", 13000000},   // 65184
35    {-10, -320, "10", 10000000},   // 65218
36    { -9, -288, "8",   8000000},   // 65248
37    { -8, -256, "6",   6000000},   // 65280
38    { -7, -224, "5",   5000000},   // 65312
39    { -6, -192, "4",   4000000},   // 65344
40    { -5, -160, "3.2", 3200000},   // 65376
41    { -4, -128, "2.5", 2500000},   // 65408
42    { -3,  -96, "2",   2000000},   // 65440
43    { -2,  -64, "1.6", 1600000},   // 65472
44    { -1,  -32, "1.3", 1300000},   // 65504
45    {  0,    0, "1",   1000000},   // PROPCASE_TV = 0
46    {  1,   32, "0.8",  800000},   // PROPCASE_TV = 32, 1000000 / 0.8 = 800000
47    {  2,   64, "0.6",  600000},   // ...
48    {  3,   96, "0.5",  500000},
49    {  4,  128, "0.4",  400000},
50    {  5,  160, "0.3",  300000},
51    {  6,  192, "1/4",  250000},
52    {  7,  224, "1/5",  200000},
53    {  8,  256, "1/6",  166667},
54    {  9,  288, "1/8",  125000},
55    { 10,  320, "1/10", 100000},
56    { 11,  352, "1/13",  76923},
57    { 12,  384, "1/15",  66667},
58    { 13,  416, "1/20",  50000},
59    { 14,  448, "1/25",  40000},
60    { 15,  480, "1/30",  33333},
61    { 16,  512, "1/40",  25000},
62    { 17,  544, "1/50",  20000},
63    { 18,  576, "1/60",  16667},
64    { 19,  608, "1/80",  12500},
65    { 20,  640, "1/100", 10000},
66    { 21,  672, "1/125",  8000},
67    { 22,  704, "1/160",  6250},
68    { 23,  736, "1/200",  5000},
69    { 24,  768, "1/250",  4000},
70    { 25,  800, "1/320",  3125},
71    { 26,  832, "1/400",  2500},
72    { 27,  864, "1/500",  2000},
73    { 28,  896, "1/640",  1563},
74    { 29,  928, "1/800",  1250},
75    { 30,  960, "1/1000", 1000},
76    { 31,  992, "1/1250",  800},
77    { 32, 1024, "1/1600",  625},
78    { 33, 1056, "1/2000",  500},
79};
80
81// PROPCASE_ISO_MODE (25/26)
82// go through every ISO setting in manual mode and note PROPCASE_ISO_MODE value.
83const ISOTable iso_table[] = {
84    {-1,     1,    "HI", -1},
85    { 0,     0,  "Auto", -1},
86    { 1,    80,    "80", -1},
87    { 2,   100,   "100", -1},
88    { 3,   200,   "200", -1},
89    { 4,   400,   "400", -1},
90    { 5,   800,   "800", -1},
91    { 6,  1600,  "1600", -1},
92};
93
94/*
95http://www.usa.canon.com/cusa/support/consumer/digital_cameras/powershot_sd_series/powershot_sd900#Specifications
96Shooting Modes:
97    Auto, Camera M,
98    Special Scene (Portrait, Foliage, Snow, Beach, Fireworks, Aquarium, Underwater, ISO 3200, Indoor, Kids & Pets, Night Snapshot),
99    Color Accent, Color Swap, Digital Macro, Stitch Assist, Movie
100
101    Still Image: 640 x 480 (Small), 1,600 x 1,200 (Medium 3), 2,272 x 1,704 (Medium 2), 2,816 x 2,112 (Medium 1), 3,648 x 2,736 (Large), 3,648 x 2,048 (Widescreen)
102    Movie: 640 x 480 / 320 x 240 (30 fps/15 fps) available up to 4GB or 1 hour for each file size, 1,024 x 768 (15 fps), 160 x 120 (3 min. at 15 fps)
103*/
104
105// PROPCASE 49
106// Mapping between camera mode and PROPCASE_SHOOTING_MODE
107static const CapturemodeMap modemap[] = {   // PROPCASE 0, check with CHDK debug menu option "Show Parameter Data 0"
108    {MODE_AUTO,               32768},
109    {MODE_M,                  33772},
110    {MODE_DIGITAL_MACRO,      33288},
111    {MODE_STITCH,             33290},
112    {MODE_COLOR_ACCENT,       33305},
113    {MODE_MY_COLORS,          33306},   // mode M "color swap" ???
114    {MODE_NIGHT_SNAPSHOT,     16395},   // mode SCN NIGHT SNAPSHOT ???
115    //{MODE_SCN_NIGHT,          16395},   // mode SCN NIGHT SNAPSHOT ???
116    {MODE_SCN_PORTRAIT,       16397},
117    {MODE_SCN_KIDS_PETS,      16399},
118    {MODE_SCN_INDOOR,         16400},
119    {MODE_SCN_FOLIAGE,        16401},
120    {MODE_SCN_SNOW,           16402},
121    {MODE_SCN_BEACH,          16403},
122    {MODE_SCN_FIREWORK,       16404},
123    //{MODE_SCN_WATER,          16405},   // old?
124    {MODE_SCN_UNDERWATER,     16405},   // ToDo: verify if correct
125    {MODE_SCN_AQUARIUM,       16406},
126    {MODE_SCN_ISO_3200,       16411},
127    {MODE_VIDEO_STD,          2596},
128    {MODE_VIDEO_COLOR_ACCENT, 2594},
129    {MODE_VIDEO_COLOR_SWAP,   2595},
130    {MODE_VIDEO_COMPACT,      2598},
131    {MODE_VIDEO_HIRES,        2599},
132};
133
134#include "../generic/shooting.c"
135
136long get_file_next_counter() {
137    return get_file_counter();
138}
139
140long get_target_file_num() {
141    long n;
142    n = get_file_next_counter();
143    n = (n>>4)&0x3FFF;
144    return n;
145}
146
147long get_target_dir_num() {
148    long n;
149    n = get_file_next_counter();
150    n = (n>>18)&0x3FF;
151    return n;
152}
153
154int circle_of_confusion = 5;    // :-)
155
156// compare PROPCASE_TV with shutter_speeds_table
157char* shooting_get_tv_str() {
158    short int tvv;
159    long i;
160    _GetPropertyCase(PROPCASE_TV, &tvv, sizeof(tvv));
161    for(i=0; i<SS_SIZE; i++) {
162        if(shutter_speeds_table[i].prop_id >= tvv)
163            return (char*)shutter_speeds_table[i].name;
164    }
165    return (void*)"?";
166}
167
168// compare PROPCASE_AV with aperture_sizes_table
169char* shooting_get_av_str() {
170    short int avv;
171    long i;
172    _GetPropertyCase(PROPCASE_AV, &avv, sizeof(avv));
173    for(i=0; i<AS_SIZE; i++) {
174        if(aperture_sizes_table[i].prop_id == avv)
175            return (char*)aperture_sizes_table[i].name;
176    }
177    return (char*) "?";
178}
179
180// compare PROPCASE_ISO_MODE with iso_table
181char* shooting_get_iso_str() {
182    short int isov;
183    long i;
184    _GetPropertyCase(PROPCASE_ISO_MODE, &isov, sizeof(isov));
185    for(i=0; i<ISO_SIZE; i++) {
186        if(iso_table[i].prop_id == isov)
187            return (char*)iso_table[i].name;
188    }
189    return (char*) "?";
190}
Note: See TracBrowser for help on using the repository browser.