[opengtl-commits] [210] fix crash when calling evaluatePixeles, the correct pixel description was not used |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/opengtl-commits Archives
]
Revision: 210
Author: cyrille
Date: 2008-06-21 10:39:12 +0200 (Sat, 21 Jun 2008)
Log Message:
-----------
fix crash when calling evaluatePixeles, the correct pixel description was not used
Modified Paths:
--------------
trunk/OpenGTL/OpenShiva/OpenShiva/CodeGenerator_p.cpp
trunk/OpenGTL/OpenShiva/OpenShiva/Kernel.cpp
trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp
Modified: trunk/OpenGTL/OpenShiva/OpenShiva/CodeGenerator_p.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/CodeGenerator_p.cpp 2008-06-20 23:12:37 UTC (rev 209)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/CodeGenerator_p.cpp 2008-06-21 08:39:12 UTC (rev 210)
@@ -112,7 +112,7 @@
llvm::Value* _pointerToPixelVectorU8 = accessPixelData( _gc, _currentBlock, _pixel );
// Call llvm.memcpy.i32
callMemcpy( _gc, _currentBlock, _pointerToPixelVectorU8, _dataPointer, GTLCore::CodeGenerator::integerToConstant( _size ) );
-
+
return _currentBlock;
}
Modified: trunk/OpenGTL/OpenShiva/OpenShiva/Kernel.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/OpenShiva/Kernel.cpp 2008-06-20 23:12:37 UTC (rev 209)
+++ trunk/OpenGTL/OpenShiva/OpenShiva/Kernel.cpp 2008-06-21 08:39:12 UTC (rev 210)
@@ -44,7 +44,8 @@
struct Kernel::Private {
Private( const GTLCore::PixelDescription& _pixelDescription) : pixelDescription(_pixelDescription)
- {}
+ {
+ }
GTLCore::String name;
GTLCore::String source;
bool enableHydraCompatibility;
Modified: trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp
===================================================================
--- trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp 2008-06-20 23:12:37 UTC (rev 209)
+++ trunk/OpenGTL/OpenShiva/tools/interpreter/Shiva.cpp 2008-06-21 08:39:12 UTC (rev 210)
@@ -103,7 +103,8 @@
source += "\n";
std::getline(in,str);
}
- OpenShiva::Kernel p(fileName);
+ GTLCore::PixelDescription pixel( GTLCore::Type::UnsignedInteger8, 1 );
+ OpenShiva::Kernel p(fileName, pixel);
p.setSource( source );
p.compile();
if(not p.isCompiled())
@@ -111,7 +112,7 @@
std::cout << "Error: " << std::endl << p.compilationErrorsMessage() << std::endl;
return EXIT_FAILURE;
}
- OpenShiva::Image image(200,300, GTLCore::PixelDescription( GTLCore::Type::UnsignedInteger8, 1 ) );
+ OpenShiva::Image image(200,300, pixel );
memset( image.data(0, 0), 0, 200 * 300 );
p.evaluatePixeles( std::list<OpenShiva::AbstractImage*>(), &image );
std::cout << (int)*image.data( 0, 0);