Kaydet (Commit) d3b0f6bc authored tarafından Caolán McNamara's avatar Caolán McNamara

always copying to a different bitmap

Change-Id: I90b205bef1b01e6c4c43788fc5c95391b7842e83
üst 1c217968
...@@ -104,10 +104,6 @@ void scaleLine( SourceIter s_begin, ...@@ -104,10 +104,6 @@ void scaleLine( SourceIter s_begin,
@param d_acc @param d_acc
Destination accessor Destination accessor
@param bMustCopy
When true, scaleImage always copies source, even when doing 1:1
copy
*/ */
template< class SourceIter, class SourceAcc, template< class SourceIter, class SourceAcc,
class DestIter, class DestAcc > class DestIter, class DestAcc >
...@@ -116,8 +112,7 @@ void scaleImage( SourceIter s_begin, ...@@ -116,8 +112,7 @@ void scaleImage( SourceIter s_begin,
SourceAcc s_acc, SourceAcc s_acc,
DestIter d_begin, DestIter d_begin,
DestIter d_end, DestIter d_end,
DestAcc d_acc, DestAcc d_acc )
bool bMustCopy=false )
{ {
const int src_width ( s_end.x - s_begin.x ); const int src_width ( s_end.x - s_begin.x );
const int src_height( s_end.y - s_begin.y ); const int src_height( s_end.y - s_begin.y );
...@@ -125,9 +120,8 @@ void scaleImage( SourceIter s_begin, ...@@ -125,9 +120,8 @@ void scaleImage( SourceIter s_begin,
const int dest_width ( d_end.x - d_begin.x ); const int dest_width ( d_end.x - d_begin.x );
const int dest_height( d_end.y - d_begin.y ); const int dest_height( d_end.y - d_begin.y );
if( !bMustCopy && if ( src_width == dest_width &&
src_width == dest_width && src_height == dest_height )
src_height == dest_height )
{ {
// no scaling involved, can simply copy // no scaling involved, can simply copy
vigra::copyImage( s_begin, s_end, s_acc, vigra::copyImage( s_begin, s_end, s_acc,
...@@ -166,20 +160,14 @@ void scaleImage( SourceIter s_begin, ...@@ -166,20 +160,14 @@ void scaleImage( SourceIter s_begin,
} }
/** Scale an image, range tuple version /** Scale an image, range tuple version
@param bMustCopy
When true, scaleImage always copies source, even when doing 1:1
copy
*/ */
template< class SourceIter, class SourceAcc, template< class SourceIter, class SourceAcc,
class DestIter, class DestAcc > class DestIter, class DestAcc >
inline void scaleImage( vigra::triple<SourceIter,SourceIter,SourceAcc> const& src, inline void scaleImage( vigra::triple<SourceIter,SourceIter,SourceAcc> const& src,
vigra::triple<DestIter,DestIter,DestAcc> const& dst, vigra::triple<DestIter,DestIter,DestAcc> const& dst )
bool bMustCopy=false )
{ {
scaleImage(src.first,src.second,src.third, scaleImage(src.first,src.second,src.third,
dst.first,dst.second,dst.third, dst.first,dst.second,dst.third);
bMustCopy);
} }
} }
......
...@@ -248,8 +248,7 @@ namespace ...@@ -248,8 +248,7 @@ namespace
aRect), aRect),
destIterRange(begin, destIterRange(begin,
acc, acc,
aRect), aRect));
isSharedBuffer(rSrcBitmap) );
} }
template< typename Iterator, typename Acc > static template< typename Iterator, typename Acc > static
...@@ -425,11 +424,6 @@ PaletteMemorySharedVector BitmapDevice::getPalette() const ...@@ -425,11 +424,6 @@ PaletteMemorySharedVector BitmapDevice::getPalette() const
return mpImpl->mpPalette; return mpImpl->mpPalette;
} }
bool BitmapDevice::isSharedBuffer( const BitmapDeviceSharedPtr& rOther ) const
{
return rOther.get()->getBuffer().get() == getBuffer().get();
}
Color BitmapDevice::getPixel( const basegfx::B2IPoint& rPt ) Color BitmapDevice::getPixel( const basegfx::B2IPoint& rPt )
{ {
if( mpImpl->maBounds.isInside(rPt) ) if( mpImpl->maBounds.isInside(rPt) )
......
...@@ -100,9 +100,6 @@ public: ...@@ -100,9 +100,6 @@ public:
*/ */
PaletteMemorySharedVector getPalette() const; PaletteMemorySharedVector getPalette() const;
/// Check if this and the other BitmapDevice share a buffer
bool isSharedBuffer( const BitmapDeviceSharedPtr& rOther ) const;
/** Get color value at given pixel /** Get color value at given pixel
*/ */
Color getPixel( const basegfx::B2IPoint& rPt ); Color getPixel( const basegfx::B2IPoint& rPt );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment