PostGIS  2.5.0dev-r@@SVN_REVISION@@
static void test_pixtype_get_min_value ( )
static

Definition at line 82 of file cu_pixtype.c.

References PT_16BSI, PT_16BUI, PT_1BB, PT_2BUI, PT_32BF, PT_32BSI, PT_32BUI, PT_4BUI, PT_64BF, PT_8BSI, PT_8BUI, PT_END, rt_pixtype_get_min_value(), rt_util_clamp_to_16BSI(), rt_util_clamp_to_16BUI(), rt_util_clamp_to_1BB(), rt_util_clamp_to_2BUI(), rt_util_clamp_to_32BSI(), rt_util_clamp_to_32BUI(), rt_util_clamp_to_4BUI(), rt_util_clamp_to_8BSI(), and rt_util_clamp_to_8BUI().

Referenced by pixtype_suite_setup().

82  {
83  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_1BB), rt_util_clamp_to_1BB((double) CHAR_MIN), DBL_EPSILON);
84  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_2BUI), rt_util_clamp_to_2BUI((double) CHAR_MIN), DBL_EPSILON);
85  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_4BUI), rt_util_clamp_to_4BUI((double) CHAR_MIN), DBL_EPSILON);
86  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_8BUI), rt_util_clamp_to_8BUI((double) CHAR_MIN), DBL_EPSILON);
87  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_8BSI), rt_util_clamp_to_8BSI((double) SCHAR_MIN), DBL_EPSILON);
88  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_16BUI), rt_util_clamp_to_16BUI((double) SHRT_MIN), DBL_EPSILON);
89  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_16BSI), rt_util_clamp_to_16BSI((double) SHRT_MIN), DBL_EPSILON);
90  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_32BUI), rt_util_clamp_to_32BUI((double) INT_MIN), DBL_EPSILON);
91  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_32BSI), rt_util_clamp_to_32BSI((double) INT_MIN), DBL_EPSILON);
92  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_32BF), -FLT_MAX, DBL_EPSILON);
93  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_64BF), -DBL_MAX, DBL_EPSILON);
94 
95  CU_ASSERT_DOUBLE_EQUAL(rt_pixtype_get_min_value(PT_END), rt_util_clamp_to_8BUI((double) CHAR_MIN), DBL_EPSILON);
96 }
int32_t rt_util_clamp_to_32BSI(double value)
Definition: rt_util.c:69
uint32_t rt_util_clamp_to_32BUI(double value)
Definition: rt_util.c:74
uint16_t rt_util_clamp_to_16BUI(double value)
Definition: rt_util.c:64
int8_t rt_util_clamp_to_8BSI(double value)
Definition: rt_util.c:49
double rt_pixtype_get_min_value(rt_pixtype pixtype)
Return minimum value possible for pixel type.
Definition: rt_pixel.c:148
uint8_t rt_util_clamp_to_4BUI(double value)
Definition: rt_util.c:44
uint8_t rt_util_clamp_to_8BUI(double value)
Definition: rt_util.c:54
uint8_t rt_util_clamp_to_1BB(double value)
Definition: rt_util.c:34
uint8_t rt_util_clamp_to_2BUI(double value)
Definition: rt_util.c:39
int16_t rt_util_clamp_to_16BSI(double value)
Definition: rt_util.c:59

Here is the call graph for this function:

Here is the caller graph for this function: