summaryrefslogtreecommitdiff
path: root/base/claptrap.h
blob: 5b2b7a9f5d75bf7ef5c4bee1fa033e3bf1ec84b0 (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
/* Copyright (C) 2015-2023 Artifex Software, Inc.
   All Rights Reserved.

   This software is provided AS-IS with no warranty, either express or
   implied.

   This software is distributed under license and may not be copied,
   modified or distributed except as expressly authorized under the terms
   of the license contained in the file LICENSE in this distribution.

   Refer to licensing information at http://www.artifex.com or contact
   Artifex Software, Inc.,  39 Mesa Street, Suite 108A, San Francisco,
   CA 94129, USA, for further information.
*/

#ifndef CLAPTRAP_H
#define CLAPTRAP_H

#include "std.h"
#include "stdpre.h"
#include "gsmemory.h"

#ifndef inline
#define inline __inline
#endif /* inline */

typedef struct ClapTrap ClapTrap;

typedef int (ClapTrap_LineFn)(void *arg, unsigned char *buf);

ClapTrap *ClapTrap_Init(gs_memory_t     *mem,
                        int              width,
                        int              height,
                        int              num_comps,
                        const int       *comp_order,
                        int              max_x_offset,
                        int              max_y_offset,
                        ClapTrap_LineFn *get_line,
                        void            *get_line_arg);

void ClapTrap_Fin(gs_memory_t *mem,
                  ClapTrap *trapper);

int ClapTrap_GetLine(ClapTrap      * gs_restrict trapper,
                     unsigned char * gs_restrict buffer);

int ClapTrap_GetLinePlanar(ClapTrap       * gs_restrict trapper,
                           unsigned char ** gs_restrict buffer);

#endif /* CLAPTRAP_H */