Вверх ↑
Ответов: 8926
Рейтинг: 823
#1: 2017-08-29 23:38:37 ЛС | профиль | цитата
Заготовку сделал, мою сотню картиночек открывает и заполняет Array за 60 мсек. Спасибо за помощь!
IC


Add(InlineCode,2865515,462,210)
{
@Hint=#14:Картинка 8 бит|
WorkPoints=#9:doReadBMP|6:doWork|
EventPoints=#8:onResult|3:onX|3:onY|5:onEnd|
VarPoints=#6:Result|
DataPoints=#13:Abmp=Картинка|17:NumBmp=№ картинки|
Code=#15:unit HiAsmUnit;|0:|9:interface|0:|21:uses kol,Share,Debug;|0:|4:type|28: THiAsmClass = class(TDebug)|10: private|55: ArrPic:Array[0..99, 0..109, 0..109, 0..2] of byte;|9: public|26: _data_Data:THI_Event;|25: onResult: THI_Event;|20: onX: THI_Event;|20: onY: THI_Event;|22: onEnd: THI_Event;|21: Abmp: THI_Event;|23: NumBmp: THI_Event;|53: procedure doReadBMP(var Data:TData; Index:word);|50: procedure doWork(var Data:TData; Index:word);|5: end;|0:|14:implementation|0:|32:procedure THiAsmClass.doReadBMP;|34:type TLine = array[0..0] of byte;|21: PLine = ^TLine;|3:var|17: A_bmp: PBitmap;|13: Line:PLine;|21: _Num,i,j,k:integer;|5:begin|37: _Num:=ReadInteger(Data, NumBmp, 0);|26: if _Num>100 then Exit; |31: A_bmp := Newbitmap(110, 110);|36: A_bmp.Assign(ToBitmapEvent(Abmp));|44: if (A_bmp = nil) or A_bmp.Empty then exit;|31: A_bmp.PixelFormat := pf24bit;|25: for i := 0 to 109 do|11: begin|33: Line := A_bmp.ScanLine[i];|28: for j := 0 to 109 do|14: begin|22: k := j * 3; |51: ArrPic[_Num,i,j,0] := Line[ k ]; //B|51: ArrPic[_Num,i,j,1] := Line[k+1]; //G|51: ArrPic[_Num,i,j,2] := Line[k+2]; //R|12: end;|10: end;|0:|13: A_bmp.free;|4:end;|0:|29:procedure THiAsmClass.doWork;|24:var _Num,i,j,k:integer;|0:|5:begin|38: _Num:=ReadInteger(Data, NumBmp, 0); |21: for i:=0 to 109 do|9: begin|24: for j:=0 to 109 do|12: begin|100: _hi_onEvent(onResult, (ArrPic[_Num,i,j,0]*65536+ArrPic[_Num,i,j,1]*256+ArrPic[_Num,i,j,2]));|28: _hi_onEvent(onX, j);|28: _hi_onEvent(onY, i);|11: end;|8: end;|28: _hi_onEvent(onEnd, _Num); |4:end;|4:end.|
}

карма: 19

0