Welcome to mirror list, hosted at ThFree Co, Russian Federation.

frame_accessor.h « intern « libmv « intern - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 39a3bc5eb1d1265a1b07be004432ed930b4eea20 (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
/*
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software Foundation,
 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 *
 * The Original Code is Copyright (C) 2014 Blender Foundation.
 * All rights reserved.
 */

#ifndef LIBMV_C_API_FRAME_ACCESSOR_H_
#define LIBMV_C_API_FRAME_ACCESSOR_H_

#include <stdint.h>

#include "intern/image.h"
#include "intern/region.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef struct libmv_FrameAccessor libmv_FrameAccessor;
typedef struct libmv_FrameTransform libmv_FrameTransform;
typedef struct libmv_FrameAccessorUserData libmv_FrameAccessorUserData;
typedef void* libmv_CacheKey;

typedef enum {
  LIBMV_IMAGE_MODE_MONO,
  LIBMV_IMAGE_MODE_RGBA,
} libmv_InputMode;

typedef libmv_CacheKey (*libmv_GetImageCallback)(
    libmv_FrameAccessorUserData* user_data,
    int clip,
    int frame,
    libmv_InputMode input_mode,
    int downscale,
    const libmv_Region* region,
    const libmv_FrameTransform* transform,
    float** destination,
    int* width,
    int* height,
    int* channels);

typedef void (*libmv_ReleaseImageCallback)(libmv_CacheKey cache_key);

typedef libmv_CacheKey (*libmv_GetMaskForTrackCallback)(
    libmv_FrameAccessorUserData* user_data,
    int clip,
    int frame,
    int track,
    const libmv_Region* region,
    float** destination,
    int* width,
    int* height);
typedef void (*libmv_ReleaseMaskCallback)(libmv_CacheKey cache_key);

libmv_FrameAccessor* libmv_FrameAccessorNew(
    libmv_FrameAccessorUserData* user_data,
    libmv_GetImageCallback get_image_callback,
    libmv_ReleaseImageCallback release_image_callback,
    libmv_GetMaskForTrackCallback get_mask_for_track_callback,
    libmv_ReleaseMaskCallback release_mask_callback);
void libmv_FrameAccessorDestroy(libmv_FrameAccessor* frame_accessor);

int64_t libmv_frameAccessorgetTransformKey(
    const libmv_FrameTransform* transform);

void libmv_frameAccessorgetTransformRun(const libmv_FrameTransform* transform,
                                        const libmv_FloatImage* input_image,
                                        libmv_FloatImage* output_image);
#ifdef __cplusplus
}
#endif

#endif  // LIBMV_C_API_FRAME_ACCESSOR_H_