Rename GIL_NONWORD_POINTER_ALIGNMENT_SUPPORTED
to BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS.
Undefine BOOST_GIL_CONFIG_HAS_UNALIGNED_ACCESS by default and document it.
If defined, issue warning or error, depending on target platform.
This changes how packed_channel_reference_base-based channels perform
access - aligned memory access by default.
This also fixes undefined behavior detected by UBSan in some test cases.
Copied from Boost.Geometry, including original tests, with some non-functional
modifications explained in the comments.
The utility can be used where it is important to avoid integer overflow.
Import the selection of integer types into boost::gil namespace,
and move from channel.hpp to typedefs.hpp for easier access.
Replace bits32f with float32_t and bits64f with float64_t
- kept as alias of scoped_channel_value.
Move float64_t (bits64f) to typedefs.hpp.
Replace the four {float|double}_{zero|one} min/max channel values
with float_point_zero and float_point_one templates.
Replace <boost/cstdint,hpp> with C++11 <cstdint>.
Introduce preference of using declaration instead of typedef.
Reformat typedefs.hpp to take advantage of the using declaration
- works much better for left-to-right reading, alias name as
most important detail comes first.
Add some of missing #include typedefs.hpp, sort some headers.
Add cast to explicitly indicate val promotion to at least
32-bit integer. The arithmetic operations are performed on
int of higher rank type. Finally, since the result value is
guaranteed to fit range of 8/16-bit result integer type,
it is safe to cast.
This should make it clearer for a reader that subtleties
of implicit promotions and conversions have been considered.
- unused parameter
- shadowed typedef
- implicit conversion changes signedness:
int to signed <int>
int to unsigned <int>
Note, arithmetic op is performed on int as higher rank type
with result is in range of return type, safe to cast.
Pre-defined packed_channel_reference_base::set::num_values already
represents the value.
Fixes warning C4458: declaration of 'num_values' hides class member
Currently GIL refuses to load TARGA files whose screen origin is
in the upper left-hand corner. See Trac ticket 8429 for sample
image files created from GIMP 2.
Currently GIL refuses to load TARGA files whose screen origin is
in the upper left-hand corner. See Trac ticket 8429 for sample
image files created from GIMP 2.