r-lib / ragg

Compare fc009c7 ... +4 ... 434861c

Coverage Reach
src/agg/include/agg_rasterizer_cells_aa.h src/agg/include/agg_scanline_storage_aa.h src/agg/include/agg_math_stroke.h src/agg/include/agg_array.h src/agg/include/agg_pixfmt_rgba.h src/agg/include/agg_span_image_filter_rgba.h src/agg/include/agg_font_cache_manager.h src/agg/include/agg_path_storage_integer.h src/agg/include/agg_rasterizer_sl_clip.h src/agg/include/agg_scanline_storage_bin.h src/agg/include/agg_rasterizer_scanline_aa.h src/agg/include/agg_path_storage.h src/agg/include/agg_color_rgba.h src/agg/include/agg_pixfmt_rgb.h src/agg/include/agg_renderer_scanline.h src/agg/include/agg_renderer_base.h src/agg/include/agg_curves.h src/agg/include/agg_rendering_buffer.h src/agg/include/agg_basics.h src/agg/include/agg_conv_curve.h src/agg/include/agg_scanline_p.h src/agg/include/agg_conv_adaptor_vcgen.h src/agg/include/agg_scanline_u.h src/agg/include/agg_span_image_filter.h src/agg/include/agg_trans_affine.h src/agg/include/agg_scanline_bin.h src/agg/include/agg_image_accessors.h src/agg/include/agg_ellipse.h src/agg/include/agg_vertex_sequence.h src/agg/include/agg_image_filters.h src/agg/include/agg_shorten_path.h src/agg/include/agg_span_interpolator_linear.h src/agg/include/util/agg_color_conv.h src/agg/include/agg_font_freetype.h src/agg/include/agg_dda_line.h src/agg/include/agg_math.h src/agg/include/agg_gamma_lut.h src/agg/include/agg_bitset_iterator.h src/agg/include/agg_conv_transform.h src/agg/include/agg_rasterizer_scanline_aa_nogamma.h src/agg/include/agg_clip_liang_barsky.h src/agg/include/agg_conv_stroke.h src/agg/include/agg_conv_dash.h src/agg/include/agg_vcgen_stroke.h src/agg/include/agg_span_allocator.h src/agg/include/agg_gamma_functions.h src/agg/include/agg_vcgen_dash.h src/agg/src/agg_font_freetype.cpp src/agg/src/agg_curves.cpp src/agg/src/agg_vcgen_stroke.cpp src/agg/src/agg_trans_affine.cpp src/agg/src/agg_vcgen_dash.cpp src/agg/src/agg_image_filters.cpp src/AggDevice.h src/text_renderer.h src/init_device.h src/png_dev.cpp src/AggDevicePng.h src/AggDeviceTiff.h src/tiff_dev.cpp src/AggDeviceJpeg.h src/AggDeviceCapture.h src/jpeg_dev.cpp src/AggDevice16.h src/ppm_dev.cpp src/AggDevicePpm.h src/capture_dev.cpp src/ragg.h src/init.cpp R/agg_dev.R R/aaa.R

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.

Showing 4 of 6 files from the diff.

@@ -58,7 +58,7 @@
Loading
58 58
    
59 59
    
60 60
    //Now writing image to the file one strip at a time
61 -
    for (int32 row = 0; row < this->height; row++) {
61 +
    for (int32_t row = 0; row < this->height; row++) {
62 62
      if (TIFFWriteScanline(out, buffer_rows.row_ptr(row), row, 0) < 0) {
63 63
        (void) TIFFClose(out);
64 64
        return false;
@@ -128,7 +128,7 @@
Loading
128 128
    
129 129
    
130 130
    //Now writing image to the file one strip at a time
131 -
    for (int32 row = 0; row < this->height; row++) {
131 +
    for (int32_t row = 0; row < this->height; row++) {
132 132
      if (TIFFWriteScanline(out, buffer_rows.row_ptr(row), row, 0) < 0) {
133 133
        (void) TIFFClose(out);
134 134
        return false;

@@ -22,6 +22,8 @@
Loading
22 22
23 23
#include "util/agg_color_conv.h"
24 24
25 +
static const int MAX_CELLS = 1 << 20;
26 +
25 27
/* Base class for graphic device interface to AGG. See AggDevice.cpp for 
26 28
 * implementation details. 
27 29
 * 
@@ -309,7 +311,7 @@
Loading
309 311
  
310 312
  lwd *= lwd_mod;
311 313
  
312 -
  agg::rasterizer_scanline_aa<> ras;
314 +
  agg::rasterizer_scanline_aa<> ras(MAX_CELLS);
313 315
  ras.clip_box(clip_left, clip_top, clip_right, clip_bottom);
314 316
  agg::scanline_p8 slp;
315 317
  agg::ellipse e1;
@@ -410,7 +412,7 @@
Loading
410 412
  
411 413
  lwd *= lwd_mod;
412 414
  
413 -
  agg::rasterizer_scanline_aa<> ras;
415 +
  agg::rasterizer_scanline_aa<> ras(MAX_CELLS);
414 416
  ras.clip_box(clip_left, clip_top, clip_right, clip_bottom);
415 417
  agg::scanline_p8 slp;
416 418
  agg::path_storage poly;
@@ -493,7 +495,7 @@
Loading
493 495
  lwd *= lwd_mod;
494 496
  
495 497
  agg::scanline_u8 sl;
496 -
  agg::rasterizer_scanline_aa<> ras;
498 +
  agg::rasterizer_scanline_aa<> ras(MAX_CELLS);
497 499
  ras.clip_box(clip_left, clip_top, clip_right, clip_bottom);
498 500
  agg::path_storage ps;
499 501
  ps.remove_all();
@@ -537,7 +539,7 @@
Loading
537 539
  
538 540
  lwd *= lwd_mod;
539 541
  
540 -
  agg::rasterizer_scanline_aa<> ras;
542 +
  agg::rasterizer_scanline_aa<> ras(MAX_CELLS);
541 543
  ras.clip_box(clip_left, clip_top, clip_right, clip_bottom);
542 544
  agg::scanline_p8 slp;
543 545
  agg::path_storage path;

@@ -7,6 +7,15 @@
Loading
7 7
    'px' = 1,
8 8
    stop('Unknown unit. Please use either px, in, cm, or, mm', call. = FALSE)
9 9
  )
10 +
  max_dim <- getOption('ragg.max_dim', 5e4)
11 +
  if (any(dims > max_dim)) {
12 +
    stop(
13 +
      'One or both dimensions exceed the maximum (', max_dim, 'px).\n', 
14 +
      '- Use `options(ragg.max_dim = ...)` to change the max\n',
15 +
      '  Warning: May cause the R session to crash',
16 +
      call. = FALSE
17 +
    )
18 +
  }
10 19
  as.integer(dims)
11 20
}
12 21

@@ -24,6 +24,9 @@
Loading
24 24
25 25
#define END_CPP                                                                \
26 26
}                                                                              \
27 +
catch (const std::bad_alloc&) {                                                \
28 +
  Rf_error("Memory allocation error. You are likely trying to create too large an image"); \
29 +
}                                                                              \
27 30
catch (std::exception & e) {                                                   \
28 31
  Rf_error("C++ exception: %s", e.what());                                     \
29 32
}                                                                              \

Learn more Showing 2 files with coverage changes found.

Changes in src/init_device.h
+10
+7
Loading file...
Changes in src/AggDevice.h
-18
+18
Loading file...
Files Coverage
aaa.R -22.31% 70.00%
agg_dev.R 73.56%
Folder Totals (2 files) 72.90%
Project Totals (71 files) 69.44%
Loading