Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Purpose: PCI raster namespace converter utilities. 4 : * 5 : ****************************************************************************** 6 : * Copyright (c) 2020 7 : * PCI Geomatics, 90 Allstate Parkway, Markham, Ontario, Canada. 8 : * 9 : * Permission is hereby granted, free of charge, to any person obtaining a 10 : * copy of this software and associated documentation files (the "Software"), 11 : * to deal in the Software without restriction, including without limitation 12 : * the rights to use, copy, modify, merge, publish, distribute, sublicense, 13 : * and/or sell copies of the Software, and to permit persons to whom the 14 : * Software is furnished to do so, subject to the following conditions: 15 : * 16 : * The above copyright notice and this permission notice shall be included 17 : * in all copies or substantial portions of the Software. 18 : * 19 : * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 20 : * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 21 : * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 22 : * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 23 : * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 24 : * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 25 : * DEALINGS IN THE SOFTWARE. 26 : ****************************************************************************/ 27 : 28 : #include "pcidsk_raster.h" 29 : 30 : using namespace PCIDSK; 31 : 32 : /************************************************************************/ 33 : /* RasterDataType() */ 34 : /************************************************************************/ 35 0 : raster::ChannelType PCIDSK::RasterDataType(eChanType eChanType) 36 : { 37 0 : switch (eChanType) 38 : { 39 0 : case CHN_8U: 40 0 : return raster::CT_8U; 41 0 : case CHN_16S: 42 0 : return raster::CT_16S; 43 0 : case CHN_16U: 44 0 : return raster::CT_16U; 45 0 : case CHN_32S: 46 0 : return raster::CT_32S; 47 0 : case CHN_32U: 48 0 : return raster::CT_32U; 49 0 : case CHN_32R: 50 0 : return raster::CT_32R; 51 0 : case CHN_64S: 52 0 : return raster::CT_64S; 53 0 : case CHN_64U: 54 0 : return raster::CT_64U; 55 0 : case CHN_64R: 56 0 : return raster::CT_64R; 57 0 : case CHN_C16S: 58 0 : return raster::CT_C16S; 59 0 : case CHN_C16U: 60 0 : return raster::CT_C16U; 61 0 : case CHN_C32S: 62 0 : return raster::CT_C32S; 63 0 : case CHN_C32U: 64 0 : return raster::CT_C32U; 65 0 : case CHN_C32R: 66 0 : return raster::CT_C32R; 67 0 : case CHN_BIT: 68 0 : return raster::CT_BIT; 69 0 : default: 70 0 : break; 71 : } 72 : 73 0 : return raster::CT_UNKNOWN; 74 : } 75 : 76 : /************************************************************************/ 77 : /* RasterDataType() */ 78 : /************************************************************************/ 79 0 : eChanType PCIDSK::RasterDataType(raster::ChannelType eChanType) 80 : { 81 0 : switch (eChanType) 82 : { 83 0 : case raster::CT_8U: 84 0 : return CHN_8U; 85 0 : case raster::CT_16S: 86 0 : return CHN_16S; 87 0 : case raster::CT_16U: 88 0 : return CHN_16U; 89 0 : case raster::CT_32S: 90 0 : return CHN_32S; 91 0 : case raster::CT_32U: 92 0 : return CHN_32U; 93 0 : case raster::CT_32R: 94 0 : return CHN_32R; 95 0 : case raster::CT_64S: 96 0 : return CHN_64S; 97 0 : case raster::CT_64U: 98 0 : return CHN_64U; 99 0 : case raster::CT_64R: 100 0 : return CHN_64R; 101 0 : case raster::CT_C16S: 102 0 : return CHN_C16S; 103 0 : case raster::CT_C16U: 104 0 : return CHN_C16U; 105 0 : case raster::CT_C32S: 106 0 : return CHN_C32S; 107 0 : case raster::CT_C32U: 108 0 : return CHN_C32U; 109 0 : case raster::CT_C32R: 110 0 : return CHN_C32R; 111 0 : case raster::CT_BIT: 112 0 : return CHN_BIT; 113 0 : default: 114 0 : break; 115 : } 116 : 117 0 : return CHN_UNKNOWN; 118 : }