#ifndef _READ_PXI_CLASSIFY_H_
#define _READ_PXI_CLASSIFY_H_
#include "commStruct.h"
#include "tinyxml2.h"

class ReadPixCnfClassify {
    public:
        ReadPixCnfClassify();
        virtual ~ReadPixCnfClassify();
        void SetClassifyList(PixClassify *pSeg, int num);
        PixClassify *GetClassifyFromCnfFile(const char *fileName, int *outNum);
        void GetClassifyFromCnfFile(const char *fileName);
        void GetRGBByType(int label, float *r, float *g, float *b);
        int GetTypeByRGB(float blue, float green, float red);
        float *ConvertToSegImg(int type, void *inMat, int inH, int inW, int *outC, int *outH, int *outW);
        void SaveHotImgFile(char *fileName, float *inMat, int inH, int inW);
        void SaveHotImgFile(char *fileName, unsigned char *inMat, int inH, int inW);

        int ReadSegSampleRGB(const char *cnfXMLName, int **retArrayR, int **retArrayG, int **retArrayB);
        int ReadSegSampleRGBByNode(tinyxml2::XMLElement *userNode, int **retArrayR, int **retArrayG, int **retArrayB);
        char *ReadSampleClassNameStrList(const char *cnfXMLName);
        int *ReadInputLayerFromXMLSubNode(tinyxml2::XMLElement *userNode, int *len);
        void ReadSampleCHWLen(const char *cnfXMLName, int *c, int *h, int *w);
        int ReadSampleHWLen(const char *cnfXMLName);
        int ReadSampleChannel(const char* cnfXMLName);
        void ReadCompMemAndParaMem(const char *cnfXMLName, float *cMem, int *apiMemType, float *pMainMem, int *pMainMemType, float *pBackMem, int *pBackMemType);
        void ReadPoolGroupNum(const char *cnfXMLName, int *cNum, int *mNum, int *bNum);

        int ReadRegressTrainAndLabelDataFromFile(const char *fileName, int inputNum, int outputNum, float *&trainData, float *&lableNum);
        
    private:
        PixClassify *mPixClassify;
        int mClassifyNum;
};

#endif
