99 vector<QString> result;
101 QString str =
toString().remove(QRegExp(
"^\\+"));
103 QStringList strSplit = str.split(
",", QString::SkipEmptyParts);
104 foreach (QString commaTok, strSplit) {
106 if(commaTok.contains(
'-')) {
108 int start =
toInt(commaTok.mid(0, commaTok.indexOf(
"-")));
109 int end =
toInt(commaTok.mid(commaTok.indexOf(
"-") + 1));
111 direction = (start <= end) ? 1 : -1;
113 for(
int band = start; band != end; band += direction) {
120 result.push_back(commaTok);
138 bool CubeAttributeInput::isBandRange(QString attribute)
const {
139 return QRegExp(
"[0-9,\\-]+").exactMatch(attribute);
145 for(
unsigned int i = 0; i < bands.size(); i++) {
159 result.append(&CubeAttributeInput::isBandRange);
186 if (pixelTypeAtts.isEmpty() || pixelTypeAtts.last() ==
"PROPAGATE")
194 return attributeList(&CubeAttributeOutput::isRange).isEmpty();
288 if (!formatList.isEmpty()) {
289 QString formatString = formatList.last();
291 if (formatString ==
"BSQ" || formatString ==
"BANDSEQUENTIAL")
306 &CubeAttributeOutput::isFileFormat);
311 double result =
Null;
314 QString range =
attributeList(&CubeAttributeOutput::isRange).last();
317 if (rangeList.count() == 2 && rangeList.first() !=
"")
318 result =
toDouble(rangeList.first());
326 double result =
Null;
329 QString range =
attributeList(&CubeAttributeOutput::isRange).last();
332 if (rangeList.count() == 2 && rangeList.last() !=
"")
333 result =
toDouble(rangeList.last());
380 QString pixelTypeAtt =
attributeList(&CubeAttributeOutput::isPixelType).last();
382 if(pixelTypeAtt ==
"8BIT" || pixelTypeAtt ==
"8-BIT" || pixelTypeAtt ==
"UNSIGNEDBYTE") {
383 result = UnsignedByte;
385 else if(pixelTypeAtt ==
"16BIT" || pixelTypeAtt ==
"16-BIT" || pixelTypeAtt ==
"SIGNEDWORD") {
388 else if(pixelTypeAtt ==
"32BIT" || pixelTypeAtt ==
"32-BIT" || pixelTypeAtt ==
"REAL") {
411 if (!labelAttachmentAtts.isEmpty()) {
412 QString labelAttachmentAtt = labelAttachmentAtts.last();
414 if (labelAttachmentAtt ==
"DETACHED")
416 else if (labelAttachmentAtt ==
"EXTERNAL")
424 bool CubeAttributeOutput::isByteOrder(QString attribute)
const {
425 return QRegExp(
"(M|L)SB").exactMatch(attribute);
429 bool CubeAttributeOutput::isFileFormat(QString attribute)
const {
430 return QRegExp(
"(BANDSEQUENTIAL|BSQ|TILE)").exactMatch(attribute);
434 bool CubeAttributeOutput::isLabelAttachment(QString attribute)
const {
435 return QRegExp(
"(ATTACHED|DETACHED|EXTERNAL)").exactMatch(attribute);
439 bool CubeAttributeOutput::isPixelType(QString attribute)
const {
440 return QRegExp(
"(8-?BIT|16-?BIT|32-?BIT|UNSIGNEDBYTE|SIGNEDWORD|REAL)").exactMatch(attribute);
445 bool CubeAttributeOutput::isRange(QString attribute)
const {
446 return QRegExp(
"[\\-+E0-9.]*:[\\-+E0-9.]*").exactMatch(attribute);
451 QString result =
"Tile";
454 result =
"BandSequential";
465 if (!byteOrderAtts.isEmpty()) {
466 QString byteOrderAtt = byteOrderAtts.last();
467 result = (byteOrderAtt ==
"LSB")? Lsb : Msb;
481 &CubeAttributeOutput::isByteOrder);
488 result.append(&CubeAttributeOutput::isByteOrder);
489 result.append(&CubeAttributeOutput::isFileFormat);
490 result.append(&CubeAttributeOutput::isLabelAttachment);
491 result.append(&CubeAttributeOutput::isPixelType);
492 result.append(&CubeAttributeOutput::isRange);