mirror of
https://github.com/Laex/Delphi-OpenCV.git
synced 2024-11-15 07:45:53 +01:00
parent
bf6d45180f
commit
13a0a73d96
@ -334,7 +334,7 @@ Type
|
|||||||
|
|
||||||
TocvDataReceiver = class(TComponent, IocvDataReceiver)
|
TocvDataReceiver = class(TComponent, IocvDataReceiver)
|
||||||
private
|
private
|
||||||
FocvVideoSource: IocvDataSource;
|
[weak] FocvVideoSource: IocvDataSource;
|
||||||
protected
|
protected
|
||||||
procedure SetVideoSource(const Value: TObject); virtual;
|
procedure SetVideoSource(const Value: TObject); virtual;
|
||||||
procedure SetOpenCVVideoSource(const Value: IocvDataSource); virtual;
|
procedure SetOpenCVVideoSource(const Value: IocvDataSource); virtual;
|
||||||
@ -348,7 +348,7 @@ Type
|
|||||||
|
|
||||||
TocvDataSourceAndReceiver = class(TocvDataSource, IocvDataReceiver)
|
TocvDataSourceAndReceiver = class(TocvDataSource, IocvDataReceiver)
|
||||||
private
|
private
|
||||||
FocvVideoSource: IocvDataSource;
|
[weak] FocvVideoSource: IocvDataSource;
|
||||||
protected
|
protected
|
||||||
procedure SetVideoSource(const Value: TObject); virtual;
|
procedure SetVideoSource(const Value: TObject); virtual;
|
||||||
procedure SetOpenCVVideoSource(const Value: IocvDataSource); virtual;
|
procedure SetOpenCVVideoSource(const Value: IocvDataSource); virtual;
|
||||||
|
@ -85,7 +85,7 @@ type
|
|||||||
|
|
||||||
TocvViewFrame = class(TCollectionItem, IocvDataReceiver)
|
TocvViewFrame = class(TCollectionItem, IocvDataReceiver)
|
||||||
private
|
private
|
||||||
FocvVideoSource: IocvDataSource;
|
[weak] FocvVideoSource: IocvDataSource;
|
||||||
FImage: IocvImage;
|
FImage: IocvImage;
|
||||||
FLock: TCriticalSection;
|
FLock: TCriticalSection;
|
||||||
FDrawRect: TocvPersistentRect;
|
FDrawRect: TocvPersistentRect;
|
||||||
@ -113,7 +113,7 @@ type
|
|||||||
|
|
||||||
TocvView = class(TWinControl, IocvDataReceiver)
|
TocvView = class(TWinControl, IocvDataReceiver)
|
||||||
private
|
private
|
||||||
FocvVideoSource: IocvDataSource;
|
[weak] FocvVideoSource: IocvDataSource;
|
||||||
FImage: IocvImage;
|
FImage: IocvImage;
|
||||||
FOnAfterPaint: TOnOcvAfterViewPaint;
|
FOnAfterPaint: TOnOcvAfterViewPaint;
|
||||||
FOnBeforePaint: TOnOcvNotify;
|
FOnBeforePaint: TOnOcvNotify;
|
||||||
@ -180,8 +180,9 @@ end;
|
|||||||
|
|
||||||
destructor TocvView.Destroy;
|
destructor TocvView.Destroy;
|
||||||
begin
|
begin
|
||||||
if Assigned(FocvVideoSource) then
|
// if Assigned(FocvVideoSource) then
|
||||||
FocvVideoSource.RemoveReceiver(Self);
|
// FocvVideoSource.RemoveReceiver(Self);
|
||||||
|
VideoSource := nil;
|
||||||
FCanvas.Free;
|
FCanvas.Free;
|
||||||
FFrames.Free;
|
FFrames.Free;
|
||||||
inherited;
|
inherited;
|
||||||
@ -191,10 +192,10 @@ procedure TocvView.SetOpenCVVideoSource(const Value: IocvDataSource);
|
|||||||
begin
|
begin
|
||||||
if FocvVideoSource <> Value then
|
if FocvVideoSource <> Value then
|
||||||
begin
|
begin
|
||||||
if Assigned(FocvVideoSource) then
|
if Assigned(FocvVideoSource) and (not(csDesigning in ComponentState)) then
|
||||||
FocvVideoSource.RemoveReceiver(Self);
|
FocvVideoSource.RemoveReceiver(Self);
|
||||||
FocvVideoSource := Value;
|
FocvVideoSource := Value;
|
||||||
if Assigned(FocvVideoSource) then
|
if Assigned(FocvVideoSource) and (not(csDesigning in ComponentState)) then
|
||||||
FocvVideoSource.AddReceiver(Self);
|
FocvVideoSource.AddReceiver(Self);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
Loading…
Reference in New Issue
Block a user