Thanks that works. However, how would I set this up in a class? Both the 256 and 714838 are dynamic. Instead of a struc for siFrame() I made a class with a constructor that allows me to set the size of the array by using QVector in siFrame instead of float[];
I have a class called siTrainer that needs to load a queue of things to train and processes that queue by allocating a siStore list, calculating each siFrame, populating the siStore list, writing the siStore list to harddisk, delete the siStore list and then repeat. So I need the class to be able to initialize and clear the siStore list. I need something like this:
class siTrainer
{
public:
siTrainer();
~siTrainer();
private:
void initStore();
void deleteStore();
int numPts; //The number of images, 714838 in my example
int siWidth; //The size of each image, 256 in my example
QVector<siFrame *> *siStore;
}
class siTrainer
{
public:
siTrainer();
~siTrainer();
private:
void initStore();
void deleteStore();
int numPts; //The number of images, 714838 in my example
int siWidth; //The size of each image, 256 in my example
QVector<siFrame *> *siStore;
}
To copy to clipboard, switch view to plain text mode
How would I implement initStore()?
QVector<siFrame* > siStore(714838); won't work since it will just create a local variable that cannot
latter be accessed by cleatStore(). When I try
siStore = new QVector<siFrame *>(numPts)
siStore = new QVector<siFrame *>(numPts)
To copy to clipboard, switch view to plain text mode
I get the following error
binary '=': no operator found which takes a right-hand operand of type 'siFrame *'
for the following line
siStore[i] = frame;
siStore[i] = frame;
To copy to clipboard, switch view to plain text mode
Bookmarks