bicotiPropertyHistogramExtended

Figura 2.3.1

     Clases

bicotiProperty
bicotiPropertyStatistical
bicotiPropertyHistogram
bicotiPropertyHistogramUsual
bicotiPropertyHistogramExtended

     Templates Clases

PixelType


class bicotiPropertyHistogramExtended < class ColorType,
                                                                        class PixelType = ColorType >



 Public Methods

bicotiPropertyHistogramExtended ( bicotiImageImplementation<PixelType>*,
                                                                 const vector< bicotiPixelAttributeSelector< ColorType, PixelType > * >& )
~bicotiPropertyHistogramExtended( )
void UpdateImageImplementation( )

void First( unsigned = 0 )
void Next( unsigned = 0 )
ColorType GetCurrentColor( unsigned = 0 )
unsigned GetCurrentPointsNumber( unsigned = 0 )
bool IsDone( unsigned = 0 )
unsigned GetHistogramsNumber( )
bicotiDexelHistogram<CoordType, ColorType, PixelType> * GetDexel( unsigned = 0 )



bicotiPropertyHistogramExtended ( bicotiImageImplementation<PixelType>* ptr_ima,
                        const vector< bicotiPixelAttributeSelector< ColorType, PixelType > * >& color_sel_list )

    Constructor al que paso como parámetro :
        ptr_ima -- puntero a la imagen a la que se refiere la propiedad.
        color_sel_list -- vector ( de la STL ) con punteros a selectores de atributos.

La propiedad tiene un conjunto de DexelHistogram , cada una de los cuales se construye con uno de los atributos del vector, por lo tanto tendrá tantas listas asociadas como selectores de atributo le pase en el vector.

Por ejemplo si queremos crear un histograma para una imagen 2D RGB de entereos.
Los templates son:
                    ColorType = int
                    PixelType = bicotiRGB< int >

Primero definimos unos tipos

typedef  int  ColT;                                                // atributo
typedef  bicotiRGB< int > PixT;                        // pixel

Creamos un selector de atributos para cada campo:

    bicotiPixelAttributeSelector< ColT, PixT > * ptr_att_sel_red;
    ptr_att_sel_red = new bicotiPixelAttributeSelectorColorRed< ColT, PixT >;

    bicotiPixelAttributeSelector< ColT, PixT > * ptr_att_sel_green;
    ptr_att_sel_green = new bicotiPixelAttributeSelectorColorGreen< ColT, PixT >;

    bicotiPixelAttributeSelector< ColT , PixT > * ptr_att_sel_blue;
    ptr_att_sel_blue = new bicotiPixelAttributeSelectorColorBlue< ColT, PixT >;

Los Pongo en un vector :

    vector <bicotiPixelAttributeSelector< ColT, PixT > * >  vect( 3 );
    vect[0]=ptr_att_sel_red; // el rojo tiene índice 0
    vect[1]=ptr_att_sel_green; // el verde tiene índice 1
    vect[2]=ptr_att_sel_blue; // el azul tiene índice 2

Ahora puedo crear la propiedad

    bicotiPropertyStatistical< ColT, PixT  >  histo( ptr_ima, vect );



virtual ~bicotiPropertyHistogram( )

    Destructor virtual.



virtual void UpdateImageImplementation( )

    Esta función sirve para actualizar a la imagen una vez que se han hecho cambios en las propiedades.
Los cambios en las propiedades NO se reflejan automáticamente en la imagen



virtual void First( unsigned index )

    Esta propiedad es un agregado de DexelHistogram, indexados de acuerdo a como se ha creado.
Cada uno de los dexeles tiene un iterador interno, que tiene las funciones típicas.
Cuando hacemos por ejemplo :

     prop_histo.First( i );

Ponemos al principio el iterador de índice i.



virtual void Next( unsigned index )

    Mueve el iterador del Dexel de índice index, un lugar.



virtual ColorType GetCurrentColor( unsigned index )

    Devuelve el valor del atributo asociado al nodo actualmente apuntado por el iterador sobre el Dexel de índice index.



virtual unsigned GetCurrentPointsNumber( unsigned index )

    Devuelve la cantidad de puntos que tiene la lista del nodo actualmente apuntado por el iterador sobre el Dexel de ínidce index.



virtual bool IsDone( unsigned index )

    Devuelve true si el iterador sobre el Dexel de índice index ha llegado al final.



virtual unsigned GetHistogramsNumber( )

    Devuelve la cantidad de DexelHistogram que están asociados a la propiedad.



bicotiDexelHistogram<CoordType, ColorType, PixelType> * GetDexel( unsigned index)

    Devuelve un puntero al Dexel de índice index.