本文整理汇总了C++中CImg::AttachFromFile方法的典型用法代码示例。如果您正苦于以下问题:C++ CImg::AttachFromFile方法的具体用法?C++ CImg::AttachFromFile怎么用?C++ CImg::AttachFromFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CImg
的用法示例。
在下文中一共展示了CImg::AttachFromFile方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main() {
CImg* pImg = create_image();
//BOOL rt = pImg->AttachFromFile("..//imgs//2-1-0.bmp");
//BOOL rt = pImg->AttachFromFile("..//imgs//code-test-23.bmp");
BOOL rt = pImg->AttachFromFile("..//imgs//TEST//origin.bmp");
if (!rt)
return -1;
Func(pImg);
getchar();
return 0;
}
示例2: main
int main() {
//OneDBarcodeGrading OneDgrading;
//CImg* pImg2 = create_image();
//BOOL rt2 = pImg2->AttachFromFile("..//imgs//barcodes//TEST2//Minimal Edge Contrast_0__0_12_4.bmp");
//if (!rt2)
// return -1;
//OneDgrading.Grading(pImg2, OneDBarCodeType::EAN_128);
//OneDgrading.SetDECODEGrade(4);
//cout << "SC: " << OneDgrading.GetSCGrade() << endl;
//cout << "MOD: " << OneDgrading.GetMODGrade() << endl;
//cout << "Rmin: " << OneDgrading.GetRminGrade() << endl;
//cout << "ECmin: " << OneDgrading.GetECminGrade() << endl;
//cout << "Decfects: " << OneDgrading.GetDefectsGrade() << endl;
//cout << "Decodability: " << OneDgrading.GetDecodabilityGrade() << endl;
//cout << "DECODE: " << OneDgrading.GetDECODEGrade() << endl;
TwoDBarcodeGrading TwoDgrading;
CImg* pImg = create_image();
BOOL rt = pImg->AttachFromFile("..//imgs//5.bmp");
if (!rt)
return -1;
//CImg* rImg = NULL;
//string code;
//DecodeAndClipRegion(pImg, rImg, code);
//TwoDgrading.Grading(rImg, 30, TwoDBarCodeType::DataMatrix);
//CImg* img = NULL;//create_image();
//unsigned char** InfoTable = NULL;
//long Twidth = 0, Theight = 0;
//TwoDgrading.SetContrastMValue(3.5);
//TwoDgrading.GetInfoTable(pImg, img, InfoTable, Twidth, Theight);
//for (unsigned long i = 0; i < Theight; ++i) {
// delete[] InfoTable[i];
//}
//delete[] InfoTable;
//InfoTable = NULL;
TwoDgrading.SetContrastMValue(3.5);
TwoDgrading.SetDECODEGrade(4);
TwoDgrading.SetUECScore(0, 30);
TwoDgrading.Grading(pImg, 30, TwoDBarCodeType::DataMatrix);
//rt = img->SaveToFile("..//results//dqt//Grid2.bmp");
//if (rt == false)
// return false;
cout << "SC: " << TwoDgrading.GetSCGrade() << endl;
cout << "MOD: " << TwoDgrading.GetMODGrade() << endl;
cout << "AN: " << TwoDgrading.GetANGrade() << endl;
cout << "GN: " << TwoDgrading.GetGNGrade() << endl;
cout << "FPD: " << TwoDgrading.GetFPDGrade() << endl;
cout << "UEC: " << TwoDgrading.GetUECGrade() << endl;
cout << "DECODE: " << TwoDgrading.GetDECODEGrade() << endl;
getchar();
return 0;
}