INTERNALS HISTORY *****************************************************************************/ { AROS_LIBFUNC_INIT HIDDT_PixelLUT pixlut; LONG pixwritten; EnterFunc(bug("WritePixelArray8(%p, %d, %d, %d, %d)\n", rp, xstart, ystart, xstop, ystop)); pixlut.entries = AROS_PALETTE_SIZE; pixlut.pixels = IS_HIDD_BM(rp->BitMap) ? HIDD_BM_PIXTAB(rp->BitMap) : NULL; if (!pixlut.pixels) { if (GetBitMapAttr(rp->BitMap, BMA_DEPTH) > 8) { D(bug("WritePixelArray8: Can't work on hicolor/truecolor screen without LUT")); ReturnInt("WritePixelArray8", LONG, 0); } } pixwritten = write_pixels_8(rp, array , ((xstop - xstart + 1) + 15) & ~15 /* modulo */ , xstart, ystart , xstop, ystop , &pixlut
static VOID hidd2amiga_fast(struct BitMap *hidd_bm , LONG x_src , LONG y_src , APTR dest_info , LONG x_dest, LONG y_dest , ULONG xsize, ULONG ysize , VOID (*putbuf_hook)() ) { ULONG tocopy_w, tocopy_h; LONG pixels_left_to_process = xsize * ysize; ULONG current_x, current_y, next_x, next_y; #warning Src bitmap migh be user initialized so we should not use HIDD_BM_PIXTAB() below HIDDT_PixelLUT pixlut = { AROS_PALETTE_SIZE, HIDD_BM_PIXTAB(hidd_bm) }; Object *bm_obj; next_x = 0; next_y = 0; bm_obj = OBTAIN_HIDD_BM(hidd_bm); if (NULL == bm_obj) return; LOCK_PIXBUF while (pixels_left_to_process) { current_x = next_x; current_y = next_y; if (NUMLUTPIX < xsize) { /* buffer cant hold a single horizontal line, and must divide each line into copies */ tocopy_w = xsize - current_x; if (tocopy_w > NUMLUTPIX) { /* Not quite finished with current horizontal pixel line */ tocopy_w = NUMLUTPIX; next_x += NUMLUTPIX; } else { /* Start at a new line */ next_x = 0; next_y ++; } tocopy_h = 1; } else { tocopy_h = MIN(NUMLUTPIX / xsize, ysize - current_y); tocopy_w = xsize; next_x = 0; next_y += tocopy_h; } /* Get some more pixels from the HIDD */ HIDD_BM_GetImageLUT(bm_obj , (UBYTE *)pixel_buf , tocopy_w , x_src + current_x , y_src + current_y , tocopy_w, tocopy_h , &pixlut); /* Write pixels to the destination */ putbuf_hook(dest_info , current_x + x_src , current_y + y_src , current_x + x_dest , current_y + y_dest , tocopy_w, tocopy_h , (UBYTE *)pixel_buf , bm_obj , IS_HIDD_BM(hidd_bm) ? HIDD_BM_PIXTAB(hidd_bm) : NULL ); pixels_left_to_process -= (tocopy_w * tocopy_h); } ULOCK_PIXBUF RELEASE_HIDD_BM(bm_obj, hidd_bm); return; }