summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Åstrand <astrand@cendio.se>2005-02-10 15:30:47 +0000
committerPeter Åstrand <astrand@cendio.se>2005-02-10 15:30:47 +0000
commit67505118683a3f91fe0c336e12684c36269ce588 (patch)
treeb7ceca84109cb1ad12693a5cb087fed38fb14d27
parent9b0809c2cf25767648376bda39dc68dbad7a33b2 (diff)
downloadtigervnc-67505118683a3f91fe0c336e12684c36269ce588.tar.gz
tigervnc-67505118683a3f91fe0c336e12684c36269ce588.zip
Uncommented getNumRects.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@165 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--rfb/TightEncoder.cxx42
-rw-r--r--rfb/TightEncoder.h2
2 files changed, 22 insertions, 22 deletions
diff --git a/rfb/TightEncoder.cxx b/rfb/TightEncoder.cxx
index fe23a971..fb19885a 100644
--- a/rfb/TightEncoder.cxx
+++ b/rfb/TightEncoder.cxx
@@ -112,27 +112,27 @@ void TightEncoder::setQualityLevel(int level)
}
}
-//int TightEncoder::getNumRects(const Rect &r)
-//{
-// const unsigned int w = r.width();
-// const unsigned int h = r.height();
-//
-// // Will this rectangle split into subrects?
-// bool rectTooBig = w > pconf->maxRectWidth || w * h > pconf->maxRectSize;
-// if (!rectTooBig)
-// return 1;
-//
-// // Compute max sub-rectangle size.
-// const unsigned int subrectMaxWidth =
-// (w > pconf->maxRectWidth) ? pconf->maxRectWidth : w;
-// const unsigned int subrectMaxHeight =
-// pconf->maxRectSize / subrectMaxWidth;
-//
-// // Return the number of subrects.
-// return (((w - 1) / pconf->maxRectWidth + 1) *
-// ((h - 1) / subrectMaxHeight + 1));
-//}
-//
+int TightEncoder::getNumRects(const Rect &r)
+{
+ const unsigned int w = r.width();
+ const unsigned int h = r.height();
+
+ // Will this rectangle split into subrects?
+ bool rectTooBig = w > pconf->maxRectWidth || w * h > pconf->maxRectSize;
+ if (!rectTooBig)
+ return 1;
+
+ // Compute max sub-rectangle size.
+ const unsigned int subrectMaxWidth =
+ (w > pconf->maxRectWidth) ? pconf->maxRectWidth : w;
+ const unsigned int subrectMaxHeight =
+ pconf->maxRectSize / subrectMaxWidth;
+
+ // Return the number of subrects.
+ return (((w - 1) / pconf->maxRectWidth + 1) *
+ ((h - 1) / subrectMaxHeight + 1));
+}
+
bool TightEncoder::writeRect(const Rect& r, ImageGetter* ig, Rect* actual)
{
// Shortcuts to rectangle coordinates and dimensions.
diff --git a/rfb/TightEncoder.h b/rfb/TightEncoder.h
index 181db72a..b6e71a19 100644
--- a/rfb/TightEncoder.h
+++ b/rfb/TightEncoder.h
@@ -55,7 +55,7 @@ namespace rfb {
static Encoder* create(SMsgWriter* writer);
virtual void setCompressLevel(int level);
virtual void setQualityLevel(int level);
- // virtual int getNumRects(const Rect &r);
+ virtual int getNumRects(const Rect &r);
virtual bool writeRect(const Rect& r, ImageGetter* ig, Rect* actual);
virtual ~TightEncoder();