Pixbuf.calculateRowstride

int calculateRowstride(gdkpixbuf.types.Colorspace colorspace, bool hasAlpha, int bitsPerSample, int width, int height)

Calculates the rowstride that an image created with those values would have.

This function is useful for front-ends and backends that want to check image values without needing to create a [gdkpixbuf.pixbuf.Pixbuf].

Parameters

colorspaceColor space for image
hasAlphaWhether the image should have transparency information
bitsPerSampleNumber of bits per color sample
widthWidth of image in pixels, must be > 0
heightHeight of image in pixels, must be > 0

Returns

the rowstride for the given values, or -1 in case of error.