I am tring to write a program that can create a queue of raw Images. I have got some success doing it all i want to know is that how can i take the first image from the queue and write it back out....... Please help me....Also i am show what part i am faling to do i have comment that by saying "//I get an error"
Here is the code....... and i am also attaching the raw Image file
Code:
#include<iostream.h>
#include<fstream.h>
#include<string>
#include<queue>
class ImageQueue
{
public:
ImageQueue(){
width = 0;// image width
height = 0;// image height
size = 0;//image size
bitCount = 0;// image is 8 bit, 16 bit, 24 bit,32 bit
}
~ImageQueue(){
width = 0;
height = 0;
size = 0;
bitCount = 0;
}
void setWidth(int value){
width = value;
}
void setHeight(int value){
height = value;
}
void setSize(int value){
size = value;
}
void setBitcount(int value){
bitCount = value;
}
int getWidth(void){
return width;
}
int getHeight(void){
return width;
}
int getSize(void){
return width;
}
int getBitcount(void){
return width;
}
unsigned char Frame[1024*700];
private:
int width;
int height;
int size;
int bitCount;
};
int main(void)
{
std::queue<ImageQueue *> values;//image Queue
std::string filename = "frame1.raw";// File Name
ifstream Inputfile;//InputFile Stream
ofstream output;// OutPutFile Stream
ImageQueue *iQueue = new ImageQueue(); // object to Class ImageQueue
int i = 0;//counter
Inputfile.open(filename.c_str(),ios::binary);
output.open("test.raw",ios::binary);
if(!Inputfile.is_open())
{
cout<<"Cant Open The File"<<endl;
}
else
{
char c = '\0';
while(!Inputfile.eof())
{
c = Inputfile.get();
(*iQueue).Frame[i] = c;
i++;
}
}
values.push(iQueue);
cout<<values.size();
// I get an error
output<<values.pop();
return 0;
}