A
download fparameters.pas
Language: Delphi
Copyright: (C) 2004 Durand Emmanuel (C) 2004 Burgel Eric
LOC: 136
Project Info
Filters
Server: SourceForge
Type: cvs
...ilters\Filters1\Src\Delphi\
   ...ractfilterNeighbor3.pas
   Chronometer.pas
   divers.pas
   filter.pas
   filterAdjust.pas
   filterArithmeticAdd.pas
   ...ithmeticConstantAdd.pas
   ...ArithmeticSubstract.pas
   filterBlobBalance.pas
   filterBlobExplorer.pas
   filterBlobGrouping.pas
   ...erBlobRepositioning.pas
   ...rBlobRepositioning2.pas
   filterBlur.pas
   filterCanny.pas
   filterContour.pas
   filterContrastExplorer.pas
   filterConvolution.pas
   filterCoocurenceMatrix.pas
   filterCopy.pas
   filterCorrelation.pas
   filterCutter.pas
   filterDistancesMap.pas
   filterExplorer.pas
   ...nisotropicDiffusion.pas
   ...GranularityExplorer.pas
   filterHistogram.pas
   ...erHistogramContrast.pas
   filterImageCreator.pas
   filterImageLoader.pas
   filterImageSaver.pas
   filterIntegration.pas
   filterInvert.pas
   filterLocalDeviation.pas
   filterLogPolar.pas
   filterMedian.pas
   filterMorphology.pas
   ...onMaximaSuppression.pas
   filterNormalize.pas
   filterOnOffCell.pas
   filterProjectionLine.pas
   filterPyramid.pas
   filterRescaleIntensity.pas
   filterResize.pas
   filterRotation.pas
   filterSigmoid.pas
   filterSmoothBilateral.pas
   filterSobel.pas
   filterSPV.pas
   filterStackProcessor.pas
   filterStackSmasher.pas
   ...erStandardDeviation.pas
   filterSUSAN.pas
   filterThresholdBinary.pas
   filterVectorHistogram.pas
   filterWavelets.pas
   filterWaves.pas
   fmask.pas
   fparameters.pas
   image.pas
   imageIO.pas
   imageIOVideo.pas
   lacModel.pas
   polygonalyzation.pas
   wrapper_itk.pas
   wrapper_opencv.pas

unit fparameters;
(* ***** BEGIN LICENSE BLOCK *****
 * Copyright (C) 2004 Durand Emmanuel
 * Copyright (C) 2004 Burgel Eric
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 *
 * Contact :
 *   filters@edurand.com
 *   filters@burgel.com
 *
 * ***** END LICENSE BLOCK ***** *)

{
 edurand (filters@edurand.com)
 eburgel (filters@burgel.com)
}

interface
uses
  Classes, Windows, SysUtils, image;


type

  //*** Parameters description ***
  EParameterInvalidDataType = class(Exception);
  EParameterNotFound = class(Exception);
  EParameterValueOutOfBound = class(Exception);

  TDataType = (dtImage,dtInteger,dtIntegerArray2D,dtString,dtBoolean,dtSingle,
    dtImages,dtArrayIntegers,dtArraySingles,dtArrayPointers,dtPointer);

  TParameter = class(TObject)
    DataType : TDataType;
    Name : String;
    Help : String;
    constructor Create( aName, aHelp : String);
  end;

  TParameterBoolean = class(TParameter)
  public
    Value : Boolean;
    constructor Create(aName,aDescription : String; defaultValue:Boolean);
  end;

  TParameterInteger = class(TParameter)
  public
    Value : Int64;
    Min, Max : Int64;
    constructor Create(aName,aDescription : String;aMin,aMax,defaultValue:Int64);
  end;

  TParameterSingle = class(TParameter)
  public
    Value : single;
    Min, Max : Single;
    constructor Create(aName,aDescription : String;aMin,aMax,defaultValue:Single);
  end;

  TParameterString = class(TParameter)
  public
    Value : String;
    constructor Create(aName,aDescription : String;defaultValue:String);
  end;

  TParameterImage = class(TParameter)
  public
    Image : PBitmap32;
    constructor Create(aName,aDescription : String);
  end;

  TParameterImages = class(TParameter)
  public
    Images : ArrayOfPBitmap32;
    constructor Create(aName,aDescription : String);
  end;

  TParameterArrayIntegers = class(TParameter)
  public
    Integers : array of Integer;
    constructor Create(aName,aDescription : String);
  end;

  TParameterArraySingles = class(TParameter)
  public
    Singles : array of Single;
    constructor Create(aName,aDescription : String);
  end;

  TParameterArrayPointers = class(TParameter)
  public
    Pointers : array of Pointer;
    constructor Create(aName,aDescription : String);
  end;

  TParameterPointer = class(TParameter)
  public
    Value : Pointer;
    constructor Create(aName,aDescription : String);
  end;


implementation


{ TParameter }

constructor TParameter.Create(aName, aHelp: String);
begin
  Name := aName;
  Help := aHelp;
end;


constructor  TParameterBoolean.Create(aName,aDescription : String;
  defaultValue:Boolean);
Begin
  inherited Create(aName,aDescription);
  DataType:=dtBoolean;
  Value:=defaultValue;
end;

{ TParameterInteger }
constructor TParameterInteger.Create(aName, aDescription: String; aMin, aMax,
  defaultValue: Int64);
begin
  inherited Create(aName,aDescription);
  DataType:=dtInteger;
  Min:=aMin;
  Max:=aMax;
  Value:=defaultValue;
end;

{ TParameterSingle }
constructor TParameterSingle.Create(aName, aDescription: String; aMin, aMax,
  defaultValue: Single);
begin
  inherited Create(aName,aDescription);
  DataType:=dtSingle;
  Min:=aMin;
  Max:=aMax;
  Value:=defaultValue;
end;

{ TParameterString }

constructor TParameterString.Create(aName, aDescription: String; defaultValue: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtString;
  Value:=defaultValue;
end;

constructor TParameterImage.Create(aName, aDescription: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtImage;
end;

constructor TParameterImages.Create(aName, aDescription: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtImages;
end;

constructor TParameterArrayIntegers.Create(aName, aDescription: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtArrayIntegers;
end;

constructor TParameterArraySingles.Create(aName, aDescription: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtArraySingles;
end;

constructor TParameterArrayPointers.Create(aName, aDescription: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtArrayPointers;
end;

constructor TParameterPointer.Create(aName, aDescription: String);
begin
  inherited Create(aName,aDescription);
  DataType:=dtPointer;
end;


end.

About Koders | Resources | Downloads | Support | Black Duck | Terms of Service | DMCA | Privacy Policy | Contact Us