Skip to content

Commit

Permalink
log more drawing primitives
Browse files Browse the repository at this point in the history
  • Loading branch information
tonycoz committed Aug 14, 2012
1 parent 37f231b commit dc95a36
Showing 1 changed file with 50 additions and 4 deletions.
54 changes: 50 additions & 4 deletions draw.c
Original file line number Diff line number Diff line change
Expand Up @@ -237,6 +237,10 @@ of angles in degrees from d1 to d2, with the color.
void
i_arc(i_img *im, i_img_dim x, i_img_dim y,double rad,double d1,double d2,const i_color *val) {
i_int_hlines hlines;
dIMCTXim(im);

im_log((aIMCTX,1,"i_arc(im %p,(x,y)=(" i_DFp "), rad %f, d1 %f, d2 %f, col %p)",
im, i_DFcp(x, y), rad, d1, d2, val));

i_int_init_hlines_img(&hlines, im);

Expand Down Expand Up @@ -265,6 +269,10 @@ of angles in degrees from d1 to d2, with the fill object.
void
i_arc_cfill(i_img *im, i_img_dim x, i_img_dim y,double rad,double d1,double d2,i_fill_t *fill) {
i_int_hlines hlines;
dIMCTXim(im);

im_log((aIMCTX,1,"i_arc_cfill(im %p,(x,y)=(" i_DFp "), rad %f, d1 %f, d2 %f, fill %p)",
im, i_DFcp(x, y), rad, d1, d2, fill));

i_int_init_hlines_img(&hlines, im);

Expand Down Expand Up @@ -364,6 +372,10 @@ i_arc_aa(i_img *im, double x, double y, double rad, double d1, double d2,
const i_color *val) {
double *xvals, *yvals;
int count;
dIMCTXim(im);

im_log((aIMCTX,1,"i_arc_aa(im %p,(x,y)=(%f,%f), rad %f, d1 %f, d2 %f, col %p)",
im, x, y, rad, d1, d2, val));

arc_poly(&count, &xvals, &yvals, x, y, rad, d1, d2);

Expand All @@ -390,6 +402,10 @@ i_arc_aa_cfill(i_img *im, double x, double y, double rad, double d1, double d2,
i_fill_t *fill) {
double *xvals, *yvals;
int count;
dIMCTXim(im);

im_log((aIMCTX,1,"i_arc_aa_cfill(im %p,(x,y)=(%f,%f), rad %f, d1 %f, d2 %f, fill %p)",
im, x, y, rad, d1, d2, fill));

arc_poly(&count, &xvals, &yvals, x, y, rad, d1, d2);

Expand Down Expand Up @@ -573,6 +589,9 @@ i_circle_out(i_img *im, i_img_dim xc, i_img_dim yc, i_img_dim r,
int error;
dIMCTXim(im);

im_log((aIMCTX, 1, "i_circle_out(im %p, centre(" i_DFp "), rad %" i_DF ", col %p)\n",
im, i_DFcp(xc, yc), i_DFc(r), col));

im_clear_error(aIMCTX);

if (r < 0) {
Expand Down Expand Up @@ -687,6 +706,10 @@ i_arc_out(i_img *im, i_img_dim xc, i_img_dim yc, i_img_dim r,
i_img_dim seg2 = scale * 4;
i_img_dim seg3 = scale * 6;
i_img_dim seg4 = scale * 8;
dIMCTXim(im);

im_log((aIMCTX,1,"i_arc_out(im %p,centre(" i_DFp "), rad %" i_DF ", d1 %f, d2 %f, col %p)",
im, i_DFcp(xc, yc), i_DFc(r), d1, d2, col));

im_clear_error(aIMCTX);

Expand Down Expand Up @@ -825,6 +848,9 @@ i_circle_out_aa(i_img *im, i_img_dim xc, i_img_dim yc, i_img_dim r, const i_colo
int orig_alpha = col->channel[3];
dIMCTXim(im);

im_log((aIMCTX,1,"i_circle_out_aa(im %p,centre(" i_DFp "), rad %" i_DF ", col %p)",
im, i_DFcp(xc, yc), i_DFc(r), col));

im_clear_error(aIMCTX);
if (r <= 0) {
im_push_error(aIMCTX, 0, "arc: radius must be non-negative");
Expand Down Expand Up @@ -936,6 +962,9 @@ i_arc_out_aa(i_img *im, i_img_dim xc, i_img_dim yc, i_img_dim r, double d1, doub
i_img_dim seg4 = scale * 8;
dIMCTXim(im);

im_log((aIMCTX,1,"i_arc_out_aa(im %p,centre(" i_DFp "), rad %" i_DF ", d1 %f, d2 %f, col %p)",
im, i_DFcp(xc, yc), i_DFc(r), d1, d2, col));

im_clear_error(aIMCTX);
if (r <= 0) {
im_push_error(aIMCTX, 0, "arc: radius must be non-negative");
Expand Down Expand Up @@ -1058,7 +1087,9 @@ Outlines the box from (x1,y1) to (x2,y2) inclusive with I<color>.
void
i_box(i_img *im,i_img_dim x1,i_img_dim y1,i_img_dim x2,i_img_dim y2,const i_color *val) {
i_img_dim x,y;
mm_log((1,"i_box(im* %p, p1(" i_DFp "), p2(" i_DFp "),val %p)\n",
dIMCTXim(im);

im_log((aIMCTX, 1,"i_box(im* %p, p1(" i_DFp "), p2(" i_DFp "),val %p)\n",
im, i_DFcp(x1,y1), i_DFcp(x2,y2), val));
for(x=x1;x<x2+1;x++) {
i_ppix(im,x,y1,val);
Expand All @@ -1085,8 +1116,9 @@ void
i_box_filled(i_img *im,i_img_dim x1,i_img_dim y1,i_img_dim x2,i_img_dim y2, const i_color *val) {
i_img_dim x, y, width;
i_palidx index;
dIMCTXim(im);

mm_log((1,"i_box_filled(im* %p, p1(" i_DFp "), p2(" i_DFp "),val %p)\n",
im_log((aIMCTX,1,"i_box_filled(im* %p, p1(" i_DFp "), p2(" i_DFp "),val %p)\n",
im, i_DFcp(x1, y1), i_DFcp(x2,y2) ,val));

if (x1 > x2 || y1 > y2
Expand Down Expand Up @@ -1145,8 +1177,9 @@ color.
int
i_box_filledf(i_img *im,i_img_dim x1,i_img_dim y1,i_img_dim x2,i_img_dim y2, const i_fcolor *val) {
i_img_dim x, y, width;
dIMCTXim(im);

mm_log((1,"i_box_filledf(im* %p, p1(" i_DFp "), p2(" i_DFp "),val %p)\n",
im_log((aIMCTX, 1,"i_box_filledf(im* %p, p1(" i_DFp "), p2(" i_DFp "),val %p)\n",
im, i_DFcp(x1, y1), i_DFcp(x2, y2), val));

if (x1 > x2 || y1 > y2
Expand Down Expand Up @@ -1203,8 +1236,9 @@ Fills the box from (x1,y1) to (x2,y2) inclusive with fill.
void
i_box_cfill(i_img *im,i_img_dim x1,i_img_dim y1,i_img_dim x2,i_img_dim y2,i_fill_t *fill) {
i_render r;
dIMCTXim(im);

mm_log((1,"i_box_cfill(im* %p, p1(" i_DFp "), p2(" i_DFp "), fill %p)\n",
im_log((aIMCTX,1,"i_box_cfill(im* %p, p1(" i_DFp "), p2(" i_DFp "), fill %p)\n",
im, i_DFcp(x1, y1), i_DFcp(x2,y2), fill));

++x2;
Expand Down Expand Up @@ -1823,6 +1857,9 @@ i_flood_fill(i_img *im, i_img_dim seedx, i_img_dim seedy, const i_color *dcol) {
i_color val;
dIMCTXim(im);

im_log((aIMCTX, 1, "i_flood_fill(im %p, seed(" i_DFp "), col %p)",
im, i_DFcp(seedx, seedy), dcol));

im_clear_error(aIMCTX);
if (seedx < 0 || seedx >= im->xsize ||
seedy < 0 || seedy >= im->ysize) {
Expand Down Expand Up @@ -1865,6 +1902,9 @@ i_flood_cfill(i_img *im, i_img_dim seedx, i_img_dim seedy, i_fill_t *fill) {
i_color val;
dIMCTXim(im);

im_log((aIMCTX, 1, "i_flood_cfill(im %p, seed(" i_DFp "), fill %p)",
im, i_DFcp(seedx, seedy), fill));

im_clear_error(aIMCTX);

if (seedx < 0 || seedx >= im->xsize ||
Expand Down Expand Up @@ -1908,6 +1948,9 @@ i_flood_fill_border(i_img *im, i_img_dim seedx, i_img_dim seedy, const i_color *
i_img_dim x, y;
dIMCTXim(im);

im_log((aIMCTX, 1, "i_flood_cfill(im %p, seed(" i_DFp "), dcol %p, border %p)",
im, i_DFcp(seedx, seedy), dcol, border));

im_clear_error(aIMCTX);
if (seedx < 0 || seedx >= im->xsize ||
seedy < 0 || seedy >= im->ysize) {
Expand Down Expand Up @@ -1948,6 +1991,9 @@ i_flood_cfill_border(i_img *im, i_img_dim seedx, i_img_dim seedy, i_fill_t *fill
struct i_bitmap *btm;
dIMCTXim(im);

im_log((aIMCTX, 1, "i_flood_cfill_border(im %p, seed(" i_DFp "), fill %p, border %p)",
im, i_DFcp(seedx, seedy), fill, border));

im_clear_error(aIMCTX);

if (seedx < 0 || seedx >= im->xsize ||
Expand Down

0 comments on commit dc95a36

Please sign in to comment.