#include "HxImageRep.h"
Go to the source code of this file.
Functions | |
void L_HXIMAGEREP | HxExportByteData (HxImageRep img, HxByte *data) |
Export image data to array of HxByte. More... |
|
Export image data to array of HxByte. The size of the (pre-allocated) array must be equal to the dimensionality of the pixel values times the number of pixels in the image.
00014 { 00015 HxString fname("HxExportByteData"); 00016 00017 if (img.isNull()) 00018 { 00019 HxGlobalError::instance()->reportError(fname, img.name(), "null image", HxGlobalError::HX_GE_INVALID); 00020 return; 00021 } 00022 if (data == NULL) 00023 { 00024 HxGlobalError::instance()->reportError(fname, "null pointer", HxGlobalError::HX_GE_INVALID); 00025 return; 00026 } 00027 00028 HxTagList tags; 00029 HxString exportOp 00030 = HxString("exportPix<") + HxString(HxClassName<HxByte>()) + ">"; 00031 HxAddTag(tags, "dataPtr", static_cast<void*>(data)); 00032 img.exportOp(exportOp, tags); 00033 } |