Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
skif::LayerSpace< SkIRect > Class Reference

#include <SkImageFilterTypes.h>

Public Member Functions

 LayerSpace ()=default
 
 LayerSpace (const SkIRect &geometry)
 
 LayerSpace (SkIRect &&geometry)
 
 LayerSpace (const SkISize &size)
 
 operator const SkIRect & () const
 
LayerSpace< SkIRectrelevantSubset (const LayerSpace< SkIRect > dstRect, SkTileMode) const
 
bool isEmpty () const
 
bool contains (const LayerSpace< SkIRect > &r) const
 
int32_t left () const
 
int32_t top () const
 
int32_t right () const
 
int32_t bottom () const
 
int32_t width () const
 
int32_t height () const
 
LayerSpace< SkIPointtopLeft () const
 
LayerSpace< SkISizesize () const
 
bool intersect (const LayerSpace< SkIRect > &r)
 
void join (const LayerSpace< SkIRect > &r)
 
void offset (const LayerSpace< IVector > &v)
 
void outset (const LayerSpace< SkISize > &delta)
 
void inset (const LayerSpace< SkISize > &delta)
 

Static Public Member Functions

static LayerSpace< SkIRectEmpty ()
 
static constexpr std::optional< LayerSpace< SkIRect > > Unbounded ()
 
template<typename BoundsFn >
static LayerSpace< SkIRectUnion (int boundsCount, BoundsFn boundsFn)
 
static bool Intersects (const LayerSpace< SkIRect > &a, const LayerSpace< SkIRect > &b)
 

Detailed Description

Definition at line 371 of file SkImageFilterTypes.h.

Constructor & Destructor Documentation

◆ LayerSpace() [1/4]

skif::LayerSpace< SkIRect >::LayerSpace ( )
default

◆ LayerSpace() [2/4]

skif::LayerSpace< SkIRect >::LayerSpace ( const SkIRect geometry)
inlineexplicit

Definition at line 374 of file SkImageFilterTypes.h.

374: fData(geometry) {}

◆ LayerSpace() [3/4]

skif::LayerSpace< SkIRect >::LayerSpace ( SkIRect &&  geometry)
inlineexplicit

Definition at line 375 of file SkImageFilterTypes.h.

375: fData(std::move(geometry)) {}

◆ LayerSpace() [4/4]

skif::LayerSpace< SkIRect >::LayerSpace ( const SkISize size)
inlineexplicit

Definition at line 376 of file SkImageFilterTypes.h.

376: fData(SkIRect::MakeSize(size)) {}
LayerSpace< SkISize > size() const
static constexpr SkIRect MakeSize(const SkISize &size)
Definition SkRect.h:66

Member Function Documentation

◆ bottom()

int32_t skif::LayerSpace< SkIRect >::bottom ( ) const
inline

Definition at line 409 of file SkImageFilterTypes.h.

409{ return fData.fBottom; }
int32_t fBottom
larger y-axis bounds
Definition SkRect.h:36

◆ contains()

bool skif::LayerSpace< SkIRect >::contains ( const LayerSpace< SkIRect > &  r) const
inline

Definition at line 404 of file SkImageFilterTypes.h.

404{ return fData.contains(r.fData); }
bool contains(int32_t x, int32_t y) const
Definition SkRect.h:463

◆ Empty()

static LayerSpace< SkIRect > skif::LayerSpace< SkIRect >::Empty ( )
inlinestatic

Definition at line 379 of file SkImageFilterTypes.h.

379{ return LayerSpace<SkIRect>(SkIRect::MakeEmpty()); }
static constexpr SkIRect MakeEmpty()
Definition SkRect.h:45

◆ height()

int32_t skif::LayerSpace< SkIRect >::height ( ) const
inline

Definition at line 412 of file SkImageFilterTypes.h.

412{ return fData.height(); }
constexpr int32_t height() const
Definition SkRect.h:165

◆ inset()

void skif::LayerSpace< SkIRect >::inset ( const LayerSpace< SkISize > &  delta)
inline

Definition at line 425 of file SkImageFilterTypes.h.

425{ fData.inset(delta.width(), delta.height()); }
void inset(int32_t dx, int32_t dy)
Definition SkRect.h:411

◆ intersect()

bool skif::LayerSpace< SkIRect >::intersect ( const LayerSpace< SkIRect > &  r)
inline

Definition at line 421 of file SkImageFilterTypes.h.

421{ return fData.intersect(r.fData); }
bool intersect(const SkIRect &r)
Definition SkRect.h:513

◆ Intersects()

static bool skif::LayerSpace< SkIRect >::Intersects ( const LayerSpace< SkIRect > &  a,
const LayerSpace< SkIRect > &  b 
)
inlinestatic

Definition at line 417 of file SkImageFilterTypes.h.

417 {
418 return SkIRect::Intersects(a.fData, b.fData);
419 }
static bool b
struct MyStruct a[10]
static bool Intersects(const SkIRect &a, const SkIRect &b)
Definition SkRect.h:535

◆ isEmpty()

bool skif::LayerSpace< SkIRect >::isEmpty ( ) const
inline

Definition at line 403 of file SkImageFilterTypes.h.

