本文整理汇总了C++中image::append_height方法的典型用法代码示例。如果您正苦于以下问题:C++ image::append_height方法的具体用法?C++ image::append_height怎么用?C++ image::append_height使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类image
的用法示例。
在下文中一共展示了image::append_height方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: append_image_right
void image::append_image_right(image& image_to_append) {
// Bring both images to the same height
if (this->size_.height < image_to_append.size().height)
append_height(image_to_append.size().height);
else if (this->size_.height > image_to_append.size().height)
image_to_append.append_height(this->size_.height);
// Append new rows from other image to the right of each row
for (int y = 0; y < (int) image_to_append.size().height; ++y)
for (int x = 0; x < (int) image_to_append.size().width; ++x)
this->pixels_.at(y).push_back(image_to_append.pixels().at(y).at(x));
this->size_.width += image_to_append.size().width;
#if DEBUG
cout << "images merged. array sizes: "
<< this->pixels_.at(1).size()
<< " width, "
<< this->pixels_.size()
<< " height. image size: "
<< this->size_.width
<< ", "
<< this->size_.height
<< endl;
#endif
}