VR-Vantage 3.1 API Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
ciOptics.h
Go to the documentation of this file.
1 
2 // Copyright JRM Enterprises, Inc. 2004
3 // All rights reserved.
4 //
5 // This code is the intellectual property of JRM Enterprises, Inc.
6 // It may not be used or released as source or compiled binary form
7 // without the prior written consent of JRM Enterprises, Inc.
8 //
9 // Original Author: Mike Ortalano
10 // Date: Oct 2004
11 //
12 //
13 //
15 
16 #if !defined(_ciOPTICS_H_)
17 #define _ciOPTICS_H_
18 #include "ciApi.h"
19 
20 #if _MSC_VER > 1000
21 #pragma once
22 #endif // _MSC_VER > 1000
23 
24 #ifndef JRM_PI
25 #define JRM_PI 3.14159265358979323846264338327950288419716939937511
26 #endif
27 #ifndef DEG2RAD
28 #define DEG2RAD (JRM_PI/180.0)
29 #endif
30 
34 #include <stdio.h>
35 #include <string.h>
36 #include <fstream>
37 #include <iostream>
38 #include <assert.h>
39 #include <string.h>
40 #include "clXML.h"
41 #include "clXMLNode.h"
42 
44 {
45 public: // enumerations
46 
48  // enum aperture Shape Type
54  {
56  RECTANGULAR
57  };
58 
59 public: // methods
60 
62  // getAspectRatio
69  double getAspectRatio() { return m_aspectRatio; }
70 
72  // setAspectRatio
80  void setAspectRatio( double aspectRatio ) { m_aspectRatio = aspectRatio; }
81 
83  // getWidthDimension
90  double getWidthDimension() { return m_widthDimension; }
91 
93  // setWidthDimension
101  void setWidthDimension( double widthDimension ){ m_widthDimension = widthDimension; }
102 
104  // getApertureShape
111  int getApertureShape() { return m_apertureShape; }
112 
114  // setApertureShape
122  void setApertureShape( int apertureShape ) { m_apertureShape = apertureShape; }
123 
125  // getBlurSpotDiameter
132  double getBlurSpotDiameter( ) { return m_blurSpotDiameter; }
133 
135  // setBlurSpotDiameter
143  void setBlurSpotDiameter( double blurSpotDiameter ) { m_blurSpotDiameter = blurSpotDiameter; }
144 
146  // getMtfMotionBlurSize
153  double getMtfMotionBlurSize( ) { return m_mtfMotionBlur; }
154 
156  // setMtfMotionBlurSize
164  void setMtfMotionBlurSize( double mtfMotionBlur ) { m_mtfMotionBlur = mtfMotionBlur; }
165 
167  // getHorizFOV
174  double getHorizFOV() { return m_horizFOV; }
175 
177  // setHorizFOV
185  void setHorizFOV( double horizFOV ) { m_horizFOV = horizFOV; }
186 
188  // getVertFOV
195  double getVertFOV() { return m_vertFOV; }
196 
198  // setLensTransmittance
206  void setLensTransmittance( double trans ) { m_lensTransmittance = trans; }
207 
209  // getLensTransmittance
216  double getLensTransmittance() const { return m_lensTransmittance; }
217 
219  // setVertFOV
227  void setVertFOV( double vertFOV ) { m_vertFOV = vertFOV; }
228 
230  //setHaloThreshold
235  void setHaloThreshold(double threshold ){m_haloThreshold = threshold;}
237  //getHaloThreshold
242  double getHaloThreshold(){return m_haloThreshold;}
244  //setHaloRadius
249  void setHaloRadius(double radius){m_haloRadius = radius;}
251  //getHaloRadius
256  double getHaloRadius(){return m_haloRadius;}
258  //setHaloIntensity
263  void setHaloIntensity(double intensity){m_haloIntensity = intensity;}
265  //getHaloIntensity
270  double getHaloIntensity(){return m_haloIntensity;}
272  //setPercentHaloIntensity
277  void setPercentHaloIntensity(double percent){m_percentHaloIntensity = percent;}
279  //getPercentHaloIntensity
284  double getPercentHaloIntensity(){return m_percentHaloIntensity;}
285 
287  //setUseSeparableKernelEnable
292  void setUseSeparableKernelEnable(bool enable)
293  {
294  m_enableSeparableKernel = enable;
295  }
296 
298  //getUseSeparableKernelEnable
303  bool getUseSeparableKernelEnable() const
304  {
305  return m_enableSeparableKernel;
306  }
307 
309  //setAberrationsEnable
314  void setAberrationsEnable (bool enable)
315  {
316  m_aberrationsEnable = enable;
317  }
318 
320  //getAberrationsEnable
325  bool getAberrationsEnable() const
326  {
327  return m_aberrationsEnable;
328  }
329 
331  //setMeanWavelength
336  void setMeanWavelength(const double wavelength)
337  {
338  m_wavelength = wavelength;
339  }
340 
342  //getMeanWavelength
347  double getMeanWavelength() const
348  {
349  return m_wavelength;
350  }
351 
353  //setAperturePercentageHorz
358  void setAperturePercentageHorz(const double aperSizeX)
359  {
360  m_horzAperturePercentage = aperSizeX;
361  }
362 
364  //getAperturePercentageHorz
369  double getAperturePercentageHorz() const
370  {
371  return m_horzAperturePercentage;
372  }
373 
375  //setAperturePercentageVert
380  void setAperturePercentageVert(const double aperSizeY)
381  {
382  m_vertAperturePercentage = aperSizeY;
383  }
384 
386  //getAperturePercentageVert
391  double getAperturePercentageVert() const
392  {
393  return m_vertAperturePercentage;
394  }
395 
397  //setDefocusCoefficient
402  void setDefocusCoefficient (const double defocus)
403  {
404  m_W020 = defocus;
405  }
406 
408  //getDefocusCoefficient
413  double getDefocusCoefficient() const
414  {
415  return m_W020;
416  }
417 
419  //setSphericalAberrationCoefficient
424  void setSphericalAberrationCoefficient (const double sphericalAberration)
425  {
426  m_W040 = sphericalAberration;
427  }
428 
430  //getSphericalAberrationCoefficient
435  double getSphericalAberrationCoefficient() const
436  {
437  return m_W040;
438  }
439 
441  //setComaCoefficient
446  void setComaCoefficient (const double coma)
447  {
448  m_W131 = coma;
449  }
450 
452  //getComaCoefficient
457  double getComaCoefficient() const
458  {
459  return m_W131;
460  }
461 
463  //setAstigmatismCoefficient
468  void setAstigmatismCoefficient (const double astigmatism)
469  {
470  m_W222 = astigmatism;
471  }
472 
474  //getAstigmatismCoefficient
479  double getAstigmatismCoefficient() const
480  {
481  return m_W222;
482  }
483 
485  //setFieldCurvatureCoefficient
490  void setFieldCurvatureCoefficient (const double fieldCurvature)
491  {
492  m_W220 = fieldCurvature;
493  }
494 
496  //getFieldCurvatureCoefficient
501  double getFieldCurvatureCoefficient() const
502  {
503  return m_W220;
504  }
505 
507  //setDistortionCoefficient
512  void setDistortionCoefficient (const double distortion)
513  {
514  m_W311 = distortion;
515  }
516 
518  //getDistortionCoefficient
523  double getDistortionCoefficient() const
524  {
525  return m_W311;
526  }
527 
529  //setFPASubDivisions
534  void setFPASubDivisions(int subdivisions)
535  {
536  m_FPASubDivisions = subdivisions;
537  }
538 
540  //getFPASubDivisions
545  int getFPASubDivisions() const
546  {
547  return m_FPASubDivisions;
548  }
549 
551  //setUserDefinedKernelEnable
556  void setUserDefinedKernelEnable(bool enable)
557  {
558  m_enableUserDefinedKernel = enable;
559  }
560 
562  //getUserDefinedKernelEnable
567  bool getUserDefinedKernelEnable() const
568  {
569  return m_enableUserDefinedKernel;
570  }
571 
573  //setUserDefinedKernelRootFilename
574  //
581  void setUserDefinedKernelRootFilename(char* filename);
582 
584  //getUserDefinedKernelRootFilename
590  char * getUserDefinedKernelRootFilename() { return m_userDefinedRootKernelfilename; }
591 
593  //setUserDefinedMTFenable
599  void setUserDefinedMTFenable(bool enable) { m_userDefinedMTFenable = enable; }
600 
602  //getUserDefinedMTFenable
606  bool getUserDefinedMTFenable() { return m_userDefinedMTFenable; }
607 
609  //setUserDefinedMTFfilename
610  //
622  void setUserDefinedMTFfilename(char* filename);
623 
625  //getUserDefinedMTFfilename
631  char * getUserDefinedMTFfilename() { return m_userDefinedMTFfilename; }
632 
634  //setHaloType
639  void setHaloType (int type)
640  {
641  m_haloType = type;
642  }
643 
645  //getHaloType
650  int getHaloType() const
651  {
652  return m_haloType;
653  }
654 
656  //setImageMaskRadius
661  void setImageMaskRadius (double radius)
662  {
663  m_ImageClipRadius = (radius > -1.0) ? radius : -1.0; // max(radius, -1.0);
664  }
665 
667  //getImageMaskRadius
672  double getImageMaskRadius() const
673  {
674  return m_ImageClipRadius;
675  }
676 
678  //setImageMaskScaleHorizontal
683  void setImageMaskScaleHorizontal(double scale)
684  {
685  m_ImageClipScaleHorz = scale;
686  }
687 
689  //getImageMaskScaleHorizontal
694  double getImageMaskScaleHorizontal() const
695  {
696  return m_ImageClipScaleHorz;
697  }
698 
700  //setImageMaskScaleVertical
705  void setImageMaskScaleVertical(double scale)
706  {
707  m_ImageClipScaleVert = scale;
708  }
709 
711  //getImageMaskScaleVertical
716  double getImageMaskScaleVertical() const
717  {
718  return m_ImageClipScaleVert;
719  }
720 
722  //setSensorIndex
727  void setSensorIndex(int sensorIndex){m_sensorIndex = sensorIndex;}
729  //getSensorIndex
734  int getSensorIndex(){return m_sensorIndex;}
735 
737  // archive
745  bool archive(std::ofstream &outf, int idx = 0);
746 
748  // serialize
756  int serialize(char *filepath, int idx);
757 
758  //
759  // loadXML
760  //
761  // \par Description:
762  // Loads attributes from an XML node
763  //
764  // \param clXMLNode* xmlParentNode
765  // \return bool
766  //
767  bool loadXML(clXMLNode* xmlParentNode);
768 
769  //
770  // parseXML
771  //
772  // \par Description:
773  // Parses an XML document for specfic tags
774  //
775  // \param clXML xmlDocument
776  // \return bool
777  //
778  bool parseXML(clXML& xmlDocument);
779 
781  //loadXMLNode
788  bool loadXMLNode(std::string tag, char *nodeString);
790  //loadXMLNode
797  bool loadXMLNode(std::string tag, bool *nodeBool);
799  //loadXMLNode
806  bool loadXMLNode(std::string tag, int *nodeInt);
808  //loadXMLNode
815  bool loadXMLNode(std::string tag, long *nodeLong);
817  //loadXMLNode
824  bool loadXMLNode(std::string tag, double *nodeDouble);
825 
826  //
827  // saveXML
828  //
829  // \par Description:
830  // Saves XML nodes to an XML document
831  //
832  // \param clXML* xmlDocument
833  //
834  void saveXML(clXML* xmlDocument);
835 
837  //serializeCheck
843  int serializeCheck(char *filepath);
844 
846  // operator =
854  ciOptics operator = (ciOptics &obj);
855 
856 protected: // methods
857 
858 public: // construction/destruction
859 
861  // ciOptics
866  ciOptics();
867 
869  // ciOptics
877 
878  virtual ~ciOptics();
879 
880 protected: // variables
881 
882  double m_aspectRatio;
886  double m_horizFOV;
887  double m_vertFOV;
891  double m_haloRadius;
895 
897  bool m_aberrationsEnable; // Aberration Enable flag
898  double m_W020; // Defocus aberration
899  double m_W040; // Spherical aberration
900  double m_W131; // Coma aberration
901  double m_W222; // Astigmatism aberration
902  double m_W220; // Field Curvature aberration
903  double m_W311; // Distortion aberration
904  double m_horzAperturePercentage; // pupil plane relative size
905  double m_vertAperturePercentage; // pupil plane relative size
906  double m_wavelength; // Central Wavelength
907  double m_ImageClipRadius; // radius to define the clipped region of an image display
908  double m_ImageClipScaleHorz; // scales the clip regioning in the horizontal direction
909  double m_ImageClipScaleVert; // scales the clip regioning in the vertical direction
910  int m_FPASubDivisions; // subdivisions of FPA for spatially dependent kernel processing
912  bool m_enableSeparableKernel; // support for separable kernels
913 
917  char m_userDefinedMTFfilename[512];
919  char m_userDefinedRootKernelfilename[512];
920 
923 
924 private: // variables
925 
926 };
927 
928 #endif // _ciOPTICS_H_


Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)