本文整理汇总了C++中DCBuffer::decompress方法的典型用法代码示例。如果您正苦于以下问题:C++ DCBuffer::decompress方法的具体用法?C++ DCBuffer::decompress怎么用?C++ DCBuffer::decompress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DCBuffer
的用法示例。
在下文中一共展示了DCBuffer::decompress方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: process
int ocvm_dim_writer::process()
{
std::string output_directory;
int x1, y1, x2, y2, z;
int i, j;
DCBuffer * in;
const char * mode;
//while (1) {
//in = read_until_upstream_exit("0");
in = read("0");
//if (!in) {
// break;
//}
in->unpack("siiiii",
&output_directory, &x1, &y1,
&x2, &y2, &z);
in->consume();
// cout << "dimwriter on " << dcmpi_get_hostname()
// << ": writing to "
// << output_filename << endl;
std::string containing_dir = dcmpi_file_dirname(output_directory);
if (!dcmpi_file_exists(containing_dir)) {
if (dcmpi_mkdir_recursive(containing_dir)) {
std::cerr << "ERROR: making directories on "
<< dcmpi_get_hostname()
<< " at " << __FILE__ << ":" << __LINE__
<< std::endl << std::flush;
}
}
assert(dcmpi_file_exists(containing_dir));
FILE * f;
mode = "w";
for (i = y1; i <= y2; i++) {
for (j = x1; j <= x2; j++) {
std::string output_filename = output_directory + tostr(j) + "_" + tostr(i) + "_0";
if ((f = fopen(output_filename.c_str(), mode)) == NULL) {
std::cerr << "ERROR: opening " << output_filename
<< " for mode " << mode
<< " on host " << dcmpi_get_hostname()
<< " at " << __FILE__ << ":" << __LINE__
<< std::endl << std::flush;
exit(1);
}
in = read("0");
if (compress) {
in->decompress();
}
if (fwrite(in->getPtr(), in->getUsedSize(), 1, f) < 1) {
std::cerr << "ERROR: calling fwrite()"
<< " at " << __FILE__ << ":" << __LINE__
<< std::endl << std::flush;
exit(1);
}
in->consume();
if (fclose(f) != 0) {
std::cerr << "ERROR: calling fclose()"
<< " at " << __FILE__ << ":" << __LINE__
<< std::endl << std::flush;
exit(1);
}
}
}
//}
return 0;
}