Copyright | Will Thompson and Iñaki García Etxebarria |
---|---|
License | LGPL-2.1 |
Maintainer | Iñaki García Etxebarria |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
GI.Clutter.Objects.Texture
Contents
- Exported types
- Methods
- getBaseSize
- getCoglMaterial
- getCoglTexture
- getFilterQuality
- getKeepAspectRatio
- getLoadAsync
- getLoadDataAsync
- getMaxTileWaste
- getPickWithAlpha
- getPixelFormat
- getRepeat
- getSyncSize
- new
- newFromActor
- newFromFile
- setAreaFromRgbData
- setCoglMaterial
- setCoglTexture
- setFilterQuality
- setFromFile
- setFromRgbData
- setFromYuvData
- setKeepAspectRatio
- setLoadAsync
- setLoadDataAsync
- setPickWithAlpha
- setRepeat
- setSyncSize
- Properties
- Signals
Description
The Texture
structure contains only private data
and should be accessed using the provided API
Since: 0.2
Synopsis
- newtype Texture = Texture (ManagedPtr Texture)
- class (GObject o, IsDescendantOf Texture o) => IsTexture o
- toTexture :: (MonadIO m, IsTexture o) => o -> m Texture
- textureGetBaseSize :: (HasCallStack, MonadIO m, IsTexture a) => a -> m (Int32, Int32)
- textureGetCoglMaterial :: (HasCallStack, MonadIO m, IsTexture a) => a -> m (Ptr ())
- textureGetCoglTexture :: (HasCallStack, MonadIO m, IsTexture a) => a -> m (Ptr ())
- textureGetFilterQuality :: (HasCallStack, MonadIO m, IsTexture a) => a -> m TextureQuality
- textureGetKeepAspectRatio :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Bool
- textureGetLoadAsync :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Bool
- textureGetLoadDataAsync :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Bool
- textureGetMaxTileWaste :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Int32
- textureGetPickWithAlpha :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Bool
- textureGetPixelFormat :: (HasCallStack, MonadIO m, IsTexture a) => a -> m PixelFormat
- textureGetRepeat :: (HasCallStack, MonadIO m, IsTexture a) => a -> m (Bool, Bool)
- textureGetSyncSize :: (HasCallStack, MonadIO m, IsTexture a) => a -> m Bool
- textureNew :: (HasCallStack, MonadIO m) => m Texture
- textureNewFromActor :: (HasCallStack, MonadIO m, IsActor a) => a -> m Texture
- textureNewFromFile :: (HasCallStack, MonadIO m) => Text -> m Texture
- textureSetAreaFromRgbData :: (HasCallStack, MonadIO m, IsTexture a) => a -> Ptr Word8 -> Bool -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> Int32 -> [TextureFlags] -> m ()
- textureSetCoglMaterial :: (HasCallStack, MonadIO m, IsTexture a) => a -> Ptr () -> m ()
- textureSetCoglTexture :: (HasCallStack, MonadIO m, IsTexture a) => a -> Ptr () -> m ()
- textureSetFilterQuality :: (HasCallStack, MonadIO m, IsTexture a) => a -> TextureQuality -> m ()
- textureSetFromFile :: (HasCallStack, MonadIO m, IsTexture a) => a -> Text -> m ()
- textureSetFromRgbData :: (HasCallStack, MonadIO m, IsTexture a) => a -> Ptr Word8 -> Bool -> Int32 -> Int32 -> Int32 -> Int32 -> [TextureFlags] -> m ()
- textureSetFromYuvData :: (HasCallStack, MonadIO m, IsTexture a) => a -> Ptr Word8 -> Int32 -> Int32 -> [TextureFlags] -> m ()
- textureSetKeepAspectRatio :: (HasCallStack, MonadIO m, IsTexture a) => a -> Bool -> m ()
- textureSetLoadAsync :: (HasCallStack, MonadIO m, IsTexture a) => a -> Bool -> m ()
- textureSetLoadDataAsync :: (HasCallStack, MonadIO m, IsTexture a) => a -> Bool -> m ()
- textureSetPickWithAlpha :: (HasCallStack, MonadIO m, IsTexture a) => a -> Bool -> m ()
- textureSetRepeat :: (HasCallStack, MonadIO m, IsTexture a) => a -> Bool -> Bool -> m ()
- textureSetSyncSize :: (HasCallStack, MonadIO m, IsTexture a) => a -> Bool -> m ()
- constructTextureDisableSlicing :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextureDisableSlicing :: (MonadIO m, IsTexture o) => o -> m Bool
- clearTextureFilename :: (MonadIO m, IsTexture o) => o -> m ()
- constructTextureFilename :: (IsTexture o, MonadIO m) => Text -> m (GValueConstruct o)
- getTextureFilename :: (MonadIO m, IsTexture o) => o -> m (Maybe Text)
- setTextureFilename :: (MonadIO m, IsTexture o) => o -> Text -> m ()
- constructTextureFilterQuality :: (IsTexture o, MonadIO m) => TextureQuality -> m (GValueConstruct o)
- getTextureFilterQuality :: (MonadIO m, IsTexture o) => o -> m TextureQuality
- setTextureFilterQuality :: (MonadIO m, IsTexture o) => o -> TextureQuality -> m ()
- constructTextureKeepAspectRatio :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextureKeepAspectRatio :: (MonadIO m, IsTexture o) => o -> m Bool
- setTextureKeepAspectRatio :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- constructTextureLoadAsync :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- setTextureLoadAsync :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- constructTextureLoadDataAsync :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- setTextureLoadDataAsync :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- constructTexturePickWithAlpha :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTexturePickWithAlpha :: (MonadIO m, IsTexture o) => o -> m Bool
- setTexturePickWithAlpha :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- getTexturePixelFormat :: (MonadIO m, IsTexture o) => o -> m PixelFormat
- constructTextureRepeatX :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextureRepeatX :: (MonadIO m, IsTexture o) => o -> m Bool
- setTextureRepeatX :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- constructTextureRepeatY :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextureRepeatY :: (MonadIO m, IsTexture o) => o -> m Bool
- setTextureRepeatY :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- constructTextureSyncSize :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextureSyncSize :: (MonadIO m, IsTexture o) => o -> m Bool
- setTextureSyncSize :: (MonadIO m, IsTexture o) => o -> Bool -> m ()
- getTextureTileWaste :: (MonadIO m, IsTexture o) => o -> m Int32
- type TextureLoadFinishedCallback = GError -> IO ()
- afterTextureLoadFinished :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureLoadFinishedCallback) -> m SignalHandlerId
- onTextureLoadFinished :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureLoadFinishedCallback) -> m SignalHandlerId
- type TexturePixbufChangeCallback = IO ()
- afterTexturePixbufChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TexturePixbufChangeCallback) -> m SignalHandlerId
- onTexturePixbufChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TexturePixbufChangeCallback) -> m SignalHandlerId
- type TextureSizeChangeCallback = Int32 -> Int32 -> IO ()
- afterTextureSizeChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureSizeChangeCallback) -> m SignalHandlerId
- onTextureSizeChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureSizeChangeCallback) -> m SignalHandlerId
Exported types
Memory-managed wrapper type.
Instances
Eq Texture Source # | |
GObject Texture Source # | |
Defined in GI.Clutter.Objects.Texture | |
ManagedPtrNewtype Texture Source # | |
Defined in GI.Clutter.Objects.Texture Methods toManagedPtr :: Texture -> ManagedPtr Texture | |
TypedObject Texture Source # | |
Defined in GI.Clutter.Objects.Texture | |
HasParentTypes Texture Source # | |
Defined in GI.Clutter.Objects.Texture | |
IsGValue (Maybe Texture) Source # | Convert |
Defined in GI.Clutter.Objects.Texture Methods gvalueGType_ :: IO GType gvalueSet_ :: Ptr GValue -> Maybe Texture -> IO () gvalueGet_ :: Ptr GValue -> IO (Maybe Texture) | |
type ParentTypes Texture Source # | |
Defined in GI.Clutter.Objects.Texture |
class (GObject o, IsDescendantOf Texture o) => IsTexture o Source #
Instances
(GObject o, IsDescendantOf Texture o) => IsTexture o Source # | |
Defined in GI.Clutter.Objects.Texture |
Methods
Click to display all available methods, including inherited ones
Methods
addAction, addActionWithName, addActor, addChild, addConstraint, addConstraintWithName, addEffect, addEffectWithName, addTransition, allocate, allocateAlignFill, allocateAvailableSize, allocatePreferredSize, animateProperty, animateWithAlphav, animateWithTimelinev, animatev, applyRelativeTransformToPoint, applyTransformToPoint, bindModel, bindProperty, bindPropertyFull, childGetProperty, childNotify, childSetProperty, clearActions, clearConstraints, clearEffects, contains, continuePaint, createChildMeta, createPangoContext, createPangoLayout, destroy, destroyAllChildren, destroyChildMeta, detachAnimation, event, findChildByName, findProperty, forceFloating, foreach, foreachWithInternals, freezeNotify, getv, grabKeyFocus, hasActions, hasAllocation, hasClip, hasConstraints, hasEffects, hasKeyFocus, hasOverlaps, hasPointer, hide, hideAll, insertChildAbove, insertChildAtIndex, insertChildBelow, interpolateValue, isFloating, isInClonePaint, isMapped, isRealized, isRotated, isScaled, isVisible, lower, lowerBottom, lowerChild, map, moveAnchorPoint, moveAnchorPointFromGravity, moveBy, needsExpand, notify, notifyByPspec, paint, parseCustomNode, popInternal, pushInternal, queueRedraw, queueRedrawWithClip, queueRelayout, raise, raiseChild, raiseTop, realize, ref, refSink, removeAction, removeActionByName, removeActor, removeAllChildren, removeAllTransitions, removeChild, removeClip, removeConstraint, removeConstraintByName, removeEffect, removeEffectByName, removeTransition, reparent, replaceChild, restoreEasingState, runDispose, saveEasingState, shouldPickPaint, show, showAll, sortDepthOrder, stealData, stealQdata, thawNotify, transformStagePoint, unmap, unparent, unrealize, unref, unsetFlags, watchClosure.
Getters
getAbsAllocationVertices, getAccessible, getAction, getActions, getAllocationBox, getAllocationGeometry, getAllocationVertices, getAnchorPoint, getAnchorPointGravity, getAnimation, getBackgroundColor, getBaseSize, getChildAtIndex, getChildMeta, getChildTransform, getChildren, getClip, getClipToAllocation, getCoglMaterial, getCoglTexture, getConstraint, getConstraints, getContent, getContentBox, getContentGravity, getContentRepeat, getContentScalingFilters, getData, getDefaultPaintVolume, getDepth, getEasingDelay, getEasingDuration, getEasingMode, getEffect, getEffects, getFilterQuality, getFirstChild, getFixedPositionSet, getFlags, getGeometry, getGid, getHeight, getId, getInitialState, getKeepAspectRatio, getLastChild, getLayoutManager, getLoadAsync, getLoadDataAsync, getMargin, getMarginBottom, getMarginLeft, getMarginRight, getMarginTop, getMaxTileWaste, getNChildren, getName, getNextSibling, getOffscreenRedirect, getOpacity, getPaintBox, getPaintOpacity, getPaintVisibility, getPaintVolume, getPangoContext, getParent, getPickWithAlpha, getPivotPoint, getPivotPointZ, getPixelFormat, getPosition, getPreferredHeight, getPreferredSize, getPreferredWidth, getPreviousSibling, getProperty, getQdata, getReactive, getRepeat, getRequestMode, getRotation, getRotationAngle, getScale, getScaleCenter, getScaleGravity, getScaleZ, getShader, getSize, getStage, getSyncSize, getTextDirection, getTransform, getTransformationMatrix, getTransformedPaintVolume, getTransformedPosition, getTransformedSize, getTransition, getTranslation, getWidth, getX, getXAlign, getXExpand, getY, getYAlign, getYExpand, getZPosition, getZRotationGravity.
Setters
setAllocation, setAnchorPoint, setAnchorPointFromGravity, setAreaFromRgbData, setBackgroundColor, setChildAboveSibling, setChildAtIndex, setChildBelowSibling, setChildTransform, setClip, setClipToAllocation, setCoglMaterial, setCoglTexture, setContent, setContentGravity, setContentRepeat, setContentScalingFilters, setCustomProperty, setData, setDataFull, setDepth, setEasingDelay, setEasingDuration, setEasingMode, setFilterQuality, setFinalState, setFixedPositionSet, setFlags, setFromFile, setFromRgbData, setFromYuvData, setGeometry, setHeight, setId, setKeepAspectRatio, setLayoutManager, setLoadAsync, setLoadDataAsync, setMargin, setMarginBottom, setMarginLeft, setMarginRight, setMarginTop, setName, setOffscreenRedirect, setOpacity, setParent, setPickWithAlpha, setPivotPoint, setPivotPointZ, setPosition, setProperty, setReactive, setRepeat, setRequestMode, setRotation, setRotationAngle, setScale, setScaleFull, setScaleWithGravity, setScaleZ, setShader, setShaderParam, setShaderParamFloat, setShaderParamInt, setSize, setSyncSize, setTextDirection, setTransform, setTranslation, setWidth, setX, setXAlign, setXExpand, setY, setYAlign, setYExpand, setZPosition, setZRotationFromGravity.
getBaseSize
Deprecated: (Since version 1.12)Use Image
and contentGetPreferredSize
instead
Gets the size in pixels of the untransformed underlying image
getCoglMaterial
textureGetCoglMaterial Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m (Ptr ()) | Returns: a handle for a |
Deprecated: (Since version 1.12)No replacement is available; it's not advisable to modify the Cogl pipeline of an actor. Use a Content
implementation and modify the pipeline during the paint sequence
Returns a handle to the underlying COGL material used for drawing the actor.
Since: 1.0
getCoglTexture
textureGetCoglTexture Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m (Ptr ()) | Returns: a |
Deprecated: (Since version 1.12)No replacement available; it's not advisable to modify the Cogl pipeline of an actor. Use a Content
implementation and set up the pipeline during the paint sequence instead.
Retrieves the handle to the underlying COGL texture used for drawing
the actor. No extra reference is taken so if you need to keep the
handle then you should call handleRef
on it.
The texture handle returned is the first layer of the material
handle used by the Texture
. If you need to access the other
layers you should use textureGetCoglMaterial
instead
and use the Material
API.
Since: 0.8
getFilterQuality
textureGetFilterQuality Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m TextureQuality | Returns: The filter quality value. |
Deprecated: (Since version 1.12)Use Image
and actorGetContentScalingFilters
instead
Gets the filter quality used when scaling a texture.
Since: 0.8
getKeepAspectRatio
textureGetKeepAspectRatio Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 1.12)Use Image
and actorGetContentGravity
instead
Retrieves the value set using textureSetKeepAspectRatio
Since: 1.0
getLoadAsync
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 1.12)There is no direct replacement for this function
Retrieves the value set using textureSetLoadAsync
Since: 1.0
getLoadDataAsync
textureGetLoadDataAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 1.12)There is no direct replacement for this function
Retrieves the value set by textureSetLoadDataAsync
Since: 1.0
getMaxTileWaste
textureGetMaxTileWaste Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Int32 | Returns: The maximum waste or -1 if the texture waste is unlimited. |
Deprecated: (Since version 1.12)No replacement is available
Gets the maximum waste that will be used when creating a texture or -1 if slicing is disabled.
Since: 0.8
getPickWithAlpha
textureGetPickWithAlpha Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 1.12)There is no direct replacement for this function
Retrieves the value set by textureSetLoadDataAsync
Since: 1.4
getPixelFormat
textureGetPixelFormat Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m PixelFormat | Returns: a |
Deprecated: (Since version 1.12)There is no direct replacement for this function
Retrieves the pixel format used by texture
. This is
equivalent to:
handle = clutter_texture_get_pixel_format (texture); if (handle != COGL_INVALID_HANDLE) format = cogl_texture_get_format (handle);
Since: 1.0
getRepeat
Deprecated: (Since version 1.12)Use Image
and actorGetContentRepeat
instead
Retrieves the horizontal and vertical repeat values set
using textureSetRepeat
Since: 1.0
getSyncSize
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> m Bool | Returns: |
Deprecated: (Since version 1.12)There is no direct replacement
Retrieves the value set with textureSetSyncSize
Since: 1.0
new
Arguments
:: (HasCallStack, MonadIO m) | |
=> m Texture | Returns: A newly created |
newFromActor
Arguments
:: (HasCallStack, MonadIO m, IsActor a) | |
=> a |
|
-> m Texture | Returns: A newly created |
Deprecated: (Since version 1.8)Use the OffscreenEffect
and ShaderEffect
directly on the intended Actor
to replace the functionality of this function.
Creates a new Texture
object with its source a prexisting
actor (and associated children). The textures content will contain
'live' redirected output of the actors scene.
Note this function is intented as a utility call for uniformly applying
shaders to groups and other potential visual effects. It requires that
the FeatureFlagsOffscreen
feature is supported by the current backend
and the target system.
Some tips on usage:
- The source actor must be visible
- The source actor must have a parent in order for it to be
allocated a size from the layouting mechanism. If the source
actor does not have a parent when this function is called then
the ClutterTexture will adopt it and allocate it at its
preferred size. Using this you can clone an actor that is
otherwise not displayed. Because of this feature if you do
intend to display the source actor then you must make sure that
the actor is parented before calling
textureNewFromActor
or that you unparent it before adding it to a container. - When getting the image for the clone texture, Clutter will attempt to render the source actor exactly as it would appear if it was rendered on screen. The source actor's parent transformations are taken into account. Therefore if your source actor is rotated along the X or Y axes so that it has some depth, the texture will appear differently depending on the on-screen location of the source actor. While painting the source actor, Clutter will set up a temporary asymmetric perspective matrix as the projection matrix so that the source actor will be projected as if a small section of the screen was being viewed. Before version 0.8.2, an orthogonal identity projection was used which meant that the source actor would be clipped if any part of it was not on the zero Z-plane.
- Avoid reparenting the source with the created texture.
- A group can be padded with a transparent rectangle as to provide a border to contents for shader output (blurring text for example).
- The texture will automatically resize to contain a further transformed source. However, this involves overhead and can be avoided by placing the source actor in a bounding group sized large enough to contain any child tranformations.
- Uploading pixel data to the texture (e.g by using
textureSetFromFile
) will destroy the offscreen texture data and end redirection. textureGetData
with the handle returned bytextureGetCoglTexture
can be used to read the offscreen texture pixels into a pixbuf.
Since: 0.6
newFromFile
Arguments
:: (HasCallStack, MonadIO m) | |
=> Text |
|
-> m Texture | Returns: A newly created |
Deprecated: (Since version 1.12)No direct replacement is available. Use Image
and platform-specific image loading API, like GdkPixbuf, instead
Creates a new ClutterTexture actor to display the image contained a
file. If the image failed to load then NULL is returned and error
is set.
Since: 0.8
setAreaFromRgbData
textureSetAreaFromRgbData Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Ptr Word8 |
|
-> Bool |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> [TextureFlags] |
|
-> m () | (Can throw |
Deprecated: (Since version 1.12)Use Image
and imageSetArea
instead
Updates a sub-region of the pixel data in a Texture
.
Since: 0.6
setCoglMaterial
textureSetCoglMaterial Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.12)No replacement is available; it's not advisable to modify the Cogl pipeline of an actor. Use a Content
implementation and modify the pipeline during the paint sequence
Replaces the underlying Cogl material drawn by this actor with
coglMaterial
. A reference to the material is taken so if the
handle is no longer needed it should be deref'd with
cogl_handle_unref. Texture data is attached to the material so
calling this function also replaces the Cogl
texture. Texture
requires that the material have a texture
layer so you should set one on the material before calling this
function.
Since: 0.8
setCoglTexture
textureSetCoglTexture Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Ptr () |
|
-> m () |
Deprecated: (Since version 1.12)No replacement available; it's not advisable to modify the Cogl pipeline of an actor. Use a Content
implementation and set up the pipeline during the paint sequence instead.
Replaces the underlying COGL texture drawn by this actor with
coglTex
. A reference to the texture is taken so if the handle is
no longer needed it should be deref'd with cogl_handle_unref.
Since: 0.8
setFilterQuality
textureSetFilterQuality Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> TextureQuality |
|
-> m () |
Deprecated: (Since version 1.12)Use Image
and actorSetContentScalingFilters
instead
Sets the filter quality when scaling a texture. The quality is an
enumeration currently the following values are supported:
TextureQualityLow
which is fast but only uses nearest neighbour
interpolation. TextureQualityMedium
which is computationally a
bit more expensive (bilinear interpolation), and
TextureQualityHigh
which uses extra texture memory resources to
improve scaled down rendering as well (by using mipmaps). The default value
is TextureQualityMedium
.
Since: 0.8
setFromFile
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Text |
|
-> m () | (Can throw |
Deprecated: (Since version 1.12)Use Image
and platform-specific image loading API, like GdkPixbuf, instead
Sets the Texture
image data from an image file. In case of
failure, False
is returned and error
is set.
If Texture:loadAsync is set to True
, this function
will return as soon as possible, and the actual image loading
from disk will be performed asynchronously. Texture::sizeChange
will be emitten when the size of the texture is available and
Texture::loadFinished will be emitted when the image has been
loaded or if an error occurred.
Since: 0.8
setFromRgbData
textureSetFromRgbData Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Ptr Word8 |
|
-> Bool |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> Int32 |
|
-> [TextureFlags] |
|
-> m () | (Can throw |
Deprecated: (Since version 1.12)Use Image
and imageSetData
instead
Sets Texture
image data.
Since: 0.4
setFromYuvData
textureSetFromYuvData Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Ptr Word8 |
|
-> Int32 |
|
-> Int32 |
|
-> [TextureFlags] |
|
-> m () | (Can throw |
Deprecated: (Since version 1.10)Use a custom Content
implementation and set up the Cogl pipeline using a PipelineNode
with a fragment shader instead.
Sets a Texture
from YUV image data. If an error occurred,
False
is returned and error
is set.
The YUV support depends on the driver; the format supported by the few drivers exposing this capability are not really useful.
The proper way to convert image data in any YUV colorspace to any
RGB colorspace is to use a fragment shader associated with the
Texture
material.
Since: 0.4
setKeepAspectRatio
textureSetKeepAspectRatio Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 1.12)Use Image
and actorSetContentGravity
with ContentGravityResizeAspect
instead
Sets whether texture
should have a preferred size maintaining
the aspect ratio of the underlying image
Since: 1.0
setLoadAsync
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 1.12)There is no direct replacement for this function. Use Image
and platform-specific API for loading image data asynchronously, like GdkPixbuf
Sets whether texture
should use a worker thread to load the data
from disk asynchronously. Setting loadAsync
to True
will make
textureSetFromFile
return immediately.
See the Texture:loadAsync property documentation, and
textureSetLoadDataAsync
.
Since: 1.0
setLoadDataAsync
textureSetLoadDataAsync Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 1.12)There is no direct replacement for this function. Use Image
and platform-specific API for loading image data asynchronously, like GdkPixbuf
Sets whether texture
should use a worker thread to load the data
from disk asynchronously. Setting loadAsync
to True
will make
textureSetFromFile
block until the Texture
has
determined the width and height of the image data.
See the Texture:loadAsync property documentation, and
textureSetLoadAsync
.
Since: 1.0
setPickWithAlpha
textureSetPickWithAlpha Source #
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 1.12)There is no direct replacement for this function
Sets whether texture
should have it's shape defined by the alpha
channel when picking.
Be aware that this is a bit more costly than the default picking due to the texture lookup, extra test against the alpha value and the fact that it will also interrupt the batching of geometry done internally.
Also there is currently no control over the threshold used to determine what value of alpha is considered pickable, and so only fully opaque parts of the texture will react to picking.
Since: 1.4
setRepeat
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Bool |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 1.12)Use Image
and actorSetContentRepeat
instead
Sets whether the texture
should repeat horizontally or
vertically when the actor size is bigger than the image size
Since: 1.0
setSyncSize
Arguments
:: (HasCallStack, MonadIO m, IsTexture a) | |
=> a |
|
-> Bool |
|
-> m () |
Deprecated: (Since version 1.12)No replacement is available. A Actor
using Image
with a RequestModeContentSize
request mode will automatically bind the preferred size of the content to the preferred size of the actor
Sets whether texture
should have the same preferred size as the
underlying image data.
Since: 1.0
Properties
disableSlicing
No description available in the introspection data.
constructTextureDisableSlicing :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “disable-slicing
” property. This is rarely needed directly, but it is used by new
.
getTextureDisableSlicing :: (MonadIO m, IsTexture o) => o -> m Bool Source #
Get the value of the “disable-slicing
” property.
When overloading is enabled, this is equivalent to
get
texture #disableSlicing
filename
The path of the file containing the image data to be displayed by the texture.
This property is unset when using the clutter_texture_set_from_*_data()
family of functions.
clearTextureFilename :: (MonadIO m, IsTexture o) => o -> m () Source #
Set the value of the “filename
” property to Nothing
.
When overloading is enabled, this is equivalent to
clear
#filename
constructTextureFilename :: (IsTexture o, MonadIO m) => Text -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “filename
” property. This is rarely needed directly, but it is used by new
.
getTextureFilename :: (MonadIO m, IsTexture o) => o -> m (Maybe Text) Source #
Get the value of the “filename
” property.
When overloading is enabled, this is equivalent to
get
texture #filename
setTextureFilename :: (MonadIO m, IsTexture o) => o -> Text -> m () Source #
Set the value of the “filename
” property.
When overloading is enabled, this is equivalent to
set
texture [ #filename:=
value ]
filterQuality
No description available in the introspection data.
constructTextureFilterQuality :: (IsTexture o, MonadIO m) => TextureQuality -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “filter-quality
” property. This is rarely needed directly, but it is used by new
.
getTextureFilterQuality :: (MonadIO m, IsTexture o) => o -> m TextureQuality Source #
Get the value of the “filter-quality
” property.
When overloading is enabled, this is equivalent to
get
texture #filterQuality
setTextureFilterQuality :: (MonadIO m, IsTexture o) => o -> TextureQuality -> m () Source #
Set the value of the “filter-quality
” property.
When overloading is enabled, this is equivalent to
set
texture [ #filterQuality:=
value ]
keepAspectRatio
No description available in the introspection data.
constructTextureKeepAspectRatio :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “keep-aspect-ratio
” property. This is rarely needed directly, but it is used by new
.
getTextureKeepAspectRatio :: (MonadIO m, IsTexture o) => o -> m Bool Source #
Get the value of the “keep-aspect-ratio
” property.
When overloading is enabled, this is equivalent to
get
texture #keepAspectRatio
setTextureKeepAspectRatio :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “keep-aspect-ratio
” property.
When overloading is enabled, this is equivalent to
set
texture [ #keepAspectRatio:=
value ]
loadAsync
Tries to load a texture from a filename by using a local thread to perform the read operations. The initially created texture has dimensions 0x0 when the true size becomes available the Texture::sizeChange signal is emitted and when the image has completed loading the Texture::loadFinished signal is emitted.
Threading is only enabled if g_thread_init()
has been called prior to
init
, otherwise Texture
will use the main loop to load
the image.
The upload of the texture data on the GL pipeline is not asynchronous, as
it must be performed from within the same thread that called
main
.
Since: 1.0
constructTextureLoadAsync :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “load-async
” property. This is rarely needed directly, but it is used by new
.
setTextureLoadAsync :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “load-async
” property.
When overloading is enabled, this is equivalent to
set
texture [ #loadAsync:=
value ]
loadDataAsync
Like Texture:loadAsync but loads the width and height synchronously causing some blocking.
Since: 1.0
constructTextureLoadDataAsync :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “load-data-async
” property. This is rarely needed directly, but it is used by new
.
setTextureLoadDataAsync :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “load-data-async
” property.
When overloading is enabled, this is equivalent to
set
texture [ #loadDataAsync:=
value ]
pickWithAlpha
No description available in the introspection data.
constructTexturePickWithAlpha :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “pick-with-alpha
” property. This is rarely needed directly, but it is used by new
.
getTexturePickWithAlpha :: (MonadIO m, IsTexture o) => o -> m Bool Source #
Get the value of the “pick-with-alpha
” property.
When overloading is enabled, this is equivalent to
get
texture #pickWithAlpha
setTexturePickWithAlpha :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “pick-with-alpha
” property.
When overloading is enabled, this is equivalent to
set
texture [ #pickWithAlpha:=
value ]
pixelFormat
No description available in the introspection data.
getTexturePixelFormat :: (MonadIO m, IsTexture o) => o -> m PixelFormat Source #
Get the value of the “pixel-format
” property.
When overloading is enabled, this is equivalent to
get
texture #pixelFormat
repeatX
No description available in the introspection data.
constructTextureRepeatX :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “repeat-x
” property. This is rarely needed directly, but it is used by new
.
getTextureRepeatX :: (MonadIO m, IsTexture o) => o -> m Bool Source #
Get the value of the “repeat-x
” property.
When overloading is enabled, this is equivalent to
get
texture #repeatX
setTextureRepeatX :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “repeat-x
” property.
When overloading is enabled, this is equivalent to
set
texture [ #repeatX:=
value ]
repeatY
No description available in the introspection data.
constructTextureRepeatY :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “repeat-y
” property. This is rarely needed directly, but it is used by new
.
getTextureRepeatY :: (MonadIO m, IsTexture o) => o -> m Bool Source #
Get the value of the “repeat-y
” property.
When overloading is enabled, this is equivalent to
get
texture #repeatY
setTextureRepeatY :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “repeat-y
” property.
When overloading is enabled, this is equivalent to
set
texture [ #repeatY:=
value ]
syncSize
No description available in the introspection data.
constructTextureSyncSize :: (IsTexture o, MonadIO m) => Bool -> m (GValueConstruct o) Source #
Construct a GValueConstruct
with valid value for the “sync-size
” property. This is rarely needed directly, but it is used by new
.
getTextureSyncSize :: (MonadIO m, IsTexture o) => o -> m Bool Source #
Get the value of the “sync-size
” property.
When overloading is enabled, this is equivalent to
get
texture #syncSize
setTextureSyncSize :: (MonadIO m, IsTexture o) => o -> Bool -> m () Source #
Set the value of the “sync-size
” property.
When overloading is enabled, this is equivalent to
set
texture [ #syncSize:=
value ]
tileWaste
No description available in the introspection data.
getTextureTileWaste :: (MonadIO m, IsTexture o) => o -> m Int32 Source #
Get the value of the “tile-waste
” property.
When overloading is enabled, this is equivalent to
get
texture #tileWaste
Signals
loadFinished
type TextureLoadFinishedCallback Source #
Deprecated: (Since version 1.12)No replacement is available
The loadFinished signal is emitted when a texture load has
completed. If there was an error during loading, error
will
be set, otherwise it will be Nothing
Since: 1.0
afterTextureLoadFinished :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureLoadFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the loadFinished signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
texture #loadFinished callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextureLoadFinished :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureLoadFinishedCallback) -> m SignalHandlerId Source #
Connect a signal handler for the loadFinished signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
texture #loadFinished callback
pixbufChange
type TexturePixbufChangeCallback = IO () Source #
Deprecated: (Since version 1.12)No replacement is available
The pixbufChange signal is emitted each time the pixbuf
used by texture
changes.
afterTexturePixbufChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TexturePixbufChangeCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pixbufChange signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
texture #pixbufChange callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTexturePixbufChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TexturePixbufChangeCallback) -> m SignalHandlerId Source #
Connect a signal handler for the pixbufChange signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
texture #pixbufChange callback
sizeChange
type TextureSizeChangeCallback Source #
Arguments
= Int32 |
|
-> Int32 |
|
-> IO () |
Deprecated: (Since version 1.12)No replacement is available
The sizeChange signal is emitted each time the size of the
pixbuf used by texture
changes. The new size is given as
argument to the callback.
afterTextureSizeChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureSizeChangeCallback) -> m SignalHandlerId Source #
Connect a signal handler for the sizeChange signal, to be run after the default handler. When overloading is enabled, this is equivalent to
after
texture #sizeChange callback
By default the object invoking the signal is not passed to the callback.
If you need to access it, you can use the implit ?self
parameter.
Note that this requires activating the ImplicitParams
GHC extension.
onTextureSizeChange :: (IsTexture a, MonadIO m) => a -> ((?self :: a) => TextureSizeChangeCallback) -> m SignalHandlerId Source #
Connect a signal handler for the sizeChange signal, to be run before the default handler. When overloading is enabled, this is equivalent to
on
texture #sizeChange callback