summaryrefslogtreecommitdiff
path: root/DevIL/src-ILU/src/ilu_states.cpp
blob: 4d11ef0ac67a55f34df55a8d30e1170fa55d04fa (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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//-----------------------------------------------------------------------------
//
// ImageLib Utility Sources
// Copyright (C) 2000-2009 by Denton Woods
// Last modified: 03/07/2009
//
// Filename: src-ILU/src/ilu_states.c
//
// Description: The state machine
//
//-----------------------------------------------------------------------------


#include "ilu_internal.h"
#include "ilu_states.h"


ILconst_string _iluVendor	= IL_TEXT("Abysmal Software");
ILconst_string _iluVersion	= IL_TEXT("Developer's Image Library Utilities (ILU) 1.7.8");// IL_TEXT(__DATE__));


ILstring ILAPIENTRY iluGetString(ILenum StringName)
{
	switch (StringName)
	{
		case ILU_VENDOR:
			return (ILstring)_iluVendor;
		//changed 2003-09-04
		case ILU_VERSION_NUM:
			return (ILstring)_iluVersion;
		default:
			ilSetError(ILU_INVALID_PARAM);
			break;
	}
	return NULL;
}


void ILAPIENTRY iluGetIntegerv(ILenum Mode, ILint *Param)
{
	switch (Mode)
	{
		case ILU_VERSION_NUM:
			*Param = ILU_VERSION;
			break;

		case ILU_FILTER:
			*Param = iluFilter;
			break;

		default:
			ilSetError(ILU_INVALID_ENUM);
	}
	return;
}


ILint ILAPIENTRY iluGetInteger(ILenum Mode)
{
	ILint Temp;
	Temp = 0;
	iluGetIntegerv(Mode, &Temp);
	return Temp;
}


ILenum iluFilter = ILU_NEAREST;
ILenum iluPlacement = ILU_CENTER;

void ILAPIENTRY iluImageParameter(ILenum PName, ILenum Param)
{
	switch (PName)
	{
		case ILU_FILTER:
			switch (Param)
			{
				case ILU_NEAREST:
				case ILU_LINEAR:
				case ILU_BILINEAR:
				case ILU_SCALE_BOX:
				case ILU_SCALE_TRIANGLE:
				case ILU_SCALE_BELL:
				case ILU_SCALE_BSPLINE:
				case ILU_SCALE_LANCZOS3:
				case ILU_SCALE_MITCHELL:
					iluFilter = Param;
					break;
				default:
					ilSetError(ILU_INVALID_ENUM);
					return;
			}
			break;

		case ILU_PLACEMENT:
			switch (Param)
			{
				case ILU_LOWER_LEFT:
				case ILU_LOWER_RIGHT:
				case ILU_UPPER_LEFT:
				case ILU_UPPER_RIGHT:
				case ILU_CENTER:
					iluPlacement = Param;
					break;
				default:
					ilSetError(ILU_INVALID_ENUM);
					return;
			}
			break;

		default:
			ilSetError(ILU_INVALID_ENUM);
			return;
	}
	return;
}