gi-gdkpixbuf-2.0.16: GdkPixbuf bindings

CopyrightWill Thompson Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.GdkPixbuf.Structs.Pixdata

Contents

Description

A Pixdata contains pixbuf information in a form suitable for serialization and streaming.

Synopsis

Exported types

newtype Pixdata Source #

Memory-managed wrapper type.

Constructors

Pixdata (ManagedPtr Pixdata) 
Instances
WrappedPtr Pixdata Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.Pixdata

tag ~ AttrSet => Constructible Pixdata tag Source # 
Instance details

Defined in GI.GdkPixbuf.Structs.Pixdata

Methods

new :: MonadIO m => (ManagedPtr Pixdata -> Pixdata) -> [AttrOp Pixdata tag] -> m Pixdata #

newZeroPixdata :: MonadIO m => m Pixdata Source #

Construct a Pixdata struct initialized to zero.

noPixdata :: Maybe Pixdata Source #

A convenience alias for Nothing :: Maybe Pixdata.

Methods

deserialize

pixdataDeserialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Pixdata

pixdata: a Pixdata structure to be filled in.

-> ByteString

stream: stream of bytes containing a serialized Pixdata structure.

-> m ()

(Can throw GError)

Deprecated: (Since version 2.32)Use Resource instead.

Deserializes (reconstruct) a Pixdata structure from a byte stream. The byte stream consists of a straightforward writeout of the Pixdata fields in network byte order, plus the pixelData bytes the structure points to. The pixdata contents are reconstructed byte by byte and are checked for validity. This function may fail with PixbufErrorCorruptImage or PixbufErrorUnknownType.

serialize

pixdataSerialize Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Pixdata

pixdata: a valid Pixdata structure to serialize.

-> m ByteString

Returns: A newly-allocated string containing the serialized Pixdata structure.

Deprecated: (Since version 2.32)Use Resource instead.

Serializes a Pixdata structure into a byte stream. The byte stream consists of a straightforward writeout of the Pixdata fields in network byte order, plus the pixelData bytes the structure points to.

toCsource

pixdataToCsource Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Pixdata

pixdata: a Pixdata to convert to C source.

-> Text

name: used for naming generated data structures or macros.

-> [PixdataDumpType]

dumpType: a PixdataDumpType determining the kind of C source to be generated.

-> m String

Returns: a newly-allocated string containing the C source form of pixdata.

Deprecated: (Since version 2.32)Use Resource instead.

Generates C source code suitable for compiling images directly into programs.

gdk-pixbuf ships with a program called [gdk-pixbuf-csource][gdk-pixbuf-csource], which offers a command line interface to this function.

Properties

height

Height of the image in pixels.

getPixdataHeight :: MonadIO m => Pixdata -> m Word32 Source #

Get the value of the “height” field. When overloading is enabled, this is equivalent to

get pixdata #height

setPixdataHeight :: MonadIO m => Pixdata -> Word32 -> m () Source #

Set the value of the “height” field. When overloading is enabled, this is equivalent to

set pixdata [ #height := value ]

length

less than 1 to disable length checks, otherwise PIXDATA_HEADER_LENGTH + length of pixelData.

getPixdataLength :: MonadIO m => Pixdata -> m Int32 Source #

Get the value of the “length” field. When overloading is enabled, this is equivalent to

get pixdata #length

setPixdataLength :: MonadIO m => Pixdata -> Int32 -> m () Source #

Set the value of the “length” field. When overloading is enabled, this is equivalent to

set pixdata [ #length := value ]

magic

magic number. A valid Pixdata structure must have PIXBUF_MAGIC_NUMBER here.

getPixdataMagic :: MonadIO m => Pixdata -> m Word32 Source #

Get the value of the “magic” field. When overloading is enabled, this is equivalent to

get pixdata #magic

setPixdataMagic :: MonadIO m => Pixdata -> Word32 -> m () Source #

Set the value of the “magic” field. When overloading is enabled, this is equivalent to

set pixdata [ #magic := value ]

pixdataType

information about colorspace, sample width and encoding, in a PixdataType.

getPixdataPixdataType :: MonadIO m => Pixdata -> m Word32 Source #

Get the value of the “pixdata_type” field. When overloading is enabled, this is equivalent to

get pixdata #pixdataType

setPixdataPixdataType :: MonadIO m => Pixdata -> Word32 -> m () Source #

Set the value of the “pixdata_type” field. When overloading is enabled, this is equivalent to

set pixdata [ #pixdataType := value ]

rowstride

Distance in bytes between rows.

getPixdataRowstride :: MonadIO m => Pixdata -> m Word32 Source #

Get the value of the “rowstride” field. When overloading is enabled, this is equivalent to

get pixdata #rowstride

setPixdataRowstride :: MonadIO m => Pixdata -> Word32 -> m () Source #

Set the value of the “rowstride” field. When overloading is enabled, this is equivalent to

set pixdata [ #rowstride := value ]

width

Width of the image in pixels.

getPixdataWidth :: MonadIO m => Pixdata -> m Word32 Source #

Get the value of the “width” field. When overloading is enabled, this is equivalent to

get pixdata #width

setPixdataWidth :: MonadIO m => Pixdata -> Word32 -> m () Source #

Set the value of the “width” field. When overloading is enabled, this is equivalent to

set pixdata [ #width := value ]