diff options
author | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2007-03-27 14:48:24 +0000 |
---|---|---|
committer | george82 <george82@3789f03b-4d11-0410-bbf8-ca57d06f2519> | 2007-03-27 14:48:24 +0000 |
commit | 9d8f0ab22617f481a7b6f2d9b19daf995272b285 (patch) | |
tree | 3e6d0f623d51276686246c8b156c4837c92dd1cf /common | |
parent | c4eb6262e62defefd076c7080b3aa3d48446b09d (diff) | |
download | tigervnc-9d8f0ab22617f481a7b6f2d9b19daf995272b285.tar.gz tigervnc-9d8f0ab22617f481a7b6f2d9b19daf995272b285.zip |
Added ScaleFilters::getFilterIdByName() method and defaultScaleFilter parameter.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2242 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r-- | common/rfb/ScaleFilters.cxx | 7 | ||||
-rw-r--r-- | common/rfb/ScaleFilters.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/common/rfb/ScaleFilters.cxx b/common/rfb/ScaleFilters.cxx index 2e6b88da..12984669 100644 --- a/common/rfb/ScaleFilters.cxx +++ b/common/rfb/ScaleFilters.cxx @@ -71,6 +71,13 @@ SFilter &ScaleFilters::operator[](unsigned int filter_id) { return filters[filter_id];
}
+int ScaleFilters::getFilterIdByName(char *filterName) {
+ for (int i = 0; i <= scaleFilterMaxNumber; i++) {
+ if (stricmp(filters[i].name, filterName) == 0) return i;
+ }
+ return -1;
+}
+
void ScaleFilters::initFilters() {
filters[scaleFilterNearestNeighbor] = create("Nearest neighbor", 0.5, nearest_neighbor);
filters[scaleFilterBilinear] = create("Bilinear", 1, linear);
diff --git a/common/rfb/ScaleFilters.h b/common/rfb/ScaleFilters.h index 62075d54..d59cc37d 100644 --- a/common/rfb/ScaleFilters.h +++ b/common/rfb/ScaleFilters.h @@ -34,6 +34,7 @@ namespace rfb { const unsigned int scaleFilterSinc = 3;
const unsigned int scaleFilterMaxNumber = 3;
+ const unsigned int defaultScaleFilter = scaleFilterBilinear;
//
// -=- Scale filters structures and routines
@@ -60,6 +61,8 @@ namespace rfb { SFilter &operator[](unsigned int filter_id);
+ int getFilterIdByName(char *filterName);
+
void makeWeightTabs(int filter, int src_x, int dst_x, SFilterWeightTab **weightTabs);
protected:
|