unit Globals; {Global declarations for Image program.} interface uses QuickDraw, Palettes, PrintTraps; const Version = 137; 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 = 5; PseudoColorItem = 6; AppleColorsItem = 7; RainbowItem = 8; PreferencesItem = 10; PlotOptionsItem = 11; ScaleToFitItem = 12; ThresholdItem = 13; SliceItem = 14; PropagateItem = 15; 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; ApplyItem = 11; EnhanceItem = 12; EqualizeItem = 13; ChangeItem = 14; BinaryMenu = 35; {Sub Menu} MakeBinaryItem = 1; ErosionItem = 3; DilationItem = 4; OpeningItem = 5; ClosingItem = 6; IterationsItem = 7; OutlineItem = 9; SkeletonizeItem = 10; ArithmeticMenu = 37; {Sub Menu} AddItem = 1; SubtractItem = 2; MultiplyItem = 3; DivideItem = 4; LogItem = 5; AnalyzeMenu = 133; MeasureItem = 1; AnalyzeItem = 2; ShowItem = 3; HistogramItem = 4; PlotItem = 5; Plot3DItem = 6; OptionsItem = 7; SetScaleItem = 9; CalibrateItem = 10; RedoItem = 11; DeleteItem = 12; ResetItem = 13; RestoreItem = 14; MarkItem = 15; TextMenu = 134; LeftItem = 5; CenterItem = 6; RightItem = 7; NoBackgroundItem = 9; WithBackgroundItem = 10; FontMenu = 32; {Sub Menus} SizeMenu = 33; StyleMenu = 34; WindowsMenu = 138; NextWindowItem = 1; StackWindowsItem = 2; TileWindowsItem = 3; PasteControlItem = 4; SelectToolsItem = 6; SelectGrayMapItem = 7; SelectLutItem = 8; SelectResultsItem = 9; SelectHistogramItem = 10; SelectPlotItem = 11; SelectMeasurementsItem = 12; UserMenu = 139; SpecialMenu = 140; StartItem = 1; AverageItem = 2; SaveBlankFieldItem = 3; SetVideoItem = 4; MakeMovieItem = 6; AnimateItem = 7; PhotoModeItem = 9; SortItem = 10; LoadMacrosItem = 12; FirstMacroItem = 14; SortPaletteMenu = 36; {Sub Menu} byHueItem = 1; bySaturationItem = 2; byBrightnessItem = 3; 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; HeaderSize = 512; TiffDirSize = 256; MaxPixelsPerLine = 2048; 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 = 75; MaxPseudoColors = 32; MaxPseudoColorsLessOne = 31; PicKind = 88; HistoKind = 89; ProfilePlotKind = 90; LUTKind = 91; GrayMapKind = 92; ToolKind = 93; ResultsKind = 94; CalibrationPlotKind = 95; PasteControlKind = 96; MeasurementsKind = 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; AppleDefaultCLUT = 8; SpectrumCLUT = 200; KlutzID = 200; PixelPaintID = 999; {Used for PixelPaint and Canvas CLUTs} GhostWindow = $A84; GrayRgnGlobal = $9EE; MBarHeight = $BAA; MaxPics = 250; NoColor = -1; 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.14159265; ValuesVStart = 11; ValuesHStart = 4; {TIFF Constants} short = 3; long = 4; SubFileType = 255; ImageWidth = 256; ImageLength = 257; BitsPerSample = 258; Compression = 259; PhotoInterp = 262; StripOffsets = 273; RowsPerStrip = 278; XResolution = 282; YResolution = 283; ResolutionUnit = 296; ImageHdrTag = -22222; {43314} TiffFillerSize = 80; RoiHandleSize = 5; CancelResetID = 3; npcItems = 6; blend = 32; LeftArrow = 28; RightArrow = 29; UpArrow = 30; DownArrow = 31; hPicOffset = 8; vPicOffset = 16; transparent = 36; qcRowBytes = 1024; FunctionKey = 16; MaxMacroSize = 15000; MaxSymbols = 250; MaxStackSize = 100; MaxMacros = 50; SymbolSize = 12; MaxPicSize = 4096; ScrollBarWidth = 15; PrefsName = 'Image Prefs'; type BitMapHandle = ^BitMapPtr; BitMapPtr = ^BitMap; UnsignedByte = 0..255; LineType = packed array[0..MaxPixelsPerLine] of UnsignedByte; rLineType = array[1..MaxPixelsPerLine] of real; ClutTable = packed array[0..255] of integer; ColorArray = packed array[0..MaxPseudoColorsLessOne] of byte; ColorArrayX = packed array[0..MaxPseudoColorsLessOne] of integer; PicType = (pdp11, NewPicture, normal, PictFile, Leftover, imported, QuickCaptureType, NullPicture, BlankField, TiffFile, InvertedTIFF, FourBitTIFF, ScionType); LUTModeType = (PseudoColor32, AppleDefault, Spectrum, GrayScale, Custom, CustomGrayscale); 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); UnitsType = (Nanometers, Micrometers, Millimeters, Centimeters, Meters, Kilometers, Inches, Feet, Miles, Pixels); FileDepthType = (EightBits, SixteenBitsUnsigned, SixteenBitsSigned); PicHeader = record FileID: packed array[1..8] of char; {8 8} hnlines: integer; {2 10} hPixelsPerLine: integer; {2 12} hversion: integer; {2 14} hLutMode: LutModeType; {2 16} hnColors: integer; {2 18} hr, hg, hb: ColorArray; {96 114} hColorStart: 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} UnusedBytes: packed array[1..252] of byte; 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: (RgnRoi, RectRoi, OvalRoi, RoundRectRoi, NoRoi); 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; nColors: integer; RedX, GreenX, BlueX: ColorArrayX; ColorStart, ColorWidth: integer; LUTMode: LUTModeType; cTable: MyCSpecArray; PixMapSize: LongInt; RawSpatialScale, SpatialScale, ScaleMagnification, PixelsPerCM, UnitsPerCM: extended; units: string[2]; FullUnits: string[11]; UnitsID: UnitsType; UnitOfMeasure: string[15]; p1x, p1y, p2x, p2y: integer; {Control points for grayscale transfer function} DeltaX, DeltaY: integer; HeaderOffset: LongInt; ImageDataOffset: LongInt; Fit: CurveFitType; nCoefficients: integer; Coefficient: CoefficientArray; Calibrated: boolean; BinaryPic: boolean; WindowState: (NormalWindow, TiledSmall, TiledSmallScaled, TiledBig, TiledBigScaled); FileDepth: FileDepthType; Revertable: boolean; { new stuff for afm } x_range, y_range, z_range: extended; { 1 pixel is ?? angstroems } 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, LengthObj, 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); xyArray = array[1..MaxPolyVertices] of integer; 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, ImportNCCD); FateTable = array[0..255] of integer; SaveAsWhatType = (asTIFF, asPICT, asMacPaint, AsPalette, AsRawData, SaveAsMCID); ExportAsWhatType = (AsRaw, asMCID, asText, AsLUT, asMeasurements, asPlotValues, asHistogramValues); 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; 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; 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 = (GetMouseC, SetMajorC, SetMinorC, TileC, rAreaC, rMeanC, rAngleC, rXC, rYC, rLengthC, rMajorC, rMinorC, rMinC, rMaxC, 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, SetScaleC, 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; var TraceInfo: str4; finished: boolean; trect, gmrect, GrayMapRect, GrayMapRect2, crect, HistoRect: rect; gmSlide1, gmslide2, gmSlide1i, gmSlide2i, gmicon1, gmicon2: rect; gmSlide1Loc: integer; gmFixedSlope: boolean; ToolWindow, GrayMapWindow, LUTWindow, ResultsWindow, HistoWindow, PlotWindow, PasteControl: WindowPtr; BuggyWatch: CursHandle; cr, tab, BackSpace, eof: char; CharCount: LongInt; ScreenPort: GrafPtr; CScreenPort: cGrafPtr; ticks: LongInt; MonoFunction: ClutTable; PaletteRec: record NumberOfColors: integer; RedData: ColorArray; GreenData: ColorArray; BlueData: ColorArray; end; Info: InfoPtr; ToolCursor: array[ToolType] of Cursor; PickerCursor, LUTCursor, gmCursor, CrossPlusCursor, CrossMinusCursor, GlassMinusCursor, watch: 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; CurrentColorIndex, ClipColorIndex: 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: LineType; 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; Settings: record sID: packed array[1..4] of char; sVersion: integer; sForegroundIndex, sBackgroundIndex: integer; sBrushHeight, sBrushWidth: integer; sAirbrushDiameter: integer; sLUTMode: LUTModeType; sColorStart, sColorWidth: 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; sProfilePlotMin, sProfilePlotMax: extended; 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; sUseZeroForBlack: boolean; sInvertYCoordinates: boolean; sFieldWidth, sPrecision: integer; sMinParticleSize, sMaxParticleSize: LongInt; sIgnoreParticlesTouchingEdge, sLabelParticles, sOutlineParticles, sIncludeHoles: boolean; sKernelsVRefNum: integer; sKernelsDirID: LongInt; sDefaultVRefNum: integer; sDefaultDirID: LongInt; sShowReversingMovies: boolean; sUsingLaserWriter6: boolean; sMaxRegions: integer; sImportCustomDepth: FileDepthType; sImportSwapBytes, sImportCalibrate, sImportAutoscale: boolean; sImportMin, sImportMax: extended; sShowHeadings: boolean; end; 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; PaletteName: string[32]; PicLeftBase, PicTopBase, PicLeft, PicTop: integer; ClipBufInfoRec: PicInfo; ClipBufInfo: InfoPtr; MouseState: (NotInRoi, InRoi, DownInRoi); MouseDownLoc, 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; StretchMode: boolean; IdentityFunction: boolean; OldScrapCount: integer; ClipboardConverted: boolean; results: record tmean, PixelLength: 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; BlankLine: LineType; UndoFromClip: boolean; DensitySlicing, Thresholding, ThresholdToForeground, NonThresholdToBackground: boolean; SliceStart, SliceEnd: integer; SliceColor: RGBColor; SaveCTable: ^MyCSpecArray; BlankFieldInfo: InfoPtr; BlankFieldMean: integer; QuickCaptureInfo, ScionInfo: InfoPtr; InvertVideo: 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: (NothingToUndo, UndoEdit, UndoFlip, UndoRotate, UndoFilter, UndoPaste, UndoTransform, UndoClear, UndoMeasurement, UndoPoint, UndoContrastEnhancement, UndoEqualization, UndoZoom, UndoOutline); 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, PropagateMenuH, EnhanceMenuH, BinaryMenuH, ArithmeticMenuH, AnalyzeMenuH, SpecialMenuH, SortPaletteMenuH, TextMenuH, FontMenuH, SizeMenuH, StyleMenuH, WindowsMenuH, UserMenuH, TransferModeMenuH, LineToolMenuH: MenuHandle; rleft, rtop: integer; ListDone: boolean; MeasurementsWindow: 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, OpenAPIC, OpenAPI2, OpenATM3, OpenNCCD); WhatToImport: WhatToImportType; ImportCustomWidth, ImportCustomHeight: integer; ImportCustomOffset: LongInt; ImportCustomDepth: FileDepthType; ImportSwapBytes, ImportAll, ImportCalibrate: boolean; TiffInfo: record Header: TiffHdr; {8} nEntries: integer; {2} directory: array[1..7] of TiffEntry; {84} NextIFD: LongInt; {4} filler: array[1..TiffFillerSize] of integer; end; 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; ResultsMessage: str255; DTStartTicks, DTFrameCount: LongInt; SaveAsWhat: SaveAsWhatType; ExportAsWhat: ExportAsWhatType; SaveAllState: (NoSaveAll, SaveAllStage1, SaveAllStage2); UseZeroForBlack, 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: (Bilinear, NearestNeighbor); 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; x1, y1, x2, y2: integer; ImportAutoScale: boolean; ImportMin, ImportMax: extended; ShowReversingMovies, UsingLaserWriter6: 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; MeasLeft, MeasTop, MeasWidth, MeasHeight: integer; UnsavedResults: boolean; MajorLabel, MinorLabel: string[9]; OldSystem: boolean; SystemRefNum: integer; ShowHeadings: boolean; implementation end.