Lines Matching defs:graphic
66 * - fix graphic pages for ReGIS -- they should also apply to text and sixel graphics
96 * - handle graphic updates in scroll regions (verify effect on graphics)
98 * - invalidate graphics under graphic if same origin, at least as big, and bg not transparent
99 * - invalidate graphic if completely scrolled past end of scrollback
100 * - invalidate graphic if all pixels are transparent/erased
101 * - invalidate graphic if completely scrolled out of alt buffer
125 * - option to set actual graphic size (not just coordinate range)
249 read_pixel(Graphic *graphic, int x, int y)
252 (x) < (graphic)->actual_width &&
254 (y) < (graphic)->actual_height)
255 ? (graphic)->pixels[(y) * (graphic)->max_width + (x)]
266 draw_solid_pixel(Graphic *graphic, int x, int y, unsigned color)
277 ? (unsigned) graphic->color_registers[color].r : 0U),
279 ? (unsigned) graphic->color_registers[color].g : 0U),
281 ? (unsigned) graphic->color_registers[color].b : 0U)));
283 if (x >= 0 && x < graphic->actual_width &&
284 y >= 0 && y < graphic->actual_height) {
285 _draw_pixel(graphic, x, y, color);
287 graphic->color_registers_used[color] = True;
292 draw_solid_rectangle(Graphic *graphic, int x1, int y1, int x2, int y2, unsigned color)
306 if (x2 < 0 || x1 >= graphic->actual_width ||
307 y2 < 0 || y1 >= graphic->actual_height)
312 if (x2 >= graphic->actual_width)
313 x2 = graphic->actual_width - 1;
316 if (y2 >= graphic->actual_height)
317 y2 = graphic->actual_height - 1;
320 graphic->color_registers_used[color] = True;
323 _draw_pixel(graphic, x, y, color);
327 copy_overlapping_area(Graphic *graphic, int src_ul_x, int src_ul_y,
359 if (dst_y < 0 || dst_y >= (int) graphic->actual_height)
366 if (dst_x < 0 || dst_x >= (int) graphic->actual_width)
369 if (src_x < 0 || src_x >= (int) graphic->actual_width ||
370 src_y < 0 || src_y >= (int) graphic->actual_height)
373 color = graphic->pixels[(unsigned) (src_y *
374 graphic->max_width) +
377 cell = (int) ((unsigned) (dst_y * graphic->max_width) +
379 SetSpixel(graphic, cell, color);
411 Graphic *graphic;
413 if (!(graphic = getActiveSlot(ii)))
415 if (graphic->private_colors)
418 if (graphic->color_registers_used[ii]) {
419 graphic->dirty = True;
425 fetch_color_register(Graphic *graphic,
435 if (graphic->color_registers_used[color]) {
436 if (graphic->private_colors) {
437 *reg = graphic->private_color_registers[color];
445 update_color_register(Graphic *graphic,
453 if (graphic->private_colors) {
454 set_color_register(graphic->private_color_registers,
456 if (graphic->color_registers_used[color]) {
457 graphic->dirty = True;
459 graphic->color_registers_used[color] = True;
676 Graphic *graphic,
683 const unsigned max_pixels = (unsigned) (graphic->max_width *
684 graphic->max_height);
688 graphic->hidden = False;
689 graphic->dirty = True;
690 memset(graphic->pixels, COLOR_HOLE & 0xff, max_pixels * sizeof(RegisterNum));
691 memset(graphic->color_registers_used, False, sizeof(graphic->color_registers_used));
713 graphic->actual_width = 0;
714 graphic->actual_height = 0;
716 graphic->pixw = 1;
717 graphic->pixh = 1;
719 graphic->valid_registers = num_color_registers;
720 TRACE(("%d color registers\n", graphic->valid_registers));
722 graphic->private_colors = private_colors;
723 if (graphic->private_colors) {
743 if (newest != NULL && newest != graphic) {
744 copy_color_registers(graphic, newest);
746 init_color_registers(screen, graphic->private_color_registers);
749 init_color_registers(screen, graphic->private_color_registers);
751 graphic->color_registers = graphic->private_color_registers;
754 graphic->color_registers = getSharedRegisters();
757 graphic->charrow = charrow;
758 graphic->charcol = charcol;
759 graphic->type = type;
760 graphic->valid = False;
768 Graphic *graphic = NULL;
774 if ((graphic = getInactiveSlot(screen, ii)) != NULL) {
775 TRACE(("using fresh graphic index %u as id %u\n",
781 /* if none are free, recycle the graphic scrolled back the farthest */
782 if (!graphic) {
788 if (!(graphic = getActiveSlot(ii)))
790 if (!min_graphic || graphic->charrow < min_charrow) {
792 min_charrow = graphic->charrow;
793 min_graphic = graphic;
796 TRACE(("recycling old graphic index %u as id %u\n",
798 graphic = min_graphic;
801 if (graphic) {
804 graphic->xw = xw;
805 graphic->bufferid = bufferid;
806 graphic->id = next_graphic_id++;
808 graphic,
814 return graphic;
827 Graphic *graphic;
831 TRACE(("checking slot=%u for graphic at %d,%d %dx%d bufferid=%d type=%u\n", ii,
835 if ((graphic = getActiveSlot(ii)) != NULL) {
836 if (graphic->type == type &&
837 graphic->bufferid == bufferid &&
838 graphic->charrow == charrow &&
839 graphic->charcol == charcol &&
840 graphic->actual_width == actual_width &&
841 graphic->actual_height == actual_height) {
842 TRACE(("found existing graphic slot=%u id=%u\n", ii, graphic->id));
843 return graphic;
845 TRACE(("not a match: graphic at %d,%d %dx%d bufferid=%d type=%u\n",
846 graphic->charrow, graphic->charcol,
847 graphic->actual_width, graphic->actual_height,
848 graphic->bufferid, graphic->type));
852 /* if no match get a new graphic */
853 if ((graphic = get_new_graphic(xw, charrow, charcol, type)) != NULL) {
854 graphic->actual_width = actual_width;
855 graphic->actual_height = actual_height;
856 TRACE(("no match; created graphic at %d,%d %dx%d bufferid=%d type=%u\n",
857 graphic->charrow, graphic->charcol,
858 graphic->actual_width, graphic->actual_height,
859 graphic->bufferid, graphic->type));
861 return graphic;
932 Graphic const *graphic,
943 int const pw = graphic->pixw;
944 int const ph = graphic->pixh;
945 int const graph_x = graphic->charcol * FontWidth(screen);
946 int const graph_y = graphic->charrow * FontHeight(screen);
947 int const graph_w = graphic->actual_width;
948 int const graph_h = graphic->actual_height;
949 int const mw = graphic->max_width;
959 TRACE(("refreshing graphic %u from %d,%d %dx%d (valid=%d, size=%dx%d, scale=%dx%d max=%dx%d)\n",
960 graphic->id,
962 graphic->valid,
963 graphic->actual_width,
964 graphic->actual_height,
966 graphic->max_width,
967 graphic->max_height));
1003 regnum = graphic->pixels[pixel_y + c];
1008 graphic->color_registers[regnum];
1013 TRACE(("done refreshing graphic: %d of %d refreshed pixels were holes; %d were out of pixmap range\n",
1156 dump_graphic(Graphic const *graphic)
1166 (void) graphic;
1168 TRACE(("graphic stats: id=%u charrow=%d charcol=%d actual_width=%d actual_height=%d pixw=%d pixh=%d\n",
1169 graphic->id,
1170 graphic->charrow,
1171 graphic->charcol,
1172 graphic->actual_width,
1173 graphic->actual_height,
1174 graphic->pixw,
1175 graphic->pixh));
1178 TRACE(("graphic colors:\n"));
1179 for (color = 0; color < graphic->valid_registers; color++) {
1182 graphic->color_registers[color].r,
1183 graphic->color_registers[color].g,
1184 graphic->color_registers[color].b));
1189 TRACE(("graphic pixels:\n"));
1190 for (r = 0; r < graphic->actual_height; r++) {
1191 for (c = 0; c < graphic->actual_width; c++) {
1192 color = graphic->pixels[r * graphic->max_width + c];
1196 reg = &graphic->color_registers[color];
1217 /* Erase the portion of any displayed graphic overlapping with a rectangle
1219 * graphic. This is used to allow text to "erase" graphics underneath it.
1222 erase_graphic(Graphic *graphic, int x, int y, int w, int h)
1224 const int pw = graphic->pixw;
1225 const int ph = graphic->pixh;
1234 TRACE(("erasing graphic %d,%d %dx%d\n", x, y, w, h));
1236 for (r = 0; r < graphic->actual_height; r++) {
1241 for (c = 0; c < graphic->actual_width; c++) {
1244 const int cell = r * graphic->max_width + c;
1245 ClrSpixel(graphic, cell);
1308 Graphic *graphic;
1309 if (!(graphic = getActiveSlot(ii)))
1311 TRACE(("refreshing graphic %d on buffer %d, current buffer %d\n",
1312 graphic->id, graphic->bufferid, screen->whichBuf));
1314 if (graphic->bufferid != 0) {
1315 TRACE(("skipping graphic %d from alt buffer (%d) when drawing screen=%d\n",
1316 graphic->id, graphic->bufferid, screen->whichBuf));
1320 if (graphic->bufferid == 0 && graphic->charrow >= 0) {
1321 TRACE(("skipping graphic %d from normal buffer (%d) when drawing screen=%d because it is not in scrollback area\n",
1322 graphic->id, graphic->bufferid, screen->whichBuf));
1325 if (graphic->bufferid == 1 &&
1326 graphic->charrow + (graphic->actual_height +
1329 TRACE(("skipping graphic %d from alt buffer (%d) when drawing screen=%d because it is completely in scrollback area\n",
1330 graphic->id, graphic->bufferid, screen->whichBuf));
1334 if (graphic->hidden)
1336 ordered_graphics[active_count++] = graphic;
1445 Graphic *graphic = ordered_graphics[jj];
1446 int draw_x = graphic->charcol * FontWidth(screen);
1447 int draw_y = graphic->charrow * FontHeight(screen);
1448 int draw_w = graphic->actual_width;
1449 int draw_h = graphic->actual_height;
1452 if (graphic->bufferid != 0) {
1479 refresh_graphic(screen, graphic, buffer,
1493 graphic->dirty = False;
1790 Graphic *graphic;
1792 if (!(graphic = getActiveSlot(ii)))
1794 if (graphic->bufferid != screen->whichBuf)
1796 if (graphic->hidden)
1799 graphic->charrow -= rows;
1817 Graphic *graphic;
1826 if (!(graphic = getActiveSlot(ii)))
1828 if (graphic->bufferid != screen->whichBuf)
1830 if (graphic->hidden)
1833 graph_x = graphic->charcol * FontWidth(screen);
1834 graph_y = graphic->charrow * FontHeight(screen);
1843 erase_graphic(graphic, x, y, w, h);