bool HotPixel::intersects(const Coordinate& p0, const Coordinate& p1) const { if (scaleFactor == 1.0) return intersectsScaled(p0, p1); copyScaled(p0, p0Scaled); copyScaled(p1, p1Scaled); return intersectsScaled(p0Scaled, p1Scaled); }
void LLImageRaw::composite( LLImageRaw* src ) { LLImageRaw* dst = this; // Just for clarity. llassert(3 == src->getComponents()); llassert(3 == dst->getComponents()); if( 3 == dst->getComponents() ) { if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) { // No scaling needed if( 3 == src->getComponents() ) { copyUnscaled( src ); // alpha is one so just copy the data. } else { compositeUnscaled4onto3( src ); } } else { if( 3 == src->getComponents() ) { copyScaled( src ); // alpha is one so just copy the data. } else { compositeScaled4onto3( src ); } } } }
// Src and dst can be any size. Src has 4 components. Dst has 3 components. void LLImageRaw::copyScaled4onto3(LLImageRaw* src) { llassert( (4 == src->getComponents()) && (3 == getComponents()) ); // Slow, but simple. Optimize later if needed. LLImageRaw temp( src->getWidth(), src->getHeight(), 3); temp.copyUnscaled4onto3( src ); copyScaled( &temp ); }
// Src and dst can be any size. Src and dst can each have 3 or 4 components. void LLImageRaw::copy(LLImageRaw* src) { if (!src) { llwarns << "LLImageRaw::copy called with a null src pointer" << llendl; return; } LLImageRaw* dst = this; // Just for clarity. llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); llassert( (3 == dst->getComponents()) || (4 == dst->getComponents()) ); if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) { // No scaling needed if( src->getComponents() == dst->getComponents() ) { copyUnscaled( src ); } else if( 3 == src->getComponents() ) { copyUnscaled3onto4( src ); } else { // 4 == src->getComponents() copyUnscaled4onto3( src ); } } else { // Scaling needed // No scaling needed if( src->getComponents() == dst->getComponents() ) { copyScaled( src ); } else if( 3 == src->getComponents() ) { copyScaled3onto4( src ); } else { // 4 == src->getComponents() copyScaled4onto3( src ); } } }
// Src and dst can be any size. Src and dst can each have 3 or 4 components. void LLImageRaw::copy(LLImageRaw* src) { if (!src) { LL_WARNS() << "LLImageRaw::copy called with a null src pointer" << LL_ENDL; return; } LLImageRaw* dst = this; // Just for clarity. if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) { // No scaling needed if( src->getComponents() == dst->getComponents() ) { copyUnscaled( src ); } else if( 3 == src->getComponents() ) { copyUnscaled3onto4( src ); } else { // 4 == src->getComponents() copyUnscaled4onto3( src ); } } else { // Scaling needed // No scaling needed if( src->getComponents() == dst->getComponents() ) { copyScaled( src ); } else if( 3 == src->getComponents() ) { copyScaled3onto4( src ); } else { // 4 == src->getComponents() copyScaled4onto3( src ); } } }
// Src and dst can be any size. Src and dst can each have 3 or 4 components. void LLImageRaw::copy(LLImageRaw* src) { LLImageRaw* dst = this; // Just for clarity. llassert( (3 == src->getComponents()) || (4 == src->getComponents()) ); llassert( (3 == dst->getComponents()) || (4 == dst->getComponents()) ); if( (src->getWidth() == dst->getWidth()) && (src->getHeight() == dst->getHeight()) ) { // No scaling needed if( src->getComponents() == dst->getComponents() ) { copyUnscaled( src ); } else if( 3 == src->getComponents() ) { copyUnscaled3onto4( src ); } else { // 4 == src->getComponents() copyUnscaled4onto3( src ); } } else { // Scaling needed // No scaling needed if( src->getComponents() == dst->getComponents() ) { copyScaled( src ); } else if( 3 == src->getComponents() ) { copyScaled3onto4( src ); } else { // 4 == src->getComponents() copyScaled4onto3( src ); } } }