In the function xyz(), I am calculating the string value and number of image and I need to return all the value like string and image. So, What I need to take the return type so they will take all value?
<Return-Type> MainWindow::xyz(QString m_ImgPath, int i)
{
try
{
m_ImgPath = Array[i];
QByteArray m_path = m_ImgPath.toLocal8Bit();
char* ImagePath = m_path.data();
obj *m_ThumpDCMReader = obj::New();
TReader->SetFileName(ImagePath);
TReader->Update();
//const QString string = NULL;
const char *str_uchar = TReader->GetMetaData()->GetAttributeValue(DC::string).GetCharData();
string = QString::fromUtf8((char *)str_uchar);
SPointer<ImageData> imageData = TReader->GetOutput();
if (!imageData) { return QImage(); }
/// \todo retrieve just the UpdateExtent
int width = imageData->GetDimensions()[0];
int height = imageData->GetDimensions()[1];
QImage image(width, height, QImage::Format_RGB32);
QRgb *rgbPtr = reinterpret_cast<QRgb *>(image.bits()) + width * (height - 1);
unsigned char *colorsPtr = reinterpret_cast<unsigned char *>(imageData->GetScalarPointer());
for (int row = 0; row < height; row++)
{
for (int col = 0; col < width; col++)
{
*(rgbPtr++) = QColor(colorsPtr[0], colorsPtr[1], colorsPtr[2]).rgb();
colorsPtr += imageData->GetNumberOfScalarComponents();
}
rgbPtr -= width * 2;
}
return (Image,string)
}
catch (...) { return QImage(); }
}
SO what i need to add the the return type.So, they will return multiple data.