MCPcopy Create free account
hub / github.com/PDAL/PDAL / _getImage2DNodeSizes

Function _getImage2DNodeSizes

plugins/e57/libE57Format/src/ReaderImpl.cpp:100–151  ·  view source on GitHub ↗

! @brief This function reads one of the image blobs @param [in] image 1 of 3 projects or the visual @param [out] imageType identifies the image format desired. @param [out] imageWidth The image width (in pixels). @param [out] imageHeight The image height (in pixels). @param [out] imageSize This is the total number of bytes for the image blob. @param [out] imageMaskType This i

Source from the content-addressed store, hash-verified

98 @return Returns true if successful
99 */
100 static bool _getImage2DNodeSizes( const StructureNode &image, Image2DType &imageType,
101 int64_t &imageWidth, int64_t &imageHeight, int64_t &imageSize,
102 Image2DType &imageMaskType )
103 {
104 imageWidth = 0;
105 imageHeight = 0;
106 imageSize = 0;
107 imageType = ImageNone;
108 imageMaskType = ImageNone;
109
110 if ( image.isDefined( "imageWidth" ) )
111 {
112 imageWidth = IntegerNode( image.get( "imageWidth" ) ).value();
113 }
114 else
115 {
116 return false;
117 }
118
119 if ( image.isDefined( "imageHeight" ) )
120 {
121 imageHeight = IntegerNode( image.get( "imageHeight" ) ).value();
122 }
123 else
124 {
125 return false;
126 }
127
128 if ( image.isDefined( "jpegImage" ) )
129 {
130 imageSize = BlobNode( image.get( "jpegImage" ) ).byteCount();
131 imageType = ImageJPEG;
132 }
133 else if ( image.isDefined( "pngImage" ) )
134 {
135 imageSize = BlobNode( image.get( "pngImage" ) ).byteCount();
136 imageType = ImagePNG;
137 }
138
139 if ( image.isDefined( "imageMask" ) )
140 {
141 if ( imageType == ImageNone )
142 {
143 imageSize = BlobNode( image.get( "imageMask" ) ).byteCount();
144 imageType = ImageMaskPNG;
145 }
146
147 imageMaskType = ImageMaskPNG;
148 }
149
150 return true;
151 }
152
153 /// Possibly get min/max from the colour node itself instead of the colorLimits.
154 void _readColourRanges( const std::string &protoName, const StructureNode &proto,

Callers 1

GetImage2DSizesMethod · 0.85

Calls 6

IntegerNodeClass · 0.85
BlobNodeClass · 0.85
isDefinedMethod · 0.45
valueMethod · 0.45
getMethod · 0.45
byteCountMethod · 0.45

Tested by

no test coverage detected