当前位置: 首页>>代码示例>>C++>>正文


C++ color::is_invisible方法代码示例

本文整理汇总了C++中color::is_invisible方法的典型用法代码示例。如果您正苦于以下问题:C++ color::is_invisible方法的具体用法?C++ color::is_invisible怎么用?C++ color::is_invisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在color的用法示例。


在下文中一共展示了color::is_invisible方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: blend

void color::blend(const color &other) {
  if (other.is_invisible()) return;
  r = alpha_over_c(other.r, other.a, r, a);
  g = alpha_over_c(other.g, other.a, g, a);
  b = alpha_over_c(other.b, other.a, b, a);
  a = a + (other.a * (0xff - a)) / 0xff;
  r = ((r * 0xff) / a);
  g = ((g * 0xff) / a);
  b = ((b * 0xff) / a);
}
开发者ID:NateLogan,项目名称:c10t,代码行数:10,代码来源:color.cpp

示例2: add_pixel

void image_operations::add_pixel(pos_t x, pos_t y, color &c)
{
  if (c.is_invisible()) {
    return;
  }
  
  if (!(x >= min_x)) { return; }
  if (!(y >= min_y)) { return; }
  if (!(x < max_x)) { return; }
  if (!(y < max_y)) { return; }

  color n = color(c);

  // tag with depth.
  n.z = z;
  
  image_operation oper;
  
  oper.x = (uint16_t)x;
  oper.y = (uint16_t)y;
  oper.c = n;
  
  operations.push_back(oper);
}
开发者ID:Ben0mega,项目名称:c10t,代码行数:24,代码来源:image_operations.cpp


注:本文中的color::is_invisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。