1/*******************************************************************
2 * morpho_hdr_checker.h
3 * [CP932/CRLF] { �� ��������������p }
4 *------------------------------------------------------------------
5 * Copyright (C) 2011-2012 Morpho,Inc.
6 *******************************************************************/
7
8#ifndef MORPHO_HDR_CHECKER_H
9#define MORPHO_HDR_CHECKER_H
10
11/*******************************************************************/
12
13#include "morpho_api.h"
14#include "morpho_error.h"
15#include "morpho_image_data.h"
16
17/*******************************************************************/
18
19#define MORPHO_HDR_CHECKER_VER "Morpho DR Checker Ver.1.1.0 2012/1/17"
20
21/*-----------------------------------------------------------------*/
22
23#define MORPHO_HDR_CHECKER_MIN_IMAGE_WIDTH     2
24#define MORPHO_HDR_CHECKER_MAX_IMAGE_WIDTH  8192
25#define MORPHO_HDR_CHECKER_MIN_IMAGE_HEIGHT    2
26#define MORPHO_HDR_CHECKER_MAX_IMAGE_HEIGHT 8192
27
28/*******************************************************************/
29
30typedef struct _morpho_HDRChecker morpho_HDRChecker;
31
32/* HDR�w�W�]���� */
33struct _morpho_HDRChecker
34{
35    void *p; /**< �����\���̂ւ̃|�C���^ */
36};
37
38/* ����сE���Ԃꔻ��̕q���x */
39typedef enum {
40    MORPHO_HDR_CHECKER_SENSITIVITY_SENSITIVE,
41    MORPHO_HDR_CHECKER_SENSITIVITY_NORMAL,
42    MORPHO_HDR_CHECKER_SENSITIVITY_INSENSITIVE,
43} MORPHO_HDR_CHECKER_SENSITIVITY;
44
45/*******************************************************************/
46
47#ifdef __cplusplus
48extern "C" {
49#endif
50
51/**
52 * �o�[�W������������擾
53 *
54 * @return �o�[�W����������(MORPHO_EASY_HDR_VER)
55 */
56MORPHO_API(const char*)
57morpho_HDRChecker_getVersion(void);
58
59/**
60 * �K�v�ȃ������T�C�Y���擾
61 *
62 * @param[in] width  ��͉摜�̕�
63 * @param[in] height ��͉摜�̍���
64 * @param[in] format ��͉摜�̃t�H�[�}�b�g
65 * @return �K�v�ȃ������T�C�Y(byte)
66 */
67MORPHO_API(int)
68morpho_HDRChecker_getBufferSize(
69    int width,
70    int height,
71    const char *format);
72
73/**
74 * ����
75 *
76 * @param[in,out] p           HDRChecker�C���X�^���X
77 * @param[in]     buffer      HDRChecker�Ɋ��蓖�Ă郁�����ւ̃|�C���^
78 * @param[in]     buffer_size HDRChecker�Ɋ��蓖�Ă郁�����̃T�C�Y
79 * @param[in]     width       ��͉摜�̕�
80 * @param[in]     height      ��͉摜�̍���
81 * @param[in]     format      ��͉摜�̃t�H�[�}�b�g
82 * @return �G���[�R�[�h (see morpho_error.h)
83 */
84MORPHO_API(int)
85morpho_HDRChecker_initialize(
86    morpho_HDRChecker * const p,
87    void * const buffer,
88    const int buffer_size,
89    const int width,
90    const int height,
91    const char *format);
92
93/**
94 * �N���[���A�b�v
95 * initialize()���s��Ɏ��s�\
96 *
97 * @param[in,out] p HDRChecker�C���X�^���X
98 * @return �G���[�R�[�h (see morpho_error.h)
99 */
100MORPHO_API(int)
101morpho_HDRChecker_finalize(
102    morpho_HDRChecker *p);
103
104/*-----------------------------------------------------------------*/
105
106/**
107 * HDR�w�W�v�Z�̕q�����̐ݒ�
108 * initialize()���s��Ɏ��s�\
109 *
110 * @param[in,out] p           HDRChecker�C���X�^���X
111 * @param[in]     sensitivity �q����(MORPHO_HDR_CHECKER_SENSITIVIY���̂Ŏw��)
112 * @return �G���[�R�[�h (see morpho_error.h)
113 */
114MORPHO_API(int)
115morpho_HDRChecker_setSensitivity(
116    morpho_HDRChecker * const p,
117    MORPHO_HDR_CHECKER_SENSITIVITY sensitivity);
118
119/**
120 * HDR�w�W�v�Z�̕q�����̎擾
121 * initialize()���s��Ɏ��s�\
122 *
123 * @param[in,out] p           HDRChecker�C���X�^���X
124 * @param[out]    sensitivity �q�����ւ̃|�C���^
125 * @return �G���[�R�[�h (see morpho_error.h)
126 */
127MORPHO_API(int)
128morpho_HDRChecker_getSensitivity(
129    morpho_HDRChecker * const p,
130    MORPHO_HDR_CHECKER_SENSITIVITY *sensitivity);
131
132/**
133 * HDR�w�W�̕]��
134 * initialize()���s��Ɏ��s�\
135 *
136 * @param[in,out] p      HDRChecker�C���X�^���X
137 * @param[out]    result �]�����ʂ��i�[����z��(�v�f��4�̔z��)
138 *                       �v�f����[���̏ꍇ�ɑΉ����鉺�L�̘I�o�̉摜���K�v�Ɣ���
139 *                       {+2, +1, -1, -2}�̏��ɔ��茋�ʂ��i�[�����
140 * @param[in]     input_image ��͉摜
141 * @return �G���[�R�[�h (see morpho_error.h)
142 */
143MORPHO_API(int)
144morpho_HDRChecker_evaluate(
145    morpho_HDRChecker * const p,
146    int * const result,
147    const morpho_ImageData * const input_image);
148
149/*-----------------------------------------------------------------*/
150
151#ifdef __cplusplus
152}
153#endif
154
155#endif /* MORPHO_HDR_CHECKER_H */
156