draw_point.c 335 B

12345678910111213141516
  1. #include <math.h>
  2. #include "pngdriver.h"
  3. void PNG_draw_point(double fx, double fy)
  4. {
  5. int x = (int) floor(fx + 0.5);
  6. int y = (int) floor(fy + 0.5);
  7. if (x < png.clip_left || x >= png.clip_rite || y < png.clip_top || y >= png.clip_bot)
  8. return;
  9. png.grid[y * png.width + x] = png.current_color;
  10. png.modified = 1;
  11. }