开发者

How to load image with IMG_Load() without the byte padding for each line?

开发者 https://www.devze.com 2023-03-23 23:33 出处:网络
If i load image such as 98x*** which is 3 bytes per pixel, it will create 2 bytes padding there to make it fit in 4 bytes sequences.

If i load image such as 98x*** which is 3 bytes per pixel, it will create 2 bytes padding there to make it fit in 4 bytes sequences.

Is it possible to use IMG_Load() without generating the padded bytes in the ->pixels raw data?

At the moment i use this to detect how many bytes it has been padded:

int pad = img->pitch - (img->开发者_JAVA百科w * img->format->BytesPerPixel);

And if > 0 Then i rebuild new image without the padded bytes... but this is inefficient, so im hoping if theres better fix?

0

精彩评论

暂无评论...
验证码 换一张
取 消