📄 matrix.h
字号:
// Matrix.h: interface for the Matrix class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_MATRIX_H__30B7D888_BB9B_11D2_9B76_204C4F4F5020__INCLUDED_)
#define AFX_MATRIX_H__30B7D888_BB9B_11D2_9B76_204C4F4F5020__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
//#include <afx.h>
class matrix
{
friend matrix operator+(const matrix& x, const matrix& y);
friend matrix operator-(const matrix& x, const matrix& y);
friend matrix operator+(const matrix& x, double a);
friend matrix operator+(double a, const matrix& x);
friend matrix operator-(const matrix& x, double a);
friend matrix operator-(double a, const matrix& x);
friend matrix operator*(const matrix& x, const matrix& y);
friend matrix operator*(const matrix& x, double a);
friend matrix operator*(double a, const matrix& x);
friend matrix operator/(const matrix& x, double a);
friend matrix operator/(const matrix& x, const matrix& y); // a ./ b
friend matrix operator&(const matrix& x, const matrix& y); // a .* b
friend matrix operator|(const matrix& x, const matrix& y); // convolve
public:
int ysize,xsize; //number of rows(ysize) and columns(xsize)
double **rowptr; //pointer to rows
double *elem; //elements are double
int numbands; // 1 if gray image, 2 if vector field, 3 if color image
//matrix(int k, int l);
matrix(int k, int l, int n = 1);
matrix(const matrix& a);
matrix();
~matrix();
double* operator[](int k);
double& operator()(int rowsize, int columnsize, int numbands = 0);
double& operator()(int k);
matrix& operator=(const matrix& y);
matrix& operator+=(const matrix& y);
matrix& operator-=(const matrix& y);
matrix& operator+=(double a);
matrix& operator-=(double a);
matrix& operator*=(double a);
matrix& operator/=(double a);
void pstr(const matrix& a, int k);
void pstc(const matrix& a, int k);
void resize(int k,int l, int n = 0);
void display(CString& message);
void display(char *fname);
void displayRGB(char *fname);
matrix read(char *fname, int xsize, int ysize);
void decimate(int factor);
void upsample(int factor);
void qdecimate(int shft);
void qupsample(int shft);
matrix extractBand(int band);
};
#endif // !defined(AFX_MATRIX_H__30B7D888_BB9B_11D2_9B76_204C4F4F5020__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -