* Implemented encoding of 16 bits per pixel bitmaps
* Add unit tests for 16 bit encoding and Bgra5551 conversion
* Add additional Bgra5551 pixel conversion tests
* Add Bgra5551 tests for Short2/4 and HalfVector2/4
* Use scaled vector conversion
* Bitmap encoder will now write a V3 header as default.
Introduces a new encoder option `SupportTransparency`: With this option a V4 header will be written with BITFIELDS compression.
* Add 4 and 16 bit images to the Identify test
* Add some useful links for bitmap documentation
* Add 32 bpp images to the Identify test
* Added further information on what will change for the encoder, if SupportTransparency is used.
* No longer throws when DrawImage source does not overlap target
Previously, when DrawImage was used to overlay an image, in cases where the source image did not overlap the target image, a very confusing error was reported: "System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: MaxDegreeOfParallelism"
Now, when this case happens, the DrawImage method will simply not affect the target image, which is the same way FillRegionProcessor handles such cases.
ParallelHelper.IterRows also now does more validation of the input rectangle so that any further cases of this kind of problem throw a more relvant exception. Note I switched from DebugGuard to Guard because IterRows is a public API and thus should always validate its inputs.
Fixes#875
* Refines DrawImage non-overlap error logic
Adresses PR feedback in #877.
Changes DrawImage shortcut to be less than or equal to. Also changes maxX calculation to use `Right` over `Width`. This is a semantic change that reflects intention better. No actual change because Top,Left for that rectanngle should always be 0,0.
And adds more informative argument names to ParallelHelper.IterRows error message.
* Non-overlapping DrawImage now throws
Adressing PR feedback from #877
DrawImage now throws when the source image does not overlap, with a useful error message.
Also improved the error messages for IterRows (and added validation to the other IterRows method)
* DrawImage overlap test changed to support RELEASE
The tests on the CI server are run in RELEASE which wrap the expected exception with an ImageProcessingException.
* Adress feedback for DrawImage exception
DrawImage throws an ImageProcessor exception which makes it easier to catch.
And reverted IterRows to use Guard helpers
* first version of sliding window adaptive histogram equalization
* going now from top to bottom of the image, added more comments
* using memory allocator to create the histogram and the cdf
* mirroring rows which exceeds the borders
* mirroring also left and right borders
* gridsize and cliplimit are now parameters of the constructor
* using Parallel.For
* only applying clipping once, effect applying it multiple times is neglectable
* added abstract base class for histogram equalization, added option to enable / disable clipping
* small improvements
* clipLimit now in percent of the total number of pixels in the grid
* optimization: only calculating the cdf until the maximum histogram index
* fix: using configuration from the parameter instead of the default
* removed unnecessary loops in CalculateCdf, fixed typo in method name AddPixelsToHistogram
* added different approach for ahe: image is split up in tiles, cdf is computed for each tile. Grey value will be determined by interpolating between 4 tiles
* simplified interpolation between the tiles
* number of tiles is now fixed and depended on the width and height of the image
* moved calculating LUT's into separate method
* number of tiles is now part of the options and will be used with the sliding window approach also, so both methods are comparable
* removed no longer valid xml comment
* attempt fixing the borders
* refactoring to improve readability
* linear interpolation in the border tiles
* refactored processing the borders into separate methods
* fixing corner tiles
* fixed build errors
* fixing mistake during merge from upstream: setting test images to "update Resize reference output because of improved ResizeKernelMap calculations"
* using Parallel.ForEach for all inner tile calculations
* using Parallel.ForEach to calculate the lookup tables
* re-using pre allocated pixel row in GetPixelRow
* fixed issue with the border tiles, when tile width != tile height
* changed default value for ClipHistogram to false again
* alpha channel from the original image is now preserved
* added unit tests for adaptive histogram equalization
* Update External
* 2x faster adaptive tiled processor
* Remove double indexing and bounds checks
* Begin optimizing the global histogram
* Parallelize GlobalHistogramEqualizationProcessor
* Moving sliding window from left to right instead of from top to bottom
* The tile width and height is again depended on the image width: image.Width / Tiles
* Removed keeping track of the maximum histogram position
* Updated reference image for sliding window AHE for moving the sliding window from left to right
* Removed unnecessary call to Span.Clear(), all values are overwritten anyway
* Revert "Moving sliding window from left to right instead of from top to bottom"
This reverts commit 8f19e5edd2.
# Conflicts:
# src/ImageSharp/Processing/Processors/Normalization/AdaptiveHistEqualizationSWProcessor.cs
* Split GetPixelRow in two version: one which mirrors the edges (only needed in the borders of the images) and one which does not
* Refactoring and cleanup sliding window processor
* Added an upper limit of 100 tiles
* Performance tweaks
* Update External
* Read from underlying stream less often
* Update benchmark dependencies
* Experimental mango port
Currently broken
* Populate table, 64byte buffer
Still broken.
* Baseline, non RST works
* 15/19 baseline tests pass now.
* Optimize position change.
* 18/19 pass
* 19/19 baseline decoded
* Can now decode all images.
* Now faster and much cleaner.
* Cleanup
* Fix reader, update benchmarks
* Update dependencies
* Remove unused method
* No need to clean initial buffer
* Remove bounds check on ReadByte()
* Refactor from feedback
* Remove multiple premultiplication.
* Use in DenseMatrix everywhere.
* Make private
* Dont convert vector row on first pass
* Remove incorrectly assigned alpha.
* Remove boxing.
* Use correct min row.
* Reorder parameters
* Correctly handle alpha component.
* Update tests
* Use dedicated methods over branching.