Files
addr2line
adler
adler32
ahash
aho_corasick
angle
approx
backtrace
bitflags
blender
bytemuck
byteorder
case
cast_trait
cfg_if
chrono
color
color_quant
const_fn
crc32fast
crossbeam
crossbeam_channel
crossbeam_deque
crossbeam_epoch
crossbeam_queue
crossbeam_skiplist
crossbeam_utils
darling
darling_core
darling_macro
dds
deflate
densevec
derive_builder
derive_builder_core
dot
downcast_rs
dual_quat
either
erased_serde
failure
failure_derive
fixedbitset
float_cmp
fnv
freeimage
freeimage_sys
freetype
freetype_gl_sys
freetype_sys
freetypegl
futures
futures_channel
futures_core
futures_executor
futures_io
futures_macro
futures_sink
futures_task
futures_util
async_await
future
io
lock
sink
stream
task
fxhash
generational_arena
generic_array
getrandom
gif
gimli
glfw
glfw_sys
glin
glin_derive
glsl
half
harfbuzz
harfbuzz_ft_sys
harfbuzz_sys
hashbrown
human_sort
ident_case
image
indexmap
instant
itertools
itoa
jpeg_decoder
lazy_static
libc
libm
lock_api
log
lut_parser
matrixmultiply
memchr
memoffset
meshopt
miniz_oxide
monotonic_clock
mopa
mutiny_derive
na
nalgebra
base
geometry
linalg
ncollide3d
bounding_volume
interpolation
partitioning
pipeline
procedural
query
algorithms
closest_points
contact
distance
nonlinear_time_of_impact
point
proximity
ray
time_of_impact
visitors
shape
transformation
utils
nom
num_complex
num_cpus
num_integer
num_iter
num_rational
num_traits
numext_constructor
numext_fixed_uint
numext_fixed_uint_core
numext_fixed_uint_hack
object
once_cell
parking_lot
parking_lot_core
pathfinding
pennereq
petgraph
pin_project_lite
pin_utils
png
polygon2
ppv_lite86
proc_macro2
proc_macro_crate
proc_macro_hack
proc_macro_nested
quote
rand
rand_chacha
rand_core
rand_distr
raw_window_handle
rawpointer
rayon
rayon_core
rect_packer
regex
regex_syntax
retain_mut
rin
rin_app
rin_blender
rin_core
rin_gl
rin_graphics
rin_gui
rin_material
rin_math
rin_postpo
rin_scene
rin_util
rin_window
rinblender
rinecs
rinecs_derive
rinecs_derive_utils
ringui_derive
rustc_demangle
rusty_pool
ryu
scopeguard
seitan
seitan_derive
semver
semver_parser
serde
serde_derive
serde_json
shaderdata_derive
simba
slab
slice_of_array
slotmap
smallvec
std140_data
streaming_iterator
strsim
syn
synstructure
thiserror
thiserror_impl
thread_local
tiff
time
toml
typenum
unchecked_unwrap
unicode_xid
vec2
vec3
weezl
x11
zlib_sys
  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
use std::mem;
use crate::ffi;

#[repr(C)]
#[derive(Eq,PartialEq,Clone,Copy,Debug)]
pub enum Format {
	UNKNOWN	= -1,
	BMP		= 0,
	ICO		= 1,
	JPEG	= 2,
	JNG		= 3,
	KOALA	= 4,
	//LBM	 = 5,
	IFF		= 5,
	MNG		= 6,
	PBM		= 7,
	PBMRAW	= 8,
	PCD		= 9,
	PCX		= 10,
	PGM		= 11,
	PGMRAW	= 12,
	PNG		= 13,
	PPM		= 14,
	PPMRAW	= 15,
	RAS		= 16,
	TARGA	= 17,
	TIFF	= 18,
	WBMP	= 19,
	PSD		= 20,
	CUT		= 21,
	XBM		= 22,
	XPM		= 23,
	DDS		= 24,
	GIF		= 25,
	HDR		= 26,
	FAXG3   = 27,
	SGI		= 28,
	EXR		= 29,
	J2K		= 30,
	JP2		= 31,
	PFM		= 32,
	PICT	= 33,
	RAW		= 34
}

impl From<i32> for Format {
	fn from(n: i32) -> Format {
		unsafe{ mem::transmute(n) }
	}
}

