summaryrefslogtreecommitdiff
path: root/macros/puttext.sci
blob: 06a0c2b2c5c961b7dfd601a4340d7a7415dd58d4 (plain)
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
function new_image = puttext(image, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin)
	
	/// varargin(1) = thickness = 1, 
	/// varargin(2) = linetype = 8, 
	/// varargin(3) = bottomleft = false
	
	[ lhs, rhs ] = argn(0)
	
	image_list = mattolist(image)
	
	select rhs
		case 9 then
			out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface)
		
		case 10 then
			out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin(1))
			
		case 11 then
			out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin(1), varargin(2))
		
		case 12 then
			out = opencv_puttext(image_list, x1, y1, fontscale, r_value, g_value, b_value, text, fontface, varargin(1), varargin(2), varargin(3))
	end
	
	sz = size(out)
	
	for i = 1 : sz
		new_image(:, :, i) = out(i)
	end
	
endfunction