[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[libcvd-members] libcvd/cvd image_ref.h internal/image_ref_imple...
From: |
Georg Klein |
Subject: |
[libcvd-members] libcvd/cvd image_ref.h internal/image_ref_imple... |
Date: |
Thu, 16 Nov 2006 17:28:38 +0000 |
CVSROOT: /cvsroot/libcvd
Module name: libcvd
Changes by: Georg Klein <georgklein> 06/11/16 17:28:38
Modified files:
cvd : image_ref.h
cvd/internal : image_ref_implementation.hh
Log message:
const version of operator[]
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/image_ref.h?cvsroot=libcvd&r1=1.13&r2=1.14
http://cvs.savannah.gnu.org/viewcvs/libcvd/cvd/internal/image_ref_implementation.hh?cvsroot=libcvd&r1=1.10&r2=1.11
Patches:
Index: image_ref.h
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/image_ref.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -b -r1.13 -r1.14
--- image_ref.h 2 Nov 2006 12:28:42 -0000 1.13
+++ image_ref.h 16 Nov 2006 17:28:38 -0000 1.14
@@ -163,6 +163,9 @@
/// Square bracket subscripts for easy loops. 0=x 1=y other=error
inline int& operator[](int i);
+ /// Square bracket const subscripts for easy loops. 0=x 1=y other=error
+ inline int operator[](int i) const;
+
//Why do these exist?
///@overload
inline ImageRef shiftl(int i) const;
Index: internal/image_ref_implementation.hh
===================================================================
RCS file: /cvsroot/libcvd/libcvd/cvd/internal/image_ref_implementation.hh,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -b -r1.10 -r1.11
--- internal/image_ref_implementation.hh 20 Apr 2006 10:31:22 -0000
1.10
+++ internal/image_ref_implementation.hh 16 Nov 2006 17:28:38 -0000
1.11
@@ -212,6 +212,15 @@
throw Exceptions::BadSubscript();
}
+inline int ImageRef::operator[](int i) const
+{
+ if(i==0)
+ return x;
+ if(i==1)
+ return y;
+ throw Exceptions::BadSubscript();
+}
+
inline unsigned int ImageRef::mag_squared() const
{
typedef unsigned int uint;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [libcvd-members] libcvd/cvd image_ref.h internal/image_ref_imple...,
Georg Klein <=