summaryrefslogtreecommitdiff
path: root/src/base/ftbitmap.c
Commit message (Collapse)AuthorAgeFilesLines
* [base] Fix thinko in previous commit.Werner Lemberg2019-04-231-10/+10
| | | | | | | * src/base/ftbitmap.c (FT_Bitmap_Blend): Check final width, not target pitch. Problem reported by Sender Ghost <lightside@gmx.com>.
* * src/base/ftbitmap.c (FT_Bitmap_Blend): Check target pitch.Werner Lemberg2019-04-221-0/+7
| | | | Problem reported by Sender Ghost <lightside@gmx.com>.
* More documentation updates.Werner Lemberg2019-02-231-1/+1
| | | | In particular, mark the new behaviour of `FT_LOAD_COLOR' as experimental.
* * src/base/ftbitmap.c (FT_Bitmap_Blend): No fractional offsets.Werner Lemberg2019-02-231-22/+1
| | | | | The function only provided a framework without an actual implementation, which this commits removes.
* Update all copyright notices.Werner Lemberg2019-02-231-1/+1
|
* Update copyright years.Werner Lemberg2019-01-221-1/+1
|
* Don't use `trace_' prefix for FT_COMPONENT arguments.Werner Lemberg2018-08-151-1/+1
| | | | | | | | * include/freetype/internal/ftdebug.h (FT_TRACE_COMP, FT_TRACE_COMP_): New auxiliary macros to add `trace_' prefix. (FT_TRACE): Use `FT_TRACE_COMP'. */* (FT_COMPONENT): Updated.
* Fix 32bit build warnings (#54239).Werner Lemberg2018-07-041-6/+6
| | | | | | | * src/base/ftbitmap.c (FT_Bitmap_Blend): Add casts to avoid signed vs. unsigned comparisons. * srb/sfnt/ttcolr.c (tt_face_get_colr_layer): Ditto.
* [base] Add tracing for `FT_Bitmap_Blend'.Werner Lemberg2018-06-171-1/+60
| | | | | | | | * include/freetype/internal/fttrace.h (trace_bitmap): New enumeration. * src/base/ftbitmap.c (FT_COMPONENT): Define. (FT_Bitmap_Blend): Add `FT_TRACE5' calls.
* * src/base/ftbitmap.c (FT_Bitmap_Blend): Avoid integer overflow.Werner Lemberg2018-06-161-2/+5
|
* Add `FT_Bitmap_Blend' API.Werner Lemberg2018-06-161-1/+295
| | | | | | | | Still missing: Support for negative bitmap pitch and subpixel offset of source bitmap. * include/freetype/ftbitmap.h, src/base/ftbitmap.c (FT_Bitmap_Blend): New function.
* [GSoC] src/*.*: Convert block comments to `light' style.Werner Lemberg2018-06-031-16/+16
| | | | | | | | | | | This monster commit was created by applying Nikhil's scripts `docconverter.py' and `markify.py' to all C header and source files, followed up by minor manual clean-up. No change in functionality, of course. I used commit f7419907bc6044b9b7057f9789866426c804ba82 from https://github.com/nikramakrishnan/freetype-docs.git.
* [base] Fix bitmap emboldening.Alexei Podtelezhnikov2018-04-221-4/+6
| | | | | | | | Bug introduced after release 2.8. * src/base/ftbitmap.c (ft_bitmap_assure_buffer): We use `FT_QALLOC_MULT', which doesn't zero out the buffer. Adjust the bitmap copying code to take care of this fact.
* Revert "[base] Fix bitmap copying where the new pitch is smaller."Werner Lemberg2018-04-221-44/+14
| | | | This reverts commit c0f1adedcfaad4f7d2fe912ff4b2933845d61d93.
* [base] Fix bitmap copying where the new pitch is smaller.Werner Lemberg2018-04-221-14/+44
| | | | * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Handle it.
* Update copyright year.Werner Lemberg2018-01-021-1/+1
|
* Fix compiler warnings.Werner Lemberg2017-12-271-16/+14
| | | | | | | * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Make `pitch' and `new_pitch' unsigned. * src/base/ftpsprop.c: Include FT_INTERNAL_POSTSCRIPT_PROPS_H.
* Fix compiler warning (#52640).Werner Lemberg2017-12-111-1/+1
| | | | | * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Remove unused variable.
* Fix access to uninitalized memory (#52613).Werner Lemberg2017-12-081-8/+35
| | | | | | | | | | Also reported as https://bugs.chromium.org/p/chromium/issues/detail?id=791317 * src/base/ftbitmap.c (ft_bitmap_assure_buffer): If increasing the bitmap size needs a larger bitmap buffer, assure that the new memory areas are initialized also.
* Update or fix links to use the https protocol instead of http.Werner Lemberg2017-12-041-1/+1
|
* Fix multiple calls of `FT_Bitmap_Convert'.Werner Lemberg2017-09-051-2/+1
| | | | | | | | | | | | | | | | | | | | | | The documentation of `FT_Bitmap_Convert' says that multiple calls do proper reallocation of the target FT_Bitmap object. However, this failed for the sequence non-empty bitmap empty bitmap non-empty bitmap Reason was that `FT_Bitmap_Convert' only reallocated the bitmap buffer if it became too small; it didn't make the buffer smaller. For an empty bitmap following a non-empty one, only the buffer dimension got set to zero, without deallocation. If the next call was a non-empty buffer again, an assertion in `ft_mem_qrealloc' was triggered. * src/base/ftbitmap.c (FT_Bitmap_Convert): Always reallocate target buffer to the correct size. * docs/CHANGES: Document it.
* Swap `ALLOC_MULT' arguments (#51833).Alexei Podtelezhnikov2017-08-251-1/+1
| | | | | | * src/base/ftbitmap.c (ft_bitmap_assure_buffer): Updated. * src/winfonts/winfnt.c (FNT_Load_Glyph): Updated. * src/raster/ftrend1.c (ft_raster1_render): Updated.
* Update copyright year.Werner Lemberg2017-01-041-1/+1
|
* Replace `foo == NULL' and `foo != NULL' with `!foo' and `foo', resp.Werner Lemberg2016-12-261-1/+1
| | | | Other minor formatting.
* Whitespace.Werner Lemberg2016-02-151-1/+1
|
* Update copyright year.Werner Lemberg2016-01-131-1/+1
|
* [base] Rename `FT_Bitmap_New' to `FT_Bitmap_Init'.Werner Lemberg2015-03-101-2/+12
| | | | | | | * include/ftbitmap.h, src/base/ftbitmap.c: Implement it. Update all callers. * docs/CHANGES: Updated.
* More minor signedness warning fixes.Werner Lemberg2015-02-161-24/+27
| | | | | * src/base/ftbbox.c, src/base/ftbitmap.c, src/base/fttrigon.c, src/base/ftutil.c: Apply.
* Run `src/tools/update-copyright'.Werner Lemberg2015-01-171-1/+1
|
* Uppercase all hex digits for orthogonality.Werner Lemberg2014-12-071-1/+1
|
* * src/base/ftbitmap.c (FT_Bitmap_Convert): Improve.Werner Lemberg2014-11-211-35/+34
| | | | | This commit completes argument checks and adds support for different flow directions.
* * src/base/ftbitmap.c (FT_Bitmap_Copy): Improve.Werner Lemberg2014-11-211-5/+41
| | | | | This commit adds argument checks and support for different flow directions.
* * src/base/ftbitmap.c (FT_Bitmap_New): Check argument.Werner Lemberg2014-11-211-1/+2
|
* Change some fields in `FT_Bitmap' to unsigned type.Werner Lemberg2014-11-211-12/+13
| | | | | | | | | | | | | This doesn't break ABI. * include/ftimage.h (FT_Bitmap): Make `rows', `width', `num_grays', `pixel_mode', and `palette_mode' unsigned types. * src/base/ftbitmap.c: Updated. (FT_Bitmap_Copy): Fix casts. * src/cache/ftcsbits.c, src/raster/ftraster.c, src/sfnt/pngshim.c: Updated.
* Make `FT_Bitmap_Convert' correctly handle negative `pitch' values.Werner Lemberg2014-11-211-28/+35
| | | | | | * src/base/ftbitmap.c (FT_Bitmap_Convert): Always use positive value for the pitch while copying data. Correctly set pitch sign in target bitmap.
* Minor code improvement in `FT_Bitmap_Embolden'.Werner Lemberg2014-11-211-8/+2
| | | | | * src/base/ftbitmap.c (FT_Bitmap_Embolden) <FT_PIXEL_MODE_GRAY[24]>: Fix thinko.
* Minor documentation improvements and whitespace.Werner Lemberg2014-11-211-6/+13
|
* Trailing space.Alexei Podtelezhnikov2014-11-191-1/+1
|
* * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Refactor.Alexei Podtelezhnikov2014-08-081-9/+9
|
* Minor.Werner Lemberg2014-07-171-4/+7
|
* [base] Further clean up color bitmap conversion.Alexei Podtelezhnikov2014-07-141-23/+10
| | | | | * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Stop using FT_MulFix and FT_DivFix since all calculations fit into 32 bits.
* [base] Clean up bitmap conversion.Alexei Podtelezhnikov2014-07-111-6/+5
| | | | | * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use appropriate FT_DivFix and remove superfluous upscaling.
* Fix clang static analyzer and compiler warnings.Sean McBride2014-02-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/autofit/afhints.c (af_glyph_hints_align_weak_points), src/autofit/afloader (af_loader_load_g) <FT_GLYPH_FORMAT_COMPOSITE>, src/base/ftcalc.c (FT_MSB), src/base/ftoutln.c (FT_Outline_Decompose), src/bdf/bdfdrivr.c (bdf_interpret_style), src/cff/cffparse.c (cff_parse_integer), src/cid/cidparse.c (cid_parser_new), src/pfr/pfrload.c (pfr_phy_font_load), src/raster/ftraster.c (Decompose_Curve), src/sfnt/sfdriver.c (sfnt_get_ps_name), src/sfnt/ttcmap.c (tt_cmap12_next, tt_cmap13_next), src/smooth/ftgrays.c (gray_hline): Remove dead code. * src/autofit/afmodule.c (af_property_get_face_globals, af_property_set, af_property_get), src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Make functions static. * src/base/ftobjs.c (ft_remove_renderer): Protect against library == NULL. (ft_property_do): Make function static. * src/base/ftrfork.c: Include `ftbase.h'. * src/sfnt/ttsbit.c (tt_face_load_sbix_image) [!FT_CONFIG_OPTION_USE_PNG], src/type1/t1gload.c (T1_Compute_Max_Advance): Avoid compiler warning. * src/truetype/ttinterp.c (TT_New_Context): Reduce scope of variable.
* Minor.Werner Lemberg2013-07-311-1/+1
|
* 2013-07-30 Behdad Esfahbod <behdad@google.com>suzuki toshiya2013-07-301-0/+4
| | | | | | | Prevent division by zero by a transparent color. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Return 0 immediately, when alpha channel is zero.
* Fix compiler warnings.Werner Lemberg2013-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * include/freetype/internal/ftmemory.h: Decorate memory allocation macros with `FT_Long' where appropriate. Remove duplicate of FT_MEM_QRENEW_ARRAY definition. * src/base/ftbitmap.c (ft_gray_for_premultiplied_srgb_bgra): Use cast. * src/base/ftobjs.c: Add warning disabling pragma for MSVC while including `md5.c'. * src/cff/cf2intrp.c (cf2_interpT2CharString) <cf2_cmdESC>: Add cast. * src/sfnt/ttsbit.c (tt_sbit_decoder_load_compound): Fix casts. (tt_sbit_decoder_load_bitmap): Beautification. * src/smooth/ftsmooth.c (ft_smooth_render_generic): Initialize variables (earlier). * src/truetype/ttgload.c (TT_Process_Simple_Glyph): Pacify compiler. * src/truetype/ttgxvar.c (TT_Get_MM_Var): Use unsigned constants where appropriate. * src/type1/t1load.c (T1_Get_MM_Var): Ditto.
* Add support for color embedded bitmaps (eg. color emoji).Behdad Esfahbod2013-05-291-0/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A new load flag, FT_LOAD_COLOR, makes FreeType load color embedded-bitmaps, following this draft specification https://color-emoji.googlecode.com/git/specification/v1.html which defines two new SFNT tables, `CBDT' and `CBLC' (named and modeled after `EBDT' and `EBLC', respectively). The color bitmaps are stored in the new FT_PIXEL_MODE_BGRA format to represent BGRA pre-multiplied sRGB images. If PNG support is available, PNG color images as defined in the same proposed specification are supported also. Note that color bitmaps are converted to grayscale if client didn't ask for color. * builds/unix/configure.raw: Search for libpng. Add `--without-png' option. * devel/ftoption.h, include/freetype/config/ftoption.h (FT_CONFIG_OPTION_USE_PNG): New macro. * include/freetype/freetype.h (FT_LOAD_COLOR): New load flag. * include/freetype/ftimage.h (FT_Pixel_Mode): Add `FT_PIXEL_MODE_BGRA'. * include/freetype/tttags.h (TTAG_CBDT, TTAG_CBLC): New tags. * src/base/ftbitmap.c (FT_Bitmap_Embolden): Updated. (ft_gray_for_premultiplied_srgb_bgra): New function. (FT_Bitmap_Convert): Handle FT_PIXEL_MODE_BGRA. * src/sfnt/pngshim.c, src/sfnt/pngshim.h: New files. * src/sfnt/sfnt.c: Include `pngshim.c'. * src/sfnt/ttsbit.c: Include FT_BITMAP_H and `pngshim.h' (tt_face_load_eblc): Load `CBLC'. (tt_sbit_decoder_init): Load `CBDT'. (tt_sbit_decoder_alloc_bitmap): Pass load flags to select between color and grayscale bitmaps. Set `num_grays'. This is used by `ftview' to choose the blending algorithm. (tt_sbit_decoder_load_byte_aligned, tt_sbit_decoder_load_bit_aligned, tt_sbit_decoder_load_compound, tt_sbit_decoder_load_image): Pass load flag. s/write/pwrite/. Don't call `tt_sbit_decoder_alloc_bitmap'. Updated. (tt_sbit_decoder_load_png) [FT_CONFIG_OPTION_USE_PNG]: New function. (tt_sbit_decoder_load_bitmap): Pass load flag. Handle new glyph formats 17, 18, and 19. Call `tt_sbit_decoder_alloc_bitmap'. Flatten color bitmaps if necessary. (tt_face_load_sbit_image): Updated. * src/sfnt/rules.mk (SFNT_DRV_SRC): Add `pngshim.c'. * docs/CHANGES: Updated.
* */*: Use `FT_THROW'.Werner Lemberg2013-03-141-11/+13
| | | | | | | | | | This is essentially a mechanical conversion, adding inclusion of `FT_INTERNAL_DEBUG_H' where necessary, and providing the macros for stand-alone compiling modes of the rasterizer modules. To convert the remaining occurrences of FT_Err_XXX and friends it is necessary to rewrite the code. Note, however, that it doesn't harm if some cases are not handled since FT_THROW is a no-op.
* Remove trailing spaces.suzuki toshiya2012-01-171-1/+1
|
* Fix compiler warning.Werner Lemberg2011-11-141-2/+2
|