00001 #include "Lens.h"
00002 #include <stdlib.h>
00003
00004 namespace FCam {
00005
00006 Lens::Tags::~Tags() {
00007 }
00008
00009 Lens::FocusAction::FocusAction(Lens *l) :
00010 lens(l) {
00011 focus = 0.0f;
00012 speed = lens->maxFocusSpeed();
00013 latency = lens->focusLatency();
00014 time = 0;
00015 }
00016
00017 Lens::FocusAction::FocusAction(Lens *l, int t, float f) :
00018 focus(f), lens(l) {
00019 speed = lens->maxFocusSpeed();
00020 latency = lens->focusLatency();
00021 time = t;
00022 }
00023
00024 Lens::FocusAction::FocusAction(Lens *l, int t, float f, float s) :
00025 focus(f), speed(s), lens(l) {
00026 latency = lens->focusLatency();
00027 time = t;
00028 }
00029
00030 void Lens::FocusAction::doAction() {
00031 lens->setFocus(focus, speed);
00032 }
00033
00034 Lens::ZoomAction::ZoomAction(Lens *l) :
00035 lens(l) {
00036 zoom = 0.0f;
00037 speed = lens->maxZoomSpeed();
00038 latency = lens->zoomLatency();
00039 time = 0;
00040 }
00041
00042 Lens::ZoomAction::ZoomAction(Lens *l, int t, float f) :
00043 zoom(f), lens(l) {
00044 speed = lens->maxZoomSpeed();
00045 latency = lens->zoomLatency();
00046 time = t;
00047 }
00048
00049 Lens::ZoomAction::ZoomAction(Lens *l, int t, float f, float s) :
00050 zoom(f), speed(s), lens(l) {
00051 latency = lens->zoomLatency();
00052 time = t;
00053 }
00054
00055 void Lens::ZoomAction::doAction() {
00056 lens->setZoom(zoom, speed);
00057 }
00058
00059
00060 Lens::ApertureAction::ApertureAction(Lens *l) :
00061 lens(l) {
00062 aperture = 0.0f;
00063 speed = lens->maxApertureSpeed();
00064 latency = lens->apertureLatency();
00065 time = 0;
00066 }
00067
00068 Lens::ApertureAction::ApertureAction(Lens *l, int t, float f) :
00069 aperture(f), lens(l) {
00070 speed = lens->maxApertureSpeed();
00071 latency = lens->apertureLatency();
00072 time = t;
00073 }
00074
00075 Lens::ApertureAction::ApertureAction(Lens *l, int t, float f, float s) :
00076 aperture(f), speed(s), lens(l) {
00077 latency = lens->apertureLatency();
00078 time = t;
00079 }
00080
00081 void Lens::ApertureAction::doAction() {
00082 lens->setAperture(aperture, speed);
00083 }
00084 }