📄 rsimage.h
字号:
//自定义的遥感图象文件格式——GeoRSImg.h
//北京大学遥感所 余家忠 1999.8.22
#ifndef _GEORSIMG_H
#define _GEORSIMG_H
#include "RSTheme.h"
#define IMAGE_NOTHING 0
#define IMAGE_SINGLEBAND 1
#define IMAGE_THEMATIC 2
#define IMAGE_COMBINE 3
#define MAX_COLOR 256
#define HEADERFLAG 19990822
class CRSImage : public CObject
{
// Attributes
public:
// the name of image
CString m_szImgName;
// the size of image
int m_nImgHeight;
int m_nImgWidth;
// the type of image
// 1:Single band image
// 2:Thematic image
// 3:RGB true color image
int m_nImgType;
// the resolution of the image
double m_dXResolution;
double m_dYResolution;
// the geo-position of the image
double m_pdGeoPosition[8];
// the date of the image
DWORD m_dwDateOfImage;
// the wavelength of the image
BYTE m_MinWaveLength;
BYTE m_MaxWaveLength;
// Main used for thematic image
// if it's single band image,the palette is gray scale
COLORREF *m_pPal;
//BOOL m_bPreview; //the flag of preview
//COLORREF * m_pNewPal; //the panel for preview
//Data block, as a BMP file in memory
BYTE * m_pImgData;
BYTE * m_pUndoData;
// Histogram,the size is 256*3 for a RGB true color
// image,or the size is 256.
DWORD * m_pdwHistogram;
int m_nLinkedImage;
CPtrArray m_aLinkedImageNameArray;
int m_nClassNumber;
THEMATICINFOARRAY m_aThemeInfoArray;
protected:
private:
// Operations
public:
CRSImage();
~CRSImage();
void Draw(CDC *pDC,int nBegX,int nBegY,double dRatio);
BOOL LoadRsImage(CFile *File,int SrcHeight,int SrcWidth,int nBegX=0,int nBegY=0,int Height=0,int Width=0,int nResRatio=1);
BOOL LoadRsInfo(CFile *File);
BOOL SaveRsInfo(CFile *File);
BOOL SaveImage(LPCTSTR szFileName);
BOOL SaveBmp(CFile *File);
void CopyThematicInfo(CRSImage * pRSImage);
void CalHistogram();
void AdjustUsingLUT(BYTE *pLUT);
void AdjustUsingLUT(BYTE *pLUTRed,BYTE *pLUTGreen,BYTE *pLUTBlue);
void Filter(int WinSize,int Type);
void FindEdge();
void Sharpen();
void Equalize();
void BrightContrast(BYTE *pNewData,int,int);
void Threshold(int);
void Posterize(BYTE *,int);
void Stretch(BYTE *pNewData,int,int,int,int);
void Stretch(BYTE *pNewData,int *,int *,int *,int *);
void UserFilter(int *,int,int,int);
void Resample(int,int,int);
void Rotate(double,bool);
void VertFlip();
void HoriFlip();
void Revert();
BOOL GetDataBlock(LPBYTE &pData,RECT &rectToGet);
BOOL SetDataBlock(LPBYTE pData,RECT &rectToSet);
//void CopyInfoFrom(CRSImage * pRsImage);
//static void GetImageName(LPCTSTR szFileName,CString &szImageName);
protected:
void ShowRsMap(CDC *pDC,int nBegX=0,int nBegY=0,double dRatio=1.0);
void ShowRGBRsMap(CDC *pDC,int nBegX=0,int nBegY=0,double dRatio=1.0);
BOOL LoadWholeImage(CFile *File,int SrcHeight,int SrcWidth);
BOOL SaveRsImage(CFile *File);
private:
};
#endif //_GEORSIMG_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -