Ejemplo n.º 1
0
        // ----- core graphics drawing -----

        // specific drawgfx implementations for each transparency type

        /*-------------------------------------------------
        *   opaque - render a gfx element with
        *   no transparency
        *  -------------------------------------------------*/
        void opaque(bitmap_ind16 dest, rectangle cliprect,
                    u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty)
        {
            color = colorbase() + granularity() * (color % colors());
            code %= elements();
            //DECLARE_NO_PRIORITY;
            bitmap_t priority = drawgfxm_global.drawgfx_dummy_priority_bitmap;

            //DRAWGFX_CORE(u16, PIXEL_OP_REBASE_OPAQUE, NO_PRIORITY);
            drawgfxm_global.DRAWGFX_CORE <u16, drawgfxm_global.NO_PRIORITY>(drawgfxm_global.PIXEL_OP_REBASE_OPAQUE, cliprect, destx, desty, width(), height(), flipx, flipy, rowbytes(), get_data, code, dest, priority, color, 0, null, 2);
        }
Ejemplo n.º 2
0
        void opaque(bitmap_rgb32 dest, rectangle cliprect,
                    u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty)
        {
            pen_t paldata = m_palette.pens()[colorbase() + granularity() * (color % colors())]; //m_palette.pens() + colorbase() + granularity() * (color % colors());

            code %= elements();
            //DECLARE_NO_PRIORITY;
            bitmap_t priority = drawgfxm_global.drawgfx_dummy_priority_bitmap;

            throw new emu_unimplemented();
#if false
            DRAWGFX_CORE(u32, PIXEL_OP_REMAP_OPAQUE, NO_PRIORITY);
#endif
        }
Ejemplo n.º 3
0
        /**
         * @fn  bitmap_t::bitmap_t(bitmap_format format, int bpp, bitmap_t &source, const rectangle &subrect)
         *
         * @brief   Constructor.
         *
         * @param   format          Describes the format to use.
         * @param   bpp             The bits per pixel.
         * @param [in,out]  source  Source for the.
         * @param   subrect         The subrect.
         */
        public bitmap_t(bitmap_format format, uint8_t bpp, bitmap_t source, rectangle subrect)
        {
            m_alloc      = null;
            m_allocbytes = 0;
            m_base       = source.raw_pixptr(subrect.top(), subrect.left()); //m_base(source.raw_pixptr(subrect.top(), subrect.left()))
            m_rowpixels  = source.m_rowpixels;
            m_width      = subrect.width();
            m_height     = subrect.height();
            m_format     = format;
            m_bpp        = (uint8_t)bpp;
            m_palette    = null;
            m_cliprect   = new rectangle(0, subrect.width() - 1, 0, subrect.height() - 1);


            assert(format == source.m_format);
            assert(bpp == source.m_bpp);
            assert(source.cliprect().contains(subrect));
        }
Ejemplo n.º 4
0
        public void transmask(bitmap_rgb32 dest, rectangle cliprect,
                              u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty,
                              u32 trans_mask)
        {
            // special case 0 mask to opaque
            if (trans_mask == 0)
            {
                opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
                return;
            }

            // use pen usage to optimize
            code %= elements();
            if (has_pen_usage())
            {
                // fully transparent; do nothing
                UInt32 usage = pen_usage(code);
                if ((usage & ~trans_mask) == 0)
                {
                    return;
                }

                // fully opaque; draw as such
                if ((usage & trans_mask) == 0)
                {
                    opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
                    return;
                }
            }

            // render
            pen_t paldata = m_palette.pens()[colorbase() + granularity() * (color % colors())];
            //DECLARE_NO_PRIORITY;
            bitmap_t priority = drawgfxm_global.drawgfx_dummy_priority_bitmap;

            throw new emu_unimplemented();
#if false
            DRAWGFX_CORE(UInt32, PIXEL_OP_REMAP_TRANSMASK, NO_PRIORITY);
#endif
        }
