root/platform/ixus900_sd900/shooting.c

/* [<][>][^][v][top][bottom][index][help] */

DEFINITIONS

This source file includes following definitions.
  1. get_file_next_counter
  2. get_target_file_num
  3. get_target_dir_num

   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.
  11 const 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
  31 const 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.
  83 const 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 /*
  95 http://www.usa.canon.com/cusa/support/consumer/digital_cameras/powershot_sd_series/powershot_sd900#Specifications
  96 Shooting 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
 107 const CapturemodeMap modemap[] = {   // PROPCASE 0, check with CHDK debug menu option "Show Parameter Data 0"
 108     {MODE_AUTO,               32768},
 109     {MODE_P,                  32772},
 110     {MODE_LONG_SHUTTER,       32774},
 111     {MODE_DIGITAL_MACRO,      33288},
 112     {MODE_STITCH,             33290},
 113     {MODE_COLOR_ACCENT,       33305},
 114     {MODE_MY_COLORS,          33306},   // mode M "color swap" ???
 115     {MODE_NIGHT_SNAPSHOT,     16395},   // mode SCN NIGHT SNAPSHOT ???
 116     //{MODE_SCN_NIGHT,          16395},   // mode SCN NIGHT SNAPSHOT ???
 117     {MODE_PORTRAIT,           16397},
 118     {MODE_KIDS_PETS,          16399},
 119     {MODE_INDOOR,             16400},
 120     {MODE_FOLIAGE,            16401},
 121     {MODE_SNOW,               16402},
 122     {MODE_BEACH,              16403},
 123     {MODE_FIREWORK,           16404},
 124     //{MODE_SCN_WATER,          16405},   // old?
 125     {MODE_UNDERWATER,         16405},   // ToDo: verify if correct
 126     {MODE_AQUARIUM,           16406},
 127     {MODE_ISO_3200,           16411},
 128     {MODE_VIDEO_STD,          2596},
 129     {MODE_VIDEO_COLOR_ACCENT, 2594},
 130     {MODE_VIDEO_COLOR_SWAP,   2595},
 131     {MODE_VIDEO_COMPACT,      2598},
 132     {MODE_VIDEO_HIRES,        2599},
 133 };
 134 
 135 #include "../generic/shooting.c"
 136 
 137 long get_file_next_counter() {
 138     return get_file_counter();
 139 }
 140 
 141 long get_target_file_num() {
 142     long n;
 143     n = get_file_next_counter();
 144     n = (n>>4)&0x3FFF;
 145     return n;
 146 }
 147 
 148 long get_target_dir_num() {
 149     long n;
 150     n = get_file_next_counter();
 151     n = (n>>18)&0x3FF;
 152     return n;
 153 }

/* [<][>][^][v][top][bottom][index][help] */