[Kst] branches/work/kst/portto4/kst/src
Peter Kümmel
syntheticpp at yahoo.com
Fri Apr 2 20:45:55 CEST 2010
SVN commit 1110326 by kuemmel:
remove vectorframecount
M +2 -5 datasources/ascii/asciisource.cpp
M +2 -6 datasources/dirfilesource/dirfilesource.cpp
M +5 -9 datasources/qimagesource/qimagesource.cpp
M +12 -0 libkst/datamatrix.cpp
M +6 -1 libkst/datamatrix.h
M +14 -0 libkst/datavector.cpp
M +7 -3 libkst/datavector.h
--- branches/work/kst/portto4/kst/src/datasources/ascii/asciisource.cpp #1110325:1110326
@@ -80,13 +80,10 @@
const DataVector::Optional DataInterfaceAsciiVector::optional(const QString &field) const
{
- DataVector::Optional opt = {-1, -1, -1};
if (!ascii._fieldList.contains(field))
- return opt;
+ return DataVector::Optional();
- opt.samplesPerFrame = 1;
- opt.frameCount = ascii._numFrames;
- return opt;
+ return DataVector::Optional(ascii._numFrames, 1);
}
--- branches/work/kst/portto4/kst/src/datasources/dirfilesource/dirfilesource.cpp #1110325:1110326
@@ -80,14 +80,10 @@
const DataVector::Optional DataInterfaceDirFileVector::optional(const QString &field) const
{
- DataVector::Optional opt = {-1, -1, -1};
if (!dir._fieldList.contains(field))
- return opt;
+ return DataVector::Optional();
- opt.samplesPerFrame = dir.samplesPerFrame(field);
- opt.frameCount = dir._frameCount;
-
- return opt;
+ return DataVector::Optional(dir._frameCount, dir.samplesPerFrame(field));
}
--- branches/work/kst/portto4/kst/src/datasources/qimagesource/qimagesource.cpp #1110325:1110326
@@ -98,15 +98,10 @@
const DataVector::Optional DataInterfaceQImageVector::optional(const QString &field) const
{
- DataVector::Optional opt = {-1, -1, -1};
if (!_vectorList.contains(field))
- return opt;
+ return DataVector::Optional();
- opt.samplesPerFrame = 1;
- opt.frameCount = _frameCount;
- opt.vectorframeCount = -1;
-
- return opt;
+ return DataVector::Optional(_frameCount, 1);
}
@@ -216,11 +211,12 @@
const DataMatrix::Optional DataInterfaceQImageMatrix::optional(const QString& matrix) const
{
- DataMatrix::Optional opt = {-1, -1, -1};
if ( !_image || _image->isNull() || !_matrixList.contains( matrix ) ) {
- return opt;
+ return DataMatrix::Optional();
}
+ DataMatrix::Optional opt;
+ opt.samplesPerFrame = 1;
opt.xSize = _image->width();
opt.ySize = _image->height();
--- branches/work/kst/portto4/kst/src/libkst/datamatrix.cpp #1110325:1110326
@@ -33,6 +33,18 @@
const QString DataMatrix::staticTypeString = I18N_NOOP("Data Matrix");
const QString DataMatrix::staticTypeTag = I18N_NOOP("datamatrix");
+
+
+DataMatrix::Optional::Optional() :
+ samplesPerFrame(-1),
+ xSize(-1),
+ ySize(-1)
+{
+}
+
+
+
+
DataMatrix::DataMatrix(ObjectStore *store)
: Matrix(store) {
}
--- branches/work/kst/portto4/kst/src/libkst/datamatrix.h #1110325:1110326
@@ -52,12 +52,17 @@
int skip;
};
- struct Optional {
+
+ struct Optional
+ {
+ Optional();
+
int samplesPerFrame;
int xSize;
int ySize;
};
+
virtual const QString& typeString() const;
static const QString staticTypeString;
static const QString staticTypeTag;
--- branches/work/kst/portto4/kst/src/libkst/datavector.cpp #1110325:1110326
@@ -48,6 +48,20 @@
const QString DataVector::staticTypeString = I18N_NOOP("Data Vector");
const QString DataVector::staticTypeTag = I18N_NOOP("datavector");
+
+DataVector::Optional::Optional() :
+ frameCount(-1),
+ samplesPerFrame(-1)
+{
+}
+
+
+DataVector::Optional::Optional(int fc, int spf) :
+ frameCount(fc),
+ samplesPerFrame(spf)
+{
+}
+
/** Create a DataVector: raw data from a file */
DataVector::DataVector(ObjectStore *store)
: Vector(store), DataPrimitive() {
--- branches/work/kst/portto4/kst/src/libkst/datavector.h #1110325:1110326
@@ -53,10 +53,14 @@
int *lastFrameRead;
};
- struct Optional {
+
+ struct Optional
+ {
+ Optional();
+ Optional(int frameCount, int samplesPerFrame);
+
+ int frameCount;
int samplesPerFrame;
- int frameCount;
- int vectorframeCount;
};
More information about the Kst
mailing list