mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-07-11 13:03:11 +08:00
47 lines
1.3 KiB
C++
47 lines
1.3 KiB
C++
#ifndef _SSCREEN_H
|
|
#define _SSCREEN_H
|
|
|
|
#include "STypes.h"
|
|
|
|
struct SScreenParams;
|
|
|
|
//-------------------------------------------------------------------------------------------------------------------------------
|
|
// SScreen
|
|
//-------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
class SScreen
|
|
{
|
|
public:
|
|
|
|
SScreen(SScreenParams *pParams);
|
|
SScreen(SScreen *pScreen);
|
|
~SScreen();
|
|
|
|
SScreen *Copy()
|
|
{
|
|
return new SScreen(this);
|
|
}
|
|
|
|
// Ñìîòðèì çíà÷åíèå ïèêñåëÿ â òî÷êå (nX, nY) (â ñåðîì öâåòå).
|
|
int GetGrayPixel(int nX, int nY, unsigned char unValue);
|
|
|
|
// Ôóíêöèÿ âîçâðàùàåò TRUE, åñëè çíà÷åíèå unValue ëèáî áîëüøå m_unMaxValue, ëèáî ìåíüøå m_unMinValue.
|
|
BOOL IsStatic(unsigned char unValue);
|
|
|
|
private:
|
|
|
|
void BuildDispersedMatrix(int nX, int nY, int nValue, int nDelta, int nOffset);
|
|
void BuildClusteredMatrix();
|
|
void BuildSCDMatrix(int nRadius);
|
|
int Distance(int nX0, int nY0, int nX1, int nY1);
|
|
|
|
private:
|
|
|
|
unsigned char *m_pMatrix; // Threshold matrix
|
|
int m_nSize; // Ðàçìåð Threshold matrix
|
|
unsigned char m_unMinValue; // Ëþáîé ïèêñåëü ñî çíà÷åíèåì ìåíüøå, ÷åì m_unMinValue ñ÷èòàåòñÿ ÷åðíûì
|
|
unsigned char m_unMaxValue; // Ëþáîé ïèêñåëü ñî çíà÷åíèåì áîëüøå, ÷åì m_unMaxValue ñ÷èòàåòñÿ áåëûì
|
|
};
|
|
|
|
#endif /* _SSCREEN_H */
|