summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorroot <root@x-bsw12.sh.intel.com>2015-04-21 16:44:14 +0800
committerroot <root@x-bsw12.sh.intel.com>2015-04-21 16:44:14 +0800
commit1444853478b2e7fcda336080bf4fc8dd88c97a0a (patch)
tree838b8244d18ef0b95b0c41b128e5cddcac1e4167
parent7f16e03bdd02ad016e684bacf9d2fb4042dab9c0 (diff)
Refine vtview & qrdecode.
Signed-off-by: root <root@x-bsw12.sh.intel.com>
-rw-r--r--tools/QRdecode.cpp7
-rw-r--r--tools/vtview.c15
2 files changed, 18 insertions, 4 deletions
diff --git a/tools/QRdecode.cpp b/tools/QRdecode.cpp
index 37f797f..37e2c0c 100644
--- a/tools/QRdecode.cpp
+++ b/tools/QRdecode.cpp
@@ -413,6 +413,7 @@ process_image(void *p, int dev_id)
sprintf(filename, "pass_%d_%d.png",mode_count, dev_id);
cvSaveImage(filename, image);
printf("SaveAs:%s\n", filename);
+ printf("Captured Camera: %s\n", dev_names[dev_id]);
kill(pid_test, SIGUSR1);
mode_count ++;
@@ -972,7 +973,8 @@ int main(int argc,char *argv[])
break;
case 'd':
- memcpy(dev_names[0], optarg, strlen(optarg));
+ sprintf( dev_names[0], "%s", optarg);
+// memcpy(dev_names[0], optarg, strlen(optarg));
dev_count = 1;
break;
@@ -1041,7 +1043,8 @@ int main(int argc,char *argv[])
}
else
{
- get_devices();
+ if (dev_count == 0)
+ get_devices();
//dev_count = 1;
for (int i = 0; i < dev_count; i++)
diff --git a/tools/vtview.c b/tools/vtview.c
index c46b767..d56d3d8 100644
--- a/tools/vtview.c
+++ b/tools/vtview.c
@@ -144,13 +144,24 @@ struct image_size_location
int img_h;
};
struct image_size_location isl;
-static void paint_image(cairo_t *cr, const char *file, struct image_size_location* isl1)
+static void paint_image(cairo_t *cr, int fb_weith, int fb_height, const char *file, struct image_size_location* isl1)
{
int img_x, img_y, img_w, img_h, img_w_o, img_h_o;
double img_w_scale, img_h_scale;
cairo_surface_t *image;
+ cairo_pattern_t *pat;
+
+ pat = cairo_pattern_create_linear(0, 0, fb_weith, fb_height);
+ //cairo_pattern_add_color_stop_rgba(pat, 1, 0, 0, 0, 1);
+ cairo_pattern_add_color_stop_rgba(pat, 0, 1, 1, 1, 1);
+ cairo_pattern_add_color_stop_rgba(pat, 0, 1, 1, 1, 1);
+
+ cairo_rectangle(cr, 0, 0, fb_weith, fb_height);
+ cairo_set_source(cr, pat);
+ cairo_fill(cr);
+
image = cairo_image_surface_create_from_png(file);
img_w_o = cairo_image_surface_get_width(image);
@@ -211,7 +222,7 @@ static void paint_output_info(struct connector *c, struct igt_fb *fb, char *imag
// img_addr=str_contact(IGT_DATADIR,separator,image);
//printf("img_addr: %s \n ",img_addr);
- paint_image(cr, img_addr, &isl);
+ paint_image(cr, l_width, l_height, img_addr, &isl);
free(img_addr);
igt_assert(!cairo_status(cr));