mrDarker
2025-08-13 5cc675212e96d87ebbf00f4fd7a8106b06a490ff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include "StdAfx.h"
#include "PixelStorage.h"
 
 
 
CPixelStorage::CPixelStorage()
{
    m_nPixelSpace= m_maxPixel= m_nPixel= 0;
    m_pPixelX= NULL;
}
CPixelStorage::~CPixelStorage()
{
    if(m_pPixelX)
        delete[] m_pPixelX;
}
 
void CPixelStorage::ResetPixelStorage()
{
    m_nPixel= 0;
}
void CPixelStorage::SetConvParam(CConvParam *pParam)
{
    m_Param= *pParam;
}
 
 
int    CPixelStorage::InitPixelStorage(int maxPixel)
{
    if(maxPixel <= m_nPixelSpace)
    {
        m_maxPixel= maxPixel;
        return m_maxPixel;
    }
 
    if(m_pPixelX != NULL)
    {
        delete[] m_pPixelX;
    }
 
    // 16°³ÀÇ ¿©ºÐÀ» µÐ´Ù..¿Ö? ³»¸É..
    int    PixelSapce= maxPixel+ 16;
    m_pPixelX= new int[PixelSapce*8];
 
    if(m_pPixelX == NULL)
    {
        m_maxPixel= m_nPixelSpace= 0;
        return m_maxPixel;
    }
 
    m_pPixelY= m_pPixelX+ PixelSapce;
    m_pPixelType= (short*)(m_pPixelX+ PixelSapce*2);
    m_pPixelValue= (short*)(m_pPixelX+ PixelSapce*3);
 
    m_pGraySrc= m_pPixelX+ PixelSapce*4;
    m_pGrayCmp= m_pPixelX+ PixelSapce*5;
    m_pZoneID= m_pPixelX+ PixelSapce*6;
    m_pZoneTh= m_pPixelX+ PixelSapce*7;
 
    m_maxPixel= m_nPixelSpace= maxPixel;
 
    for(int i= 0; i < m_maxPixel; i++)
    {
        m_pZoneID[i]= 0;
        m_pZoneTh[i]= 0;
    }
 
    return m_maxPixel;
}
 
 
/*
int    CPixelStorage::GetPixelX(int i)
{
    if(i< 0 || i >= m_nPixel)    return -1;
    return m_pPixelX[i];
}
int CPixelStorage::GetPixelY(int i)
{
    if(i< 0 || i >= m_nPixel) return -1;
    return m_pPixelY[i];
}
int CPixelStorage::GetPixelValue(int i)
{
    if(i< 0 || i >= m_nPixel) return -1;
    return m_pPixelValue[i];
}
int CPixelStorage::GetPixelType(int i)
{
    if(i< 0 || i >= m_nPixel) return -1;
    return m_pPixelType[i];
}
*/