Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/geode/io/image/raster_image_input.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@
absl::FixedArray< GByte > values( raster.nb_cells() );
const auto status =
gdal_data.GetRasterBand( component )
->RasterIO( GF_Read, 0, 0, width, height, values.data(), width,

Check warning on line 47 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:47:74 [bugprone-narrowing-conversions]

narrowing conversion from 'index_t' (aka 'unsigned int') to signed type 'int' is implementation-defined

Check warning on line 47 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:47:51 [bugprone-narrowing-conversions]

narrowing conversion from 'index_t' (aka 'unsigned int') to signed type 'int' is implementation-defined

Check warning on line 47 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:47:44 [bugprone-narrowing-conversions]

narrowing conversion from 'index_t' (aka 'unsigned int') to signed type 'int' is implementation-defined
height, GDT_Byte, 0, 0 );

Check warning on line 48 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:48:21 [bugprone-narrowing-conversions]

narrowing conversion from 'index_t' (aka 'unsigned int') to signed type 'int' is implementation-defined
geode::OpenGeodeIOImageException::check_exception( status == CE_None,
nullptr, geode::OpenGeodeException::TYPE::data,
"[ImageInputImpl] Failed to read color component" );
Expand All @@ -56,11 +56,11 @@
std::array< geode::index_t, 3 > rgb_indices{ 0, 0, 0 };
const auto nb_color_components =
static_cast< geode::index_t >( gdal_data.GetRasterCount() );
for( const auto id : geode::Range( nb_color_components ) )

Check warning on line 59 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:59:25 [readability-identifier-length]

variable name 'id' is too short, expected at least 3 characters
{
const auto band_id = id + 1;
GDALColorInterp colorInterp =

Check warning on line 62 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:62:29 [readability-identifier-naming]

invalid case style for variable 'colorInterp'
gdal_data.GetRasterBand( band_id )->GetColorInterpretation();

Check warning on line 63 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:63:42 [bugprone-narrowing-conversions]

narrowing conversion from 'unsigned int' to signed type 'int' is implementation-defined
if( colorInterp == GCI_RedBand )
{
rgb_indices[0] = band_id;
Expand All @@ -78,7 +78,7 @@
}

template < typename SpecificRange >
geode::RasterImage2D read_file( GDALDataset& gdal_data )

Check warning on line 81 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:81:26 [readability-function-cognitive-complexity]

function 'read_file' has cognitive complexity of 12 (threshold 10)
{
const auto width = gdal_data.GetRasterXSize();
const auto height = gdal_data.GetRasterYSize();
Expand All @@ -97,7 +97,7 @@
for( const auto image_i :
geode::Range{ raster.nb_cells_in_direction( 0 ) } )
{
const auto pixel = image_i + width * image_j;

Check warning on line 100 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:100:50 [readability-math-missing-parentheses]

'*' has higher precedence than '+'; add parentheses to explicitly specify the order of operations
const auto value = grey_scale[pixel];
raster.set_color( cell++, { value, value, value } );
}
Expand All @@ -107,7 +107,7 @@
{
const auto rgb_indices = get_rgb_indices( gdal_data );
const auto red =
read_color_component( raster, gdal_data, rgb_indices[0] );

Check warning on line 110 in src/geode/io/image/raster_image_input.cpp

View workflow job for this annotation

GitHub Actions / test / tidy

src/geode/io/image/raster_image_input.cpp:110:58 [bugprone-narrowing-conversions]

narrowing conversion from 'value_type' (aka 'unsigned int') to signed type 'int' is implementation-defined
const auto green =
read_color_component( raster, gdal_data, rgb_indices[1] );
const auto blue =
Expand Down Expand Up @@ -150,7 +150,7 @@

Percentage ImageInputImpl::is_loadable()
{
if( dataset().GetRasterCount() < 2 )
if( dataset().GetRasterCount() == 0 )
{
return Percentage{ 0 };
}
Expand Down
Loading