/normxcorr/trunk

To get this branch, use:
bzr branch http://suren.me/webbzr/normxcorr/trunk

« back to all changes in this revision

Viewing changes to dict_hw/src/dict_hw.h

  • Committer: Suren A. Chilingaryan
  • Date: 2009-12-12 01:38:41 UTC
  • Revision ID: csa@dside.dyndns.org-20091212013841-feih3qa4i28x75j4
Provide stand-alone library

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef _DICT_HW_H
 
2
#define _DICT_HW_H
 
3
 
 
4
typedef struct STProcessingState *DICTContext;
 
5
 
 
6
# ifdef __cplusplus
 
7
extern "C" {
 
8
# endif
 
9
 
 
10
enum DICTErrors {
 
11
    DICT_ERROR_CUFFT = 1,
 
12
    DICT_ERROR_CUDA_MALLOC = 2,
 
13
    DICT_ERROR_MALLOC = 3,
 
14
    DICT_ERROR_CUDPP = 4
 
15
};
 
16
 
 
17
enum DICTFlags {
 
18
    DICT_FLAGS_DEFAULT = 0,
 
19
    DICT_FLAGS_FIXED_FFT_SIZE = 1
 
20
};
 
21
 
 
22
 
 
23
/**
 
24
 * Detect supported hardware devices
 
25
 *
 
26
 * @return the number of supported hardware devices, 0 - if all detected devices
 
27
 * does not meet minimal requirements, and -1 if no devices are detected.
 
28
 */
 
29
int dictDetectHardware();
 
30
 
 
31
DICTContext dictCreateContext();
 
32
void dictDestroyContext(DICTContext ctx);
 
33
 
 
34
/**
 
35
 * Initializes context with given configuration
 
36
 *
 
37
 * @param ncp is a number of control points
 
38
 * @param corrsize is a radius of correlation area (15)
 
39
 * @param precision defines number of signifcant digits after decimal point (1000)
 
40
 * @return 0 or error code
 
41
 */
 
42
int dictSetup(DICTContext ctx, int ncp, int corrsize, int precision, DICTFlags flags);
 
43
int dictSetDimensions(DICTContext ps, int width, int height);
 
44
 
 
45
int dictSetTemplatePoints(DICTContext ctx, const float *points_x, const float *points_y);
 
46
int dictSetCurrentPoints(DICTContext ctx, const float *points_x, const float *points_y);
 
47
int dictGetCurrentPoints(DICTContext ctx, float *points_x, float *points_y);
 
48
 
 
49
int dictLoadTemplateImage(DICTContext ctx, const unsigned char *img, int width, int height);
 
50
int dictLoadTemplateFragment(DICTContext ctx, int icp, int ncp, const unsigned char *img);
 
51
//int dictLoadTemplateImageFile(DICTContext ctx, const char *name);
 
52
 
 
53
int dictLoadImage(DICTContext ctx, unsigned char *img);
 
54
int dictLoadFragment(DICTContext ctx, int icp, int ncp, const unsigned char *image);
 
55
//int dictLoadImageFile(DICTContext ctx, const char *name);
 
56
 
 
57
int dictSetPointsBuffer(DICTContext ps, float *point_x, float *point_y);
 
58
int dictCompute(DICTContext ctx);
 
59
int dictProcessImage(DICTContext ctx, unsigned char *img);
 
60
//int dictProcessImageFile(DICTContext ctx, const char *name);
 
61
 
 
62
 
 
63
    // Internal use only, this functions could be revised
 
64
int dictGetCorrelations(DICTContext ps, int icp, float *res);
 
65
int dictGetCorrections(DICTContext ps, float *res_x, float *res_y);
 
66
int dictGetLocalSum(DICTContext ps, int icp, float *lsum, float *denom);
 
67
 
 
68
typedef void (*DICTLogger)(const char *msg, ...);
 
69
int dictSetLogger(DICTLogger error_reporter, DICTLogger message_writer);
 
70
 
 
71
# ifdef __cplusplus
 
72
}
 
73
# endif
 
74
 
 
75
#endif /* _DICT_HW_H */