#[repr(i32)]
#[derive(Eq,PartialEq,Clone,Copy,Debug)]
pub enum ColorChannel {
	RGB = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_RGB,
	RED = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_RED,
	GREEN = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_GREEN,
	BLUE = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_BLUE,
	ALPHA = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_ALPHA,
	BLACK = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_BLACK,
	REAL = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_REAL,
	IMAG = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_IMAG,
	MAG = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_MAG,
	PHASE = ffi::FREE_IMAGE_COLOR_CHANNEL_FICC_PHASE,
}

//pub enum SaveFlags{
pub static DEFAULT:i32 = 0; 		// Default option for all types.
pub static BMP_SAVE_RLE:i32=1; 	// Save with run length encoding.
pub static EXR_FLOAT:i32=0x0001; 		// Save data as float instead of as half (not recommended).
pub static EXR_NONE:i32=0x0002;  		// Save with no compression.
pub static EXR_ZIP:i32=0x0004;		// Save with zlib compression; in blocks of 16 scan lines.
pub static EXR_PIZ:i32=0x0008;		// Save with piz-based wavelet compression.
pub static EXR_PXR24:i32=0x0010;		// Save with lossy 24-bit float compression.
pub static EXR_B44:i32=0x0020;		// Save with lossy 44% float compression - goes to 22% when combined with EXR_LC.
pub static EXR_LC:i32=0x0040;			// Save images with one luminance and two chroma channels; rather than as RGB (lossy compression).
pub static JPEG_QUALITYSUPERB:i32=0x80;		// Save with superb quality (100:1).
pub static JPEG_QUALITYGOOD:i32=0x0100;		// Save with good quality (75:1).
pub static JPEG_QUALITYNORMAL:i32=0x0200;		// Save with normal quality (50:1).
pub static JPEG_QUALITYAVERAGE:i32=0x0400;	// Save with average quality (25:1).
pub static JPEG_QUALITYBAD:i32=0x0800;		// Save with bad quality (10:1).
pub static JPEG_PROGRESSIVE:i32=0x2000;		// Save as a progressive-JPEG (use | to combine with other save flags).
pub static JPEG_SUBSAMPLING_411:i32=0x1000;	// Save with high 4x1 chroma subsampling (4:1:1).
pub static JPEG_SUBSAMPLING_420:i32=0x4000;	// Save with medium 2x2 medium chroma (4:2:0).
pub static JPEG_SUBSAMPLING_422:i32=0x8000;	// Save with low 2x1 chroma subsampling (4:2:2).
pub static JPEG_SUBSAMPLING_444:i32=0x10000;	// Save with no chroma subsampling (4:4:4).
pub static PNG_Z_BEST_SPEED:i32=0x0001;		// Save using ZLib level 1 compression flag (default value is PNG_Z_DEFAULT_COMPRESSION).
pub static PNG_Z_DEFAULT_COMPRESSION:i32=0x0006;	// Save using ZLib level 6 compression flag (default recommended value).
pub static PNG_Z_BEST_COMPRESSION:i32=0x0009;		// save using ZLib level 9 compression flag (default value is PNG_Z_DEFAULT_COMPRESSION).
pub static PNG_Z_NO_COMPRESSION:i32=0x0100;		// Save without ZLib compression.
pub static PNG_INTERLACED:i32=0x0200;		// Save using Adam7 interlacing (use | to combine with other save flags).
pub static PNM_SAVE_ASCII:i32=1;		// If set the writer saves in ASCII format (i.e. P1; P2 or P3).
pub static TIFF_CMYK:i32=0x0001;			// Stores tags for separated CMYK (use | to combine with compression flags).
pub static TIFF_PACKBITS:i32=0x0100;		// Save using PACKBITS compression.
pub static TIFF_DEFLATE:i32=0x0200;		// Save using DEFLATE compression (a.k.a. ZLIB compression).
pub static TIFF_ADOBE_DEFLATE:i32=0x0400;	// Save using ADOBE DEFLATE compression.
pub static TIFF_NONE:i32=0x0800;			// Save without any compression.
pub static TIFF_CCITTFAX3:i32=0x1000;		// Save using CCITT Group 3 fax encoding.
pub static TIFF_CCITTFAX4:i32=0x2000;		// Save using CCITT Group 4 fax encoding.
pub static TIFF_LZW:i32=0x4000;			// Save using LZW compression.
pub static TIFF_JPEG:i32=0x8000;			// Save using JPEG compression.
//}