about summary refs log tree commit diff
path: root/lib/colorname.h
blob: 492df9519cc170798f079e95258b84cfea7d6db3 (plain) (blame)
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
#ifndef COLORNAME_H
#define COLORNAME_H

#include <string.h>
#include <stdio.h>
#include <netpbm/ppm.h>
#include <netpbm/pam.h>

#ifdef __cplusplus
extern "C" {
#endif
#if 0
} /* to fake out automatic code indenters */
#endif

enum colornameFormat {PAM_COLORNAME_ENGLISH = 0,
                      PAM_COLORNAME_HEXOK   = 1};

#define PAM_COLORFILE_MAXVAL 255

struct colorfile_entry {
    long r, g, b;
        /* Red, green, and blue components of color based on maxval
           PAM_COLORFILE_MAXVAL
        */
    char * colorname;
};



void
pm_canonstr(char * const str);

FILE *
pm_openColornameFile(const char * const fileName, const int must_open);

struct colorfile_entry
pm_colorget(FILE * const f);

void
pm_parse_dictionary_namen(char   const colorname[],
                          tuplen const color);

void
pm_parse_dictionary_name(const char       colorname[],
                         pixval     const maxval,
                         int        const closeOk,
                         pixel *    const colorP);

#ifdef __cplusplus
}
#endif
#endif