summaryrefslogtreecommitdiff
path: root/camera/hdr/include/morpho_hdr_checker.h
blob: 662cfc1b4e32e321cb1e41a58346e5eaabff00df (plain)
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
/*******************************************************************
 * morpho_hdr_checker.h
 * [CP932/CRLF] { �� ������������������p }
 *------------------------------------------------------------------
 * Copyright (C) 2011-2012 Morpho,Inc.
 *******************************************************************/

#ifndef MORPHO_HDR_CHECKER_H
#define MORPHO_HDR_CHECKER_H

/*******************************************************************/

#include "morpho_api.h"
#include "morpho_error.h"
#include "morpho_image_data.h"

/*******************************************************************/

#define MORPHO_HDR_CHECKER_VER "Morpho DR Checker Ver.1.1.0 2012/1/17"

/*-----------------------------------------------------------------*/

#define MORPHO_HDR_CHECKER_MIN_IMAGE_WIDTH     2
#define MORPHO_HDR_CHECKER_MAX_IMAGE_WIDTH  8192
#define MORPHO_HDR_CHECKER_MIN_IMAGE_HEIGHT    2
#define MORPHO_HDR_CHECKER_MAX_IMAGE_HEIGHT 8192

/*******************************************************************/

typedef struct _morpho_HDRChecker morpho_HDRChecker;

/* HDR�w�W�]���� */
struct _morpho_HDRChecker
{
    void *p; /**< �����\���̂ւ̃|�C���^ */
};

/* ����сE���‚Ԃꔻ��̕q���x */
typedef enum {
    MORPHO_HDR_CHECKER_SENSITIVITY_SENSITIVE,
    MORPHO_HDR_CHECKER_SENSITIVITY_NORMAL,
    MORPHO_HDR_CHECKER_SENSITIVITY_INSENSITIVE,
} MORPHO_HDR_CHECKER_SENSITIVITY;

/*******************************************************************/

#ifdef __cplusplus
extern "C" {
#endif

/**
 * �o�[�W������������擾
 *
 * @return �o�[�W����������(MORPHO_EASY_HDR_VER)
 */
MORPHO_API(const char*)
morpho_HDRChecker_getVersion(void);

/**
 * �K�v�ȃ������T�C�Y���擾
 *
 * @param[in] width  ���͉摜�̕�
 * @param[in] height ���͉摜�̍���
 * @param[in] format ���͉摜�̃t�H�[�}�b�g
 * @return �K�v�ȃ������T�C�Y(byte)
 */
MORPHO_API(int)
morpho_HDRChecker_getBufferSize(
    int width,
    int height,
    const char *format);

/**
 * ������
 *
 * @param[in,out] p           HDRChecker�C���X�^���X
 * @param[in]     buffer      HDRChecker�Ɋ��蓖�Ă郁�����ւ̃|�C���^
 * @param[in]     buffer_size HDRChecker�Ɋ��蓖�Ă郁�����̃T�C�Y
 * @param[in]     width       ���͉摜�̕�
 * @param[in]     height      ���͉摜�̍���
 * @param[in]     format      ���͉摜�̃t�H�[�}�b�g
 * @return �G���[�R�[�h (see morpho_error.h)
 */
MORPHO_API(int)
morpho_HDRChecker_initialize(
    morpho_HDRChecker * const p,
    void * const buffer,
    const int buffer_size,
    const int width,
    const int height,
    const char *format);

/**
 * �N���[���A�b�v
 * initialize()���s��Ɏ��s�”\
 *
 * @param[in,out] p HDRChecker�C���X�^���X
 * @return �G���[�R�[�h (see morpho_error.h)
 */
MORPHO_API(int)
morpho_HDRChecker_finalize(
    morpho_HDRChecker *p);

/*-----------------------------------------------------------------*/

/**
 * HDR�w�W�v�Z�̕q�����̐ݒ�
 * initialize()���s��Ɏ��s�”\
 *
 * @param[in,out] p           HDRChecker�C���X�^���X
 * @param[in]     sensitivity �q����(MORPHO_HDR_CHECKER_SENSITIVIY�񋓑̂Ŏw��)
 * @return �G���[�R�[�h (see morpho_error.h)
 */
MORPHO_API(int)
morpho_HDRChecker_setSensitivity(
    morpho_HDRChecker * const p,
    MORPHO_HDR_CHECKER_SENSITIVITY sensitivity);

/**
 * HDR�w�W�v�Z�̕q�����̎擾
 * initialize()���s��Ɏ��s�”\
 *
 * @param[in,out] p           HDRChecker�C���X�^���X
 * @param[out]    sensitivity �q�����ւ̃|�C���^
 * @return �G���[�R�[�h (see morpho_error.h)
 */
MORPHO_API(int)
morpho_HDRChecker_getSensitivity(
    morpho_HDRChecker * const p,
    MORPHO_HDR_CHECKER_SENSITIVITY *sensitivity);

/**
 * HDR�w�W�̕]��
 * initialize()���s��Ɏ��s�”\
 *
 * @param[in,out] p      HDRChecker�C���X�^���X
 * @param[out]    result �]�����ʂ��i�[����z��(�v�f��4�̔z��)
 *                       �v�f����[���̏ꍇ�ɑΉ����鉺�L�̘I�o�̉摜���K�v�Ɣ���
 *                       {+2, +1, -1, -2}�̏��ɔ��茋�ʂ��i�[�����
 * @param[in]     input_image ���͉摜
 * @return �G���[�R�[�h (see morpho_error.h)
 */
MORPHO_API(int)
morpho_HDRChecker_evaluate(
    morpho_HDRChecker * const p,
    int * const result,
    const morpho_ImageData * const input_image);

/*-----------------------------------------------------------------*/

#ifdef __cplusplus
}
#endif

#endif /* MORPHO_HDR_CHECKER_H */