summaryrefslogtreecommitdiff
path: root/DevIL/src-IL/include/il_pnm.h
blob: 4ac1d0f284c23c4fe33bc10418b377bf139adabb (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
51
52
53
54
55
56
57
//-----------------------------------------------------------------------------
//
// ImageLib Sources
// Copyright (C) 2000-2017 by Denton Woods
// Last modified: 05/25/2001 <--Y2K Compliant! =]
//
// Filename: src-IL/include/il_pnm.h
//
// Description: Reads/writes to/from pbm/pgm/ppm formats
//
//-----------------------------------------------------------------------------


#ifndef PPMPGM_H
#define PPMPGM_H

#include "il_internal.h"
#include <string>

using namespace std;


#define IL_PBM_ASCII	0x0001
#define IL_PGM_ASCII	0x0002
#define IL_PPM_ASCII	0x0003
#define IL_PBM_BINARY	0x0004
#define IL_PGM_BINARY	0x0005
#define IL_PPM_BINARY	0x0006
#define IL_PAM			0x0007

enum PamTuples { PAM_BW = 1, PAM_GRAY, PAM_RGB, PAM_BW_ALPHA, PAM_GRAY_ALPHA, PAM_RGB_ALPHA };

typedef struct PPMINFO
{
	ILenum	Type;
	ILuint	Width;
	ILuint	Height;
	ILuint	Depth;
	ILuint	MaxColour;
	ILubyte	Bpp;
	ILubyte	TuplType;
} PPMINFO;

ILboolean	iIsValidPnm(void);
ILboolean	iCheckPnm(char Header[2]);
ILboolean	iLoadPnmInternal(void);
ILboolean	iSavePnmInternal(void);
ILimage		*ilReadAsciiPpm(PPMINFO *Info);
ILimage		*ilReadBinaryPpm(PPMINFO *Info);
ILimage		*ilReadBitPbm(PPMINFO *Info);
ILboolean	ilReadPam(void);
ILboolean	iGetWord(ILboolean);
void		PbmMaximize(ILimage *Image);
ILint		DecodeTupleType(string &TupleStr);


#endif//PPMPGM_H