| Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte |
|---|---|
| License | LGPL-2.1 |
| Maintainer | Iñaki García Etxebarria (garetxe@gmail.com) |
| Safe Haskell | None |
| Language | Haskell2010 |
GI.GdkPixbuf.Structs.Pixdata
Contents
Description
A Pixdata contains pixbuf information in a form suitable for
serialization and streaming.
Synopsis
- newtype Pixdata = Pixdata (ManagedPtr Pixdata)
- newZeroPixdata :: MonadIO m => m Pixdata
- noPixdata :: Maybe Pixdata
- pixdataDeserialize :: (HasCallStack, MonadIO m) => Pixdata -> ByteString -> m ()
- pixdataSerialize :: (HasCallStack, MonadIO m) => Pixdata -> m ByteString
- pixdataToCsource :: (HasCallStack, MonadIO m) => Pixdata -> Text -> [PixdataDumpType] -> m String
- getPixdataHeight :: MonadIO m => Pixdata -> m Word32
- setPixdataHeight :: MonadIO m => Pixdata -> Word32 -> m ()
- getPixdataLength :: MonadIO m => Pixdata -> m Int32
- setPixdataLength :: MonadIO m => Pixdata -> Int32 -> m ()
- getPixdataMagic :: MonadIO m => Pixdata -> m Word32
- setPixdataMagic :: MonadIO m => Pixdata -> Word32 -> m ()
- getPixdataPixdataType :: MonadIO m => Pixdata -> m Word32
- setPixdataPixdataType :: MonadIO m => Pixdata -> Word32 -> m ()
- getPixdataRowstride :: MonadIO m => Pixdata -> m Word32
- setPixdataRowstride :: MonadIO m => Pixdata -> Word32 -> m ()
- getPixdataWidth :: MonadIO m => Pixdata -> m Word32
- setPixdataWidth :: MonadIO m => Pixdata -> Word32 -> m ()
Exported types
Memory-managed wrapper type.
Constructors
| Pixdata (ManagedPtr Pixdata) |
Instances
| WrappedPtr Pixdata Source # | |
Defined in GI.GdkPixbuf.Structs.Pixdata | |
| tag ~ AttrSet => Constructible Pixdata tag Source # | |
Defined in GI.GdkPixbuf.Structs.Pixdata | |
Methods
deserialize
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Pixdata |
|
| -> ByteString |
|
| -> m () | (Can throw |
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
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Pixdata |
|
| -> m ByteString | Returns: A
newly-allocated string containing the serialized |
toCsource
Arguments
| :: (HasCallStack, MonadIO m) | |
| => Pixdata |
|
| -> Text |
|
| -> [PixdataDumpType] |
|
| -> m String | Returns: a newly-allocated string containing the C source form
of |
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
setpixdata [ #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
setpixdata [ #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
setpixdata [ #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
setpixdata [ #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
setpixdata [ #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
setpixdata [ #width:=value ]