-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimgio.h
More file actions
36 lines (27 loc) · 824 Bytes
/
imgio.h
File metadata and controls
36 lines (27 loc) · 824 Bytes
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
#ifndef IMGIO_H
#define IMGIO_H
#include <stdio.h>
#include <SDL.h>
#include <cairo.h>
#include "pytj.h"
typedef struct {
unsigned char *buf;
unsigned char *jpeg_buf;
int jpeg_length;
unsigned char *yuv_buf;
int yuv_len;
int width, height, subsamp;
double timestamp;
cairo_surface_t *surf;
cairo_t *ctx;
} Image;
Image *clone_image(const Image *image);
void free_image(Image *image);
Image *read_jpeg_frame(TJContext *ctx, FILE *fin);
Image *read_frame(TJContext *ctx, FILE *fin);
Image *read_frame_to_yuv(TJContext *ctx, FILE *fin);
int write_jpeg_frame(TJContext *ctx, FILE *fout, Image *image);
int write_frame(TJContext *ctx, FILE *fout, Image *image);
void get_cairo_context(Image *image);
void copy_yuv_to_planes(const Image *image, Uint16 *pitches, Uint8 **pixels, int swap_chroma);
#endif