Lines Matching refs:img

13 static inline void PetscImageSetClip(PetscImage img, int x, int y, int w, int h)  in PetscImageSetClip()  argument
15 img->clip[0] = PetscClipInterval(x, 0, img->w - 1); /* xmin */ in PetscImageSetClip()
16 img->clip[1] = PetscClipInterval(y, 0, img->h - 1); /* ymin */ in PetscImageSetClip()
17 img->clip[2] = PetscClipInterval(x + w, 0, img->w); /* xmax+1 */ in PetscImageSetClip()
18 img->clip[3] = PetscClipInterval(y + h, 0, img->h); /* ymax+1 */ in PetscImageSetClip()
21 static inline void PetscImageClear(PetscImage img) in PetscImageClear() argument
23 int x, xs = img->clip[0], xe = img->clip[2]; in PetscImageClear()
24 int y, ys = img->clip[1], ye = img->clip[3]; 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
31 if (x < img->clip[0] || x >= img->clip[2]) return; in PetscImageDrawPixel()
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()
36 static inline void PetscImageDrawLine(PetscImage img, int x_1, int y_1, int x_2, int y_2, int c) in PetscImageDrawLine() argument
45 while (x_1 <= x_2) PetscImageDrawPixel(img, x_1++, y_1, c); in PetscImageDrawLine()
53 while (y_1 <= y_2) PetscImageDrawPixel(img, x_1, y_1++, c); in PetscImageDrawLine()
60 PetscImageDrawPixel(img, x_1, y_1, c); in PetscImageDrawLine()
75 static inline void PetscImageDrawRectangle(PetscImage img, int x, int y, int w, int h, int c) in PetscImageDrawRectangle() argument
77 int xs = PetscMax(x, img->clip[0]), xe = PetscMin(x + w, img->clip[2]); in PetscImageDrawRectangle()
78 int ys = PetscMax(y, img->clip[1]), ye = PetscMin(y + h, img->clip[3]); in PetscImageDrawRectangle()
81 for (x = xs; x < xe; x++) img->buffer[y * img->w + x] = (unsigned char)c; in PetscImageDrawRectangle()
84 static inline void PetscImageDrawEllipse(PetscImage img, int xc, int yc, int w, int h, int c) in PetscImageDrawEllipse() argument
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()
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()
108 static inline void PetscImageDrawTriangle(PetscImage img, int x_1, int y_1, int t_1, int x_2, int y… in PetscImageDrawTriangle() argument
111 const int xmin = img->clip[0], xmax = img->clip[2] - 1; in PetscImageDrawTriangle()
112 const int ymin = img->clip[1], ymax = img->clip[3] - 1; 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()
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 …if (PetscImageFontBitmap[chr - 32][i] & (1 << (tw - 1 - j))) PetscImageDrawPixel(img, x + j + k * … in PetscImageDrawText()