00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef GDITHER_TYPES_H
00022 #define GDITHER_TYPES_H
00023
00024 #include <stdint.h>
00025
00026 #ifdef __cplusplus
00027 extern "C" {
00028 #endif
00029
00030 #define GDITHER_SH_BUF_SIZE 8
00031 #define GDITHER_SH_BUF_MASK 7
00032
00033
00034 typedef enum {
00035 GDitherNone = 0,
00036 GDitherRect,
00037 GDitherTri,
00038 GDitherShaped
00039 } GDitherType;
00040
00041 typedef enum {
00042 GDither8bit = 8,
00043 GDither16bit = 16,
00044 GDither32bit = 32,
00045 GDitherFloat = 25,
00046 GDitherDouble = 54
00047 } GDitherSize;
00048
00049 typedef struct {
00050 uint32_t phase;
00051 float buffer[GDITHER_SH_BUF_SIZE];
00052 } GDitherShapedState;
00053
00054 typedef struct GDither_s {
00055 GDitherType type;
00056 uint32_t channels;
00057 uint32_t bit_depth;
00058 uint32_t dither_depth;
00059 float scale;
00060 uint32_t post_scale;
00061 float post_scale_fp;
00062 float bias;
00063
00064 int clamp_u;
00065
00066 int clamp_l;
00067 float *tri_state;
00068 GDitherShapedState *shaped_state;
00069 } *GDither;
00070
00071 #ifdef __cplusplus
00072 }
00073 #endif
00074
00075 #endif