Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-04-09 07:48:55

0001 /*
0002  * Copyright (c) 2019 Opticks Team. All Rights Reserved.
0003  *
0004  * This file is part of Opticks
0005  * (see https://bitbucket.org/simoncblyth/opticks).
0006  *
0007  * Licensed under the Apache License, Version 2.0 (the "License"); 
0008  * you may not use this file except in compliance with the License.  
0009  * You may obtain a copy of the License at
0010  *
0011  *   http://www.apache.org/licenses/LICENSE-2.0
0012  *
0013  * Unless required by applicable law or agreed to in writing, software 
0014  * distributed under the License is distributed on an "AS IS" BASIS, 
0015  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
0016  * See the License for the specific language governing permissions and 
0017  * limitations under the License.
0018  */
0019 
0020 #pragma once
0021 
0022 /**0
0023 pack.h
0024 ========
0025 
0026 * * https://bitbucket.org/simoncblyth/opticks/src/master/optixrap/cu/pack.h
0027 
0028 .. contents:: Table of Contents
0029    :depth: 2
0030 
0031 0**/
0032 
0033 
0034 /**1
0035 pack.h : PACK4 Macro
0036 ---------------------
0037 
0038 Packs 4 8bit integers into 32 bits  
0039 
0040 1**/
0041 
0042 #define PACK4( a, b, c, d)   ( \
0043        (( (a) & 0xff ) <<  0 ) | \
0044        (( (b) & 0xff ) <<  8 ) | \
0045        (( (c) & 0xff ) << 16 ) | \
0046        (( (d) & 0xff ) << 24 ) \
0047                              )
0048 
0049 
0050 
0051 
0052 /**2
0053 pack.h : UNPACK4_0/1/2/3 Macros
0054 --------------------------------
0055 
0056 Returns 8 bit constituent from the packed 32 bits. 
0057 
0058 2**/
0059 
0060 #define UNPACK4_0( packed ) (  ((packed) >>  0) & 0xff )
0061 #define UNPACK4_1( packed ) (  ((packed) >>  8) & 0xff )
0062 #define UNPACK4_2( packed ) (  ((packed) >> 16) & 0xff )
0063 #define UNPACK4_3( packed ) (  ((packed) >> 24) & 0xff )
0064 
0065