[Kst] extragear/graphics/kst/kst/datasources
Barth Netterfield
netterfield at astro.utoronto.ca
Tue Nov 22 02:07:01 CET 2005
SVN commit 482159 by netterfield:
Image sources refer to the 1st image as '1', etc.
M +5 -5 fitsimage/fitsimage.cpp
M +21 -8 qimagesource/qimagesource.cpp
--- trunk/extragear/graphics/kst/kst/datasources/fitsimage/fitsimage.cpp #482158:482159
@@ -56,8 +56,8 @@
fits_open_image( &_fptr, _filename.latin1( ), READONLY, &status );
if ( status == 0 ) {
_fieldList.append( "INDEX" );
- _fieldList.append( "M1" );
- _matrixList.append( "M1" );
+ _fieldList.append( "1" );
+ _matrixList.append( "1" );
return update() == KstObject::UPDATE;
} else {
fits_close_file( _fptr, &status );
@@ -140,7 +140,7 @@
i=0;
z = data->z;
- if ( field=="M1" ) {
+ if ( field=="1" ) {
for ( px = xStart; px<x1; px++ ) {
for ( py=y1-1; py>=yStart; py-- ) {
z[ni - i] = buffer[px + py*n_axes[0]];
@@ -187,7 +187,7 @@
for ( i=0; i<n; i++ ) {
v[i] = i+s;
}
- } else if ( field=="M1" ) {
+ } else if ( field=="1" ) {
double *buffer;
long fpixel[2] = {1, 1};
double nullval = 0;
@@ -293,7 +293,7 @@
}
if ( understands_fitsimage(NULL, filename) ) {
fieldList.append("INDEX");
- fieldList.append( "M1" );
+ fieldList.append( "1" );
}
return fieldList;
}
--- trunk/extragear/graphics/kst/kst/datasources/qimagesource/qimagesource.cpp #482158:482159
@@ -50,10 +50,18 @@
_fieldList.append( "RED" );
_fieldList.append( "GREEN" );
_fieldList.append( "BLUE" );
+ _fieldList.append( "1" );
+ _fieldList.append( "2" );
+ _fieldList.append( "3" );
+ _fieldList.append( "4" );
_matrixList.append( "GRAY" );
_matrixList.append( "RED" );
_matrixList.append( "GREEN" );
_matrixList.append( "BLUE" );
+ _matrixList.append( "1" );
+ _matrixList.append( "2" );
+ _matrixList.append( "3" );
+ _matrixList.append( "4" );
return update() == KstObject::UPDATE;
} else {
_image.reset();
@@ -110,28 +118,28 @@
i=0;
z = data->z;
- if ( field=="GRAY" ) {
+ if ( field=="GRAY" || field == "1") {
for ( px = xStart; px<x1; px++ ) {
for ( py=y1-1; py>=yStart; py-- ) {
z[i] = qGray( _image.pixel( px, py ) );
i++;
}
}
- } else if ( field=="RED" ) {
+ } else if ( field=="RED" || field == "2" ) {
for ( px = xStart; px<x1; px++ ) {
for ( py=y1-1; py>=yStart; py-- ) {
z[i] = qRed( _image.pixel( px, py ) );
i++;
}
}
- } else if ( field=="GREEN" ) {
+ } else if ( field=="GREEN" || field == "3" ) {
for ( px = xStart; px<x1; px++ ) {
for ( py=y1-1; py>=yStart; py-- ) {
z[i] = qGreen( _image.pixel( px, py ) );
i++;
}
}
- } else if ( field=="BLUE" ) {
+ } else if ( field=="BLUE" || field == "4" ) {
for ( px = xStart; px<x1; px++ ) {
for ( py=y1-1; py>=yStart; py-- ) {
z[i] = qBlue( _image.pixel( px, py ) );
@@ -156,25 +164,25 @@
for ( i=0; i<n; i++ ) {
v[i] = i+s;
}
- } else if ( field=="GRAY" ) {
+ } else if ( field=="GRAY" || field == "1" ) {
for ( i=s; i<s+n; i++ ) {
px = i%_image.width();
py = i/_image.width();
v[i-s] = qGray( _image.pixel( px, py ) );
}
- } else if ( field=="RED" ) {
+ } else if ( field=="RED" || field == "2" ) {
for ( i=s; i<s+n; i++ ) {
px = i%_image.width();
py = i/_image.width();
v[i-s] = qRed( _image.pixel( px, py ) );
}
- } else if ( field=="GREEN" ) {
+ } else if ( field=="GREEN" || field == "3" ) {
for ( i=s; i<s+n; i++ ) {
px = i%_image.width();
py = i/_image.width();
v[i-s] = qGreen( _image.pixel( px, py ) );
}
- } else if ( field=="BLUE" ) {
+ } else if ( field=="BLUE" || field == "4" ) {
for ( i=s; i<s+n; i++ ) {
px = i%_image.width();
py = i/_image.width();
@@ -264,6 +272,10 @@
fieldList.append( "RED" );
fieldList.append( "GREEN" );
fieldList.append( "BLUE" );
+ fieldList.append( "1" );
+ fieldList.append( "2" );
+ fieldList.append( "3" );
+ fieldList.append( "4" );
}
return fieldList;
}
@@ -273,3 +285,4 @@
KST_KEY_DATASOURCE_PLUGIN(qimagesource)
// vim: ts=2 sw=2 et
+
\ No newline at end of file
More information about the Kst
mailing list