Ignore:
Timestamp:
09/18/16 14:46:35 (8 years ago)
Author:
tbretz
Message:
Removed references to root, replaced with basic types.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/drive/FilterLed.h

    r18618 r18621  
    22#define CAOS_FilterLed
    33
    4 #ifndef __CINT__
    5 #include <TROOT.h>
    6 #endif
    7 
    8 typedef unsigned char byte;
     4#include <stdint.h>
     5#include <vector>
    96
    107class Led;
    11 class Leds;
    128class Ring;
    139
    1410class FilterLed
    1511{
    16     byte *fImg;
     12    uint8_t *fImg;
    1713    int fW;
    1814    int fH;
     
    2117    float fCut;
    2218
    23     Float_t FindCluster(int &cnt, float *sum, UInt_t x, UInt_t y,
    24                         UInt_t x0, UInt_t y0, UInt_t x1, UInt_t y1) const;
     19    float FindCluster(int &cnt, float *sum, uint32_t x, uint32_t y,
     20                        uint32_t x0, uint32_t y0, uint32_t x1, uint32_t y1) const;
    2521
    26     void GetMinMax(const int offset, byte *min, byte *max) const;
     22    void GetMinMax(const int offset, uint8_t *min, uint8_t *max) const;
    2723    int  GetMeanPosition(const int x, const int y, const int boxx, const int boxy) const;
    2824    int  GetMeanPosition(const int x, const int y, const int boxx, const int boxy,
     
    4036
    4137public:
    42     FilterLed(byte *img, int w, int h, double cut=2.5)
    43       : fImg(img), fW(w), fH(h), fBoxX(w), fBoxY(h), fCut(cut)
     38    FilterLed(uint8_t *img, int w, int h, double cut=2.5) : fImg(img),
     39        fW(w), fH(h), fBoxX(w), fBoxY(h), fCut(cut)
    4440    {
    4541    }
    4642
    47     FilterLed(byte *img, int w, int h, int boxx, int boxy, double cut=2.5)
    48       : fImg(img), fW(w), fH(h), fBoxX(boxx), fBoxY(boxy), fCut(cut)
     43    FilterLed(uint8_t *img, int w, int h, int boxx, int boxy, double cut=2.5) : fImg(img),
     44        fW(w), fH(h), fBoxX(boxx), fBoxY(boxy), fCut(cut)
    4945    {
    5046    }
     
    5349    void SetBox(int box)   { fBoxX = fBoxY = box; }
    5450    void SetBox(int boxx, int boxy)   { fBoxX = boxx; fBoxY = boxy; }
    55     void SetCut(float cut) { fCut = cut; }
    56     void FindStar(Leds &leds, int xc, int yc, bool circle=false) const;
    57    
    58     void Execute(Leds &leds, int xc, int yc, double &bright) const;
    59     void Execute(Leds &leds, int xc, int yc) const;
    60     void Execute(Leds &leds) const { Execute(leds, fW/2, fH/2); }
    61     void ExecuteAndMark(Leds &leds, int xc, int yc) const;
    62     void ExecuteAndMark(Leds &leds, int xc, int yc, double &bright) const;
    63     void ExecuteAndMark(Leds &leds) const { ExecuteAndMark(leds, fW/2, fH/2); }
    64     void Execute(int xc, int yc) const;
    65     void Execute() const { Execute(fW/2, fH/2); }
     51    void SetCut(float cut) { fCut = cut; }
     52    void FindStar(std::vector<Led> &leds, int xc, int yc, bool circle=false) const;
     53
     54    void Execute(std::vector<Led> &leds, int xc, int yc, double &bright) const;
     55    void Execute(std::vector<Led> &leds, int xc, int yc) const;
     56    void Execute(std::vector<Led> &leds) const { Execute(leds, fW/2, fH/2); }
     57
    6658    void MarkPoint(const Led &led) const;
    67     void MarkPoint(Float_t x, Float_t y, Float_t mag) const;
     59    void MarkPoint(float x, float y, float mag) const;
    6860    void Stretch() const;
    69     void DrawCircle(float cx, float cy, float r, byte col=0x40) const;
    70     void DrawCircle(float r, byte col=0x40) const { DrawCircle(fW/2, fH/2, r, col); }
    71     void DrawCircle(const Ring &c, byte col=0x40) const;
    72     void DrawCircle(const Ring &c, double r, byte col) const;
    73     void DrawHexagon(float cx, float cy, float r, byte col=0x40) const;
    74     void DrawHexagon(const Ring &c, double r, byte col) const;
    7561
    76     ClassDef(FilterLed, 0)
     62    void DrawCircle(float cx, float cy, float r, uint8_t col=0x40) const;
     63    void DrawCircle(float r, uint8_t col=0x40) const { DrawCircle(fW/2, fH/2, r, col); }
     64    void DrawCircle(const Ring &c, uint8_t col=0x40) const;
     65    void DrawCircle(const Ring &c, double r, uint8_t col) const;
     66    void DrawHexagon(float cx, float cy, float r, uint8_t col=0x40) const;
     67    void DrawHexagon(const Ring &c, double r, uint8_t col) const;
    7768};
    7869
Note: See TracChangeset for help on using the changeset viewer.