MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / visitTiffData

Function visitTiffData

source/MRIOExtras/MRTiff.cpp:180–218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

178
179template <typename Func>
180void visitTiffData( Func f, const uint8_t* data, const TiffParameters& tp )
181{
182#pragma warning( push )
183// disable false conversion warning
184#pragma warning( disable: 4242 )
185#pragma warning( disable: 4244 )
186#define CALL_IF( Type ) \
187 if ( tp.bytesPerSample == sizeof( Type ) ) \
188 return f( reinterpret_cast<const Type*>( data ) );
189
190 switch ( tp.sampleType )
191 {
192 case TiffParameters::SampleType::UInt:
193 CALL_IF( uint8_t )
194 CALL_IF( uint16_t )
195 CALL_IF( uint32_t )
196 CALL_IF( uint64_t )
197 MR_UNREACHABLE_NO_RETURN
198 break;
199 case TiffParameters::SampleType::Int:
200 CALL_IF( int8_t )
201 CALL_IF( int16_t )
202 CALL_IF( int32_t )
203 CALL_IF( int64_t )
204 MR_UNREACHABLE_NO_RETURN
205 break;
206 case TiffParameters::SampleType::Float:
207 CALL_IF( float )
208 CALL_IF( double )
209 MR_UNREACHABLE_NO_RETURN
210 break;
211 case TiffParameters::SampleType::Unknown:
212 MR_UNREACHABLE_NO_RETURN
213 break;
214 }
215
216#undef CALL_IF
217#pragma warning( pop )
218}
219
220template <typename T>
221void readTiff( TIFF* tiff, T* bytes, [[maybe_unused]] size_t size, const TiffParameters& tp )

Callers 2

readTiffFunction · 0.85
fromTiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected