### Function

# GdkPixbuf.Pixbuf.calculate_rowstride

#### Declaration [src]

    gint
    gdk_pixbuf_calculate_rowstride (
      GdkColorspace colorspace,
      gboolean has_alpha,
      int bits_per_sample,
      int width,
      int height
    )

#### Description [src]

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`.

#### Parameters

`colorspace` | `GdkColorspace`
| Color space for image
`has_alpha` | `gboolean`
| Whether the image should have transparency information
`bits_per_sample` | `int`
| Number of bits per color sample
`width` | `int`
| Width of image in pixels, must be > 0
`height` | `int`
| Height of image in pixels, must be > 0

#### Return value

Returns: `gint`
the rowstride for the given values, or -1 in case of error.