Ejemplo n.º 5
0
        //void transpen_raw(bitmap_ind16 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen);
        //void transpen_raw(bitmap_rgb32 &dest, const rectangle &cliprect, UINT32 code, UINT32 color, int flipx, int flipy, INT32 destx, INT32 desty, UINT32 transpen);


        /*-------------------------------------------------
        *   transmask - render a gfx element
        *   with a multiple transparent pens provided as
        *   a mask
        *  -------------------------------------------------*/
        public void transmask(bitmap_ind16 dest, rectangle cliprect,
                              u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty,
                              u32 trans_mask)
        {
            // special case 0 mask to opaque
            if (trans_mask == 0)
            {
                opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
                return;
            }

            // use pen usage to optimize
            code %= elements();
            if (has_pen_usage())
            {
                // fully transparent; do nothing
                UInt32 usage = pen_usage(code);
                if ((usage & ~trans_mask) == 0)
                {
                    return;
                }

                // fully opaque; draw as such
                if ((usage & trans_mask) == 0)
                {
                    opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
                    return;
                }
            }

            // render
            color = colorbase() + granularity() * (color % colors());
            //DECLARE_NO_PRIORITY;
            bitmap_t priority = drawgfxm_global.drawgfx_dummy_priority_bitmap;

            //DRAWGFX_CORE(u16, PIXEL_OP_REBASE_TRANSMASK, NO_PRIORITY);
            drawgfxm_global.DRAWGFX_CORE <UInt16, drawgfxm_global.NO_PRIORITY>(drawgfxm_global.PIXEL_OP_REBASE_TRANSMASK, cliprect, destx, desty, width(), height(), flipx, flipy, rowbytes(), get_data, code, dest, priority, color, trans_mask, null, 2);
        }
Ejemplo n.º 6
0
        public void transpen(bitmap_rgb32 dest, rectangle cliprect,
                             u32 code, u32 color, int flipx, int flipy, s32 destx, s32 desty,
                             u32 trans_pen)
        {
            // special case invalid pens to opaque
            if (trans_pen > 0xff)
            {
                opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
                return;
            }

            // use pen usage to optimize
            code %= elements();
            if (has_pen_usage())
            {
                // fully transparent; do nothing
                UInt32 usage = pen_usage(code);
                if ((usage & ~(1 << (int)trans_pen)) == 0)
                {
                    return;
                }

                // fully opaque; draw as such
                if ((usage & (1 << (int)trans_pen)) == 0)
                {
                    opaque(dest, cliprect, code, color, flipx, flipy, destx, desty);
                    return;
                }
            }

            // render
            ListPointer <rgb_t> paldata = new ListPointer <rgb_t>(m_palette.pens(), (int)(colorbase() + granularity() * (color % colors())));  //const pen_t *paldata = m_palette.pens() + colorbase() + granularity() * (color % colors());
            //DECLARE_NO_PRIORITY;
            bitmap_t priority = drawgfxm_global.drawgfx_dummy_priority_bitmap;

            //DRAWGFX_CORE(u32, PIXEL_OP_REMAP_TRANSPEN, NO_PRIORITY);
            drawgfxm_global.DRAWGFX_CORE <u32, drawgfxm_global.NO_PRIORITY>(drawgfxm_global.PIXEL_OP_REMAP_TRANSPEN, cliprect, destx, desty, width(), height(), flipx, flipy, rowbytes(), get_data, code, dest, priority, color, trans_pen, paldata, 2);
        }
Ejemplo n.º 7
0
Archivo: png.cs Proyecto: kwanboy/mcs
        //png_error png_read_bitmap(util::core_file &fp, bitmap_argb32 &bitmap);

        //png_error png_write_bitmap(util::core_file &fp, png_info *info, bitmap_t &bitmap, int palette_length, const rgb_t *palette);

        //png_error mng_capture_start(util::core_file &fp, bitmap_t &bitmap, double rate);
        public static png_error mng_capture_frame(util.core_file fp, png_info info, bitmap_t bitmap, int palette_length, List <rgb_t> palette)
        {
            throw new emu_unimplemented();
        }
Ejemplo n.º 8
0
 //PRIORITY_TYPE *priptr = PRIORITY_ADDR(priority, PRIORITY_TYPE, cury, destx);
 //#define PRIORITY_ADDR(p,t,y,x)  (PRIORITY_VALID(t) ? (&(p).pixt<t>(y, x)) : NULL)
 static ListBytesPointer PRIORITY_ADDR <PRIORITY_TYPE>(bitmap_t p, int y, int x)
 {
     return(PRIORITY_VALID <PRIORITY_TYPE>() ? p.pix8(y, x) : null);
 }