本文整理汇总了C++中magick::Image::flop方法的典型用法代码示例。如果您正苦于以下问题:C++ Image::flop方法的具体用法?C++ Image::flop怎么用?C++ Image::flop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类magick::Image
的用法示例。
在下文中一共展示了Image::flop方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: load_cube_map
void texture_t::load_cube_map( vector<string> const & files_names )
{
Magick::Image img;
for (int i = 0; i < files_names.size(); ++i)
{
img.read(files_names[i]);
int res_x = img.rows()
,res_y = img.columns();
scoped_array<unsigned char> data(new unsigned char[res_x * res_y * 3]);
if (i == 2 || i == 3)
img.flip();
else
img.flop();
img.write(0, 0, res_x, res_y, "RGB", CharPixel, data.get());
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glTexImage2D(GL_TEXTURE_CUBE_MAP_POSITIVE_X + i, 0, GL_RGB16, res_x, res_y, 0, GL_RGB
,GL_UNSIGNED_BYTE, data.get());
}
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE);
}
示例2: base_orient
// Orient an image's pixels as EXIF instructs
int base_orient(Exiv2::ExifData & exif, Magick::Image & img) {
int orient = -1;
try {
orient = exif["Exif.Image.Orientation"].toLong();
if (-1 == orient) {
orient = exif["Exif.Panasonic.Rotation"].toLong();
}
if (-1 == orient) {
orient = exif["Exif.MinoltaCs5D.Rotation"].toLong();
}
} catch (Exiv2::Error &) {}
if (1 > orient || 8 < orient) {
orient = 1;
}
switch (orient) {
case 2:
img.flop();
break;
case 3:
img.rotate(180.0);
break;
case 4:
img.flip();
break;
case 5:
img.rotate(90.0);
img.flip();
break;
case 6:
img.rotate(90.0);
break;
case 7:
img.rotate(270.0);
img.flip();
break;
case 8:
img.rotate(270.0);
break;
default:
break;
}
return orient;
}
示例3:
void Magick::flopImage::operator()( Magick::Image &image_ ) const
{
image_.flop( );
}