[opengtl-commits] [484] some small optimization and install Library.h

[ Thread Index | Date Index | More lists.tuxfamily.org/opengtl-commits Archives ]


Revision: 484
Author:   cyrille
Date:     2008-11-21 23:34:56 +0100 (Fri, 21 Nov 2008)

Log Message:
-----------
some small optimization and install Library.h

Modified Paths:
--------------
    trunk/OpenGTL/OpenGTL/GTLCore/BufferImage.cpp
    trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt


Modified: trunk/OpenGTL/OpenGTL/GTLCore/BufferImage.cpp
===================================================================
--- trunk/OpenGTL/OpenGTL/GTLCore/BufferImage.cpp	2008-11-16 23:03:55 UTC (rev 483)
+++ trunk/OpenGTL/OpenGTL/GTLCore/BufferImage.cpp	2008-11-21 22:34:56 UTC (rev 484)
@@ -31,6 +31,7 @@
 {
   GTLCore::Buffer* buffer;
   int lineWidth;
+  int pixelSize;
   int width;
   int height;
   char* defaultPixel;
@@ -42,8 +43,9 @@
   d->lineWidth = _width * pixelSize();
   d->width = _width;
   d->height = _height;
-  d->defaultPixel = new char[ pixelSize() ];
-  memset( d->defaultPixel, 0, pixelSize() );
+  d->pixelSize = pixelSize();
+  d->defaultPixel = new char[ d->pixelSize ];
+  memset( d->defaultPixel, 0, d->pixelSize );
   GTL_DEBUG( d->buffer->size() << " " << d->lineWidth << " " << _height);
   GTL_ASSERT( d->buffer->size() == d->lineWidth * _height );
 }
@@ -59,7 +61,7 @@
 {
   if( _x >= 0 and _y >= 0 and _x < d->width and _y < d->height )
   {
-    return d->buffer->rawData() + (_x * pixelSize() + _y * lineWidth());
+    return d->buffer->rawData() + (_x * d->pixelSize + _y * d->lineWidth);
   } else {
     return d->defaultPixel;
   }
@@ -69,7 +71,7 @@
 {
   if( _x >= 0 and _y >= 0 and _x < d->width and _y < d->height )
   {
-    return d->buffer->rawData() + (_x * pixelSize() + _y * lineWidth());
+    return d->buffer->rawData() + (_x * d->pixelSize + _y * d->lineWidth);
   } else {
     return d->defaultPixel;
   }

Modified: trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt	2008-11-16 23:03:55 UTC (rev 483)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/CMakeLists.txt	2008-11-21 22:34:56 UTC (rev 484)
@@ -39,7 +39,7 @@
 
 # Install target
 install(TARGETS OpenShiva  DESTINATION ${LIB_INSTALL_DIR} )
-install( FILES Kernel.h Version.h DESTINATION ${INCLUDE_INSTALL_DIR}/OpenShiva )
+install( FILES Kernel.h Library.h Version.h DESTINATION ${INCLUDE_INSTALL_DIR}/OpenShiva )
 
 # Create and install pc file
 configure_file("OpenShiva.pc.cmake" "${CMAKE_CURRENT_BINARY_DIR}/OpenShiva.pc" @ONLY)


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/