1
0
mirror of https://github.com/moparisthebest/Simba synced 2025-03-03 02:41:54 -05:00

Few changes - not done yet.

git-svn-id: http://www.villavu.com/repositories/merlijn/mufasa@178 3f818213-9676-44b0-a9b4-5e4c4e03d09d
This commit is contained in:
Wizzup? 2009-11-02 11:35:53 +00:00
parent c3aa2b3e36
commit cee2bb4d82
2 changed files with 13 additions and 5 deletions

View File

@ -1,4 +1,4 @@
function rs_GetUpText: String; function rs_GetUpText: String;
begin begin
Result := CurrThread.Client.MOCR.GetUpTextAt(9,9); Result := CurrThread.Client.MOCR.GetUpTextAt(7,7);
end; end;

View File

@ -469,6 +469,12 @@ var
begin begin
RGBtoXYZ(c,X,Y,Z); RGBtoXYZ(c,X,Y,Z);
sum:= X + Y + Z; sum:= X + Y + Z;
if(sum = 0) then
begin
result.l := 0.0;
result.a := 0.0;
result.b := 0.0;
end;
Xn:= X / sum; Xn:= X / sum;
Yn:= Y / sum; Yn:= Y / sum;
Zn:= Z / sum; Zn:= Z / sum;
@ -484,7 +490,7 @@ end;
function ExtractText(colors: PRGB32;{colors: tRGBArray;} w,h: integer): TNormArray; function ExtractText(colors: PRGB32;{colors: tRGBArray;} w,h: integer): TNormArray;
const const
GradientMax = 5.0; GradientMax = 2.0;
white: tRGB = ( b: $FF; g: $FF; r: $FF; a: $00 ); white: tRGB = ( b: $FF; g: $FF; r: $FF; a: $00 );
cyan: tRGB = ( b: $FF; g: $FF; r: $00; a: $00 ); cyan: tRGB = ( b: $FF; g: $FF; r: $00; a: $00 );
yellow: tRGB = ( b: $00; g: $EF; r: $FF; a: $00 ); yellow: tRGB = ( b: $00; g: $EF; r: $FF; a: $00 );
@ -643,7 +649,7 @@ var
begin begin
TClient(Client).MWindow.GetDimensions(w, h); TClient(Client).MWindow.GetDimensions(w, h);
ww := 300; ww := 200;
hh := 20; hh := 20;
if ww + atX > w then if ww + atX > w then
@ -653,12 +659,14 @@ begin
bmp := TMufasaBitmap.Create; bmp := TMufasaBitmap.Create;
// bmp.SetSize(ww - atX, hh - atY); CopyCLientToBitmap will automatically resize -> Resize bool is true. // bmp.SetSize(ww - atX, hh - atY); CopyCLientToBitmap will automatically resize -> Resize bool is true.
bmp.CopyClientToBitmap(TClient(Client).MWindow,True, atX, atY, atX + ww, atY + hh); bmp.CopyClientToBitmap(TClient(Client).MWindow,True, atX, atY, atX + ww - 1, atY + hh - 1);
writeln(inttostr(bmp.Width) + ', ' + inttostr(bmp.height));
bmp.SaveToFile('/tmp/output.bmp');
n := ExtractText(bmp.FData, bmp.Width, bmp.Height); n := ExtractText(bmp.FData, bmp.Width, bmp.Height);
Result := ocrDetect(n, bmp.Width, bmp.Height, OCRData[0]); Result := ocrDetect(n, bmp.Width, bmp.Height, OCRData[0]);
bmp.SaveToFile('/tmp/output.bmp');
bmp.Free; bmp.Free;
end; end;