root/platform/ixus220_elph300hs/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 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 #include "conf.h"
   5 #include "keyboard.h"
   6 #include "stdlib.h"
   7 #include "platform.h"
   8 
   9 #define PARAM_FILE_COUNTER      0x3B
  10 #define PARAM_EXPOSURE_COUNTER  0x02
  11 
  12 // borrowed from IXUS 200, which is similar
  13 // but not exactly the same lens
  14 const ApertureSize aperture_sizes_table[] = {
  15         {  9, 293, "2.8" },
  16         { 10, 306, "3.2" },
  17         { 11, 321, "3.2" },
  18         { 12, 338, "3.5" },
  19         { 13, 358, "3.5" },
  20         { 14, 383, "4.0" },
  21         { 15, 413, "4.5" },
  22         { 16, 435, "5.0" },
  23         { 17, 449, "5.0" },
  24         { 18, 472, "5.6" },
  25         { 19, 466, "5.6" },
  26         { 20, 499, "5.9" },
  27 };
  28 
  29 const ShutterSpeed shutter_speeds_table[] = {
  30         { -12, -384, "15", 15000000 },
  31         { -11, -352, "13", 13000000 },
  32         { -10, -320, "10", 10000000 },
  33         {  -9, -288, "8",   8000000 },
  34         {  -8, -256, "6",   6000000 },
  35         {  -7, -224, "5",   5000000 },
  36         {  -6, -192, "4",   4000000 },
  37         {  -5, -160, "3.2", 3200000 },
  38         {  -4, -128, "2.5", 2500000 },
  39         {  -3,  -96, "2",   2000000 },
  40         {  -2,  -64, "1.6", 1600000 },
  41         {  -1,  -32, "1.3", 1300000 },
  42         {   0,    0, "1",   1000000 },
  43         {   1,   32, "0.8",  800000 },
  44         {   2,   64, "0.6",  600000 },
  45         {   3,   96, "0.5",  500000 },
  46         {   4,  128, "0.4",  400000 },
  47         {   5,  160, "0.3",  300000 },
  48         {   6,  192, "1/4",  250000 },
  49         {   7,  224, "1/5",  200000 },
  50         {   8,  256, "1/6",  166667 },
  51         {   9,  288, "1/8",  125000 },
  52         {  10,  320, "1/10", 100000 },
  53         {  11,  352, "1/13",  76923 },
  54         {  12,  384, "1/15",  66667 },
  55         {  13,  416, "1/20",  50000 },
  56         {  14,  448, "1/25",  40000 },
  57         {  15,  480, "1/30",  33333 },
  58         {  16,  512, "1/40",  25000 },
  59         {  17,  544, "1/50",  20000 },
  60         {  18,  576, "1/60",  16667 },
  61         {  19,  608, "1/80",  12500 },
  62         {  20,  640, "1/100", 10000 },
  63         {  21,  672, "1/125",  8000 },
  64         {  22,  704, "1/160",  6250 },
  65         {  23,  736, "1/200",  5000 },
  66         {  24,  768, "1/250",  4000 },
  67         {  25,  800, "1/320",  3125 },
  68         {  26,  832, "1/400",  2500 },
  69         {  27,  864, "1/500",  2000 },
  70         {  28,  896, "1/640",  1563 },
  71         {  29,  928, "1/800",  1250 },
  72         {  30,  960, "1/1000", 1000 },
  73         {  31,  992, "1/1250",  800 },
  74         {  32, 1024, "1/1600",  625 },
  75         {  33, 1056, "1/2000",  500 },
  76         {  34, 1088, "1/2500",  400 },
  77         {  35, 1120, "1/3200",  313 },
  78 };
  79 
  80 const ISOTable iso_table[] = {
  81         {  0,    0, "Auto", -1},
  82         {  1,  100,  "100", -1},
  83         {  2,  200,  "200", -1},
  84         {  3,  400,  "400", -1},
  85         {  4,  800,  "800", -1},
  86         {  5, 1600, "1600", -1},
  87         {  6, 3200, "3200", -1},
  88 };
  89 
  90 // modemap, values have been verified for IXUS220HS on 1.00c/1.01a/1.01c
  91 // http://chdk.setepontos.com/index.php?topic=6341.msg76892#msg76892
  92 const CapturemodeMap modemap[] = {
  93     { MODE_AUTO,                32768 },
  94     { MODE_P,                   32772 },
  95 
  96     { MODE_PORTRAIT,            32783 },
  97     { MODE_KIDS_PETS,           32786 },
  98     { MODE_SMART_SHUTTER,       33321 },
  99     { MODE_HIGHSPEED_BURST,     33288 },
 100     { MODE_BEST_IMAGE,          33289 },
 101     { MODE_NIGHT_SCENE,         33325 },
 102     { MODE_LOWLIGHT,            32801 },
 103     { MODE_FISHEYE,             33323 },
 104     { MODE_MINIATURE,           33324 },
 105     { MODE_TOY_CAMERA,          33327 },
 106     { MODE_MONOCHROME,          33330 },
 107     { MODE_SUPER_VIVID,         33318 },
 108     { MODE_POSTER_EFFECT,       33319 },
 109     { MODE_COLOR_ACCENT,        33309 },
 110     { MODE_COLOR_SWAP,          33310 },
 111     { MODE_BEACH,               32791 },
 112     { MODE_UNDERWATER,          32793 },
 113     { MODE_FOLIAGE,             32789 },
 114     { MODE_SNOW,                32790 },
 115     { MODE_SNOW,                32774 },        
 116     { MODE_STITCH,              33292 },
 117         
 118     { MODE_VIDEO_MOVIE_DIGEST,  33333 },
 119     { MODE_VIDEO_SUPER_SLOW,     2626 },
 120         
 121     // cannot be called directly from Canon options but probably needed
 122     { MODE_FACE_SELF_TIMER,     33320 },
 123     { MODE_WINK_SELF_TIMER,     33322 },
 124     { MODE_FIREWORK,            32792 },
 125 
 126 };
 127 
 128 #include "../generic/shooting.c"
 129 
 130 long get_file_next_counter() {
 131         return get_file_counter();
 132 }
 133 
 134 long get_target_file_num() {
 135         long n;
 136 
 137 
 138         n = get_file_next_counter();
 139 
 140     n = (n>>4)&0x3FFF;
 141 
 142     return n;
 143 }
 144 
 145 void get_target_dir_name(char *out)
 146 {       
 147         extern void _GetImageFolder(char*,int,int,int);
 148         _GetImageFolder(out,get_file_next_counter(),CAM_DATE_FOLDER_NAMING,time(NULL));
 149 }
 150 
 151 long get_target_dir_num() {
 152         long n;
 153 
 154         n = get_file_next_counter();
 155         n = (n>>18)&0x3FF;
 156         return n;
 157 }

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