Cogl.Texture2D
Description: Reference for Cogl.Texture2D

### Class

# CoglTexture2D

since: 13

#### Description

    final class Cogl.Texture2D : GObject.TypeInstance
      implements Cogl.Texture {
      /* No available fields */
    }

No description available.

Available since: 13

#### Ancestors

- CoglObject

#### Implements

- CoglTexture

#### Constructors

###### cogl_texture_2d_new_from_bitmap

Creates a low-level `CoglTexture2D` texture based on data residing in a `CoglBitmap`.

since: 13

###### cogl_texture_2d_new_from_data

Creates a low-level `CoglTexture2D` texture based on data residing in memory.

since: 13

###### cogl_texture_2d_new_from_egl_image_external

No description available.

since: 13

###### cogl_texture_2d_new_from_file

Creates a low-level `CoglTexture2D` texture from an image file.

since: 13

###### cogl_texture_2d_new_with_format

Creates a low-level `CoglTexture2D` texture with a given `width` and `height` that your GPU can texture from directly.

since: 2.0

###### cogl_texture_2d_new_with_size

Creates a low-level `CoglTexture2D` texture with a given `width` and `height` that your GPU can texture from directly.

since: 13

#### Instance methods

###### cogl_texture_2d_egl_image_external_alloc_finish

No description available.

since: 13

###### cogl_texture_2d_egl_image_external_bind

No description available.

since: 13

##### Methods inherited from CoglObject (2)

###### cogl_object_get_user_data

Finds the user data previously associated with `object` using the given `key`. If no user data has been associated with `object` for the given `key` this function returns NULL.

since: 13

###### cogl_object_set_user_data

Associates some private `user_data` with a given `CoglObject`. To later remove the association call `cogl_object_set_user_data()` with the same `key` but NULL for the `user_data`.

since: 13

##### Methods inherited from CoglTexture (15)

###### cogl_texture_allocate

Explicitly allocates the storage for the given `texture` which allows you to be sure that there is enough memory for the texture and if not then the error can be handled gracefully.

since: 13

###### cogl_texture_get_components

Queries what components the given `texture` stores internally as set via cogl_texture_set_components().

since: 13

###### cogl_texture_get_data

Copies the pixel data from a cogl texture to system memory.

since: 13

###### cogl_texture_get_gl_texture

Queries the GL handles for a GPU side texture through its `CoglTexture`.

since: 13

###### cogl_texture_get_height

Queries the height of a cogl texture.

since: 13

###### cogl_texture_get_max_waste

Queries the maximum wasted (unused) pixels in one dimension of a GPU side texture.

since: 13

###### cogl_texture_get_premultiplied

Queries the pre-multiplied alpha status for internally stored red, green and blue components for the given `texture` as set by cogl_texture_set_premultiplied().

since: 13

###### cogl_texture_get_width

Queries the width of a cogl texture.

since: 13

###### cogl_texture_is_get_data_supported

No description available.

since: 13

###### cogl_texture_is_sliced

Queries if a texture is sliced (stored as multiple GPU side tecture objects).

since: 13

###### cogl_texture_set_components

Affects the internal storage format for this texture by specifying what components will be required for sampling later.

since: 13

###### cogl_texture_set_data

`texture` a `CoglTexture`. Sets all the pixels for a given mipmap `level` by copying the pixel data pointed to by the `data` argument into the given `texture`.

since: 13

###### cogl_texture_set_premultiplied

Affects the internal storage format for this texture by specifying whether red, green and blue color components should be stored as pre-multiplied alpha values.

since: 13

###### cogl_texture_set_region

Sets the pixels in a rectangular subregion of `texture` from an in-memory buffer containing pixel data.

since: 13

###### cogl_texture_set_region_from_bitmap

Copies a specified source region from `bitmap` to the position (`src_x`, `src_y`) of the given destination texture `handle`.

since: 13