Core definition file of code

Source: Internet
Author: User
Tags define null

Many of the codes in my previous Blog have their own data types, which are confusing. Below I will post the public part of my code definition to help you view the code.

/*************************************** ************************************* Time: * Project: remote sensing platform * purpose: core library file * Author: Li minlu * copyright (c) 2009, liminlu0314@gmail.com * describe: provides common data type definitions, such ********************************* **************************************** * ***/# ifndef imgalg_h # define imgalg_h/*** \ file imgcore. H * @ brief Core Type Definition ** export interface (in C language), Core type definition * // *** ignore warning lm on MS widows Platform L 2010-10-19 * warning c4100: "*": the parameter x warning c4190: "identifier1" has a specified C link, however, the system returns the incompatible UDT "identifier2" * warning c00001: Class "type". The client of the class "type2" needs to use the DLL Interface * warning c4275: the non-DLL interface key "identifier" serves as the base of the DLL interface key "identifier" and uses * warning c4305: truncate * warning c4309 from "type1" to "type2: truncation constant value * warning c4819: This file contains characters that cannot be expressed in the current Code Page (936. Save the file as Unicode to prevent data loss * warning c4996: non-standard extension used: enumeration is used in the qualified name */# If defined (_ msc_ver) & (_ msc_ver> = 1400) # pragma warning (Disable: 4100 4190 4251 4275 4305 4309 4819) # endif/*** @ brief whether to use VLD Memory leakage monitoring tool */# If _ usevld # If _ debug // detect memory leakage in debug mode # include "VLD. H "# endif/*** @ brief whether to use the log tool to write logs */# If _ uselog # define use_log4cpp # endif # include <float. h> # include <algorithm> # include <deque> # include <Fstream> # include <limits> # include <map> # include <stack> # include <string> # include <vector> using namespace STD; /*** @ brief export symbol definition */# ifdef imgalg_exports # define imgalg_api _ declspec (dllexport) # else # define imgalg_api _ declspec (dllimport) # endif/*** @ brief defines null */# ifndef null # define null 0 # endif/*** @ brief defines false */# ifndef false # define false 0 # endif /*** @ brief defines true */# ifndef true # define true 1 # E Ndif # ifndef max /*! Maximum value */# define min (A, B) (A <B )? A: B )/*! Minimum value */# define max (A, B) (A> B )? A: B) # endif/*** @ brief defines abs and calculates the absolute value */# ifndef abs # define ABS (x) (x <0 )? (-1 * (x): X) # endif/*** @ brief defines Pi = 3. 141592653... and degrees and radians conversion */# ifndef m_pi /*! Define the circumference rate pI */# define m_pi 3.1415926535897932384626433832795 /*! Radian rotation */# define deg_per_rad (double) (180.0/m_pi ))/*! Degrees to radians */# define rad_per_deg (double) (m_pi/180.0) # endif/*** @ brief defines square */# ifndef m_square # define m_square (X) (x) * (x) # endif/*** @ Brief definition cube */# ifndef m_cube # define m_cube (x) * (X) # endif /*! Determine if the floating point number is Nan */inline bool isnan (const float & V) {return _ isnan (v )? True: false ;}/*! Determine whether the number of double types is Nan */inline bool isnan (const double & V) {return _ isnan (v )? True: false ;}/*! Obtain the Nan value of double */inline double Nan () {return numeric_limits <double >:: quiet_nan ();} /*** @ brief Float Type Extreme Value */# ifndef flt_equals /*! Whether the floating point number is equal */# define flt_equals (x, y) (FABS (double) x-y) <flt_epsilon )/*! Whether the floating point is equal (specify the comparison threshold) */# define flt_equals_n (x, y, z) (FABS (double) x-y) <z) # endif # ifndef flt_zero /*! Whether the floating point number is 0 */# define flt_zero (x) (FABS (x) <flt_epsilon) # endif/*** @ brief release array */# define release (X) if (X! = NULL) {Delete [] X; X = NULL;}/*** @ brief sets the global region as the default Operating System Region */# define set_local {locale :: global (locale (""); setlocale (lc_all, "Chinese-simplified");}/*** @ brief restore global region settings */# define revert_locallocale :: global (locale ("C") # ifndef equal # If defined (win32) | defined (win32ce )/*! Compare whether the strings are equal */# define limit N (A, B, n) (_ strnicmp (A, B, n) = 0 )/*! Compare whether the strings are equal */# define equal (A, B) (_ stricmp (a, B) = 0) # else /*! Compare whether the strings are equal */# define limit N (A, B, n) (strncasecmp (A, B, n) = 0 )/*! Compare whether the strings are equal */# define equal (A, B) (strcasecmp (a, B) = 0) # endif /*! Byte */typedef unsigned charbyte ;/*! 8u */typedef unsigned chardt_8u ;/*! 16u */typedef unsigned into dt_16u ;/*! 16 S */typedef shortdt_16s ;/*! 32u */typedef unsigned intdt_32u ;/*! 32 S */typedef intdt_32s ;/*! 32f */typedef floatdt_32f ;/*! 64f */typedef doubledt_64f ;/*! Successfully executed */const int re_success = 0 ;/*! The file does not exist */const int re_filenotexist = 1 ;/*! The file format is not supported */const int re_filenotsupport = 2 ;/*! Incorrect image data type */const int re_filetypeerror = 3 ;/*! Image creation failed */const int re_createfailed = 4 ;/*! Input parameter error */const int re_paramerror = 5 ;/*! Other errors */const int re_failed = 6 ;/*! The image does not exist in the public Region */const int re_nosameextent = 7 ;/*! User cancels operation */const int re_usercancel = 8 ;/*! The file has been used */const int re_fileisuesed = 9 ;/*! Unsupported pixel depth */const int re_depthnotsupport = 10 ;/*! Invalid band quantity */const int re_bandcounterror = 11 ;/*! The file does not exist. */const int re_noprojection = 12 ;/*! Inconsistent projection */const int re_projectiondiff = 13; # endif

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.