1 /* 2 Copyright 2016 Esri 3 4 Licensed under the Apache License, Version 2.0 (the "License"); 5 you may not use this file except in compliance with the License. 6 You may obtain a copy of the License at 7 8 http://www.apache.org/licenses/LICENSE-2.0 9 10 Unless required by applicable law or agreed to in writing, software 11 distributed under the License is distributed on an "AS IS" BASIS, 12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 See the License for the specific language governing permissions and 14 limitations under the License. 15 16 A local copy of the license and additional notices are located with the 17 source distribution at: 18 19 http://github.com/Esri/lepcc/ 20 21 Contributors: Thomas Maurer, Ronald Poirrier 22 */ 23 24 #pragma once 25 26 //#define TryHuffmanOnColor 27 28 namespace lepcc 29 { 30 31 typedef unsigned char Byte; 32 typedef unsigned short uint16; 33 typedef unsigned int uint32; 34 typedef long long int64; 35 typedef unsigned long long uint64; 36 37 struct RGB_t 38 { 39 Byte r, g, b; 40 RGB_tRGB_t41 RGB_t() : r{0}, g{0}, b{0} 42 {} RGB_tRGB_t43 RGB_t(Byte r0, Byte g0, Byte b0) : r(r0), g(g0), b(b0) 44 {} 45 46 bool operator==(const RGB_t& v) const 47 { return r == v.r && g == v.g && b == v.b; } 48 }; 49 50 struct Point3D 51 { 52 double x, y, z; 53 Point3DPoint3D54 Point3D() : x{0}, y{0}, z{0} 55 {} 56 Point3DPoint3D57 Point3D(double a, double b, double c) : x(a), y(b), z(c) 58 {} 59 60 Point3D operator-(const Point3D& b) const 61 { return Point3D(x - b.x, y - b.y, z - b.z); } 62 }; 63 64 struct Extent3D 65 { 66 Point3D lower, upper; 67 }; 68 69 enum class ErrCode : int 70 { 71 Ok, 72 Failed, 73 WrongParam, 74 WrongVersion, 75 WrongCheckSum, 76 NotLepcc, 77 NotClusterRGB, 78 NotIntensity, 79 NotFlagBytes, 80 BufferTooSmall, 81 OutArrayTooSmall, 82 QuantizeVirtualRasterTooBig, 83 QuantizeIndexOutOfRange 84 }; 85 86 enum class BlobType : int 87 { 88 bt_XYZ = 0, 89 bt_RGB, 90 bt_Intensity, 91 bt_FlagBytes 92 }; 93 94 } // namespace 95 96