1
/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
3
Copyright (C) 2009 Red Hat, Inc.
5
This library is free software; you can redistribute it and/or
6
modify it under the terms of the GNU Lesser General Public
7
License as published by the Free Software Foundation; either
8
version 2.1 of the License, or (at your option) any later version.
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Lesser General Public License for more details.
15
You should have received a copy of the GNU Lesser General Public
16
License along with this library; if not, see <http://www.gnu.org/licenses/>.
22
#include <spice/macros.h>
23
#include "quic_config.h"
29
QUIC_IMAGE_TYPE_INVALID,
31
QUIC_IMAGE_TYPE_RGB16,
32
QUIC_IMAGE_TYPE_RGB24,
33
QUIC_IMAGE_TYPE_RGB32,
40
typedef void *QuicContext;
42
typedef struct QuicUsrContext QuicUsrContext;
43
struct QuicUsrContext {
44
SPICE_ATTR_PRINTF(2, 3) void (*error)(QuicUsrContext *usr, const char *fmt, ...);
45
SPICE_ATTR_PRINTF(2, 3) void (*warn)(QuicUsrContext *usr, const char *fmt, ...);
46
SPICE_ATTR_PRINTF(2, 3) void (*info)(QuicUsrContext *usr, const char *fmt, ...);
47
void *(*malloc)(QuicUsrContext *usr, int size);
48
void (*free)(QuicUsrContext *usr, void *ptr);
49
int (*more_space)(QuicUsrContext *usr, uint32_t **io_ptr, int rows_completed);
50
int (*more_lines)(QuicUsrContext *usr, uint8_t **lines); // on return the last line of previous
51
// lines bunch must still be valid
54
int quic_encode(QuicContext *quic, QuicImageType type, int width, int height,
55
uint8_t *lines, unsigned int num_lines, int stride,
56
uint32_t *io_ptr, unsigned int num_io_words);
58
int quic_decode_begin(QuicContext *quic, uint32_t *io_ptr, unsigned int num_io_words,
59
QuicImageType *type, int *width, int *height);
60
int quic_decode(QuicContext *quic, QuicImageType type, uint8_t *buf, int stride);
63
QuicContext *quic_create(QuicUsrContext *usr);
64
void quic_destroy(QuicContext *quic);