summaryrefslogtreecommitdiff
path: root/base/gximdecode.h
blob: 42f53b8a7264bd34abb090415082a916afc9e9f4 (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
/* Copyright (C) 2014-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.
*/

/* Prototypes for decoding and unpacking image data.  Used for color
   monitoring in clist and for creating TIFF files for xpswrite device */

#ifndef gximdecode_h_INCLUDED
#define gximdecode_h_INCLUDED

#include "gx.h"
#include "gxfixed.h"
#include "gximage.h"
#include "gxsample.h"
#include "gxfrac.h"

typedef void(*applymap_t) (sample_map map[], const void *psrc, int spp,
    void *pdes, void *bufend);

/* Define the structure the image_enums can use for handling decoding */
typedef struct image_decode_s {
    int bps;
    int spp;
    SAMPLE_UNPACK_PROC((*unpack));
    int spread;
    sample_map map[GS_IMAGE_MAX_COMPONENTS];
    applymap_t applymap;
} image_decode_t;

void get_unpack_proc(gx_image_enum_common_t *pie, image_decode_t *imd,
    gs_image_format_t format, const float *decode);
void get_map(image_decode_t *imd, gs_image_format_t format, const float *decode);
void applymap16(sample_map map[], const void *psrc, int spp, void *pdes, void *bufend);
void applymap8(sample_map map[], const void *psrc, int spp, void *pdes, void *bufend);

#endif