23 #ifndef LSST_SPHGEOM_CHUNKER_H_
24 #define LSST_SPHGEOM_CHUNKER_H_
69 int32_t numSubStripesPerStripe);
72 return _numStripes == c._numStripes &&
73 _numSubStripesPerStripe == c._numSubStripesPerStripe;
77 return _numStripes != c._numStripes ||
78 _numSubStripesPerStripe != c._numSubStripesPerStripe;
90 return _numSubStripesPerStripe;
110 bool valid(int32_t chunkId)
const;
115 int32_t numChunksPerStripe;
116 int32_t numSubChunksPerChunk;
120 numChunksPerStripe(0),
121 numSubChunksPerChunk(0)
127 int32_t numSubChunksPerChunk;
129 SubStripe() : subChunkWidth(), numSubChunksPerChunk(0) {}
132 int32_t _getStripe(int32_t chunkId)
const {
133 return chunkId / (2 * _numStripes);
136 int32_t _getChunk(int32_t chunkId, int32_t stripe)
const {
137 return chunkId - stripe*2*_numStripes;
140 int32_t _getChunkId(int32_t stripe, int32_t chunk)
const {
141 return stripe * 2 * _numStripes + chunk;
144 int32_t _getSubChunkId(int32_t stripe, int32_t subStripe,
145 int32_t chunk, int32_t subChunk)
const {
146 int32_t
y = subStripe - stripe * _numSubStripesPerStripe;
147 int32_t
x = subChunk -
148 chunk * _subStripes[subStripe].numSubChunksPerChunk;
149 return y * _maxSubChunksPerSubStripeChunk +
x;
154 NormalizedAngleInterval
const & lon,
158 int32_t maxSS)
const;
159 Box _getChunkBoundingBox(int32_t stripe, int32_t chunk)
const;
160 Box _getSubChunkBoundingBox(int32_t subStripe, int32_t subChunk)
const;
163 int32_t _numSubStripesPerStripe;
164 int32_t _numSubStripes;
165 int32_t _maxSubChunksPerSubStripeChunk;
166 Angle _subStripeHeight;
173 #endif // LSST_SPHGEOM_CHUNKER_H_