struct PNG::PackedData(T)
- PNG::PackedData(T)
- Struct
- Value
- Object
Overview
PackedData is a wrapper around a Slice data which performs R/W operations on data packed within the type
Included Modules
- Indexable::Mutable(T)
Defined in:
png/packed_data.crConstructors
- .new(size : Int, depth : UInt8, begin_bit : Int32 = 0)
- .new(data : Slice(T), depth : UInt8, size : Int32 | Nil = nil, begin_bit : Int32 = 0)
Instance Method Summary
- #[](range : Range)
- #clone
- #data : Slice(T)
- #data=(data : Slice(T))
- #depth : UInt8
-
#size
Returns the number of elements in this container.
-
#unsafe_fetch(index : Int)
Returns the element at the given index, without doing any bounds check.
-
#unsafe_put(index : Int, value : T)
Sets the element at the given index to value, without doing any bounds check.
- #word_bit(index : Int)
Constructor Detail
Instance Method Detail
Returns the number of elements in this container.
Returns the element at the given index, without doing any bounds check.
Indexable
makes sure to invoke this method with index in 0...size
,
so converting negative indices to positive ones is not needed here.
Clients never invoke this method directly. Instead, they access
elements with #[](index)
and #[]?(index)
.
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.
Sets the element at the given index to value, without doing any bounds check.
Indexable::Mutable
makes sure to invoke this method with index in
0...size
, so converting negative indices to positive ones is not needed
here.
Clients never invoke this method directly. Instead, they modify elements
with #[]=(index, value)
.
This method should only be directly invoked if you are absolutely sure the index is in bounds, to avoid a bounds check for a small boost of performance.