Skip to content

Commit a091fb9

Browse files
committed
change stride data type in conversion test
1 parent bab79f3 commit a091fb9

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

tests/conversion.cc

+7-7
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ std::string PrintChannel(const HeifPixelImage& image, heif_channel channel) {
7575
uint32_t max_rows = 10;
7676
uint32_t width = std::min(image.get_width(channel), max_cols);
7777
uint32_t height = std::min(image.get_height(channel), max_rows);
78-
uint32_t stride;
78+
size_t stride;
7979
const T* p = (T*)image.get_plane(channel, &stride);
8080
stride /= (int)sizeof(T);
8181
int bpp = image.get_bits_per_pixel(channel);
@@ -127,8 +127,8 @@ double GetPsnr(const HeifPixelImage& original, const HeifPixelImage& compressed,
127127
return 0;
128128
}
129129

130-
uint32_t orig_stride;
131-
uint32_t compressed_stride;
130+
size_t orig_stride;
131+
size_t compressed_stride;
132132
const T* orig_p = (T*)original.get_plane(channel, &orig_stride);
133133
const T* compressed_p = (T*)compressed.get_plane(channel, &compressed_stride);
134134
orig_stride /= (int)sizeof(T);
@@ -301,7 +301,7 @@ void TestConversion(const std::string& test_name, const ColorState& input_state,
301301
CHECK(out_image->has_alpha() == target_state.has_alpha);
302302
for (const Plane& plane : GetPlanes(target_state, width, height)) {
303303
INFO("Channel: " << plane.channel);
304-
uint32_t stride;
304+
size_t stride;
305305
CHECK(out_image->get_plane(plane.channel, &stride) != nullptr);
306306
CHECK(out_image->get_bits_per_pixel(plane.channel) ==
307307
target_state.bits_per_pixel);
@@ -612,7 +612,7 @@ static void fill_plane(std::shared_ptr<HeifPixelImage>& img, heif_channel channe
612612
auto error = img->add_plane(channel, w, h, 8, nullptr);
613613
REQUIRE(!error);
614614

615-
uint32_t stride;
615+
size_t stride;
616616
uint8_t* p = img->get_plane(channel, &stride);
617617

618618
for (int y = 0; y < h; y++) {
@@ -629,7 +629,7 @@ static void assert_plane(std::shared_ptr<HeifPixelImage>& img, heif_channel chan
629629
uint32_t w = img->get_width(channel);
630630
uint32_t h = img->get_height(channel);
631631

632-
uint32_t stride;
632+
size_t stride;
633633
uint8_t* p = img->get_plane(channel, &stride);
634634

635635
for (uint32_t y = 0; y < h; y++) {
@@ -704,7 +704,7 @@ TEST_CASE("RGB 5-6-5 to RGB")
704704

705705
uint8_t v = 1;
706706
for (heif_channel plane: {heif_channel_R, heif_channel_G, heif_channel_B}) {
707-
uint32_t dst_stride = 0;
707+
size_t dst_stride = 0;
708708
uint8_t *dst = img->get_plane(plane, &dst_stride);
709709
for (uint32_t y = 0; y < height; y++) {
710710
for (uint32_t x = 0; x < width; x++) {

0 commit comments

Comments
 (0)