home *** CD-ROM | disk | FTP | other *** search
- unit Globals;
-
- {Global declarations for Image program.}
-
- interface
-
- uses
- QuickDraw, Palettes, PrintTraps;
-
- const
- Version = 144;
-
- UsingFPU = true;
-
- AppleMenu = 128;
-
- FileMenu = 129;
- NewItem = 1;
- OpenItem = 2;
- ImportItem = 3;
- CloseItem = 4;
- SaveItem = 6;
- SaveAsItem = 7;
- ExportItem = 8;
- SaveScreenItem = 9;
- RecordPreferencesItem = 10;
- RevertItem = 12;
- DuplicateItem = 13;
- GetInfoItem = 14;
- SetHalftoneItem = 16;
- PageSetupItem = 17;
- PrintItem = 18;
- QuitItem = 20;
-
- EditMenu = 130;
- UndoItem = 1;
- CutItem = 3;
- CopyItem = 4;
- PasteItem = 5;
- ClearItem = 6;
- FillItem = 8;
- InvertItem = 9;
- DrawBoundaryItem = 10;
- DrawScaleItem = 11;
- SelectAllItem = 13;
- ScaleAndRotateItem = 14;
- RotateLeftItem = 16;
- RotateRightItem = 17;
- FlipVerticalItem = 18;
- FlipHorizontalItem = 19;
- UnzoomItem = 21;
- ShowClipboardItem = 22;
-
- OptionsMenu = 131;
- InvertPaletteItem = 1;
- SetNumberItem = 2;
- SetExtraColorsItem = 3;
- GrayscaleItem = 4;
- ColorTablesItem = 5;
- PreferencesItem = 11;
- PlotOptionsItem = 12;
- ScaleToFitItem = 13;
- ThresholdItem = 14;
- SliceItem = 15;
- PropagateItem = 16;
-
- FontMenu = 32; {Sub Menu}
-
- SizeMenu = 33; {Sub Menu}
-
- StyleMenu = 34; {Sub Menu}
- LeftItem = 8;
- CenterItem = 9;
- RightItem = 10;
- NoBackgroundItem = 12;
- WithBackgroundItem = 13;
-
- ColorTablesMenu = 41; {Sub Menu}
- SystemPaletteItem = 1;
- Pseudo20Item = 2;
- Pseudo32Item = 3;
- RainbowItem = 4;
- Fire1Item = 5;
- Fire2Item = 6;
- IceItem = 7;
- GraysItem = 8;
- SpectrumItem = 9;
-
- PropagateMenu = 38; {Sub Menu}
- LUTItem = 1;
- SpatialItem = 2;
- DensityItem = 3;
- AllItem = 4;
-
- EnhanceMenu = 132;
- SmoothItem = 1;
- SharpenItem = 2;
- ShadowItem = 3;
- EdgeDetectItem = 4;
- ReduceNoiseItem = 5;
- DitherItem = 6;
- ConvolveItem = 7;
- BinaryItem = 9;
- ArithmeticItem = 10;
- BackgroundItem = 11;
- ApplyItem = 12;
- EnhanceItem = 13;
- EqualizeItem = 14;
- ChangeItem = 15;
-
- BinaryMenu = 35; {Sub Menu}
- MakeBinaryItem = 1;
- ErosionItem = 3;
- DilationItem = 4;
- OpeningItem = 5;
- ClosingItem = 6;
- SetCountItem = 7;
- IterationsItem = 8;
- OutlineItem = 10;
- SkeletonizeItem = 11;
-
- ArithmeticMenu = 37; {Sub Menu}
- AddItem = 1;
- SubtractItem = 2;
- MultiplyItem = 3;
- DivideItem = 4;
- LogItem = 5;
-
- BackgroundMenu = 40; {Sub Menu}
- HorizontalItem = 1;
- VerticalItem = 2;
- Sub2DItem = 3;
- RemoveStreaksItem = 4;
- FasterItem = 6;
- RadiusItem = 7;
-
- AnalyzeMenu = 133;
- MeasureItem = 1;
- AnalyzeItem = 2;
- ShowItem = 3;
- HistogramItem = 4;
- PlotItem = 5;
- PlotSurfaceItem = 6;
- OptionsItem = 7;
- SetScaleItem = 9;
- CalibrateItem = 10;
- RedoItem = 11;
- DeleteItem = 12;
- ResetItem = 13;
- RestoreItem = 14;
- MarkItem = 15;
-
- SpecialMenu = 140;
- StartItem = 1;
- AverageItem = 2;
- SaveBlankFieldItem = 3;
- VideoOptionsItem = 4;
- PhotoModeItem = 6;
- SortItem = 7;
- LoadMacrosItem = 9;
- FirstMacroItem = 11;
-
- StacksMenu = 141;
- StackFromWindowsItem = 1;
- WindowsFromStackItem = 2;
- AddSliceItem = 3;
- DeleteSliceItem = 4;
- NextSliceItem = 5;
- PreviousSliceItem = 6;
- MakeMovieItem = 8;
- CaptureFramesItem = 9;
- AnimateItem = 10;
- ProjectItem = 12;
- ResliceItem = 13;
- ResliceOptionsItem = 14;
-
- SortPaletteMenu = 36; {Sub Menu}
- byHueItem = 1;
- bySaturationItem = 2;
- byBrightnessItem = 3;
-
- WindowsMenu = 138;
- NextWindowItem = 1;
- StackWindowsItem = 2;
- TileWindowsItem = 3;
- PasteControlItem = 4;
- SelectToolsItem = 6;
- SelectGrayMapItem = 7;
- SelectLutItem = 8;
- SelectValuesItem = 9;
- SelectHistogramItem = 10;
- SelectPlotItem = 11;
- SelectResultsItem = 12;
-
- UserMenu = 139;
-
- TransferModeMenu = 200; {Popup Menu in Paste Control window}
- CopyModeItem = 1;
- AndItem = 2;
- OrItem = 3;
- XorItem = 4;
- ReplaceItem = 5;
- BlendItem = 6;
-
- LineToolMenu = 201;
- StraightItem = 1;
- SegmentedItem = 2;
- FreehandItem = 3;
-
- MinFree = 125000;
- HeaderSize = 512;
- TiffDirSize = 256;
- MaxLine = 4096;
- tleft = 36;
- ttop = 40;
- twidth = 44;
- tmiddle = 22;
- theight = 277;
- gmleft = 2;
- gmtop = 338;
- gmwidth = 78;
- gmheight = 118;
- gmRectLeft = 7;
- gmRectTop = 6;
- gmRectRight = 71;
- gmRectBottom = 70;
- gmSlideWidth = 68;
- gmSlideHeight = 7;
- gmSlide1Offset = 8;
- gmSlide2Offset = 19;
- gmIconWidth = 17;
- gmIconHeight = 14;
- gmIconOffset = 31;
- gmIcon1Left = 17;
- gmIcon2Left = 46;
- cleft = 2;
- ctop = 40;
- cwidth = 30;
- rwidth = 200;
- rheight = 225;
- hleft = 220;
- hwidth = 256;
- hheight = 120;
- pcwidth = 186;
- pcheight = 85;
- MaxPseudoColors = 32;
- MaxPseudoColorsLessOne = 31;
- PicKind = 88;
- HistoKind = 89;
- ProfilePlotKind = 90;
- LUTKind = 91;
- MapKind = 92;
- ToolKind = 93;
- ValuesKind = 94;
- CalibrationPlotKind = 95;
- PasteControlKind = 96;
- ResultsKind = 97;
- IOErrorID = 400;
- AboutID = 256;
- VersItem = 2;
- MemItem = 3;
- StackSize = 40000;
- ToolFont = 249; {Bits 7-14 of font resource ID(31884) }
- WindowsMenuItems = 13; {Items in Windows menu before images}
- ho = 2;
- vo = 4;
- WhiteIndex = 0;
- BlackIndex = 255;
- OvalSize = 15;
- LinesLeft = 13;
- LinesRight = 40;
- nLinetypes = 6;
- CheckMarkChar = 65;
- TxPlain = 1;
- TxBold = 2;
- TxItalic = 3;
- TxUnderLine = 4;
- TxOutLine = 5;
- TxShadow = 6;
- FileID8 = 'IPICIMAG';
- DefaultBufferSize = 307200; {Enough for 640x480 image}
- PickerCursorID = 111;
- LUTCursorID = 112;
- gmCursorID = 113;
- GrabberCursorID = 114;
- PencilCursorID = 115;
- CrossCursorID = 117;
- CrossCursorPlusID = 118;
- CrossCursorMinusID = 119;
- BucketCursorID = 120;
- GlassCursorPlusID = 121;
- GlassCursorMinusID = 122;
- WandCursorID = 123;
- WandPlusCursorID = 124;
- WandMinusCursorID = 125;
- AppleDefaultCLUT = 8;
- SpectrumCLUT = 200;
- KlutzID = 200;
- PixelPaintID = 999; {Used for PixelPaint and Canvas CLUTs}
- GhostWindow = $A84;
- GrayRgnGlobal = $9EE;
- MBarHeight = $BAA;
- MaxPics = 250;
- FirstExtraColorsEntry = 1;
- MaxExtraColors = 6;
- MaxExtraPlus2 = 8;
- ExtraColorsHeight = 10;
- MyMaxLong = 2000000000;
- MaxTextBufSize = 32700;
- MaxMaxRegions = 8000;
- MaxStandards = 20;
- BadReal = 808080.0;
- NoValue = -808080.0;
- TabSpacing = 12;
- MaxPolyVertices = 4000;
- pi = 3.1415926535898;
- ValuesVStart = 11;
- ValuesHStart = 4;
- {TIFF Constants}
- short = 3;
- long = 4;
- NewSubfileType = 254;
- ImageWidth = 256;
- ImageLength = 257;
- BitsPerSample = 258;
- Compression = 259;
- PhotoInterp = 262;
- StripOffsets = 273;
- SamplesPerPixel = 277;
- RowsPerStrip = 278;
- StripByteCount = 279;
- XResolution = 282;
- YResolution = 283;
- ResolutionUnit = 296;
- ColorMapTag = 320;
- ImageHdrTag = -22222; {43314}
- TiffFillerSize = 67;
- RoiHandleSize = 5;
- CancelResetID = 3;
- npcItems = 7;
- {Blend = 32;}
- {Transparent = 36;}
- LeftArrow = 28;
- RightArrow = 29;
- UpArrow = 30;
- DownArrow = 31;
- hPicOffset = 8;
- vPicOffset = 16;
- qcRowBytes = 1024;
- FunctionKey = 16;
- MaxMacroSize = 15000;
- MaxSymbols = 300;
- MaxStackSize = 100;
- MaxMacros = 50;
- SymbolSize = 12;
- MaxPicSize = 16383;
- ScrollBarWidth = 15;
- PrefsName = 'Image Prefs';
- StraightChar = 97;
- SegmentedChar = 98;
- FreehandChar = 99;
- MaxSlices = 256;
- HomeKey = 1;
- EndKey = 4;
- PageUp = 11;
- PageDown = 12;
- osEvt = 15;
- Pseudo20ID = 1001;
- Pseudo32ID = 1002;
- RainbowID = 1003;
- Fire1ID = 1004;
- Fire2ID = 1005;
- IceID = 1006;
- GraysID = 1007;
- MaxColor = 15000;
- MaxCoordinates = 10000;
-
-
-
- type
- BitMapHandle = ^BitMapPtr;
- BitMapPtr = ^BitMap;
- UnsignedByte = 0..255;
- LineType = packed array[0..MaxLine] of UnsignedByte;
- LinePtr = ^LineType;
- rLineType = array[1..MaxLine] of real;
- ClutTable = packed array[0..255] of integer;
- ColorArray = packed array[0..MaxPseudoColorsLessOne] of byte;
- LutArray = packed array[0..255] of byte;
- PicType = (pdp11, NewPicture, normal, PictFile, Leftover, imported, QuickCaptureType, NullPicture, BlankField, TiffFile, InvertedTIFF, FourBitTIFF, ScionType, PicsFile);
- LUTModeType = (PseudoColor, OldAppleDefault, OldSpectrum, GrayScale, ColorLut, CustomGrayscale);
- ColorTableType = (CustomTable, AppleDefault, Pseudo20, Pseudo32, Rainbow, Fire1, Fire2, Ice, Grays, Spectrum);
- ExtraColorsArray = array[1..MaxExtraColors] of rgbColor;
- MyCSpecArray = array[0..255] of ColorSpec;
- CoefficientArray = array[1..6] of double;
- CurveFitType = (StraightLine, Poly2, Poly3, Poly4, Poly5, ExpoFit, PowerFit, LogFit, RodbardFit, SpareFit1, SpareFit2, UncalibratedOD);
- UnitsType = (Nanometers, Micrometers, Millimeters, Centimeters, Meters, Kilometers, Inches, Feet, Miles, Pixels);
- FileDepthType = (EightBits, SixteenBitsUnsigned, SixteenBitsSigned);
- RoiTypeType = (RgnRoi, RectRoi, OvalRoi, LineRoi, FreeLineRoi, SegLineRoi, NoRoi);
-
- PicHeader = record
- FileID: packed array[1..8] of char; {8 8}
- hnlines: integer; {2 10}
- hPixelsPerLine: integer; {2 12}
- hversion: integer; {2 14}
- hOldLutMode: LutModeType; {2 16}
- hOldnColors: integer; {2 18}
- hr, hg, hb: ColorArray; {96 114}
- hOldColorStart: integer; {2 116}
- hColorWidth: integer; {2 118}
- hExtraColors: ExtraColorsArray; {36 154}
- hnExtraColors: integer; {2 156}
- hForegroundIndex: integer; {2 158}
- hBackgroundIndex: integer; {2 160}
- hRawSpatialScale: double; {8 168}
- Unused2: integer; {2 170}
- Unused3: integer; {2 172}
- hUnitsID: integer; {2 174}
- hp1x, hp1y, hp2x, hp2y: integer; {8 182}
- hfit: CurveFitType; {2 184}
- hnCoefficients: integer; {2 186}
- hCoeff: CoefficientArray; {48 234}
- hUM: string[15]; {16 250}
- UnusedBoolean: boolean; {1 251}
- hBinaryPic: boolean; {1 252}
- hSliceStart: integer; {2 254}
- hSliceEnd: integer; {2 256}
- hScaleMagnification: real; {4 260}
- hNSlices: integer; {2 262}
- hSliceSpacing: real; {4 266}
- hCurrentSlice: integer; {2 268}
- hLoopTime: real; {4 272}
- hPixelAspectRatio: real; {4 276}
- hColorStart: integer; {2 278}
- hColorEnd: integer; {2 280}
- hnColors: integer; {2 282}
- hFill1, hFill2: RGBColor; {12 294}
- hTable: ColorTableType; {1 295}
- hLutMode: LutModeType; {1 296}
- hInvertedTable: boolean; {1 297}
- hZeroClip: boolean; {1 298}
- UnusedBytes: packed array[1..214] of byte;
- end;
-
- StackInfoRec = record
- nSlices: integer;
- CurrentSlice: integer;
- PicBaseH: array[1..MaxSlices] of handle;
- SliceSpacing: real;
- LoopTime: real;
- end;
- StackInfoPtr = ^StackInfoRec;
-
- PaletteHeader = record
- pID: packed array[1..4] of char; {4 4}
- pVersion: integer; {2 6}
- pnColors: integer; {2 8}
- pColorStart: integer; {2 10}
- pColorEnd: integer; {2 12}
- pFill1: rgbColor; {6 18}
- pFill2: rgbColor; {6 24}
- pUnused: array[1..4] of integer; {8 32}
- end;
-
- RoiHeader = record
- rID: packed array[1..4] of char; {4 4}
- rVersion: integer; {2 6}
- rRoiType: RoiTypeType; {2 8}
- rRoiRect: rect; {8 16}
- rNCoordinates: integer; {2 18}
- rX1, rY1, rX2, rY2: real; {16 34}
- rLineWidth: integer; {2 36}
- rUnused: array[1..14] of integer; {28 64}
- end;
-
- PicInfo = record
- nlines, PixelsPerLine: integer;
- ImageSize: LongInt;
- BytesPerRow: integer;
- PicBaseAddr: ptr;
- PicBaseHandle: handle;
- osPort: cGrafPtr; {Offscreen Port}
- PicRect: rect;
- RoiRect: rect;
- roiRgn: rgnHandle;
- RoiType: RoiTypeType;
- SrcRect: rect;
- wrect: rect;
- initwrect: rect;
- savewrect, SaveSrcRect: rect;
- SaveMagnification: extended;
- savehloc, savevloc: integer; {Old window location in global coordinates}
- RoiShowing: boolean;
- title: string[30];
- NewPic: boolean;
- Magnification: extended;
- vref: integer;
- PictureType: PicType;
- wptr: WindowPtr;
- PicNum: integer;
- ScaleToFitWindow: boolean;
- Changes: boolean;
- RedLUT, GreenLUT, BlueLUT: LutArray;
- nColors: integer;
- ColorStart, ColorEnd: LongInt;
- FillColor1, FillColor2: RGBColor;
- LUTMode: LUTModeType;
- ColorTable: ColorTableType;
- InvertedColorTable: boolean;
- cTable: MyCSpecArray;
- IdentityFunction: boolean;
- PixMapSize: LongInt;
- RawSpatialScale, xSpatialScale, ySpatialScale, ScaleMagnification, UnitsPerCM, PixelAspectRatio: extended;
- units: string[2];
- FullUnits: string[11];
- UnitsID: UnitsType;
- UnitOfMeasure: string[15];
- HeaderOffset, ImageDataOffset, ColorMapOffset: LongInt;
- Fit: CurveFitType;
- nCoefficients: integer;
- Coefficient: CoefficientArray;
- DensityCalibrated, SpatiallyCalibrated: boolean;
- ZeroClip: boolean;
- BinaryPic: boolean;
- WindowState: (NormalWindow, TiledSmall, TiledSmallScaled, TiledBig, TiledBigScaled);
- FileDepth: FileDepthType;
- Revertable: boolean;
- LX1, LY1, LX2, LY2: real;
- cLength, uLength: extended;
- StackInfo: StackInfoPtr;
- end;
-
- InfoPtr = ^PicInfo;
- ToolType = (MagnifyingGlass, SelectionTool, Grabber, OvalSelectionTool, Pencil, PolygonTool, Eraser, FreehandTool, Brush, LineTool, ruler, LUTTool, PaintBucket, TextTool, PlotTool, AirbrushTool, Wand, PickerTool, AngleTool, CrossHairTool);
- OpType = (InvertOp, PaintOp, FrameOp, EraseOp, PasteOp, AddOp, SubtractOp, MultiplyOp, DivideOp);
- ObjectType = (lineObj, oval, SelectionOval, Rectangle, PlotLine, SelectionRect, BrushObj);
- FilterType = (WeightedAvg, UnweightedAvg, fsharpen, fshadow, EdgeDetect, ReduceNoise, dither, erosion, dilation, OutlineFilter, skeletonize);
- rhptr = ^RgnHandle;
- FlipRotateType = (RotateLeft, RotateRight, FlipVertical, FlipHorizontal);
- TextBackType = (NoBack, WithBack);
- HistogramType = array[0..255] of LongInt;
- str4 = packed array[1..4] of char;
- LookupTable = packed array[0..255] of UnsignedByte;
- TextBufType = packed array[1..MaxTextBufSize] of char;
- TextBufPtr = ^TextBufType;
- SortArray = array[1..9] of integer;
- StandardsArray = array[1..MaxStandards] of extended;
- MeasurementTypes = (AreaM, MeanM, StdDevM, xyLocM, ModeM, LengthM, MajorAxisM, MinorAxisM, AngleM, IntDenM, MinMaxM, User1M, User2M);
- TiffHdr = record
- ByteOrder: packed array[1..2] of char;
- Version: integer;
- FirstIFDOffset: LongInt;
- end;
- TiffEntry = record
- TagField: integer;
- ftype: integer;
- length: LongInt;
- offset: LongInt;
- end;
- pcItemType = (pcPopupMenu, pcCheckBox, pcButton);
- WhatToImportType = (ImportTIFF, ImportMCID, ImportLUT, ImportText, ImportCustom);
- FateTable = array[0..255] of integer;
- SaveAsWhatType = (asTIFF, asPICT, asMacPaint, asPICS, AsPalette, AsOutline, AsRawData, SaveAsMCID);
- ExportAsWhatType = (AsRaw, asMCID, asText, AsLUT, asMeasurements, asPlotValues, asHistogramValues, asCoordinates);
-
- RealArray = array[0..MaxMaxRegions] of real;
- meanType = RealArray;
- sdType = RealArray;
- PixelCountType = array[0..MaxMaxRegions] of LongInt;
- AreaType = RealArray;
- modeType = RealArray;
- IntegratedDensityType = RealArray;
- idBackgroundType = RealArray;
- xcenterType = RealArray;
- ycenterType = RealArray;
- MajorAxisType = RealArray;
- MinorAxisType = RealArray;
- orientationType = RealArray;
- MinType = RealArray;
- MaxType = RealArray;
- plengthType = RealArray;
- User1Type = RealArray;
- User2Type = RealArray;
-
- meanPtr = ^meanType;
- sdPtr = ^sdType;
- PixelCountPtr = ^PixelCountType;
- AreaPtr = ^AreaType;
- modePtr = ^modeType;
- IntegratedDensityPtr = ^IntegratedDensityType;
- idBackgroundPtr = ^idBackgroundType;
- xcenterPtr = ^xcenterType;
- ycenterPtr = ^ycenterType;
- MajorAxisPtr = ^MajorAxisType;
- MinorAxisPtr = ^MinorAxisType;
- orientationPtr = ^orientationType;
- MinPtr = ^MinType;
- MaxPtr = ^MaxType;
- plengthPtr = ^plengthType;
- User1Ptr = ^User1Type;
- User2Ptr = ^User2Type;
-
- TokenType = (NullT, beginT, endT, identifier, UnknownIdentifier, DoneT, LeftParen, RightParen, LeftBracket, RightBracket, comma, colon, SemiColon, stringT, NumericLiteral, VarT, IntegerT, RealT, BooleanT, CommandT, FunctionT, ArrayT, AssignOp, ForT, ToT, DoT, IfT, ThenT, ElseT, whileT, repeatT, untilT, IntVarT, Variable, PlusOp, MinusOp, MulOp, DivOp, eqOP, ltOp, gtOp, neOp, leOp, geOp, orOp, IntDivOp, modOp, andOp, NotOp, ProcedureT, MacroT, ProcIdT, TrueT, FalseT);
- CommandType = (SetUser1C, SetUser2C, GetPlotCountC, PlotDataC, RequiresC, SetOptionsC, BufferC, GetSpacingC, SetSpacingC, PropagateLutC, PropagateDensityC, PropagateSpatialC, SetCountC, ShowMsgC, UpdateLutC, SetCounterC, RedLutC, GreenLutC, BlueLutC, SaveStateC, RestoreStateC, GetTimeC, SetScaleC, MakeLineC, PlotProfileC, ResliceC, CopyModeC, TriggerC, AverageFramesC, AddSliceC, DeleteSliceC, MakeStackC, GetSliceC, nSlicesC, SelectSliceC, ChooseSliceC, GetMouseC, SetMajorC, SetMinorC, TileC, rAreaC, rMeanC, rStdDevC, rAngleC, rXC, rYC, rLengthC, rMajorC, rMinorC, rMinC, rMaxC, rUser1C, rUser2C, UpdateResultsC, rCountC, HistogramC, ChangeC, ExportC, PicNumC, ScaleSelectionC, ScalingOptionsC, PutPixelC, ChoosePicC, WriteC, WritelnC, AreaC, DensityC, StdC, XyC, ModeC, PerimeterC, MajorC, MinorC, AngleC, IntDensityC, MinMaxC, SetPrecisionC, SetParticleSizeC, AdjustC, IgnoreC, OutlineParticlesC, LabelC, IncludeC, AutoC, PlotXYZC, CalibratedC, cValueC, SameSizeC, GetColumnC, PutColumnC, GetRowC, PutRowC, ShowResultsC, SetWidthC, ScaleMathC, InvertYC, AndC, OrC, XorC, BlendC, ReplaceC, AddC, SubC, MulC, DivC, SetOptionC, GetResultsC, SetLabelsC, SetPlotScaleC, SetDimC, ColumnC, ChannelC, ShowPasteC, NullC, RotateRC, RotateLC, FlipVC, FlipHC, CopyC, SelectC, ClearC, FillC, InvertC, FrameC, PasteC, KillC, RestoreC, AnalyzeC, ConvolveC, NextC, MarkC, MeasureC, ThresholdC, ResetgmC, MakeBinC, DitherC, SmoothC, SharpenC, ShadowC, TraceC, ReduceC, SetSliceC, RedirectC, WaitC, ResetmC, UndoC, SetForeC, SetBackC, ScaleC, HistoC, EnhanceC, EqualizeC, ErodeC, DilateC, OutlineC, ThinC, AddConstC, MulConstC, RevertC, BeepC, NopC, MakeC, MakeOvalC, MoveC, InsetC, MoveToC, LineToC, DrawTextC, DrawNumC, SetFontC, SetFontSizeC, SetTextC, GetPicSizeC, PutMsgC, ExitC, GetRoiC, TruncC, RoundC, GetNumC, StartC, StopC, CaptureC, RandomC, MakeNewC, DrawScaleC, SetPaletteC, GetPixelC, ButtonC, oddC, absC, sqrtC, sinC, cosC, expC, lnC, arctanC, sqrC, OpenC, ImportC, SetImportC, SetMinMaxC, SetCustomC, nPicsC, SelectPicC, SetPicNameC, ApplyLutC, SetSizeC, SaveC, SaveAllC, SaveAsC, CopyResultsC, CloseC, DisposeC, DisposeAllC, DupC, GetInfoC, PrintC, GetLineC);
- SymbolType = packed array[1..SymbolSize] of char;
- VarType = (IntVar, RealVar, BooleanVar);
- SymTabRec = record
- Symbol: SymbolType;
- tType: TokenType;
- cType: CommandType;
- loc: integer;
- end;
- StackRec = record
- Symbol: SymbolType;
- vType: VarType;
- Value: extended;
- end;
- MacrosRec = record
- Macros: packed array[0..MaxMacroSize] of char;
- SymbolTable: array[1..MaxSymbols] of SymTabRec;
- stack: array[1..MaxStackSize] of StackRec;
- aLine: LineType;
- end;
- MacrosPtr = ^MacrosRec;
- rsMethodType = (Bilinear, NearestNeighbor);
- TiffColorMapType = array[1..3] of array[0..255] of integer;
- StackIFDType = record
- nEntries: integer; {2}
- TiffDir: array[1..6] of TiffEntry; {72}
- NextIFD: LongInt; {4}
- end;
-
- SettingsType = record
- sID: packed array[1..4] of char;
- sVersion: integer;
- sForegroundIndex, sBackgroundIndex: integer;
- sBrushHeight, sBrushWidth: integer;
- sAirbrushDiameter: integer;
- sLUTMode: LUTModeType;
- sOldColorStart: integer;
- sOldColorWidth: integer;
- sCurrentFontID: integer;
- sCurrentStyle: style;
- sCurrentSize: integer;
- sTextJust: integer;
- sTextBack: TextBackType;
- snExtraColors: integer;
- sExtraColors: ExtraColorsArray;
- sInvertVideo: boolean;
- sMeasurements: set of MeasurementTypes;
- sInvertPlots, sAutoScalePlots, sLinePlot, sDrawPlotLabels, sFixedSizePlot: boolean;
- sUnused1: packed array[1..12] of integer;
- sProfilePlotWidth, sProfilePlotHeight: integer;
- sFramesToAverage: integer;
- sNewPicWidth, sNewPicHeight: integer;
- sBufferSize: LongInt;
- sMaxScionWidth: integer;
- sThresholdToForeground, sNonThresholdToBackground: boolean;
- sVideoChannel: integer;
- sWhatToImport: WhatToImportType;
- sImportCustomWidth, sImportCustomHeight: integer;
- sImportCustomOffset: LongInt;
- sWandAutoMeasure, sWandAdjustAreas: boolean;
- sBinaryIterations: integer;
- sScaleArithmetic: boolean;
- sInvertPixelValues: boolean;
- sInvertYCoordinates: boolean;
- sFieldWidth, sPrecision: integer;
- sMinParticleSize, sMaxParticleSize: LongInt;
- sIgnoreParticlesTouchingEdge, sLabelParticles, sOutlineParticles, sIncludeHoles: boolean;
- sKernelsVRefNum: integer;
- sKernelsDirID: LongInt;
- sDefaultVRefNum: integer;
- sDefaultDirID: LongInt;
- sOscillatingMovies: boolean;
- sDriverHalftoning: boolean;
- sMaxRegions: integer;
- sImportCustomDepth: FileDepthType;
- sImportSwapBytes, sImportCalibrate, sImportAutoscale: boolean;
- sUnused2: packed array[1..12] of integer;
- sShowHeadings: boolean;
- {Added with V1.40}
- sProfilePlotMin, sProfilePlotMax: real;
- sImportMin, sImportMax: real;
- sHighlightPixels: boolean;
- {Added with V1.41}
- sBallRadius: integer;
- sFasterBackgroundSubtraction: boolean;
- sScaleConvolutions: boolean;
- {Added with V1.42}
- sBinaryCount: integer;
- sColorTable: ColorTableType;
- sColorStart, sColorEnd: integer;
- sInvertedTable: boolean;
- {Added with V1.44}
- sHalftoneFrequency, sHalftoneAngle: integer;
- sHalftoneDotFunction: boolean;
- end;
-
- TiffInfoRec = record
- Width, Height: integer;
- BitsPerPixel: integer;
- ZeroIsBlack: boolean;
- OffsetToData, OffsetToColorMap, OffsetToImageHeader: LongInt;
- Resolution: extended;
- ResUnits: (tCentimeters, tInches, tNoUnits);
- NextIFD: LongInt;
- end;
-
- TiffIFDTable = array[1..MaxSlices] of record
- iWidth, iHeight: integer;
- Offset: LongInt;
- Invert: boolean;
- end;
-
- PaletteRecType = record
- NumberOfColors: integer;
- RedData: ColorArray;
- GreenData: ColorArray;
- BlueData: ColorArray;
- end;
-
- ProjectionMethodType = (NearestPoint, BrightestPoint, MeanValue);
- AxisType = (XAxis, YAxis, ZAxis);
-
- CoordinatesType = array[1..MaxCoordinates] of integer;
- xCoordinatesPtr = ^CoordinatesType;
- yCoordinatesPtr = ^CoordinatesType;
- WhatToUndoType = (NothingToUndo, UndoEdit, UndoFlip, UndoRotate, UndoFilter, UndoPaste, UndoTransform, UndoClear, UndoMeasurement, UndoPoint, UndoZoom, UndoOutline, UndoSliceDelete, UndoFirstSliceDelete, UndoLUT);
-
-
-
- var
- TraceInfo: str4;
- finished: boolean;
- trect, gmrect, MapRect, MapRect2, crect, HistoRect: rect;
- gmSlide1, gmslide2, gmSlide1i, gmSlide2i, gmicon1, gmicon2: rect;
- ToolWindow, MapWindow, LUTWindow, ValuesWindow, HistoWindow, PlotWindow, PasteControl: WindowPtr;
- BuggyWatch: CursHandle;
- cr, tab, BackSpace, eof: char;
- CharCount: LongInt;
- ScreenPort: GrafPtr;
- CScreenPort: cGrafPtr;
- ticks: LongInt;
- MonoFunction: ClutTable;
- Info: InfoPtr;
- ToolCursor: array[ToolType] of Cursor;
- PickerCursor, LUTCursor, gmCursor, CrossPlusCursor, CrossMinusCursor, GlassMinusCursor, watch, WandPlusCursor, WandMinusCursor: Cursor;
- CurrentTool, PreviousTool, FirstTool, LastTool: ToolType;
- ToolRect: array[ToolType] of rect;
- ToolChar, ToolCursorChar: array[ToolType] of char;
- ToolTime, LutTime: longInt;
- nPics: integer;
- PicWindow: array[1..MaxPics] of WindowPtr;
- ScreenWidth, ScreenHeight: integer;
- ScreenBase: ptr;
- ScreenRowBytes: LongInt;
- Histogram: HistogramType;
- HistogramSliceStart, HistogramSliceEnd: integer;
- ForegroundIndex, BackgroundIndex: integer;
- lines: array[1..nLineTypes] of rect;
- CheckRect: rect;
- LineWidth, LineIndex: integer;
- StartOfLines: integer;
- MaskRgn: RgnHandle;
- PlotPICT: PicHandle;
- PlotLeft, PlotTop, PlotWidth, PlotHeight: integer;
- PlotMin, PlotMax: extended;
- PlotCount, PlotAvg: integer;
- PlotData: LinePtr;
- PlotMean: extended;
- InvertPlots, AutoscalePlots, LinePlot, DrawPlotLabels, FixedSizePlot: boolean;
- ProfilePlotMin, ProfilePlotMax: extended;
- ProfilePlotWidth, ProfilePlotHeight: integer;
- UndoBuf, ClipBuf, BigBuf: ptr;
- ClipBufSize, UndoBufSize, BigBufSize: LongInt;
- UndoInfoRec: PicInfo;
- UndoInfo: InfoPtr;
- CurrentUndoSize: LongInt;
- AirbrushDiameter, AirbrushRadius, AirbrushRadius2: integer;
- BrushHeight, BrushWidth: integer;
- CurrentFontID, CurrentSize, NumFontItems: integer;
- CurrentStyle: Style;
- InsertionPoint: point; {Offscreen coordinates}
- IsInsertionPoint: boolean;
- TextJust: integer;
- TextBack: TextBackType;
- TextStr: str255;
- TextRect: rect;
- TextStart: point;
- BlinkTime: LongInt;
- pat: array[0..7] of pattern;
- PatIndex: integer;
- OpPending: boolean;
- CurrentOp: OpType;
- IsOK: boolean;
- PicLeftBase, PicTopBase, PicLeft, PicTop: integer;
- ClipBufInfoRec: PicInfo;
- ClipBufInfo: InfoPtr;
- MouseState: (NotInRoi, InRoi, DownInRoi);
- osMouseDownLoc: point;
- OldRoiRect: rect;
- WhatsOnClip: (Nothing, AColor, RectPic, NonRectPic, ImportedPic, CameraPic, TextOnClip);
- ClipTextInBuffer: boolean;
- ExtraColors: ExtraColorsArray;
- nExtraColors: integer;
- PasteTransferMode: integer;
- cheight: integer;
- ExtraColorsRect: array[1..MaxExtraPlus2] of rect;
- ExtraColorsEntry: array[1..MaxExtraPlus2] of integer;
- RoiMode: (MoveMode, StretchMode, LeftEndMode, RightEndMode);
- OldScrapCount: integer;
- ClipboardConverted: boolean;
- results: record
- tmean: extended;
- MinIndex, MaxIndex, imode, imean: integer;
- end;
- FrameGrabber: (QuickCapture, Scion, NoFrameGrabber);
- DTSlotBase, ScionSlotBase: LongInt;
- ControlReg, ChannelReg: ptr;
- Digitizing: boolean;
- debugging: boolean;
- NoInfo: InfoPtr;
- NoInfoRec: PicInfo;
- UndoFromClip: boolean;
- DensitySlicing, Thresholding, ThresholdToForeground, NonThresholdToBackground: boolean;
- SliceStart, SliceEnd: integer;
- SliceColor: RGBColor;
- BlankFieldInfo: InfoPtr;
- BlankFieldMean: integer;
- QuickCaptureInfo, ScionInfo: InfoPtr;
- InvertVideo, HighlightSaturatedPixels: boolean;
- VideoChannel: integer;
- TextBufSize, TextBufColumn, TextBufLineCount: integer;
- TextBufP: TextBufPtr;
- BitInfoCount: integer;
- mCount, mCount2: integer;
- nPoints, nLengths, nAngles: integer;
- umean: array[0..MaxStandards] of real; {Uncalibrated means}
- StandardValues: StandardsArray;
- nStandards: integer;
- cvalue: array[0..255] of extended;
- MinValue, MaxValue, FitGoodness, FitSD: extended;
- PlotLeftMargin, PlotTopMargin, PlotBottomMargin, PlotRightMargin: integer;
- WhatToUndo: WhatToUndoType;
- WhatToCopy: (NothingToCopy, CopySelection, CopyCLUT, CopyGrayMap, CopyTools, CopyPlot, CopyCalibrationPlot, CopyHistogram, CopyMeasurements, CopyColor);
- WhatToPrint: (NothingToPrint, PrintImage, PrintSelection, PrintMeasurements, PrintPlot, PrintHistogram);
- PrintRecord: THPrint;
- isLaserWriter: boolean;
- printing: boolean;
- HalftoneFrequency, HalftoneAngle: integer;
- HalftoneDotFunction: boolean;
- AppleMenuH, FileMenuH, EditMenuH, OptionsMenuH, ColorTablesMenuH, PropagateMenuH, EnhanceMenuH, BinaryMenuH, ArithmeticMenuH, BackgroundMenuH, AnalyzeMenuH, SpecialMenuH, StacksMenuH, SortPaletteMenuH, FontMenuH, SizeMenuH, StyleMenuH, WindowsMenuH, UserMenuH, TransferModeMenuH, LineToolMenuH: MenuHandle;
- rleft, rtop: integer;
- ListDone: boolean;
- ResultsWindow: WindowPtr;
- hScrollBar, vScrollBar: ControlHandle;
- ListTE: TEHandle;
- hListPageSize, vListPageSize: integer;
- measuring: boolean;
- Measurements: set of MeasurementTypes;
- nListColumns: integer;
- FramesToAverage: integer;
- xLabel, yLabel, zLabel: string[31];
- xValueLoc, yValueLoc, zValueLoc: integer;
- MenuBarHeight: integer;
- NewPicWidth, NewPicHeight: integer;
- RestoreUndoBuf: boolean;
- WhatToOpen: (OpenImage, OpenPICT2, OpenTIFF, OpenMCID, OpenUnknown, OpenImported, OpenCustom);
- WhatToImport: WhatToImportType;
- ImportCustomWidth, ImportCustomHeight: integer;
- ImportCustomOffset: LongInt;
- ImportCustomDepth: FileDepthType;
- ImportSwapBytes, ImportAll, ImportCalibrate: boolean;
- IntelByteOrder: boolean;
- BufferSize: LongInt;
- MaxScionWidth: integer;
- isSelectionTool: boolean;
- SelectionMode: (NewSelection, AddSelection, SubSelection);
- RoiMovementState: (Unconstrained, Constrained, ConstrainedH, ConstrainedV);
- pcItem: array[1..npcItems] of record
- r: rect;
- itype: pcItemType;
- str: string[20];
- end;
- PictF: integer;
- PictBuffer, curPictBufPtr: ptr;
- BytesInPictBuffer: LongInt;
- FitsInPictBuffer, RoiNudged, GrayMapReady, RedoSelection: boolean;
- ThresholdingMode: (DensitySlice, GrayMapThresholding, BinaryImage, NoThresholding);
- WandAutoMeasure, WandAdjustAreas, RedirectSampling: boolean;
- LabelParticles, OutlineParticles, IgnoreParticlesTouchingEdge, IncludeHoles: boolean;
- MinParticleSize, MaxParticleSize: LongInt;
- OptionKeyWasDown, ScaleArithmetic, FitEllipse, AnalyzingParticles: boolean;
- WhiteRGB, BlackRGB: RGBColor;
- BinaryIterations: integer;
- nMonitors: integer;
- Monitors: array[1..6] of GDHandle;
- ValuesMessage: str255;
- DTStartTicks, DTFrameCount: LongInt;
- SaveAsWhat: SaveAsWhatType;
- ExportAsWhat: ExportAsWhatType;
- SaveAllState: (NoSaveAll, SaveAllStage1, SaveAllStage2);
- InvertPixelValues, InvertYCoordinates, ContinuousHistogram: boolean;
- qcPort: cGrafPtr;
- qcWidth, qcHeight: integer;
- RoiUpdateTime: LongInt; {Time required to draw ROI outline. Set to 0 to force redraw.}
- FieldWidth: integer;
- Precision: integer; {Digits to right of decimal point}
- MeasurementToRedo: integer;
- Has32BitQuickDraw: boolean;
- DefaultRefNum, KernelsRefNum: integer;
- DefaultFileName: string[63];
- rsHScale, rsVScale, rsAngle: real; {Rotate and Scale Parameters}
- rsMethod: rsMethodType;
- rsCreateNewWindow: boolean;
- rsInteractive: boolean;
- TextEol, TextEof: boolean;
- Textf, TextIndex: integer;
- TextFileSize: LongInt;
- nMacros, nSymbols: integer;
- Macro: boolean; {Set true if macro is running.}
- MacrosP: MacrosPtr;
- MacroCommand: CommandType;
- ImportAutoScale: boolean;
- ImportMin, ImportMax: extended;
- OscillatingMovies, DriverHalftoning: boolean;
- ExplicitPalette: PaletteHandle;
- LivePasteMode: boolean;
- ShowCount: boolean;
- PasteControlLeft, PasteControlTop: integer;
- MaxRegions: integer;
- mean: meanPtr;
- sd: sdPtr;
- PixelCount: PixelCountPtr;
- mArea: AreaPtr;
- mode: modePtr;
- IntegratedDensity: IntegratedDensityPtr;
- idBackground: idBackgroundPtr;
- xcenter: xcenterPtr;
- ycenter: ycenterPtr;
- MajorAxis: MajorAxisPtr;
- MinorAxis: MinorAxisPtr;
- orientation: orientationPtr;
- mMin: MinPtr;
- mMax: MaxPtr;
- plength: plengthPtr;
- User1: User1Ptr;
- User2: User2Ptr;
- ResultsLeft, ResultsTop, ResultsWidth, ResultsHeight: integer;
- UnsavedResults: boolean;
- MajorLabel, MinorLabel, User1Label, User2Label: string[9];
- OldSystem, System7: boolean;
- SystemRefNum: integer;
- ShowHeadings: boolean;
- MakingLOI: boolean;
- LOIType: (Straight, Freehand, Segmented);
- MakingStack: boolean;
- FramesWanted: integer;
- ScaleConvolutions: boolean;
- FasterBackgroundSubtraction: boolean;
- BallRadius: integer;
- DelayTicks: integer;
- CmdPeriodToStop: string[21];
- CommandKey: char;
- BinaryCount, BinaryThreshold: integer;
- ClipboardColor: rgbColor;
- InitAngle, TotalAngle, AngleInc, {initial, total, and incremental angles of volume rotation}
- TransparencyLower, {pixels below this threshold are transparent}
- TransparencyUpper, {pixels above this threshold are transparent}
- Opacity, {percentage nearest-point in a combined projection}
- DepthCueSurf, {depth-cueing constant for nearest-pt component}
- DepthCueInt: integer; {depth-cueing constant for other projection components}
- AxisOfRotation: AxisType; {project volume as it rotates about x,y,or z-axis}
- SaveProjections, {if TRUE, save and close proj frames once created}
- MinProjSize: boolean; {if FALSE, make windows same size regardless of rotation axis}
- ProjectionMethod: ProjectionMethodType;
- MeterWindow: WindowPtr;
- xCoordinates: xCoordinatesPtr;
- yCoordinates: yCoordinatesPtr;
- nCoordinates: integer;
- BlankLine: LinePtr;
- SwitchLUTOnSuspend: boolean;
- SumFrames, ExternalTrigger, BlindMovieCapture: boolean;
-
-
-
-
-
- implementation
-
- end.