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


C++ ConstImageBuffer类代码示例

本文整理汇总了C++中ConstImageBuffer的典型用法代码示例。如果您正苦于以下问题:C++ ConstImageBuffer类的具体用法?C++ ConstImageBuffer怎么用?C++ ConstImageBuffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: canvas

void
Canvas::Stretch(int dest_x, int dest_y,
                unsigned dest_width, unsigned dest_height,
                ConstImageBuffer src,
                int src_x, int src_y,
                unsigned src_width, unsigned src_height)
{
  assert(dest_width < 0x4000);
  assert(dest_height < 0x4000);

  if (dest_width == src_width && dest_height == src_height) {
    /* fast path: no zooming needed */
    Copy(dest_x, dest_y, dest_width, dest_height, src, src_x, src_y);
    return;
  }

  if (dest_width >= 0x4000 || dest_height >= 0x4000)
    /* paranoid sanity check; shouldn't ever happen */
    return;

  SDLRasterCanvas canvas(buffer);

  canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
                        src.At(src_x, src_y), src.pitch, src_width, src_height);
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:25,代码来源:Canvas.cpp

示例2: assert

void
Canvas::StretchNot(const Bitmap &_src)
{
  assert(_src.IsDefined());

  ConstImageBuffer src = _src.GetNative();
  const unsigned src_x = 0, src_y = 0;
  const unsigned dest_x = 0, dest_y = 0;
  const unsigned dest_width = GetWidth();
  const unsigned dest_height = GetHeight();

  SDLRasterCanvas canvas(buffer);
  BitNotPixelOperations<ActivePixelTraits> operations;

  canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
                        src.At(src_x, src_y), src.pitch, src.width, src.height,
                        operations);
}
开发者ID:ThomasXBMC,项目名称:XCSoar,代码行数:18,代码来源:Canvas.cpp

示例3: assert

void
Canvas::StretchAnd(int dest_x, int dest_y,
               unsigned dest_width, unsigned dest_height,
               const Bitmap &src, 
               int src_x, int src_y, unsigned src_width, unsigned src_height)
{
  assert(IsDefined());
  assert(src.IsDefined());
  
  ConstImageBuffer srcImg = src.GetNative();  
  
  SDLRasterCanvas canvas(buffer);
  BitAndPixelOperations<ActivePixelTraits> operations;

  canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
                       srcImg.At(src_x, src_y), srcImg.pitch, src_width, src_height,
                       operations);
}
开发者ID:jaaaaf,项目名称:LK8000,代码行数:18,代码来源:Canvas.cpp

示例4: canvas

void
Canvas::StretchTransparentWhite(int dest_x, int dest_y,
                                unsigned dest_width, unsigned dest_height,
                                ConstImageBuffer src, int src_x, int src_y,
                                unsigned src_width, unsigned src_height)
{
  if (!Clip(dest_x, dest_width, GetWidth(), src_x) ||
      !Clip(dest_y, dest_height, GetHeight(), src_y))
    return;

  SDLRasterCanvas canvas(buffer);
  TransparentPixelOperations<ActivePixelTraits> operations(canvas.Import(COLOR_WHITE));
  canvas.ScaleRectangle(dest_x, dest_y, dest_width, dest_height,
                        src.At(src_x, src_y), src.pitch, src.width, src.height,
                        operations);
}
开发者ID:Advi42,项目名称:XCSoar,代码行数:16,代码来源:Canvas.cpp

示例5: canvas

void
Canvas::AlphaBlendNotWhite(int dest_x, int dest_y,
                           unsigned dest_width, unsigned dest_height,
                           ConstImageBuffer src,
                           int src_x, int src_y,
                           unsigned src_width, unsigned src_height,
                           uint8_t alpha)
{
    // TODO: support scaling

    SDLRasterCanvas canvas(buffer);

    NotWhiteCondition<SDLPixelTraits> c;
    NotWhiteAlphaPixelOperations<SDLPixelTraits> operations(c,
            PortableAlphaPixelOperations<SDLPixelTraits>(alpha));

    canvas.CopyRectangle(dest_x, dest_y, dest_width, dest_height,
                         src.At(src_x, src_y), src.pitch,
                         operations);
}
开发者ID:lniv,项目名称:tophat,代码行数:20,代码来源:Canvas.cpp


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