コード例 #1
0
ファイル: lens.hpp プロジェクト: jonsterling/Lens.hpp
 const typename Inside::member_type& get()
 {
   auto _this = Outside(this->t);
   auto get_this = _this.get();
   auto get_that = Inside(get_this);
   return get_that.get();
 }
コード例 #2
0
ファイル: lens.hpp プロジェクト: jonsterling/Lens.hpp
 const typename Outside::object_type set(const typename Inside::member_type& a)
 {
   auto _this = Outside(this->t);
   
   auto get_this = _this.get();
   auto mod_that = Inside(get_this).set(a);
   return _this.set(mod_that);
 }
コード例 #3
0
void StrokeStyle::operator () (Pixels destPixels, Pixels maskPixels)
{
  if (!active)
    return;

  if (type != typeGradient)// || gradient.style != GradientFill::styleShapeBurst)
  {
    //
    // Calculate mask using distance transform
    //

    Image matteImage (
      Image::SingleChannel,
      maskPixels.getBounds ().getWidth (),
      maskPixels.getBounds ().getHeight (),
      false);

    Pixels mattePixels (matteImage);

    switch (pos)
    {
    case posInner:
      DistanceTransform::Meijster::calculateAntiAliased (
        RenderMask (Pixels::Map2D (mattePixels), size),
        Inside (maskPixels),
        maskPixels.getWidth (),
        maskPixels.getHeight (),
        DistanceTransform::Meijster::EuclideanMetric ());
      break;

    case posOuter:
      DistanceTransform::Meijster::calculateAntiAliased (
        RenderMask (Pixels::Map2D (mattePixels), size),
        Outside (maskPixels),
        maskPixels.getWidth (),
        maskPixels.getHeight (),
        DistanceTransform::Meijster::EuclideanMetric ());
      break;

    case posCentre:
      break;

    default:
      jassertfalse;
      break;
    };

    //
    // Apply fill using mask
    //

    switch (type)
    {
    case typeColour:
      BlendMode::apply (
        mode,
        Pixels::Iterate2 (destPixels, mattePixels),
        BlendProc::RGB::MaskFill (colour, opacity));
      break;

    case typeGradient:
      break;

    case typePattern:
      break;

    default:
      jassertfalse;
      break;
    };
  }
  else
  {
    //
    // Special case for shape burst gradients
    //
    SharedTable <Colour> colourTable = gradient.colours.createLookupTable ();

    switch (pos)
    {
    case posInner:
      {
        DistanceTransform::Meijster::calculateAntiAliased (
          RenderShapeBurst (Pixels::Map2D (destPixels), size, colourTable),
          Inside (maskPixels),
          maskPixels.getWidth (),
          maskPixels.getHeight (),
          DistanceTransform::Meijster::EuclideanMetric ());
      }
      break;

    case posOuter:
      {
        DistanceTransform::Meijster::calculateAntiAliased (
          RenderShapeBurst (Pixels::Map2D (destPixels), size, colourTable),
          Outside (maskPixels),
          maskPixels.getWidth (),
          maskPixels.getHeight (),
          DistanceTransform::Meijster::EuclideanMetric ());
      }
      break;

    case posCentre:
      {
      }
      break;

    default:
      jassertfalse;
      break;
    };
  }
}