| 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.GstBase.Structs.BitReader
Contents
Description
BitReader provides a bit reader that can read any number of bits
from a memory buffer. It provides functions for reading any number of bits
into 8, 16, 32 and 64 bit variables.
- newtype BitReader = BitReader (ManagedPtr BitReader)
- newZeroBitReader :: MonadIO m => m BitReader
- noBitReader :: Maybe BitReader
- bitReaderFree :: (HasCallStack, MonadIO m) => BitReader -> m ()
- bitReaderGetBitsUint16 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word16)
- bitReaderGetBitsUint32 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word32)
- bitReaderGetBitsUint64 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word64)
- bitReaderGetBitsUint8 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word8)
- bitReaderGetPos :: (HasCallStack, MonadIO m) => BitReader -> m Word32
- bitReaderGetRemaining :: (HasCallStack, MonadIO m) => BitReader -> m Word32
- bitReaderGetSize :: (HasCallStack, MonadIO m) => BitReader -> m Word32
- bitReaderInit :: (HasCallStack, MonadIO m) => BitReader -> ByteString -> m ()
- bitReaderPeekBitsUint16 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word16)
- bitReaderPeekBitsUint32 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word32)
- bitReaderPeekBitsUint64 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word64)
- bitReaderPeekBitsUint8 :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m (Bool, Word8)
- bitReaderSetPos :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m Bool
- bitReaderSkip :: (HasCallStack, MonadIO m) => BitReader -> Word32 -> m Bool
- bitReaderSkipToByte :: (HasCallStack, MonadIO m) => BitReader -> m Bool
- getBitReaderBit :: MonadIO m => BitReader -> m Word32
- setBitReaderBit :: MonadIO m => BitReader -> Word32 -> m ()
- getBitReaderByte :: MonadIO m => BitReader -> m Word32
- setBitReaderByte :: MonadIO m => BitReader -> Word32 -> m ()
- getBitReaderSize :: MonadIO m => BitReader -> m Word32
- setBitReaderSize :: MonadIO m => BitReader -> Word32 -> m ()
Exported types
Constructors
| BitReader (ManagedPtr BitReader) |
Instances
| WrappedPtr BitReader Source # | |
| (~) AttrOpTag tag AttrSet => Constructible BitReader tag Source # | |
newZeroBitReader :: MonadIO m => m BitReader Source #
Construct a BitReader struct initialized to zero.
Methods
free
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> m () |
Frees a BitReader instance, which was previously allocated by
gst_bit_reader_new().
getBitsUint16
bitReaderGetBitsUint16 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word16) |
Read nbits bits into val and update the current position.
getBitsUint32
bitReaderGetBitsUint32 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word32) |
Read nbits bits into val and update the current position.
getBitsUint64
bitReaderGetBitsUint64 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word64) |
Read nbits bits into val and update the current position.
getBitsUint8
bitReaderGetBitsUint8 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word8) |
Read nbits bits into val and update the current position.
getPos
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> m Word32 | Returns: The current position of |
Returns the current position of a BitReader instance in bits.
getRemaining
bitReaderGetRemaining Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> m Word32 | Returns: The remaining number of bits of |
Returns the remaining number of bits of a BitReader instance.
getSize
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> m Word32 | Returns: The total number of bits of |
Returns the total number of bits of a BitReader instance.
init
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> ByteString |
|
| -> m () |
Initializes a BitReader instance to read from data. This function
can be called on already initialized instances.
peekBitsUint16
bitReaderPeekBitsUint16 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word16) |
Read nbits bits into val but keep the current position.
peekBitsUint32
bitReaderPeekBitsUint32 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word32) |
Read nbits bits into val but keep the current position.
peekBitsUint64
bitReaderPeekBitsUint64 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word64) |
Read nbits bits into val but keep the current position.
peekBitsUint8
bitReaderPeekBitsUint8 Source #
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m (Bool, Word8) |
Read nbits bits into val but keep the current position.
setPos
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m Bool | Returns: |
Sets the new position of a BitReader instance to pos in bits.
skip
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> Word32 |
|
| -> m Bool | Returns: |
Skips nbits bits of the BitReader instance.
skipToByte
Arguments
| :: (HasCallStack, MonadIO m) | |
| => BitReader |
|
| -> m Bool |
Skips until the next byte.