Coverage Report

Created: 2017-11-12 13:27

/home/liu/buildslave/linux-x64-runtests/build/test/unit/image_processing.tests.c
Line
Count
Source
1
#include "ccv.h"
2
#include "case.h"
3
#include "ccv_case.h"
4
5
TEST_CASE("image saturation")
6
1
{
7
1
  ccv_dense_matrix_t* image = 0;
8
1
  ccv_read("../../samples/nature.png", &image, CCV_IO_RGB_COLOR | CCV_IO_ANY_FILE);
9
1
  ccv_dense_matrix_t* b = 0;
10
1
  ccv_saturation(image, &b, 0, 0.5);
11
1
  
REQUIRE_MATRIX_FILE_EQ1
(b, "data/nature.saturation.0.5.bin", "should be desaturated image");1
12
1
  ccv_matrix_free(b);
13
1
  b = 0;
14
1
  ccv_saturation(image, &b, 0, 1.5);
15
1
  
REQUIRE_MATRIX_FILE_EQ1
(b, "data/nature.saturation.1.5.bin", "should be oversaturated image");1
16
1
  ccv_matrix_free(b);
17
1
  ccv_matrix_free(image);
18
1
}
19
20
TEST_CASE("image contrast")
21
1
{
22
1
  ccv_dense_matrix_t* image = 0;
23
1
  ccv_read("../../samples/nature.png", &image, CCV_IO_RGB_COLOR | CCV_IO_ANY_FILE);
24
1
  ccv_dense_matrix_t* b = 0;
25
1
  ccv_contrast(image, &b, 0, 0.5);
26
1
  
REQUIRE_MATRIX_FILE_EQ1
(b, "data/nature.contrast.0.5.bin", "should be decontrasted image");1
27
1
  ccv_matrix_free(b);
28
1
  b = 0;
29
1
  ccv_contrast(image, &b, 0, 1.5);
30
1
  
REQUIRE_MATRIX_FILE_EQ1
(b, "data/nature.contrast.1.5.bin", "should be overcontrasted image");1
31
1
  ccv_matrix_free(b);
32
1
  ccv_matrix_free(image);
33
1
}
34
35
#include "case_main.h"