Lines Matching refs:img
13 #define XTRANS(draw, img, x) ((int)(((img)->w - 1) * ((draw)->port_xl + ((((x) - (draw)->coor_xl) *… argument
14 #define YTRANS(draw, img, y) (((img)->h - 1) - (int)(((img)->h - 1) * ((draw)->port_yl + ((((y) - (… argument
16 #define ITRANS(draw, img, i) ((draw)->coor_xl + (((PetscReal)(i)) * ((draw)->coor_xr - (draw)->coor… argument
17 #define JTRANS(draw, img, j) ((draw)->coor_yl + (((PetscReal)(j)) / ((img)->h - 1) + (draw)->port_y… argument
21 PetscImage img = (PetscImage)draw->data; in PetscDrawSetViewport_Image() local
25 int xmax = img->w - 1, ymax = img->h - 1; in PetscDrawSetViewport_Image()
28 PetscImageSetClip(img, xa, ya, xb + 1 - xa, yb + 1 - ya); in PetscDrawSetViewport_Image()
43 PetscImage img = (PetscImage)draw->data; in PetscDrawCoordinateToPixel_Image() local
46 if (i) *i = XTRANS(draw, img, x); in PetscDrawCoordinateToPixel_Image()
47 if (j) *j = YTRANS(draw, img, y); in PetscDrawCoordinateToPixel_Image()
53 PetscImage img = (PetscImage)draw->data; in PetscDrawPixelToCoordinate_Image() local
56 if (x) *x = ITRANS(draw, img, i); in PetscDrawPixelToCoordinate_Image()
57 if (y) *y = JTRANS(draw, img, j); in PetscDrawPixelToCoordinate_Image()
71 PetscImage img = (PetscImage)draw->data; in PetscDrawPoint_Image() local
76 int j, xx = XTRANS(draw, img, x); in PetscDrawPoint_Image()
77 int i, yy = YTRANS(draw, img, y); in PetscDrawPoint_Image()
79 for (j = -1; j <= 1; j++) PetscImageDrawPixel(img, xx + j, yy + i, c); in PetscDrawPoint_Image()
86 PetscImage img = (PetscImage)draw->data; in PetscDrawPointPixel_Image() local
91 PetscImageDrawPixel(img, x, y, c); in PetscDrawPointPixel_Image()
106 PetscImage img = (PetscImage)draw->data; in PetscDrawLineGetWidth_Image() local
111 *width = lw * (draw->coor_xr - draw->coor_xl) / (img->w * (draw->port_xr - draw->port_xl)); in PetscDrawLineGetWidth_Image()
118 PetscImage img = (PetscImage)draw->data; in PetscDrawLine_Image() local
122 int x_1 = XTRANS(draw, img, xl), x_2 = XTRANS(draw, img, xr); in PetscDrawLine_Image()
123 int y_1 = YTRANS(draw, img, yl), y_2 = YTRANS(draw, img, yr); in PetscDrawLine_Image()
124 PetscImageDrawLine(img, x_1, y_1, x_2, y_2, c); in PetscDrawLine_Image()
131 PetscImage img = (PetscImage)draw->data; in PetscDrawArrow_Image() local
136 int x_1 = XTRANS(draw, img, xl), x_2 = XTRANS(draw, img, xr); in PetscDrawArrow_Image()
137 int y_1 = YTRANS(draw, img, yl), y_2 = YTRANS(draw, img, yr); in PetscDrawArrow_Image()
139 PetscImageDrawLine(img, x_1, y_1, x_2, y_2, c); in PetscDrawArrow_Image()
142 PetscImageDrawLine(img, x_2, y_2, x_2 - 3, y_2 - 3, c); in PetscDrawArrow_Image()
143 PetscImageDrawLine(img, x_2, y_2, x_2 + 3, y_2 - 3, c); in PetscDrawArrow_Image()
145 PetscImageDrawLine(img, x_2, y_2, x_2 - 3, y_2 + 3, c); in PetscDrawArrow_Image()
146 PetscImageDrawLine(img, x_2, y_2, x_2 + 3, y_2 + 3, c); in PetscDrawArrow_Image()
151 PetscImageDrawLine(img, x_2 - 3, y_2 - 3, x_2, y_2, c); in PetscDrawArrow_Image()
152 PetscImageDrawLine(img, x_2 - 3, y_2 + 3, x_2, y_2, c); in PetscDrawArrow_Image()
154 PetscImageDrawLine(img, x_2, y_2, x_2 + 3, y_2 - 3, c); in PetscDrawArrow_Image()
155 PetscImageDrawLine(img, x_2, y_2, x_2 + 3, y_2 + 3, c); in PetscDrawArrow_Image()
164 PetscImage img = (PetscImage)draw->data; in PetscDrawRectangle_Image() local
172 int x = XTRANS(draw, img, xl), w = XTRANS(draw, img, xr) + 1 - x; in PetscDrawRectangle_Image()
173 int y = YTRANS(draw, img, yr), h = YTRANS(draw, img, yl) + 1 - y; in PetscDrawRectangle_Image()
175 PetscImageDrawRectangle(img, x, y, w, h, c); in PetscDrawRectangle_Image()
182 PetscImage img = (PetscImage)draw->data; in PetscDrawEllipse_Image() local
189 int xc = XTRANS(draw, img, x), w = XTRANS(draw, img, x + a / 2) + 0 - xc; in PetscDrawEllipse_Image()
190 int yc = YTRANS(draw, img, y), h = YTRANS(draw, img, y - b / 2) + 0 - yc; in PetscDrawEllipse_Image()
192 PetscImageDrawEllipse(img, xc, yc, w, h, c); in PetscDrawEllipse_Image()
199 PetscImage img = (PetscImage)draw->data; in PetscDrawTriangle_Image() local
206 int x_1 = XTRANS(draw, img, X_1), x_2 = XTRANS(draw, img, X_2), x_3 = XTRANS(draw, img, X_3); in PetscDrawTriangle_Image()
207 int y_1 = YTRANS(draw, img, Y_1), y_2 = YTRANS(draw, img, Y_2), y_3 = YTRANS(draw, img, Y_3); in PetscDrawTriangle_Image()
208 PetscImageDrawTriangle(img, x_1, y_1, c1, x_2, y_2, c2, x_3, y_3, c3); in PetscDrawTriangle_Image()
223 PetscImage img = (PetscImage)draw->data; in PetscDrawStringGetSize_Image() local
229 if (w) *w = tw * (draw->coor_xr - draw->coor_xl) / (img->w * (draw->port_xr - draw->port_xl)); in PetscDrawStringGetSize_Image()
230 if (h) *h = th * (draw->coor_yr - draw->coor_yl) / (img->h * (draw->port_yr - draw->port_yl)); in PetscDrawStringGetSize_Image()
237 PetscImage img = (PetscImage)draw->data; in PetscDrawString_Image() local
244 int xx = XTRANS(draw, img, x); in PetscDrawString_Image()
245 int yy = YTRANS(draw, img, y); in PetscDrawString_Image()
249 PetscImageDrawText(img, xx, yy, c, subtext); in PetscDrawString_Image()
260 PetscImage img = (PetscImage)draw->data; in PetscDrawStringVertical_Image() local
266 int xx = XTRANS(draw, img, x); in PetscDrawStringVertical_Image()
267 int yy = YTRANS(draw, img, y); in PetscDrawStringVertical_Image()
270 PetscImageDrawText(img, xx, yy + offset, c, chr); in PetscDrawStringVertical_Image()
297 PetscImage img = (PetscImage)draw->data; in PetscDrawClear_Image() local
301 PetscImageClear(img); in PetscDrawClear_Image()
350 PetscImage img = (PetscImage)draw->data; in PetscDrawResizeWindow_Image() local
353 if (w == img->w && h == img->h) PetscFunctionReturn(PETSC_SUCCESS); in PetscDrawResizeWindow_Image()
354 PetscCall(PetscFree(img->buffer)); in PetscDrawResizeWindow_Image()
356 img->w = w; in PetscDrawResizeWindow_Image()
357 img->h = h; in PetscDrawResizeWindow_Image()
358 PetscCall(PetscCalloc1((size_t)(img->w * img->h), &img->buffer)); in PetscDrawResizeWindow_Image()
365 PetscImage img = (PetscImage)draw->data; in PetscDrawDestroy_Image() local
369 PetscCall(PetscFree(img->buffer)); in PetscDrawDestroy_Image()
459 PetscImage img = (PetscImage)draw->data; in PetscDrawGetImage_Image() local
464 if (w) *w = (unsigned int)img->w; in PetscDrawGetImage_Image()
465 if (h) *h = (unsigned int)img->h; in PetscDrawGetImage_Image()
469 PetscCall(PetscMemcpy(palette, img->palette, sizeof(img->palette))); in PetscDrawGetImage_Image()
470 PetscCall(PetscMalloc1((size_t)(img->w * img->h), &buffer)); in PetscDrawGetImage_Image()
475 PetscCall(PetscArraycpy(buffer, img->buffer, img->w * img->h)); in PetscDrawGetImage_Image()
477 …PetscCallMPI(MPI_Reduce(img->buffer, buffer, img->w * img->h, MPI_UNSIGNED_CHAR, MPI_MAX, 0, Petsc… in PetscDrawGetImage_Image()
534 PetscImage img; in PetscDrawCreate_Image() local
564 PetscCall(PetscNew(&img)); in PetscDrawCreate_Image()
566 draw->data = (void *)img; in PetscDrawCreate_Image()
568 img->w = w; in PetscDrawCreate_Image()
569 img->h = h; in PetscDrawCreate_Image()
570 PetscCall(PetscCalloc1((size_t)(img->w * img->h), &img->buffer)); in PetscDrawCreate_Image()
571 PetscImageSetClip(img, 0, 0, img->w, img->h); in PetscDrawCreate_Image()
579 img->palette[k][0] = BasicColors[k][0]; in PetscDrawCreate_Image()
580 img->palette[k][1] = BasicColors[k][1]; in PetscDrawCreate_Image()
581 img->palette[k][2] = BasicColors[k][2]; in PetscDrawCreate_Image()
584 img->palette[k][0] = R[i]; in PetscDrawCreate_Image()
585 img->palette[k][1] = G[i]; in PetscDrawCreate_Image()
586 img->palette[k][2] = B[i]; in PetscDrawCreate_Image()