Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:49:11

0001 #pragma once
0002 /**
0003 QTex.hh
0004 ========
0005 
0006 
0007 **/
0008 #include <string>
0009 #include <cstddef>
0010 #include "scuda.h"
0011 
0012 #if defined(MOCK_TEXTURE) || defined(MOCK_CUDA)
0013 #else
0014 #include <texture_types.h>
0015 #endif
0016 
0017 struct NP ; 
0018 struct quad4 ; 
0019 union quad ; 
0020 
0021 #include "QUDARAP_API_EXPORT.hh"
0022 
0023 template<typename T>
0024 struct QUDARAP_API QTex
0025 {
0026     size_t       width ; 
0027     size_t       height ; 
0028     const void*  src ;
0029     char         filterMode ;  // 'L':cudaFilterModeLinear OR 'P':cudaFilterModePoint 
0030     bool         normalizedCoords ; 
0031     const void*  origin ;  // typically an NP array 
0032     const NP*    a ; 
0033     // TODO: remove the duplication here, why not just use a ?
0034 
0035 #if defined(MOCK_TEXTURE) || defined(MOCK_CUDA)
0036 #else
0037     cudaArray*   cuArray ; 
0038     cudaChannelFormatDesc channelDesc ;
0039 #endif
0040     cudaTextureObject_t texObj ;
0041 
0042     quad4*              meta ; 
0043     quad4*              d_meta ; 
0044 
0045     QTex( size_t width, size_t height, const void* src, char filterMode, bool normalizedCoords, const NP* a   );
0046 
0047     void     setMetaDomainX( const quad* domx ); 
0048     void     setMetaDomainY( const quad* domy ); 
0049     void     uploadMeta(); 
0050 
0051     void           setOrigin(const void* origin_) ; 
0052     const void*    getOrigin() const ; 
0053 
0054     void     setHDFactor(unsigned hd_factor_) ; 
0055     unsigned getHDFactor() const ; 
0056 
0057     char     getFilterMode() const ; 
0058     bool     getNormalizedCoords() const ; 
0059 
0060     virtual ~QTex();  
0061 
0062     void init(); 
0063     std::string desc() const ; 
0064 
0065 #if defined(MOCK_TEXTURE) || defined(MOCK_CUDA)
0066 #else
0067     void createArray(); 
0068     void uploadToArray(); 
0069     void createTextureObject(); 
0070 #endif
0071 
0072 };
0073 
0074