本文整理汇总了C++中BMP::getOutputfile方法的典型用法代码示例。如果您正苦于以下问题:C++ BMP::getOutputfile方法的具体用法?C++ BMP::getOutputfile怎么用?C++ BMP::getOutputfile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BMP
的用法示例。
在下文中一共展示了BMP::getOutputfile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
int choice;
Text tobj;
JPEG jobj;
MP3 mobj;
BMP bobj;
cout<<"\n\n";
cout<<"\t\t\tIMAGE STEGANOGRAPHY"<<endl<<endl;
cout<<"\tDo you want to \n\t1. Embed Data\n\t2. Extract Data"<<endl;
cout<<"\n\tEnter choice :: ";
cin>>choice;
system("cls");
cout<<"\n\n";
cout<<"\t\t\tIMAGE STEGANOGRAPHY"<<endl<<endl;
switch(choice){
case 1: cout<<"\t1. Embed Text.\n\t2. Embed JPEG Image.\n\t3. Embed MP3 file."<<endl;
cout<<"\n\tEnter choice :: ";
cin>>choice;
system("cls");
cout<<"\n\n";
cout<<"\t\t\tIMAGE STEGANOGRAPHY"<<endl<<endl;
if ( !bobj.getInputfile() )
cout<<"\tInvalid file name."<<endl;
else {
if( !bobj.checkFile() )
cout<<"\tNot a BMP image."<<endl;
else {
bobj.setlength();
switch(choice){
case 1: bobj.getOutputfile();
bobj.byepassHeader();
tobj.getData();
tobj.openStream();
tobj.embedHeader(bobj);
tobj.embedData(bobj);
tobj.embedTrailer(bobj);
tobj.embedRest(bobj);
cout<<"\n\tText successfully embedded to \"output.bmp\"."<<endl;
cout<<"\tThe file can be found in the current folder."<<endl;
break;
case 2: jobj.getData();
if ( !jobj.checkFile() )
cout<<"\tNot a JPEG file."<<endl;
else {
if ( !jobj.checkLength(bobj) )
cout<<"\tFile too large to be embedded."<<endl;
else {
bobj.getOutputfile();
bobj.byepassHeader();
jobj.embedHeader(bobj);
jobj.embedLength(bobj);
jobj.embedData(bobj);
jobj.embedRest(bobj);
cout<<"\n\tJPEG file successfully embedded to \"output.bmp\"."<<endl;
cout<<"\tThe file can be found in the current folder."<<endl;
}
}
break;
case 3: mobj.getData();
if( !mobj.checkFile() )
cout<<"\tNot a MP3 file!"<<endl;
else {
if( !mobj.checkLength(bobj) )
cout<<"\tFile too large to be embedded."<<endl;
else {
bobj.getOutputfile();
bobj.byepassHeader();
mobj.embedHeader(bobj);
mobj.embedLength(bobj);
mobj.embedData(bobj);
mobj.embedRest(bobj);
cout<<"\n\tMP3 file successfully embedded to \"output.bmp\"."<<endl;
cout<<"\tThe file can be found in the current folder."<<endl;
}
}
break;
default: if (choice != 1 || choice != 2 || choice != 3 )
cout<<"\tInvalid choice."<<endl;
break;
} // End of switch
bobj.closefiles();
} // End of else
}
break;
case 2: cout<<"\t1. Extract Text.\n\t2. Extract JPEG Image.\n\t3. Extract MP3 file."<<endl;
cout<<"\n\tEnter choice :: ";
cin>>choice;
system("cls");
cout<<"\n\n";
cout<<"\t\t\tIMAGE STEGANOGRAPHY"<<endl<<endl;
switch(choice){
case 1: if ( tobj.setHead() )
if ( tobj.checkHead() )
tobj.extractData();
getch();
cout<<"\n\n\tPress any key to exit...";
break;
case 2: if ( jobj.setHead() )
//.........这里部分代码省略.........