Lines Matching refs:y
13 static inline void PetscImageSetClip(PetscImage img, int x, int y, int w, int h) in PetscImageSetClip() argument
16 img->clip[1] = PetscClipInterval(y, 0, img->h - 1); /* ymin */ in PetscImageSetClip()
18 img->clip[3] = PetscClipInterval(y + h, 0, img->h); /* ymax+1 */ in PetscImageSetClip()
24 int y, ys = img->clip[1], ye = img->clip[3]; in PetscImageClear() local
25 for (y = ys; y < ye; y++) in PetscImageClear()
26 for (x = xs; x < xe; x++) img->buffer[y * img->w + x] = 0; in PetscImageClear()
29 static inline void PetscImageDrawPixel(PetscImage img, int x, int y, int c) in PetscImageDrawPixel() argument
32 if (y < img->clip[1] || y >= img->clip[3]) return; in PetscImageDrawPixel()
33 img->buffer[y * img->w + x] = (unsigned char)c; in PetscImageDrawPixel()
75 static inline void PetscImageDrawRectangle(PetscImage img, int x, int y, int w, int h, int c) in PetscImageDrawRectangle() argument
78 int ys = PetscMax(y, img->clip[1]), ye = PetscMin(y + h, img->clip[3]); in PetscImageDrawRectangle()
80 for (y = ys; y < ye; y++) in PetscImageDrawRectangle()
81 for (x = xs; x < xe; x++) img->buffer[y * img->w + x] = (unsigned char)c; in PetscImageDrawRectangle()
87 int x, y, s, a2 = w * w, b2 = h * h; in PetscImageDrawEllipse() local
88 for (x = 0, y = h, s = 2 * b2 + a2 * (1 - 2 * h); b2 * x <= a2 * y; x++) { in PetscImageDrawEllipse()
89 PetscImageDrawLine(img, xc + x, yc + y, xc - x, yc + y, c); in PetscImageDrawEllipse()
90 PetscImageDrawLine(img, xc + x, yc - y, xc - x, yc - y, c); in PetscImageDrawEllipse()
92 s += 4 * a2 * (1 - y); in PetscImageDrawEllipse()
93 y--; in PetscImageDrawEllipse()
97 for (x = w, y = 0, s = 2 * a2 + b2 * (1 - 2 * w); a2 * y <= b2 * x; y++) { in PetscImageDrawEllipse()
98 PetscImageDrawLine(img, xc + x, yc + y, xc - x, yc + y, c); in PetscImageDrawEllipse()
99 PetscImageDrawLine(img, xc + x, yc - y, xc - x, yc - y, c); in PetscImageDrawEllipse()
104 s += a2 * ((4 * y) + 6); in PetscImageDrawEllipse()
115 int lc, rc = 0, lx, rx = 0, xx, y, c; in PetscImageDrawTriangle() local
163 for (y = y_1; y <= y_2; y++) { in PetscImageDrawTriangle()
166 lfrac = ((float)(y - y_1)) * R_y2_y1; in PetscImageDrawTriangle()
170 rfrac = ((float)(y - y_1)) * R_y3_y1; in PetscImageDrawTriangle()
179 PetscImageDrawPixel(img, xx, y, c); in PetscImageDrawTriangle()
184 PetscImageDrawPixel(img, xx, y, c); in PetscImageDrawTriangle()
188 PetscImageDrawPixel(img, lx, y, c); in PetscImageDrawTriangle()
207 for (y = y_2; y <= y_3; y++) { in PetscImageDrawTriangle()
210 lfrac = ((float)(y - y_2)) * R_y3_y2; in PetscImageDrawTriangle()
214 rfrac = ((float)(y - y_1)) * R_y3_y1; in PetscImageDrawTriangle()
223 PetscImageDrawPixel(img, xx, y, c); in PetscImageDrawTriangle()
228 PetscImageDrawPixel(img, xx, y, c); in PetscImageDrawTriangle()
232 PetscImageDrawPixel(img, lx, y, c); in PetscImageDrawTriangle()
338 static inline void PetscImageDrawText(PetscImage img, int x, int y, int c, const char text[]) in PetscImageDrawText() argument
345 …Bitmap[chr - 32][i] & (1 << (tw - 1 - j))) PetscImageDrawPixel(img, x + j + k * tw, y + i - th, c); in PetscImageDrawText()