51 m_spatialExtents[0] = tileSize.
x;
52 m_spatialExtents[1] = tileSize.
y;
104 m_nullPixelValue(rhs.m_nullPixelValue),
105 m_minPixelValue(rhs.m_minPixelValue),
106 m_maxPixelValue(rhs.m_maxPixelValue),
107 m_alpha(rhs.m_alpha),
108 m_origin(rhs.m_origin),
109 m_indexedFlag(rhs.m_indexedFlag),
204 return static_cast<const void*
>(b);
216 return static_cast<void*
>(b);
442 const unsigned char* sourceBuf =
getUcharBuf(bandNumber);
443 p = sourceBuf[offset];
449 p = sourceBuf[offset];
460 p = sourceBuf[offset];
466 p = sourceBuf[offset];
473 p = sourceBuf[offset];
479 p = sourceBuf[offset];
486 p = sourceBuf[offset];
493 p = sourceBuf[offset];
501 <<
"ossimImageData::setNormalizedFloat Unsupported scalar type!" 513 ( ( p >=
m_minPixelValue[bandNumber] ) ? ( p + OFFSET_TO_ONE ) / DELTA : 0.0 ) : 1.0;
538 p = inputValue * DELTA + OFFSET_TO_MIN + 0.5;
553 unsigned char* sourceBuf =
getUcharBuf(bandNumber);
596 sourceBuf[offset] = p;
603 sourceBuf[offset] = p;
610 <<
"ossimImageData::setNormalizedFloat Unsupported scalar type!" 790 "ossimImageData::computeMeanSquaredError File %s line %d\n\ 791 Invalid scalar type: %d",
819 const T* BUFFER =
static_cast<const T*
>(
getBuf(bandNumber));
823 for(index = 0; index < BOUNDS; ++index)
827 delta = BUFFER[index] - meanValue;
828 result += (delta*delta);
832 if(validPixelCount > 0)
834 result /= validPixelCount;
866 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
869 if(currentHisto.
valid())
872 float* histoBins = currentHisto->
GetCounts();
873 int binCount = currentHisto->
GetRes();
876 if ( binCount == 256 )
878 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
880 if (buffer[offset] != nullpix)
881 ++histoBins[ buffer[offset] ];
886 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
888 if (buffer[offset] != nullpix)
889 currentHisto->
UpCount((
float)buffer[offset]);
903 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
906 if(currentHisto.
valid())
911 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
913 if (buffer[offset] != nullpix)
914 currentHisto->
UpCount((
float)buffer[offset]);
922 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
925 if(currentHisto.
valid())
930 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
932 if (buffer[offset] != nullpix)
933 currentHisto->
UpCount((
float)buffer[offset]);
941 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
944 if(currentHisto.
valid())
949 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
951 if (buffer[offset] != nullpix)
952 currentHisto->
UpCount((
float)buffer[offset]);
960 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
963 if(currentHisto.
valid())
968 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
970 if (buffer[offset] != nullpix)
971 currentHisto->
UpCount((
float)buffer[offset]);
981 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
984 if(currentHisto.
valid())
991 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
993 if (!ossim::almostEqual<ossim_float64>(buffer[offset], nullpix, epsilon))
994 currentHisto->
UpCount((
float)buffer[offset]);
1004 for(
ossim_uint32 band = 0; band < numberOfBands; ++band)
1007 if(currentHisto.
valid())
1014 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
1016 if (!ossim::almostEqual<ossim_float32>(buffer[offset], nullpix, epsilon))
1017 currentHisto->
UpCount((
float)buffer[offset]);
1028 <<
"ossimImageData::populateHistogram\n" 1029 <<
"Unknown scalar type." << std::endl;
1101 "ossimImageData::computeAverageBandValue File %s line %d\n\ 1102 Invalid scalar type: %d",
1128 const T* BUFFER =
static_cast<const T*
>(
getBuf(bandNumber));
1132 for(index = 0; index < BOUNDS; ++index)
1136 result += BUFFER[index];
1140 if(validPixelCount > 0)
1142 result /= validPixelCount;
1221 for(
ossim_uint32 band = 0; band < NUMBER_OF_BANDS; ++band)
1224 const T* p =
static_cast<const T*
>(
getBuf(band));
1229 if (p[i] != NP) ++count;
1238 else if (count == SIZE)
1313 "ossimImageData::makeBlank File %s line %d\n\ 1314 Invalid scalar type: %d",
1336 memset(
getBuf(band),
'\0', sizePerBandInBytes);
1341 T* p =
static_cast<T*
>(
getBuf(band));
1366 bool result =
false;
1369 os.open(f.
c_str(), ios::out | ios::binary);
1373 os.write(static_cast<const char*>(
getBuf()),
1383 os.open(hdrFile.
c_str(), ios::out);
1387 os <<
"filename: " << f.
c_str()
1388 <<
"\nimage_type: general_raster_bsq" 1390 <<
"\ninterleave_type: bsq" 1395 <<
"\nscalar_type: " 1445 unsigned char* buf =
static_cast<unsigned char*
>(
getBuf(band))+
1447 *buf = (
unsigned char)color;
1480 signed short* buf =
static_cast<signed short*
>(
getBuf(band))+
1482 *buf = (
signed short)color;
1531 <<
"ossimImageData::setValue Unsupported scalar type!" 1602 if(!rhsPtr)
return false;
1632 if(deepTest&&result)
1761 <<
"ossimImageData::fill Unsupported scalar type!" 1782 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1790 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1803 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1811 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1819 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1827 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1836 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1845 for (
ossim_uint32 i=0; i<size_in_pixels; i++) p[i] = np;
1853 "ossimImageData::makeBlank File %s line %d\n\ 1854 Invalid scalar type: %d",
1878 if (valueNullCount==0)
1956 "ossimImageData::createTestTile File %s line %d\nInvalid or unhandled scalar type: %d",
1966 "ossimImageData::createTestTile File %s line %d\nTile must be initialed!",
1985 const T
STEP =
static_cast<T
>( (MAX_PIX-NP) / (LINES-1) );
2022 for(band = 0; band < numberOfBands; ++band)
2034 for(band = 0; band < numberOfBands; ++band)
2051 for(band = 0; band < numberOfBands; band++)
2063 for(band = 0; band < numberOfBands; band++)
2075 for(band = 0; band < numberOfBands; band++)
2087 for(band = 0; band < numberOfBands; band++)
2099 for(band = 0; band < numberOfBands; band++)
2111 for(band = 0; band < numberOfBands; band++)
2123 for(band = 0; band < numberOfBands; band++)
2135 for(band = 0; band < numberOfBands; band++)
2150 <<
"ossimImageData::isNull Unsupported scalar type!" 2253 <<
"ossimImageData::isNull Unsupported scalar type!" 2285 return isNull(offset, band);
2296 for(band = 0; band < numberOfBands; ++band)
2305 for(band = 0; band < numberOfBands; ++band)
2319 for(band = 0; band < numberOfBands; band++)
2329 for(band = 0; band < numberOfBands; band++)
2339 for(band = 0; band < numberOfBands; band++)
2349 for(band = 0; band < numberOfBands; band++)
2360 for(band = 0; band < numberOfBands; band++)
2370 for(band = 0; band < numberOfBands; band++)
2382 <<
"ossimImageData::isNull Unsupported scalar type!" 2452 <<
"ossimImageData::isNull Unsupported scalar type!" 2634 if(bands && (b != bands))
2645 vector<ossim_float64> newNull(bands);
2646 vector<ossim_float64> newMin(bands);
2647 vector<ossim_float64> newMax(bands);
2650 while (i < minBands)
2694 if( ( (w*h != nw*nh) || ( bands != numberOfBands) ) &&
2753 <<
"ossimImageData::assign\n" 2754 <<
"Number of components is 0, can't assign" << std::endl;
2771 const void* s = data->
getBuf();
2774 memcpy(d, s, source_size);
2792 <<
"ossimImageData::assignBand ERROR:" 2793 <<
"\nInvalid source band!" << std::endl;
2799 <<
"ossimImageData::assignBand ERROR:" 2800 <<
"\nInvalid output band!" << std::endl;
2806 <<
"ossimImageData::assignBand ERROR:" 2807 <<
"\nSource data status is null!" << std::endl;
2813 <<
"ossimImageData::assignBand ERROR:" 2814 <<
"\nThis status is null!" << std::endl;
2829 const void* s = data->
getBuf(source_band);
2830 void* d =
getBuf(output_band);
2833 if (s == 0 || d == 0)
2839 memcpy(d, s, source_size);
2892 "ossimImageData::loadBand\n\ 2893 File %s line %d\nUnknown scalar type!",
2951 "ossimImageData::loadBand\n\ 2952 File %s line %d\nUnknown scalar type!",
2979 static const char MODULE[] =
"ossimImageData::loadBand";
2987 "%s File %s line %d\nNULL pointer passed to method!",
3000 "%s File %s line %d\nInvalid band: %d",
3029 const T* s =
static_cast<const T*
>(src);
3030 T* d =
static_cast<T*
>(
getBuf(band));
3033 s += (clip_rect.
ul().
y - src_rect.
ul().
y) * s_width +
3034 clip_rect.
ul().
x - src_rect.
ul().
x;
3036 d += (clip_rect.
ul().
y - img_rect.
ul().
y) * d_width +
3037 clip_rect.
ul().
x - img_rect.
ul().
x;
3045 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
3047 d[sample] = s[sample];
3060 <<
"ossimImageData::loadTile ERROR:" 3061 <<
"Null tile passed to method!" << std::endl;
3068 <<
"ossimImageData::loadTile ERROR:" 3069 <<
"Source tile buff is null!" << std::endl;
3076 <<
"ossimImageData::loadTile ERROR:" 3077 <<
"This tile not initialized!" << std::endl;
3084 <<
"ossimImageData::loadTile ERROR:" 3085 <<
"Tiles do not have same number of bands!" << std::endl;
3128 s_width + (clip_rect.
ul().
x - src_rect.
ul().
x);
3131 d_width + (clip_rect.
ul().
x - img_rect.
ul().
x);
3137 for (band=0; band<num_bands; ++band)
3145 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
3155 sourceIndex += s_width;
3156 destinationIndex += d_width;
3179 <<
"ossimImageData::loadTile ERROR: unsupported interleave type!" 3183 "ossimImageData::loadTile\n\ 3184 File %s line %d\nUnknown interleave type!",
3209 <<
"ossimImageData::loadTileWithAlpha ERROR: unsupported interleave type!" 3213 "ossimImageData::loadTile\n\ 3214 File %s line %d\nUnknown interleave type!",
3239 <<
"ossimImageData::loadTile ERROR: unsupported interleave type!" 3243 "ossimImageData::loadTile\n\ 3244 File %s line %d\nUnknown interleave type!",
3254 bool multiplyAlphaFlag)
3267 bool multiplyAlphaFlag)
3314 "ossimImageData::nullTileAlpha\n\ 3315 File %s line %d\nUnsupported scalar type for method!",
3371 "ossimImageData::loadTileFromBip\n\ 3372 File %s line %d\nUnsupported scalar type for method!",
3427 "ossimImageData::loadTileFromBip\n\ 3428 File %s line %d\nUnsupported scalar type for method!",
3484 "ossimImageData::loadTileFromBip\n\ 3485 File %s line %d\nUnsupported scalar type for method!",
3540 "ossimImageData::loadTileFromBil\n\ 3541 File %s line %d\nUnsupported scalar type for method!",
3597 "ossimImageData::loadTileFromBil\n\ 3598 File %s line %d\nUnsupported scalar type for method!",
3653 "ossimImageData::loadTileFromBsq\n\ 3654 File %s line %d\nUnsupported scalar type for method!",
3710 "ossimImageData::loadTileFromBsq\n\ 3711 File %s line %d\nUnsupported scalar type for method!",
3719 vector<ossim_float64>& maxBands)
const 3798 <<
"ossimImageData::computeMinPix Unsupported scalar type!" 3807 vector<ossim_float64>& minBands,
3808 vector<ossim_float64>& maxBands)
const 3813 if( minBands.size() != BANDS ||
3814 maxBands.size() != BANDS )
3816 minBands.resize(BANDS);
3817 maxBands.resize(BANDS);
3828 const T* bandBuffer = (
const T*)
getBuf(band);
3831 const T NP =
static_cast<T
>(
getNullPix(band));
3836 T p = bandBuffer[offset];
3843 else if(p > currentMax)
3849 minBands[band] = currentMin;
3850 maxBands[band] = currentMax;
3856 vector<ossim_float64>& maxBands,
3857 vector<ossim_float64>& nulBands)
const 3942 <<
"ossimImageData::computeMinNulPix Unsupported scalar type!" 3951 vector<ossim_float64>& minBands,
3952 vector<ossim_float64>& maxBands,
3953 vector<ossim_float64>& nulBands)
const 3959 if( minBands.size() != BANDS ||
3960 maxBands.size() != BANDS ||
3961 nulBands.size() != BANDS )
3964 minBands.resize(BANDS);
3965 maxBands.resize(BANDS);
3966 nulBands.resize(BANDS);
3978 const T* bandBuffer = (
const T*)
getBuf(band);
3986 T p = bandBuffer[offset];
4000 if ( p != DEFAULT_NULL )
4003 if ( p < currentNul )
4007 if( ( p < currentMin ) && ( p > currentNul ) )
4011 else if( p > currentMax )
4017 minBands[band] = currentMin;
4018 maxBands[band] = currentMax;
4019 nulBands[band] = currentNul;
4055 static const char MODULE[] =
"ossimImageData::loadTileFromBip";
4063 "%s File %s line %d\nNULL pointer passed to method!",
4092 const T* s =
static_cast<const T*
>(src);
4093 T** d =
new T*[num_bands];
4096 for (band=0; band<num_bands; band++)
4098 d[band] =
static_cast<T*
>(
getBuf(band));
4101 d[band] += (clip_rect.
ul().
y - img_rect.
ul().
y) * d_width +
4102 clip_rect.
ul().
x - img_rect.
ul().
x;
4106 s += (clip_rect.
ul().
y - src_rect.
ul().
y) * s_width +
4107 (clip_rect.
ul().
x - src_rect.
ul().
x) * num_bands;
4116 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4118 for (band=0; band<num_bands; band++)
4120 d[band][sample] = s[j+band];
4126 for (band=0; band<num_bands; band++)
4141 static const char MODULE[] =
"ossimImageData::loadTileFromBip";
4149 "%s File %s line %d\nNULL pointer passed to method!",
4178 const T* s =
static_cast<const T*
>(src);
4179 T** d =
new T*[num_bands];
4182 for (band=0; band<num_bands; band++)
4184 d[band] =
static_cast<T*
>(
getBuf(band));
4187 d[band] += (clip_rect.
ul().
y - img_rect.
ul().
y) * d_width +
4188 clip_rect.
ul().
x - img_rect.
ul().
x;
4192 s += (clip_rect.
ul().
y - src_rect.
ul().
y) * s_width +
4193 (clip_rect.
ul().
x - src_rect.
ul().
x) * (num_bands+1);
4202 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4204 for (band=0; band<num_bands; band++)
4206 d[band][sample] = s[j+band];
4212 for (band=0; band<num_bands; band++)
4240 static const char MODULE[] =
"ossimImageData::loadTileFromBil";
4248 "%s File %s line %d\nNULL pointer passed to method!",
4278 clip_rect.
ul().
x - img_rect.
ul().
x;
4280 const T* s =
static_cast<const T*
>(src);
4283 T** d =
new T*[num_bands];
4285 for (band=0; band<num_bands; band++)
4287 d[band] =
static_cast<T*
>(
getBuf(band));
4290 d[band] += d_offset;
4294 s += (clip_rect.
ul().
y - src_rect.
ul().
y) * s_width * num_bands +
4295 clip_rect.
ul().
x - src_rect.
ul().
x;
4303 for (band = 0; band < num_bands; ++band)
4305 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4307 d[band][sample] = s[sample];
4336 static const char MODULE[] =
"ossimImageData::loadTileFromBsq";
4344 "%s File %s line %d\nNULL pointer passed to method!",
4374 const T* s =
static_cast<const T*
>(src);
4378 (clip_rect.
ul().
x - img_rect.
ul().
x);
4381 (clip_rect.
ul().
x - src_rect.
ul().
x);
4387 for (band=0; band<num_bands; band++)
4389 T* destinationBand =
static_cast<T*
>(
getBuf(band));
4390 destinationIndex = destinationOffset;
4391 sourceIndex = sourceOffset + s_band_offset*band;
4395 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
4397 destinationBand[destinationIndex + sample]
4398 = s[sourceIndex+sample];
4400 sourceIndex += s_width;
4401 destinationIndex += d_width;
4428 static const char MODULE[] =
"ossimImageData::loadShortBand";
4436 "%s File %s line %d\nNULL pointer passed to method!",
4449 "%s File %s line %d\nInvalid band: %d",
4479 s += (clip_rect.
ul().
y - src_rect.
ul().
y) * s_width +
4480 clip_rect.
ul().
x - src_rect.
ul().
x;
4482 d += (clip_rect.
ul().
y - img_rect.
ul().
y) * d_width +
4483 clip_rect.
ul().
x - img_rect.
ul().
x;
4491 d[i] = (swap_bytes ? ( (s[i] << 8) | (s[i] >> 8) ) :
4545 "ossimImageData::unloadTile\n\ 4546 File %s line %d\nUnknown scalar type!",
4602 "ossimImageData::unloadTileToBip\n\ 4603 File %s line %d\nUnsupported scalar type for method!",
4659 "ossimImageData::unloadTileToBipAlpha\n\ 4660 File %s line %d\nUnsupported scalar type for method!",
4716 "ossimImageData::unloadTileToBil\n\ 4717 File %s line %d\nUnsupported scalar type for method!",
4773 "ossimImageData::unloadTileToBsq\n\ 4774 File %s line %d\nUnsupported scalar type for method!",
4839 "ossimImageData::unloadBand\n\ 4840 File %s line %d\nUnsupported scalar type for method!",
4865 static const char MODULE[] =
"ossimImageData::unloadBand";
4869 unloadBandToBsq( dest, src_band, dest_band, dest_rect, clip_rect, ow_type );
4874 << MODULE <<
" NOTICE:" 4875 <<
"\nUnsupported interleave type: " << il_type <<
" Returning..." 4932 "ossimImageData::unloadBandToBsq\n\ 4933 File %s line %d\nUnsupported scalar type for method!",
4947 static const char MODULE[] =
"ossimImageData::unloadBand";
4953 << MODULE <<
" ERROR:" 4954 <<
"\nNULL pointer passed to method! Returning..." << std::endl;
4961 << MODULE <<
" ERROR:" 4962 <<
"\nThis object is null! Returning..." << std::endl;
4972 output_clip_rect = dest_rect.
clipToRect(output_clip_rect);
4979 if ( !(output_clip_rect.
intersects(dest_rect)) )
4988 << MODULE <<
" NOTICE:" 4989 <<
"\nInvalid band: " << band <<
" Returning..." 4997 const T* s =
reinterpret_cast<const T*
>(
getBuf(band));
5004 T* d =
reinterpret_cast<T*
>(dest);
5007 buf_width + output_clip_rect.
ul().
x - dest_rect.
ul().
x;
5013 line<=output_clip_rect.
lr().
y; ++line)
5017 samp<=output_clip_rect.
lr().
x; ++samp)
5027 template <
class T>
void 5033 static const char MODULE[] =
"ossimImageData::unloadTileToBip";
5039 << MODULE <<
" ERROR:" 5040 <<
"\nNULL pointer passed to method! Returning..." << std::endl;
5044 bool dataIsNull =
false;
5056 output_clip_rect = dest_rect.
clipToRect(output_clip_rect);
5059 if (output_clip_rect.
hasNans())
5063 if ( !(output_clip_rect.
intersects(dest_rect)) )
5075 const T** s =
new const T*[num_bands];
5080 for (band=0; band<num_bands; band++)
5082 s[band] =
reinterpret_cast<const T*
>(
getBuf(band));
5086 T* d =
reinterpret_cast<T*
>(dest);
5088 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * buf_width +
5089 (output_clip_rect.
ul().
x - dest_rect.
ul().
x) * num_bands;
5093 s_width + (output_clip_rect.
ul().
x - img_rect.
ul().
x);
5100 s[band] += src_offset;
5104 for (
ossim_int32 line=0; line<output_clip_height; ++line)
5107 for (
ossim_int32 samp=0; samp<output_clip_width; ++samp, j+=num_bands)
5109 for (band=0; band<num_bands; ++band)
5111 d[j+band] = s[band][samp];
5117 for (band=0; band<num_bands; ++band)
5128 T* nulls =
new T[num_bands];
5129 for(band = 0; band < num_bands; ++band)
5134 T* d =
reinterpret_cast<T*
>(dest);
5136 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * buf_width +
5137 (output_clip_rect.
ul().
x - dest_rect.
ul().
x) * num_bands;
5140 line<=output_clip_rect.
lr().
y; ++line)
5145 samp<=output_clip_rect.
lr().
x; ++samp)
5147 for (band=0; band<num_bands; ++band)
5149 d[j+band] = nulls[band];
5163 template <
class T>
void 5169 static const char M[] =
"ossimImageData::unloadTileToBipAlphaTemplate";
5178 <<
"\nAttempting to copy null tile! Returning..." << std::endl;
5187 <<
"\nNULL pointer passed to method! Returning..." << std::endl;
5195 <<
"\nTile has no alpha! Returning..." << std::endl;
5205 output_clip_rect = dest_rect.
clipToRect(output_clip_rect);
5208 if (output_clip_rect.
hasNans())
5212 if ( !(output_clip_rect.
intersects(dest_rect)) )
5230 S_WIDTH + (output_clip_rect.
ul().
x - img_rect.
ul().
x);
5233 std::vector<const T*> s(NUM_DATA_BANDS);
5235 for (band = 0; band < NUM_DATA_BANDS; ++band)
5237 s[band] =
reinterpret_cast<const T*
>(
getBuf(band));
5240 s[band] += SRC_OFFSET;
5250 T* d =
reinterpret_cast<T*
>(dest);
5253 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * D_WIDTH +
5254 (output_clip_rect.
ul().
x - dest_rect.
ul().
x) * BANDS;
5258 for (
ossim_int32 line = 0; line < OUTPUT_CLIP_HEIGHT; ++line)
5262 for (
ossim_int32 samp = 0; samp < OUTPUT_CLIP_WIDTH; ++samp, j +=BANDS)
5265 for (band = 0; band < NUM_DATA_BANDS; ++band)
5267 d[j+band] = s[band][samp];
5273 d[j+NUM_DATA_BANDS] = a[alphaIdx++];
5277 d[j+NUM_DATA_BANDS] =
5278 static_cast<T
>( (a[alphaIdx++]/ALPHA_MAX_PIX) * MAX_PIX );
5284 for (band = 0; band < NUM_DATA_BANDS; ++band)
5292 template <
class T>
void 5298 static const char MODULE[] =
"ossimImageData::unloadTileToBil";
5304 << MODULE <<
" ERROR:" 5305 <<
"\nNULL pointer passed to method! Returning..." << std::endl;
5308 bool dataIsNull =
false;
5320 output_clip_rect = dest_rect.
clipToRect(output_clip_rect);
5323 if (output_clip_rect.
hasNans())
5327 if ( !(output_clip_rect.
intersects(dest_rect)) )
5339 const T** s =
new const T*[num_bands];
5343 for (band=0; band<num_bands; band++)
5345 s[band] =
reinterpret_cast<const T*
>(
getBuf(band));
5353 T* d =
reinterpret_cast<T*
>(dest);
5355 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) *
5356 buf_width * num_bands +
5357 (output_clip_rect.
ul().
x-dest_rect.
ul().
x);
5359 for (band=0; band<num_bands; ++band)
5361 s[band] += src_offset;
5365 line<=output_clip_rect.
lr().
y; ++line)
5367 for (band=0; band<num_bands; ++band)
5371 samp<=output_clip_rect.
lr().
x; ++samp)
5386 T* nulls =
new T[num_bands];
5387 for(band = 0; band < num_bands; ++band)
5393 T* d =
reinterpret_cast<T*
>(dest);
5395 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) *
5396 buf_width * num_bands + (output_clip_rect.
ul().
x - dest_rect.
ul().
x);
5399 line<=output_clip_rect.
lr().
y; ++line)
5401 for (band=0; band<num_bands; ++band)
5405 samp<=output_clip_rect.
lr().
x; ++samp)
5422 bool multiplyAlphaFlag)
5424 static const char MODULE[] =
"ossimImageData::nullTileAlphaTemplate";
5432 "%s File %s line %d\nNULL pointer passed to method!",
5462 (clip_rect.
ul().
x - img_rect.
ul().
x);
5465 (clip_rect.
ul().
x - src_rect.
ul().
x);
5470 if(!multiplyAlphaFlag)
5473 for (band=0; band<num_bands; band++)
5475 T* destinationBand =
static_cast<T*
>(
getBuf(band));
5476 destinationIndex = destinationOffset;
5477 sourceIndex = sourceOffset;
5482 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
5484 if(src[sourceIndex+sample] == 0)
5486 destinationBand[destinationIndex + sample] = nullPix;
5488 else if(destinationBand[destinationIndex + sample] == nullPix)
5490 destinationBand[destinationIndex + sample] = minPix;
5493 sourceIndex += s_width;
5494 destinationIndex += d_width;
5502 for (band=0; band<num_bands; band++)
5504 T* destinationBand =
static_cast<T*
>(
getBuf(band));
5505 destinationIndex = destinationOffset;
5506 sourceIndex = sourceOffset;
5511 for (
ossim_uint32 sample = 0; sample < clipWidth; ++sample)
5513 if(src[sourceIndex+sample] != 255)
5515 if(src[sourceIndex+sample] != 0)
5517 destinationBand[destinationIndex + sample] = (T)(destinationBand[destinationIndex + sample]*
5518 (src[sourceIndex+sample]*normalizer));
5519 if(destinationBand[destinationIndex + sample] == nullPix)
5521 destinationBand[destinationIndex + sample] = minPix;
5526 destinationBand[destinationIndex + sample] = nullPix;
5529 else if(destinationBand[destinationIndex + sample] == nullPix)
5531 destinationBand[destinationIndex + sample] = minPix;
5534 sourceIndex += s_width;
5535 destinationIndex += d_width;
5542 template <
class T>
void 5548 static const char MODULE[] =
"ossimImageData::unloadTileToBsq";
5554 << MODULE <<
" ERROR:" 5555 <<
"\nNULL pointer passed to method! Returning..." << std::endl;
5559 bool dataIsNull =
false;
5571 output_clip_rect = dest_rect.
clipToRect(output_clip_rect);
5574 if (output_clip_rect.
hasNans())
5578 if ( !(output_clip_rect.
intersects(dest_rect)) )
5591 s_width + (output_clip_rect.
ul().
x - img_rect.
ul().
x);
5593 T* d =
static_cast<T*
>(dest);
5594 const T** s =
new const T*[num_bands];
5597 for (band=0; band<num_bands; ++band)
5599 s[band] =
reinterpret_cast<const T*
>(
getBuf(band));
5602 s[band] += s_offset;
5606 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * d_width +
5607 (output_clip_rect.
ul().
x - dest_rect.
ul().
x);
5609 for (band=0; band<num_bands; ++band)
5614 line<=output_clip_rect.
lr().
y; ++line)
5618 samp<=output_clip_rect.
lr().
x; ++samp)
5620 d[d_buf_offset+i] = s[band][i];
5624 d_buf_offset += d_width;
5641 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * d_width +
5642 (output_clip_rect.
ul().
x - dest_rect.
ul().
x);
5644 for (band=0; band<num_bands; ++band)
5650 line<=output_clip_rect.
lr().
y; ++line)
5654 samp<=output_clip_rect.
lr().
x; ++samp)
5656 d[d_buf_offset+i] = np;
5660 d_buf_offset += d_width;
5667 template <
class T>
void 5676 static const char MODULE[] =
"ossimImageData::unloadBandToBsq";
5682 << MODULE <<
" ERROR:" 5683 <<
"\nNULL pointer passed to method! Returning..." << std::endl;
5687 bool dataIsNull =
false;
5699 output_clip_rect = dest_rect.
clipToRect(output_clip_rect);
5702 if (output_clip_rect.
hasNans())
5706 if ( !(output_clip_rect.
intersects(dest_rect)) )
5719 s_width + (output_clip_rect.
ul().
x - img_rect.
ul().
x);
5721 T* d =
static_cast<T*
>(dest);
5722 const T** s =
new const T*[num_bands];
5725 for (band=0; band<num_bands; ++band)
5727 s[band] =
reinterpret_cast<const T*
>(
getBuf(band));
5730 s[band] += s_offset;
5734 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * d_width +
5735 (output_clip_rect.
ul().
x - dest_rect.
ul().
x);
5737 ossim_uint32 d_dest_band_offset = dest_band * d_band_offset;
5741 line<=output_clip_rect.
lr().
y; ++line)
5745 samp<=output_clip_rect.
lr().
x; ++samp)
5748 ossim_uint32 d_dest_band_pixel_offset = d_pixel_offset + d_dest_band_offset;
5755 T d_dest_band = d[d_dest_band_pixel_offset];
5757 for ( band=0; band<num_bands && band!=dest_band; ++band )
5759 T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5762 if ( d_other_band != d_dest_band )
5764 d[d_dest_band_pixel_offset] = s[src_band][i];
5773 T d_dest_band = d[d_dest_band_pixel_offset];
5775 bool bFoundSameValue =
false;
5776 for ( band=0; band<num_bands && band!=dest_band; ++band )
5778 T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5781 if ( d_other_band == d_dest_band )
5783 bFoundSameValue =
true;
5787 if ( bFoundSameValue ==
false )
5789 d[d_dest_band_pixel_offset] = s[src_band][i];
5796 T d_src_band = s[src_band][i];
5798 for ( band=0; band<num_bands && band!=dest_band; ++band )
5800 T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5803 if ( d_other_band == d_src_band )
5805 d[d_dest_band_pixel_offset] = s[src_band][i];
5814 T d_src_band = s[src_band][i];
5816 bool bFoundDifferentValue =
false;
5817 for ( band=0; band<num_bands && band!=dest_band; ++band )
5819 T d_other_band = d[d_pixel_offset + (band * d_band_offset)];
5822 if ( d_other_band != d_src_band )
5824 bFoundDifferentValue =
true;
5828 if ( bFoundDifferentValue ==
false )
5830 d[d_dest_band_pixel_offset] = s[src_band][i];
5838 d[d_dest_band_pixel_offset] = s[src_band][i];
5846 d_buf_offset += d_width;
5847 s[src_band] += s_width;
5861 d += (output_clip_rect.
ul().
y - dest_rect.
ul().
y) * d_width +
5862 (output_clip_rect.
ul().
x - dest_rect.
ul().
x);
5864 for (band=0; band<num_bands; ++band)
5870 line<=output_clip_rect.
lr().
y; ++line)
5874 samp<=output_clip_rect.
lr().
x; ++samp)
5876 d[d_buf_offset+i] = np;
5880 d_buf_offset += d_width;
5897 <<
"ossimImageData::copyTileToNormalizedBuffer ERROR:" 5898 <<
"\nNull buffer passed to method! Returning..." << std::endl;
5905 <<
"ossimImageData::copyTileToNormalizedBuffer ERROR:" 5906 <<
"\nThis object is null! Returning..." << std::endl;
5921 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
5923 buf[offset] = inputBuf[offset];
5978 <<
"NOTICE: copyTileToNormalizedBuffer not implemented yet" 5999 const T* s = (T*)
getBuf(band);
6013 d[offset] = (p-MIN_PIX)/RANGE;
6038 const T* s = (T*)
getBuf(band);
6052 d[offset] = (p-MIN_PIX)/RANGE;
6074 const T* s = (T*)
getBuf(band);
6088 d[offset] = (p-MIN_PIX)/RANGE;
6109 const T* s = (T*)
getBuf(band);
6123 d[offset] = (p-MIN_PIX)/RANGE;
6155 d[offset] = (T)(MIN_PIX + RANGE*P);
6188 if(test > MAX_PIX) test = MAX_PIX;
6189 d[offset] = (T)test;
6219 if(test > MAX_PIX) test = MAX_PIX;
6220 d[offset] = (T)test;
6249 if(test > MAX_PIX) test = MAX_PIX;
6250 d[offset] = (T)test;
6265 <<
"ossimImageData::copyTileBandToNormalizedBuffer ERROR:" 6266 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6273 <<
"ossimImageData::copyTileBandToNormalizedBuffer ERROR:" 6274 <<
"\nThis object is null! Returning..." << std::endl;
6278 if(!
getBuf(band))
return;
6291 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6293 buf[offset] = inputBuf[offset];
6348 <<
"ossimImageData::copyTileBandToNormalizedBuffer ERROR:" 6349 <<
" Unknown scalar type!" 6363 <<
"ossimImageData::copyTileToNormalizedBuffer ERROR:" 6364 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6371 <<
"ossimImageData::copyTileToNormalizedBuffer ERROR:" 6372 <<
"\nThis object is null! Returning..." << std::endl;
6382 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6384 buf[offset] = inputBuf[offset];
6444 <<
"NOTICE: copyTileToNormalizedBuffer not implemented yet" 6457 <<
"ossimImageData::copyTileBandToNormalizedBuffer ERROR:" 6458 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6465 <<
"ossimImageData::copyTileBandToNormalizedBuffer ERROR:" 6466 <<
"\nThis object is null! Returning..." << std::endl;
6476 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6478 buf[offset] = inputBuf[offset];
6538 <<
"ossimImageData::copyTileBandToNormalizedBuffer ERROR:" 6539 <<
" Unknown scalar type" 6552 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6553 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6560 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6561 <<
"\nThis object is null! Returning..." << std::endl;
6576 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6633 <<
"ossimImageData::copyNormalizedBufferToTile\n" 6634 <<
"Unknown scalar type!" << std::endl;
6646 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6647 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6654 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6655 <<
"\nThis object is null! Returning..." << std::endl;
6672 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6729 <<
"ossimImageData::copyNormalizedBufferToTile\n" 6730 <<
"Unknown scalar type." << std::endl;
6742 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6743 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6750 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6751 <<
"\nThis object is null! Returning..." << std::endl;
6761 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6763 inputBuf[offset] = buf[offset];
6823 <<
"ossimImageDatacopyNormalizedBufferToTile\n" 6824 <<
"Unknown scalar type!" << std::endl;
6836 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6837 <<
"\nNull buffer passed to method! Returning..." << std::endl;
6844 <<
"ossimImageData::copyNormalizedBufferToTile ERROR:" 6845 <<
"\nThis object is null! Returning..." << std::endl;
6855 for(
ossim_uint32 offset = 0; offset < upperBound; ++offset)
6857 inputBuf[offset] = buf[offset];
6917 <<
"ossimImageData::copyNormalizedBufferToTile\n" 6918 <<
"Unknown scalar type!" << std::endl;
6937 <<
"\nm_origin: " <<
m_origin <<
"\n";
6940 out <<
"Null values: ";
6944 std::ostream_iterator<ossim_float64>(out,
" "));
6949 out <<
"Min values: ";
6953 std::ostream_iterator<ossim_float64>(out,
" "));
6958 out <<
"Max values: ";
6962 std::ostream_iterator<ossim_float64>(out,
" "));
6969 <<
"\nalpha size: " <<
m_alpha.size()
7035 "ossimImageData::stretchMinMax File %s line %d\n\ 7036 Invalid scalar type: %d",
7065 T* s =
static_cast<T*
>(
getBuf(band));
7082 else if (p <= T_MIN)
7086 else if (p >= T_MAX)
7093 p = (p - T_MIN + 1.0) * SPP + S_MIN - 1.0;
7095 s[i] = ossim::round<T>(p);
7166 "ossimImageData::computeAlphaChannel File %s line %d\n\ 7167 Invalid scalar type: %d",
7191 memset( static_cast<void*>(&
m_alpha.front()),
7192 static_cast<int>(AVP),
7193 static_cast<int>(SPB) );
7198 memset( static_cast<void*>(&
m_alpha.front()),
7199 static_cast<int>(ANP),
7200 static_cast<int>(SPB) );
7206 std::vector<T> null_pix(BANDS);
7207 std::vector<const T*> buf(BANDS);
7209 for(band = 0; band < BANDS; ++band)
7211 buf[band] =
static_cast<const T*
>(
getBuf(band));
7222 for(band = 0; band < BANDS; ++band)
7224 if (buf[band][i] != null_pix[band])
7288 lineStopSample, lineInterleave);
7294 lineStopSample, lineInterleave);
7306 lineStopSample, lineInterleave);
7312 lineStopSample, lineInterleave);
7318 lineStopSample, lineInterleave);
7324 lineStopSample, lineInterleave);
7331 lineStopSample, lineInterleave);
7338 lineStopSample, lineInterleave);
7346 <<
"ossimImageData::copyLine Unsupported scalar type!" 7367 if ( ( lineNumber >= RECT.
ul().
y) &&
7368 ( lineNumber <= RECT.
lr().
y) &&
7369 ( lineStartSample < lineStopSample) &&
7370 ( lineStartSample <= RECT.
lr().
x) &&
7371 ( lineStopSample >= RECT.
ul().
x) )
7375 (lineStartSample > RECT.
ul().
x)?lineStartSample:RECT.
ul().
x;
7377 (lineStopSample < RECT.
lr().
x)?lineStopSample:RECT.
lr().
x;
7378 const ossim_int32 SAMPS = STOP_SAMP - START_SAMP + 1;
7380 std::vector<T*> d(BANDS);
7383 for (band = 0; band < BANDS; ++band)
7385 d[band] =
static_cast<T*
>(
getBuf(band));
7388 d[band] += (lineNumber - RECT.
ul().
y) * RECT.
width() + (START_SAMP - RECT.
ul().
x);
7393 const T* S =
static_cast<const T*
>(src);
7396 S += (START_SAMP - lineStartSample) * BANDS;
7401 for (band = 0; band < BANDS; ++band)
7403 d[band][samp] = S[srcOffset++];
7409 const ossim_int32 W = lineStopSample - lineStartSample + 1;
7410 std::vector<const T*> S(BANDS);
7411 for (band = 0; band < BANDS; ++band)
7413 S[band] =
static_cast<const T*
>(src) + (START_SAMP - lineStartSample);
7416 S[band] += band * W;
7420 for (band = 0; band < BANDS; ++band)
7424 d[band][samp] = S[band][samp];
7455 kwl.
add(prefix,
"null_pixels", null_pixels,
true);
7456 kwl.
add(prefix,
"min_pixels", min_pixels,
true);
7457 kwl.
add(prefix,
"max_pixels", max_pixels,
true);
7461 kwl.
add(prefix,
"alpha", alpha,
true);
7474 const char* null_pixels = kwl.
find(prefix,
"null_pixels");
7475 const char* min_pixels = kwl.
find(prefix,
"min_pixels");
7476 const char* max_pixels = kwl.
find(prefix,
"max_pixels");
7477 const char* alpha = kwl.
find(prefix,
"alpha");
7478 const char* origin = kwl.
find(prefix,
"origin");
7479 const char* indexed = kwl.
find(prefix,
"indexed");
7481 const char* numberOfBands = kwl.
find(prefix,
"number_bands");
7523 if(!rectString.
empty())
7527 if(rect.
toRect(rectString))
OSSIMDLLEXPORT void ossimSetError(const char *className, ossim_int32 error, const char *fmtString=0,...)
ossimString toString() const
16 bit unsigned integer (15 bits used)
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void loadBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band)
virtual ossim_uint32 getWidth() const
void fill(ossim_uint32 band, ossim_float64 value)
will fill the entire band with the value.
virtual void setValue(ossim_int32 x, ossim_int32 y, ossim_float64 color)
virtual const ossim_float64 * getMaxPix() const
ossimRefPtr< ossimMultiResLevelHistogram > getHistogram()
virtual ossimRefPtr< ossimImageData > newNormalizedFloat() const
Will take this tile and normalize it to a newly allocated floating point tile.
virtual void setNumberOfBands(ossim_uint32 bands, bool reallocate=false)
virtual void setOwner(ossimSource *aSource)
Sets the owner of this Data object.
virtual ossim_uint32 getNumberOfBands() const
virtual void computeAlphaChannel()
Computes the alpha channel.
virtual void setImageRectangle(const ossimIrect &rect)
virtual const ossim_uint16 * getUshortBuf() const
virtual ossim_float64 getMinNormalizedPix() const
returns normalized minimum pixel value of band zero.
void loadTileFromBil(const void *src, const ossimIrect &src_rect)
virtual void populateHistogram(ossimRefPtr< ossimMultiBandHistogram > histo)
virtual const ossim_uint8 * getUcharBuf() const
virtual void setWidthHeight(ossim_uint32 w, ossim_uint32 h)
Represents serializable keyword/value map.
virtual void computeMinMaxPix(std::vector< ossim_float64 > &minBands, std::vector< ossim_float64 > &maxBands) const
If the minBands and maxBands are empty or not equal to the imageData's current number of bands it wil...
void unloadTileToBsq(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual void getNormalizedFloat(ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 &result) const
will go to the band and offset and compute the normalized float and return it back to the caller thro...
virtual std::ostream & print(std::ostream &out) const
Generic print method.
const char * find(const char *key) const
std::vector< ossim_uint8 > m_alpha
Alpha channel.
virtual ossimString getEntryString(ossim_int32 entry_number) const
virtual void unloadBandToBsq(void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, OverwriteBandRule ow_type=NULL_RULE) const
Called from public unloadBand() routines that have an OverwriteBandRule interface.
virtual ossimImageData * newNormalizedDouble() const
Will take this tile and normalize it to a newly allocated double point tile.
virtual bool saveState(ossimKeywordlist &kwl, const char *prefix=0) const
virtual void copyTileBandToNormalizedBuffer(ossim_uint32 band, ossim_float64 *buf) const
Will copy this tiles specified band number to the normalized buffer.
virtual bool hasAlpha() const
ossim_uint32 height() const
static ossimString toString(bool aValue)
Numeric to string methods.
OSSIM_DLL void defaultTileSize(ossimIpt &tileSize)
void toSimpleStringList(ossimString &result, const std::vector< T > &valuesList)
This will output a vector of values inst a string.
const ossimIpt & ul() const
virtual void getWidthHeight(ossim_uint32 &w, ossim_uint32 &h)
virtual ossimDataObjectStatus getDataObjectStatus() const
virtual ossim_uint32 getHeight() const
16 bit unsigned integer (14 bits used)
static const ossimErrorCode OSSIM_ERROR
virtual ossimString getClassName() const
ossim_uint32 toUInt32() const
16 bit unsigned integer (13 bits used)
virtual void assign(const ossimRectilinearDataObject *data)
virtual ossim_float64 getPix(const ossimIpt &position, ossim_uint32 band=0) const
Will return the pixel at location position.
bool intersects(const ossimIrect &rect) const
unsigned short ossim_uint16
virtual const ossim_sint16 * getSshortBuf() const
virtual void initializeNullDefault()
initializeNullDefault() Resizes theNullPixelValue array to number of bands and initializes to the def...
virtual ~ossimImageData()
virtual destructor
void unloadTileToBip(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual void initialize()
Initialize the data buffer.
void unloadTileToBil(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual bool write(const ossimFilename &f) const
Writes tile to stream.
virtual ossimObject * dup() const
virtual void computeMinMaxNulPix(std::vector< ossim_float64 > &minBands, std::vector< ossim_float64 > &maxBands, std::vector< ossim_float64 > &nulBands) const
Scans tile for min, max, nulls.
virtual void assign(const ossimDataObject *data)
ossimScalarType m_scalarType
virtual ossim_uint32 getSizePerBandInBytes() const
Returns the number of bytes in single band of the tile.
bool toSimpleVector(std::vector< T > &result, const ossimString &stringOfPoints)
void unloadBandTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect, ossim_uint32 band) const
virtual void unloadBand(void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, ossimInterleaveType il_type=OSSIM_BSQ, OverwriteBandRule ow_type=NULL_RULE) const
This routine is designed for overwriting a selected band of the destination buffer 'dest' by an indep...
bool completely_within(const ossimIrect &rect) const
bool isNull(ossim_uint32 offset) const
void unloadTileToBilTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual void assignBand(const ossimImageData *data, ossim_uint32 source_band, ossim_uint32 output_band)
void add(const char *prefix, const ossimKeywordlist &kwl, bool overwrite=true)
virtual void loadTile(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
virtual void setHeight(ossim_uint32 height)
static ossimScalarTypeLut * instance()
Returns the static instance of an ossimScalarTypeLut object.
virtual void setNullPix(ossim_float64 null_pix)
OSSIM_DLL double defaultMin(ossimScalarType scalarType)
std::vector< ossim_uint8 > m_dataBuffer
virtual void setNumberOfDataComponents(ossim_uint32 n)
How many components make up this data object.
ossimRefPtr< ossimMultiResLevelHistogram > m_histogram
virtual ossim_uint32 getSizeInBytes() const
Returns the total number of bytes for all bands.
virtual ossimDataObjectStatus validate() const
signed short ossim_sint16
virtual void setImageRectangleAndBands(const ossimIrect &rect, ossim_uint32 numberOfBands)
virtual bool isEqualTo(const ossimDataObject &rhs, bool deepTest=false) const
virtual void initializeMaxDefault()
initializeMaxDefault() Resizes theMaxPixelValue array to number of bands and initializes to the defau...
void createTestTile()
Creates a step wedge for testing only.
bool toBool() const
String to numeric methods.
OSSIM_DLL double defaultNull(ossimScalarType scalarType)
virtual void nullTileAlpha(const ossim_uint8 *src, const ossimIrect &src_rect, bool mutliplyAlphaFlag=false)
void loadTileFromBip(const void *src, const ossimIrect &src_rect)
virtual ossim_uint32 getSizePerBand() const
Returns the number of pixels in a single band in a tile.
virtual void loadTileWithAlpha(const void *src, const ossimIrect &src_rect, ossimInterleaveType il_type)
std::vector< ossim_float64 > m_maxPixelValue
Max pixel value for each band.
void loadTileFromBipAlphaTemplate(T, const void *src, const ossimIrect &src_rect)
void loadTileFromBsqTemplate(T, const void *src, const ossimIrect &src_rect)
unsigned int ossim_uint32
virtual const ossim_float64 * getNullPix() const
32 bit normalized floating point
OverwriteBandRule
Definitions for the unloadBand routines.
virtual void unnormalizeInput(ossimImageData *normalizedInput)
Will take the normalized input and convert it to this tile's data type.
ossimRefPtr< ossimHistogram > getHistogram(ossim_int32 band)
void loadTileFromBipAlpha(const void *src, const ossimIrect &src_rect)
virtual ossimString getScalarTypeAsString() const
void loadTileFromBilTemplate(T, const void *src, const ossimIrect &src_rect)
virtual void setWidth(ossim_uint32 width)
virtual ossimIrect getImageRectangle() const
virtual ossim_float64 computeMeanSquaredError(ossim_float64 meanValue, ossim_uint32 bandNumber=0) const
This will call the compute average band value and then use that in the calculation of: ...
void nullTileAlphaTemplate(T, const ossim_uint8 *src, const ossimIrect &src_rect, const ossimIrect &clip_rect, bool multiplyAlphaFlag=false)
std::vector< ossim_uint32 > m_spatialExtents
virtual void copyTileToNormalizedBuffer(ossim_float64 *buf) const
Copies entire tile to buf passed in.
virtual bool isWithin(ossim_int32 x, ossim_int32 y)
std::vector< ossim_float64 > m_minPixelValue
Min pixel value for each band.
virtual ossim_float64 computeAverageBandValue(ossim_uint32 bandNumber=0) const
This will compute the average value for the band.
const ossimIpt & lr() const
void UpCount(float newval, float occurences=1)
virtual void copyNormalizedBufferToTile(ossim_float64 *buf)
Copies buf passed in to tile.
virtual void unloadTileToBipAlpha(void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual void unloadTile(void *dest, const ossimIrect &dest_rect, ossimInterleaveType il_type) const
ossim_uint32 width() const
ossim_float64 m_percentFull
percentage (0-100) of image tile that has valid (non-null) pixel values.
ossimIrect clipToRect(const ossimIrect &rect) const
void copyLineTemplate(T dummyTemplate, const void *src, ossim_int32 lineNumber, ossim_int32 lineStartSample, ossim_int32 lineStopSample, ossimInterleaveType lineInterleave)
Templated copy line method.
void toPoint(const std::string &s)
Initializes this point from string.
void setNull(ossim_uint32 offset)
virtual const ossimImageData & operator=(const ossimImageData &rhs)
assignment operator=
void setIndexedFlag(bool flag)
Sets the indexed flag.
virtual bool isValidBand(ossim_uint32 band) const
virtual void setOrigin(const ossimIpt &origin)
virtual ossim_uint32 getScalarSizeInBytes() const
virtual const ossim_float32 * getFloatBuf() const
virtual const ossim_float64 * getMinPix() const
virtual void initialize()
Initializes m_dataBuffer to current spatial extents.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual ossimScalarType getScalarType() const
virtual void makeBlank()
Initializes data to null pixel values.
64 bit normalized floating point
16 bit unsigned integer (11 bits used)
virtual void setNormalizedFloat(ossim_uint32 offset, ossim_uint32 bandNumber, ossim_float32 input)
This will assign to this object a normalized value by unnormalizing to its native type...
#define OSSIM_DEFAULT_MIN_PIX_NORM_DOUBLE
OSSIM_DLL double defaultMax(ossimScalarType scalarType)
virtual void loadShortBand(const void *src, const ossimIrect &src_rect, ossim_uint32 band, bool swap_bytes=false)
Specialized to load a tile from a short (16 bit scalar type) buffer.
virtual void setMaxPix(ossim_float64 max_pix)
void unloadBandToBsqTemplate(T, void *dest, ossim_uint32 src_band, ossim_uint32 dest_band, const ossimIrect &dest_rect, const ossimIrect &clip_rect, OverwriteBandRule ow_type=NULL_RULE) const
virtual bool isPointWithin(const ossimIpt &point) const
std::vector< ossim_float64 > m_nullPixelValue
Null pixel value for each band.
virtual ossim_uint32 getSize() const
Returns the total number of pixels in a tile for all bands.
virtual const void * getBuf() const
virtual void convertToNormalizedDouble(ossimImageData *result) const
Will use the memory that you pass in to normalize this data object.
bool m_indexedFlag
Indicates data contains palette indexes.
ossim_uint32 m_numberOfDataComponents
virtual void loadTileFrom1Band(const ossimImageData *data)
#define OSSIM_DEFAULT_MIN_PIX_NORM_FLOAT
bool getIndexedFlag() const
const char * c_str() const
Returns a pointer to a null-terminated array of characters representing the string's contents...
bool toRect(const ossimString &rectString)
expected Format: form 1: ( 30, -90, 512, 512, [LH|RH] ) -x- -y- -w- -h- -Right or left handed- ...
virtual void setDataObjectStatus(ossimDataObjectStatus status) const
Full list found in ossimConstants.h.
virtual ossim_uint32 getDataSizeInBytes() const
virtual ossimSource * getOwner()
virtual const ossimRectilinearDataObject & operator=(const ossimRectilinearDataObject &rhs)
assignment operator=
void unloadTileToBsqTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual void initializeMinDefault()
initializeMinDefault() Resizes theMinPixelValue array to number of bands and initializes to the defau...
std::basic_ofstream< char > ofstream
Class for char output file streams.
virtual ossim_uint32 getNumberOfDataComponents() const
#define RTTI_DEF1(cls, name, b1)
virtual void copyLine(const void *src, ossim_int32 lineNumber, ossim_int32 lineStartSample, ossim_int32 lineStopSample, ossimInterleaveType lineInterleave)
Method to copy a single line to the tile.
ossimDataObjectStatus
Definitions for data object status.
virtual bool loadState(const ossimKeywordlist &kwl, const char *prefix=0)
virtual const ossim_uint8 * getAlphaBuf() const
ossimFilename & setExtension(const ossimString &e)
Sets the extension of a file name.
void unloadTileToBipAlphaTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
virtual void convertToNormalizedFloat(ossimImageData *result) const
Will use the memory that you pass in to normalize this data object.
ossimDataObjectStatus theDataObjectStatus
void loadTileFromBsq(const void *src, const ossimIrect &src_rect)
virtual void setMinPix(ossim_float64 min_pix)
void loadTileFromBipTemplate(T, const void *src, const ossimIrect &src_rect)
void unloadTileToBipTemplate(T, void *dest, const ossimIrect &dest_rect, const ossimIrect &clip_rect) const
unsigned char ossim_uint8
virtual std::ostream & print(std::ostream &out) const
Generic print method.
virtual void stretchMinMax()
Performs linear stretch on tile data from min/max to limits of scalar type.
OSSIMDLLEXPORT std::ostream & ossimNotify(ossimNotifyLevel level=ossimNotifyLevel_WARN)
std::basic_ostream< char > ostream
Base class for char output streams.
virtual void initializeDefaults()
initializeDefaults() Resizes and sets min/max/null arrays to number of bands and some default value f...
16 bit unsigned integer (12 bits used)
void loadBandTemplate(T, const void *src, const ossimIrect &src_rect, ossim_uint32 band)
virtual const ossim_float64 * getDoubleBuf() const
virtual void setHistogram(ossimRefPtr< ossimMultiResLevelHistogram > histo)