root/platform/ixus135_elph120/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_name
  4. get_target_dir_num

   1 // TODO this holds and exposure count of some kind, but it only updates when rebooting or switching to play!
   2 #define PARAM_FILE_COUNTER      0x1
   3 
   4 #include "platform.h"
   5 
   6 // These F-numbers are the "mock" values shown by the cam.
   7 // They're linked to FL (zoom) and ND filter.
   8 // aperture_sizes_table[].id is just a serial number.
   9 // note av96 varies continously with zoom, the following values are just representative
  10 const ApertureSize aperture_sizes_table[] = { // PROPCASE 23
  11     {  9, 328, "3.2" },
  12     { 10, 331, "3.5" }, 
  13     { 11, 379, "4.0" }, 
  14     { 12, 425, "4.5" },
  15     { 13, 463, "5.0" },
  16     { 14, 474, "5.6" },
  17     { 15, 502, "6.3" },
  18     { 16, 541, "6.9" },
  19 
  20 // The rest are the same physical apertures as above, but with ND:
  21     { 17, 604, "9.0" },
  22     { 18, 613, "10.0" },
  23     { 19, 657, "11.0" },
  24     { 20, 687, "13.0" },
  25     { 21, 710, "14.0" },
  26     { 22, 750, "16.0" },
  27     { 23, 790, "18.0" },
  28     { 24, 817, "20.0" },
  29 };
  30 
  31 // OLD copied comment!
  32 // TODO copied from 850
  33 // Another set of "mock" values, which can probably
  34 // be derived from the table found at FFB4E258 in FW.
  35 // At the moment, I see no reason to amend it.
  36 const ShutterSpeed shutter_speeds_table[] = {
  37     { -12, -384, "15", 15000000 },
  38     { -11, -352, "13", 13000000 },
  39     { -10, -320, "10", 10000000 },
  40     {  -9, -288, "8",   8000000 },
  41     {  -8, -256, "6",   6000000 },
  42     {  -7, -224, "5",   5000000 },
  43     {  -6, -192, "4",   4000000 },
  44     {  -5, -160, "3.2", 3200000 },
  45     {  -4, -128, "2.5", 2500000 },
  46     {  -3,  -96, "2",   2000000 },
  47     {  -2,  -64, "1.6", 1600000 },
  48     {  -1,  -32, "1.3", 1300000 },
  49     {   0,    0, "1",   1000000 },
  50     {   1,   32, "0.8",  800000 },
  51     {   2,   64, "0.6",  600000 },
  52     {   3,   96, "0.5",  500000 },
  53     {   4,  128, "0.4",  400000 },
  54     {   5,  160, "0.3",  300000 },
  55     {   6,  192, "1/4",  250000 },
  56     {   7,  224, "1/5",  200000 },
  57     {   8,  256, "1/6",  166667 },
  58     {   9,  288, "1/8",  125000 },
  59     {  10,  320, "1/10", 100000 },
  60     {  11,  352, "1/13",  76923 },
  61     {  12,  384, "1/15",  66667 },
  62     {  13,  416, "1/20",  50000 },
  63     {  14,  448, "1/25",  40000 },
  64     {  15,  480, "1/30",  33333 },
  65     {  16,  512, "1/40",  25000 },
  66     {  17,  544, "1/50",  20000 },
  67     {  18,  576, "1/60",  16667 },
  68     {  19,  608, "1/80",  12500 },
  69     {  20,  640, "1/100", 10000 },
  70     {  21,  672, "1/125",  8000 },
  71     {  22,  704, "1/160",  6250 },
  72     {  23,  736, "1/200",  5000 },
  73     {  24,  768, "1/250",  4000 },
  74     {  25,  800, "1/320",  3125 },
  75     {  26,  832, "1/400",  2500 },
  76     {  27,  864, "1/500",  2000 },
  77     {  28,  896, "1/640",  1563 },
  78     {  29,  928, "1/800",  1250 },
  79     {  30,  960, "1/1000", 1000 },
  80     {  31,  992, "1/1250",  800 },
  81     {  32, 1021, "1/1600",  625 },
  82 };
  83 
  84 const ISOTable iso_table[] = {
  85 //    { -1,     1,    "HI", -1},
  86     {  0,     0,  "Auto", -1},
  87     {  1,    80,    "80", -1}, // note, camera does not support 89
  88     {  2,   100,   "100", -1},
  89     {  3,   200,   "200", -1},
  90     {  4,   400,   "400", -1},
  91     {  5,   800,   "800", -1},
  92     {  6,  1600,  "1600", -1},
  93 };          
  94 
  95 /*
  96 http://www.usa.canon.com/cusa/consumer/products/cameras/digital_cameras/powershot_elph_130_is#Specifications
  97 
  98 Shooting Modes
  99         Auto, P, Portrait, Smart shutter (Smile, Wink self timer, Face Self timer),
 100     Low light, Fisheye Effect, Miniature Effect, Toy Camera Effect, Monochrome,
 101     Super Vivid, Poster Effect, Color Accent, Color Swap, Snow, Fireworks, 
 102     Long Shutter, Stitch assist
 103         Movie
 104                 1280 x 720 (25 fps), 640 x 480 (30 fps) 
 105         
 106 
 107 canon mode list FF61C088 in 100a
 108 
 109 NOTE elph130 does not have "scene" modes, but the distinction is meaningless for chdk
 110 */
 111 const CapturemodeMap modemap[] = {
 112     { MODE_LONG_SHUTTER,        32774 },
 113     { MODE_P,                   32772 },
 114     { MODE_STITCH,              33293 }, // either direction
 115     { MODE_MINIATURE,           33330 },
 116     { MODE_FISHEYE,             33329 },
 117     { MODE_TOY_CAMERA,          33333 }, // not really a SCN mode
 118     { MODE_LOWLIGHT,            32807 },
 119     { MODE_COLOR_ACCENT,        33315 },
 120     { MODE_COLOR_SWAP,          33316 },
 121     { MODE_MONOCHROME,          33336 },
 122     { MODE_SUPER_VIVID,         33324 },
 123     { MODE_POSTER_EFFECT,       33325 },
 124     { MODE_PORTRAIT,            32787 },
 125     { MODE_SNOW,                32795 },
 126     { MODE_FIREWORK,            32797 },
 127     { MODE_AUTO,                32768 },
 128     { MODE_FACE_SELF_TIMER,     33326 },
 129     { MODE_SMART_SHUTTER,       33327 },
 130     { MODE_WINK_SELF_TIMER,     33328 },
 131 //  { MODE_VIDEO_STD,           33796 }, // not a real mode - see http://chdk.setepontos.com/index.php?topic=12163.0
 132 };
 133 
 134 #include "../generic/shooting.c"
 135 
 136 long get_file_next_counter() {
 137     return get_file_counter();
 138 }
 139 
 140 long get_target_file_num() {
 141     return get_exposure_counter();
 142 }
 143 #if defined(CAM_DATE_FOLDER_NAMING)
 144 // ELPH130 camera uses date to name directory
 145 // TODO currently returns something like A/DCIM/101___09/ETC_0112.TMP
 146 // may need different params
 147 void get_target_dir_name(char *out)
 148 {
 149     static char buf[32];
 150     extern void _GetImageFolder(char*,int,int,int);
 151     _GetImageFolder(buf,get_file_next_counter(),CAM_DATE_FOLDER_NAMING,time(NULL));
 152     strncpy(out,buf,15);
 153     out[15] = 0;
 154 }
 155 #else
 156 long get_target_dir_num() 
 157 {
 158     return 0;
 159 }
 160 #endif
 161 

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