SDC C-Project CF Review 프로그램
LYW
2021-07-01 597136832196f40e9d91dee12c3b9ca94a8fc7eb
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
#pragma once
 
struct SSharedImageInfo
{
    SSharedImageInfo() 
    {
        nUpdated            = 0;
        nSelected            = 0;
        nCameraIndex        = -1;    
        nImageIndex            = -1;    
 
        nDigitalZoom        = 0;
        dRulerGab            = 100;    
        dResolution            = 4.4;    
 
        nImageWidth            = 0;
        nImageWidthStep        = 0;    
        nImageHeight        = 0;    
        nImageChannels        = 0;        
    }
 
    int        nUpdated;
    int        nSelected;            
    int        nCameraIndex;        // 카메라 고유 번호
    int        nImageIndex;        // 이미지 고유 인덱스
    
    int        nDigitalZoom;        // Digital Zoom
    double    dRulerGab;            // Ruler 간격
    double    dResolution;        // 배율 인덱스
 
    int        nImageWidth;        // 영상 가로 크기
    int        nImageWidthStep;    // 영상 가로 크기 Step
    int        nImageHeight;        // 영상 세로 크기
    int        nImageChannels;        // 영상 세로 크기
};
 
class CSharedImageData
{
public:
    CSharedImageData(void);
    virtual ~CSharedImageData(void);
    BOOL CreateMemory(int nImageCount);
    void DeleteMemory();
 
    int GetImageCount()        { return m_nImageCount; }
    int GetUpdated(int nIndex);
    int GetSelected(int nIndex);
    BOOL LockImageData(int nIndex);
    BOOL UnlockImageData(int nIndex);
    const BYTE* GetImageData(int nIndex);
    const SSharedImageInfo* GetImageInfo(int nIndex);
    BOOL SetImageData(int nIndex, SSharedImageInfo *pImageInfo, BYTE* pImageData);
 
private:
    HANDLE                m_hAsignedMemory;
    CSemaphore**        m_pSMImageData;
 
    BYTE                *m_pSharedMemory;
    SSharedImageInfo    **m_pImageInfo;
    BYTE                **m_pImageData;
 
    int                    m_nImageCount;
    long                m_nImageInfoSize;
    long                m_nMaxImageSize;
};