root/platform/sx210is/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
  4. get_target_dir_name

   1 #include "lolevel.h"
   2 #include "platform.h"
   3 #include "core.h"
   4 #include "conf.h"
   5 #include "keyboard.h"
   6 #include "stdlib.h"   //ASM1989 debuging
   7 #include "platform.h"//ASM1989 debuging
   8 //#define PARAM_FILE_COUNTER      0x02  // with 02 worked changin the script but??
   9 
  10 #define PARAM_FILE_COUNTER      0x3A
  11 
  12 #define PARAM_EXPOSURE_COUNTER  0x02
  13 
  14 #include "platform.h"
  15 #include "stdlib.h"
  16 //No zoom 3.1 3.5 4.0 4.5 5.0 5.6 6.3 7.1 8.0
  17 //maz zoom 5.9 7.1 8.0
  18  //ASM1989 sx210 values
  19 const ApertureSize aperture_sizes_table[] = {
  20         {  9, 322, "3.1" },
  21     { 10, 352, "3.5" },
  22         { 11, 384, "4.0" },
  23         { 12, 416, "4.5" },
  24         { 13, 448, "5.0" },
  25         { 14, 480, "5.6" },
  26         { 15, 512, "6.3" },
  27         { 16, 544, "7.1" },
  28         { 17, 576, "8.0" }
  29 };
  30 
  31 const ShutterSpeed shutter_speeds_table[] = {
  32         { -12, -384, "15", 15000000 },
  33         { -11, -352, "13", 13000000 },
  34         { -10, -320, "10", 10000000 },
  35         {  -9, -288, "8",   8000000 },
  36         {  -8, -256, "6",   6000000 },
  37         {  -7, -224, "5",   5000000 },
  38         {  -6, -192, "4",   4000000 },
  39         {  -5, -160, "3.2", 3200000 },
  40         {  -4, -128, "2.5", 2500000 },
  41         {  -3,  -96, "2",   2000000 },
  42         {  -2,  -64, "1.6", 1600000 },
  43         {  -1,  -32, "1.3", 1300000 },
  44         {   0,    0, "1",   1000000 },
  45         {   1,   32, "0.8",  800000 },
  46         {   2,   64, "0.6",  600000 },
  47         {   3,   96, "0.5",  500000 },
  48         {   4,  128, "0.4",  400000 },
  49         {   5,  160, "0.3",  300000 },
  50         {   6,  192, "1/4",  250000 },
  51         {   7,  224, "1/5",  200000 },
  52         {   8,  256, "1/6",  166667 },
  53         {   9,  288, "1/8",  125000 },
  54         {  10,  320, "1/10", 100000 },
  55         {  11,  352, "1/13",  76923 },
  56         {  12,  384, "1/15",  66667 },
  57         {  13,  416, "1/20",  50000 },
  58         {  14,  448, "1/25",  40000 },
  59         {  15,  480, "1/30",  33333 },
  60         {  16,  512, "1/40",  25000 },
  61         {  17,  544, "1/50",  20000 },
  62         {  18,  576, "1/60",  16667 },
  63         {  19,  608, "1/80",  12500 },
  64         {  20,  640, "1/100", 10000 },
  65         {  21,  672, "1/125",  8000 },
  66         {  22,  704, "1/160",  6250 },
  67         {  23,  736, "1/200",  5000 },
  68         {  24,  768, "1/250",  4000 },
  69         {  25,  800, "1/320",  3125 },
  70         {  26,  832, "1/400",  2500 },
  71         {  27,  864, "1/500",  2000 },
  72         {  28,  896, "1/640",  1563 },
  73         {  29,  928, "1/800",  1250 },
  74         {  30,  960, "1/1000", 1000 },
  75         {  31,  992, "1/1250",  800 },
  76         {  32, 1024, "1/1600",  625 },
  77         {  33, 1056, "1/2000",  500 },
  78         {  34, 1088, "1/2500",  400 },
  79         {  35, 1120, "1/3200",  313 },
  80 };
  81 
  82 const ISOTable iso_table[] = {
  83         { -1,    1,   "HI", -1},
  84         {  0,    0, "Auto", -1},
  85         {  1,   80,   "80", -1},
  86         {  2,  100,  "100", -1},
  87         {  3,  200,  "200", -1},
  88         {  4,  400,  "400", -1},
  89         {  5,  800,  "800", -1},
  90         {  6, 1600, "1600", -1},
  91         {  7, 3200, "3200", -1},
  92 };
  93 
  94 /*
  95 http://www.usa.canon.com/cusa/support/consumer/digital_cameras/other_powershot/powershot_sx210_is#Specifications
  96 Shooting Modes
  97     Auto, P, Av, Tv, M, Portrait, Landscape,
  98     Special Scene
  99         (Smart Shutter (Smile, Wink Self-timer, Face Detection Self-timer), Low Light, Color Accent, Color Swap, Fisheye Effect, Miniature Effect, Beach, Foliage, Snow, Fireworks, Stitch Assist),
 100     Super Macro, Indoor, Kids & Pets, Night Snapshot, Movie
 101 Movie: High Definition: 1280 x 720 (30 fps);
 102     Standard Definition: 640 x 480 (30 fps), 320 x 240 (30 fps)
 103 
 104 canon mode list FFB6D0A4 in 100c
 105 */
 106 const CapturemodeMap modemap[] = {
 107         { MODE_AUTO,               32768  },
 108         { MODE_P,                  32772  },
 109         { MODE_TV,                 32771  },
 110         { MODE_AV,                 32770  },
 111         { MODE_M,                  32769  },
 112         { MODE_EASY,               33314  }, // Changed in SX210
 113         { MODE_PORTRAIT,           32783  }, // Changed in SX210
 114         { MODE_NIGHT_SNAPSHOT,     32781  }, // Changed in SX210
 115         { MODE_LANDSCAPE,          32782  }, // Changed in SX210
 116         { MODE_VIDEO_COLOR_ACCENT, 2610   }, //??
 117         { MODE_VIDEO_COLOR_SWAP,   2611   }, //??
 118         { MODE_VIDEO_STD,          2612   },// Changed in SX210
 119         { MODE_KIDS_PETS,          32786  },// Changed in SX210
 120         { MODE_INDOOR,             32787  },// Changed in SX210
 121         { MODE_MINIATURE,          16940  },   //New in sx210 ???
 122         { MODE_FISHEYE,            16939  },    //New in sx210 ???
 123         { MODE_LOWLIGHT,           16417 },    //New in sx210 ???
 124         { MODE_SMART_SHUTTER,      33320 },    //New in sx210 ???
 125 //      { MODE_SUNSET,             16402  },   //??
 126 //      { MODE_NIGHT_SCENE,        16398  }, //??
 127         { MODE_FIREWORK,           16408  },// Changed in SX210
 128         { MODE_BEACH,              16407  },// Changed in SX210
 129         { MODE_FOLIAGE,            16405  },// Changed in SX210
 130         { MODE_SNOW,               16406  },// Changed in SX210
 131         { MODE_COLOR_ACCENT,       16925  }, // Changed in SX210?
 132         { MODE_COLOR_SWAP,         16926  }, // Changed in SX210
 133         { MODE_STITCH,             16908  }  // Changed in SX210
 134 };
 135 
 136 #include "../generic/shooting.c"
 137 
 138 long get_file_next_counter() {
 139         return get_file_counter();
 140 }
 141 
 142 long get_target_file_num() {
 143         long n;
 144 
 145 
 146         n = get_file_next_counter();
 147 
 148     n = (n>>4)&0x3FFF;
 149 
 150     //n+=22;
 151         return n;
 152 }
 153 
 154 /*
 155 long get_target_dir_num() {
 156         long n;
 157 
 158         n = get_file_next_counter();
 159 
 160         n = (n>>18)&0x3FF;
 161 
 162         //n+=22;
 163         //n=n/1000;
 164         //n+=101;
 165         return n;
 166 }*/
 167 
 168 
 169 long get_target_dir_num() {
 170         long n;
 171 
 172         n = get_file_next_counter();
 173         n = (n>>18)&0x3FF;
 174         return n;
 175 }
 176 
 177 
 178 void get_target_dir_name(char *out)
 179 {
 180         //Dosnt seem to work in SX210 Dont know why?
 181 /*      extern void _GetImageFolder(char*,int,int,int);
 182         out[0] = 'A';
 183         _GetImageFolder(out+1,get_file_next_counter(),CAM_DATE_FOLDER_NAMING,time(NULL));*/
 184         int month;
 185         struct tm *ttm;
 186         unsigned long t;
 187         t = time(NULL);
 188         ttm = localtime(&t);
 189         month = ttm->tm_mon + 1;
 190         sprintf(out, "A/DCIM/%03d___%02d", get_target_dir_num(), month);
 191 
 192 
 193 }
 194 
 195 // not used ? -> CAM_DRAW_EXPOSITION
 196 /*
 197 char* shooting_get_tv_str()
 198 {
 199     short int tvv;
 200     long i;
 201     _GetPropertyCase(PROPCASE_TV, &tvv, sizeof(tvv));   // 262 for DiGiC III
 202     for (i=0;i<SS_SIZE;i++){
 203         if (shutter_speeds_table[i].prop_id >= tvv)
 204             return (char*)shutter_speeds_table[i].name;
 205     }
 206     return (void*)"?";
 207 }
 208 
 209 char* shooting_get_av_str()
 210 {
 211     short int avv;
 212     long i;
 213     _GetPropertyCase(PROPCASE_AV, &avv, sizeof(avv));   // 23 for DiGiC III
 214     for (i=0;i<AS_SIZE;i++){
 215         if (aperture_sizes_table[i].prop_id == avv)
 216             return (char*)aperture_sizes_table[i].name;
 217     }
 218     return (char*) "?";
 219 }
 220 
 221 char* shooting_get_iso_str()
 222 {
 223     short int isov;
 224     long i;
 225     _GetPropertyCase(PROPCASE_ISO_MODE, &isov, sizeof(isov));
 226     for (i=0;i<ISO_SIZE;i++){
 227    if (iso_table[i].prop_id == isov)
 228        return (char*)iso_table[i].name;
 229     }
 230     return (char*) "?";
 231 }
 232 
 233 */

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