403{ return fData.isEmpty64(); }
bool isEmpty64() const
Definition SkRect.h:196

◆ join()

void skif::LayerSpace< SkIRect >::join ( const LayerSpace< SkIRect > &  r)
inline

Definition at line 422 of file SkImageFilterTypes.h.

422{ fData.join(r.fData); }
void join(const SkIRect &r)
Definition SkRect.cpp:31

◆ left()

int32_t skif::LayerSpace< SkIRect >::left ( ) const
inline

Definition at line 406 of file SkImageFilterTypes.h.

406{ return fData.fLeft; }
int32_t fLeft
smaller x-axis bounds
Definition SkRect.h:33

◆ offset()

void skif::LayerSpace< SkIRect >::offset ( const LayerSpace< IVector > &  v)
inline

Definition at line 423 of file SkImageFilterTypes.h.

423{ fData.offset(SkIVector(v)); }
SkIPoint SkIVector
void offset(int32_t dx, int32_t dy)
Definition SkRect.h:367

◆ operator const SkIRect &()

skif::LayerSpace< SkIRect >::operator const SkIRect & ( ) const
inlineexplicit

Definition at line 377 of file SkImageFilterTypes.h.

377{ return fData; }

◆ outset()

void skif::LayerSpace< SkIRect >::outset ( const LayerSpace< SkISize > &  delta)
inline

Definition at line 424 of file SkImageFilterTypes.h.

424{ fData.outset(delta.width(), delta.height()); }
void outset(int32_t dx, int32_t dy)
Definition SkRect.h:428

◆ relevantSubset()

LayerSpace< SkIRect > skif::LayerSpace< SkIRect >::relevantSubset ( const LayerSpace< SkIRect dstRect,
SkTileMode  tileMode 
) const

Definition at line 407 of file SkImageFilterTypes.cpp.

408 {
409 LayerSpace<SkIRect> fittedSrc = *this;
410 if (tileMode == SkTileMode::kDecal || tileMode == SkTileMode::kClamp) {
411 // For both decal/clamp, we only care about the region that is in dstRect, unless we are
412 // clamping and have to preserve edge pixels when there's no overlap.
413 if (!fittedSrc.intersect(dstRect)) {
414 if (tileMode == SkTileMode::kDecal) {
415 // The dstRect would be filled with transparent black.
416 fittedSrc = LayerSpace<SkIRect>::Empty();
417 } else {
418 // We just need the closest row/column/corner of this rect to dstRect.
419 auto edge = SkRectPriv::ClosestDisjointEdge(SkIRect(fittedSrc), SkIRect(dstRect));
420 fittedSrc = LayerSpace<SkIRect>(edge);
421 }
422 }
423 } // else assume the entire source is needed for periodic tile modes, so leave fittedSrc alone
424
425 return fittedSrc;
426}
static SkIRect ClosestDisjointEdge(const SkIRect &src, const SkIRect &dst)
Definition SkRect.cpp:323

◆ right()

int32_t skif::LayerSpace< SkIRect >::right ( ) const
inline

Definition at line 408 of file SkImageFilterTypes.h.

408{ return fData.fRight; }
int32_t fRight
larger x-axis bounds
Definition SkRect.h:35

◆ size()

LayerSpace< SkISize > skif::LayerSpace< SkIRect >::size ( ) const
inline

Definition at line 415 of file SkImageFilterTypes.h.

415{ return LayerSpace<SkISize>(fData.size()); }
constexpr SkISize size() const
Definition SkRect.h:172

◆ top()

int32_t skif::LayerSpace< SkIRect >::top ( ) const
inline

Definition at line 407 of file SkImageFilterTypes.h.

407{ return fData.fTop; }
int32_t fTop
smaller y-axis bounds
Definition SkRect.h:34

◆ topLeft()

LayerSpace< SkIPoint > skif::LayerSpace< SkIRect >::topLeft ( ) const
inline

Definition at line 414 of file SkImageFilterTypes.h.

414{ return LayerSpace<SkIPoint>(fData.topLeft()); }
constexpr SkIPoint topLeft() const
Definition SkRect.h:151

◆ Unbounded()

static constexpr std::optional< LayerSpace< SkIRect > > skif::LayerSpace< SkIRect >::Unbounded ( )
inlinestaticconstexpr

Definition at line 381 of file SkImageFilterTypes.h.

381{ return {}; }

◆ Union()

template<typename BoundsFn >
static LayerSpace< SkIRect > skif::LayerSpace< SkIRect >::Union ( int  boundsCount,
BoundsFn  boundsFn 
)
inlinestatic

Definition at line 387 of file SkImageFilterTypes.h.

387 {
388 if (boundsCount <= 0) {
389 return LayerSpace<SkIRect>::Empty();
390 }
391 LayerSpace<SkIRect> output = boundsFn(0);
392 for (int i = 1; i < boundsCount; ++i) {
393 output.join(boundsFn(i));
394 }
395 return output;
396 }

◆ width()

int32_t skif::LayerSpace< SkIRect >::width ( ) const
inline

Definition at line 411 of file SkImageFilterTypes.h.

411{ return fData.width(); }
constexpr int32_t width() const
Definition SkRect.h:158

The documentation for this class was generated from the following files: