summaryrefslogtreecommitdiffstats
path: root/debian/transcode/transcode-1.1.7/libtcvideo/tcvideo.h
blob: dcfd01c833df355aad3eef6e8645d8aa1cc4e965 (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
/*
 * tcvideo.h - include file for video processing library for transcode
 * Written by Andrew Church <achurch@achurch.org>
 *
 * This file is part of transcode, a video stream processing tool.
 * transcode is free software, distributable under the terms of the GNU
 * General Public License (version 2 or later).  See the file COPYING
 * for details.
 */

#ifndef LIBTCVIDEO_TCVIDEO_H
#define LIBTCVIDEO_TCVIDEO_H

#ifdef HAVE_CONFIG_H
# include "config.h"
#endif

#include <stdint.h>

#include "aclib/imgconvert.h"

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

/* Handle for calling tcvideo functions, allocated by tcv_init() and passed
 * to all other functions to hold internal state information.  Opaque to
 * the caller. */
typedef struct tcvhandle_ *TCVHandle;

/* Modes for tcv_deinterlace(): */
typedef enum {
    TCV_DEINTERLACE_DROP_FIELD_TOP,
    TCV_DEINTERLACE_DROP_FIELD_BOTTOM,
    TCV_DEINTERLACE_INTERPOLATE,
    TCV_DEINTERLACE_LINEAR_BLEND,
} TCVDeinterlaceMode;

/* Filter IDs for tcv_zoom(): */
typedef enum {
    TCV_ZOOM_DEFAULT = 0, /* alias for an existing following id */
    TCV_ZOOM_HERMITE = 1,
    TCV_ZOOM_BOX,
    TCV_ZOOM_TRIANGLE,
    TCV_ZOOM_BELL,
    TCV_ZOOM_B_SPLINE,
    TCV_ZOOM_LANCZOS3,
    TCV_ZOOM_MITCHELL,
    TCV_ZOOM_CUBIC_KEYS4,
    TCV_ZOOM_SINC8,
    TCV_ZOOM_NULL, /* this one MUST be the last one */
} TCVZoomFilter;

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

TCVHandle tcv_init(void);

void tcv_free(TCVHandle handle);

int tcv_clip(TCVHandle handle,
             uint8_t *src, uint8_t *dest, int width, int height, int Bpp,
             int clip_left, int clip_right, int clip_top, int clip_bottom,
             uint8_t black_pixel);

int tcv_deinterlace(TCVHandle handle,
                    uint8_t *src, uint8_t *dest, int width, int height,
                    int Bpp, TCVDeinterlaceMode mode);

int tcv_resize(TCVHandle handle,
               uint8_t *src, uint8_t *dest, int width, int height, int Bpp,
               int resize_w, int resize_h, int scale_w, int scale_h);

int tcv_zoom(TCVHandle handle,
             uint8_t *src, uint8_t *dest, int width, int height, int Bpp,
             int new_w, int new_h, TCVZoomFilter filter);

int tcv_reduce(TCVHandle handle,
               uint8_t *src, uint8_t *dest, int width, int height, int Bpp,
               int reduce_w, int reduce_h);

int tcv_flip_v(TCVHandle handle,
               uint8_t *src, uint8_t *dest, int width, int height, int Bpp);

int tcv_flip_h(TCVHandle handle,
               uint8_t *src, uint8_t *dest, int width, int height, int Bpp);

int tcv_gamma_correct(TCVHandle handle,
                      uint8_t *src, uint8_t *dest, int width, int height,
                      int Bpp, double gamma);

int tcv_antialias(TCVHandle handle,
                  uint8_t *src, uint8_t *dest, int width, int height,
                  int Bpp, double weight, double bias);

int tcv_convert(TCVHandle handle, uint8_t *src, uint8_t *dest, int width,
                int height, ImageFormat srcfmt, ImageFormat destfmt);

const char *tcv_zoom_filter_to_string(TCVZoomFilter filter);

TCVZoomFilter tcv_zoom_filter_from_string(const char *name);

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

#endif  /* LIBTCVIDEO_TCVIDEO_H */

/*
 * Local variables:
 *   c-file-style: "stroustrup"
 *   c-file-offsets: ((case-label . *) (statement-case-intro . *))
 *   indent-tabs-mode: nil
 * End:
 *
 * vim: expandtab shiftwidth=4:
 */