本文整理汇总了C++中magick::Image::baseRows方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::baseRows方法的具体用法?C++ Image::baseRows怎么用?C++ Image::baseRows使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类magick::Image
的用法示例。
在下文中一共展示了Image::baseRows方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onInput
void PipelineStabDetect::onInput(InputImageInfo info, Magick::Image image) {
try {
if (!initialized) {
init(image);
}
if (image.rows() != height || image.columns() != width) {
throw runtime_error(QString("Not uniform image size! %").arg(info.file.fileName()).toStdString());
}
Magick::Blob blob;
// set raw RGBS output format & convert it into a Blob
if (image.depth() > 8)
*err << "Warning: we lost some information by converting to 8bit depth (now " << image.depth() << ")" << endl;
image.depth(8);
image.magick("RGB");
image.write(&blob);
LocalMotions localmotions;
VSFrame frame;
size_t dataLen = blob.length();
Q_ASSERT(fi.planes == 1);
Q_ASSERT(dataLen == image.baseColumns() * image.baseRows() * 3);
if (stabConf->mdConf.show > 0) { // create copy of blob
frame.data[0] = new uint8_t[dataLen];
memcpy(frame.data[0], blob.data(), dataLen);
} else {
frame.data[0] = (uint8_t*) blob.data();
}
frame.linesize[0] = image.baseColumns() * 3;
if (vsMotionDetection(&md, &localmotions, &frame) != VS_OK) {
throw runtime_error("motion detection failed");
} else {
if (vsWriteToFile(&md, f, &localmotions) != VS_OK) {
throw runtime_error("cannot write to transform file");
}
vs_vector_del(&localmotions);
}
if (stabConf->mdConf.show > 0) {
// if we want to store transformations, we have to create new image...
Magick::Geometry g(width, height);
Magick::Blob oblob(frame.data[0], dataLen);
Magick::Image oimage;
oimage.read(oblob, g, 8, "RGB");
delete[] frame.data[0];
emit input(info, oimage);
} else {
emit input(info, image);
}
} catch (exception &e) {
emit error(e.what());
}
}