#9
Post
by BlubBlab » Sun Dec 21, 2014 11:35 am
Okay I write the api overview once here
I also will in a fe minutes update the upload on mediafire.
/* first grouping */
/* functions which find static stuff on screen */
cv.lines(hwd[, int min_lenght][, max_gap][,bool debugwindow]))
cv.cycles(hwd[, int min_radius][, max_radius][,bool debugwindow])
cv.objects(hwd, string xml_path[,int min_width, int min_height][,int max_width, int max_height][,bool debugwindow]))
/* static filter which apply only once */
cv.setFilter_rect(hwd, int x, int y, int width, int heigh[,bool debugwindow]))
cv.setFilter_colour(hwd, int min_red, int min_green, int min_blue, int max_red, int max_green, int max_blue[,bool debugwindow]))
cv.setFilter_colour2(hwd, int min_red, int min_green, int min_blue, int max_red, int max_green, int max_blue[,bool debugwindow]))
/* read filter from hand without making new screenshots*/
local red, green, blue = cv.getFilterPixel(int x, int y,)
/* delete static filter manually */
cv.clearFilter()
/* non static function to find stuff */
cv.motions(hwd[, int min_found_in_a_row][,int pause_in_msec] [, int min_diff_pixel][, int history_size][, bool shadows][,bool debugwindow]))
cv.motions2(hwd[, int run_time][,int pause_in_msec] [, int min_diff_pixel][, int history_size][, bool shadows][,bool debugwindow]))
/* global filter to blend things out of the screen with rectangles */
tab = {x1=2,y1=4,x2=1,y2=1}
cv.setMaskFilter(tab,...)
/* clear global filter */
cv.clearMaskFilter()
/* help functions */
cv.loadImage(string file)
cv.saveImage(string file)
/* Iterators */
{tab.x1,tab.y1,tab.x2,tab.y2},{..}= cv.lines_next()
{tab.x,tab.y,tab.radius},{..} = cv.lines_cycles()
{tab.x,tab.y,tab.width,tab.height},{..} = cv.objects_next()
{tab.x,tab.y,tab.width,tab.height},{..} = cv.motions_next()
/* clear iterator buffer dismiss all (next) results */
cv.clearBuffer()
First all the static stuff which find something on the screen will use the information from the filter when you defined one and after that the filter will be cleared.(I did that to avoid memory leaks)
cv.setMaskFilter(..) apply on everything(with the exception of loadImage()) and unlike the other won't be cleared automatically you need to get rid of it until you call cv.clearMaskFilter()
cv.setFilter_rect(..) gives you your ROI your region of interest basically to cut out a picture from a larger picture.
cv.setFilter_colour(..) gives you an result in black and white, white is your result. It basically filter (into black/white) the parts which are defined by your RGB values between min , max. If you want it in the original colours use cv.setFilter_colour2(..)
cv.motions(..) returns only after it successfully found something which moves keep that in mind also the static filter won't work for it only cv.setMaskFilter(..)
If you want a limited runtime use cv.motions2
Those debugwindow flags open a window in which you can see what MM sees very useful.
Before I forgot the results you always grap them through the iterators because it is just to many you will receive 10 tables at max at the time if you receive null the buffer is empty and please make it empty if you don't use all result.
Okay I will now copy the souce code a final test if everything is okay than upload.
My MM2 64-bit version has also writePtr64 and readPtr64 for the bigger 64-bit pointers and also support int64 and uint64 as long and ulong.