You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
returns new instance of TLuminanceSource, it should be stored and released in TInvertedLuminanceSource.Destructor;
suggested changes:
constructor TInvertedLuminanceSource.Create(delegate: TLuminanceSource; ownDelegate : Boolean = FALSE);
begin
inherited Create(delegate.Width, delegate.Height);
Self.delegate := delegate;
Self.ownDelegate := ownDelegate; // new property
end;
destructor TInvertedLuminanceSource.Destroy;
begin
if Self.ownDelegate then
begin
FreeAndNil(Self.delegate);
end;
inherited;
end;
function TInvertedLuminanceSource.crop(const left, top, width, height: Integer): TLuminanceSource;
begin
Result := TInvertedLuminanceSource.Create(
Self.delegate.crop(left, top, width, height),
TRUE);
end;
function TInvertedLuminanceSource.rotateCounterClockwise(): TLuminanceSource;
begin
Result := TInvertedLuminanceSource.Create(
Self.delegate.rotateCounterClockwise,
TRUE);
end;
function TInvertedLuminanceSource.rotateCounterClockwise45(): TLuminanceSource;
begin
Result := TInvertedLuminanceSource.Create(
Self.delegate.rotateCounterClockwise45,
TRUE);
end;
// should return new instance like TBaseLuminanceSource.Invert()
// not optimal, but consistent with the crop and rotate functions
function TInvertedLuminanceSource.invert: TLuminanceSource;
begin
Result := TInvertedLuminanceSource.Create(SELF);
end;
The text was updated successfully, but these errors were encountered:
In functions: crop, rotate
returns new instance of TLuminanceSource, it should be stored and released in TInvertedLuminanceSource.Destructor;
suggested changes:
The text was updated successfully, but these errors were encountered: