SDcmWeb/webassembly/test.sh
2025-10-12 00:17:30 +09:00

47 lines
3.7 KiB
Bash
Executable File

#!/bin/bash
make clean
# -s EXPORT_NAME='createDicomViewerModule' -sMODULARIZE=1 -sEXPORT_ES6=1 \
emcc test.cc -o test.js -sUSE_SDL=2 -sENVIRONMENT=web -gsource-map -sASSERTIONS=1 \
-s EXPORT_NAME='createDicomViewerModule' -sMODULARIZE=1 -sEXPORT_ES6=1 --bind \
-s MAXIMUM_MEMORY=4096MB -s ALLOW_TABLE_GROWTH -s ALLOW_MEMORY_GROWTH \
-s EXPORTED_RUNTIME_METHODS="['ccall','cwrap','specialHTMLTargets', 'JSEvents', 'GL', 'callMain', 'abort', 'addFunction' ,'HEAPU8', 'UTF8ToString']" \
-s EXPORTED_FUNCTIONS="['_malloc', '_free', '_main', '_UpdateDcmImage', '_SetWindowWidthLevel', '_GetWindowWidth', '_GetWindowCenter',
'_SetCallbackUpdateDcmImageComplete', '_CancelLoadImage', '_SetDisplayFrameIndex', '_SetResizeFrame',
'_GetTotalBytes', '_GetReadBytes', '_GetTotalFrames', '_GetFrameUpdateTimeDelay', '_ResetView',
'_ResetWindowWidthLevel', '_ProcessDCMFile', '_SetInteractionMode',
'_DoMouseMove', '_DoMouseDown', '_DoMouseUp', '_DoMouseWheelZoom', '_DoPinchZoom',
'_ParseDicomToPixelData', '_GetFrameWidth', '_GetFrameHeight', '_GetFrameSizeUncompressed',
'_GetPaletteEntries', '_GetPixelData', '_GetPaletteData', '_GetDefaultWindowWidth', '_GetDefaultWindowCenter',
'_GetBitsAllocated', '_GetBitsStored', '_GetSamplesPerPixel', '_SetDicomData', '_GetColorType', '_GetWidth', '_GetHeight',
'_GetFrameTime', '_GetFrameDelay', '_ClearImageData', '_IsUseMonochrome1', '_GetCurrentFrame',
'_getDumpJson', '_setDumpJson', '_Shutdown', '_SetCallbackUpdateWasmInitGeometryComplete']" \
-s RESERVED_FUNCTION_POINTERS=60 \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libz.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libxml2.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libtiff.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libtiffxx.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libpng16.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libopenjp2.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmdata.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmimage.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmimgle.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmiod.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmjpeg.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmjpls.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmtkcharls.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libdcmxml.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libi2d.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libijg12.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libijg16.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libijg8.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/liboflog.a \
/home/ssdoctors/emsdk/upstream/emscripten/cache/sysroot/lib/libofstd.a \
camera.cpp \
events.cpp
cp -av test.wasm* ../static/.
cp -av test.{js,wasm*} ../src/lib/viewer/.