Пример #1
0
 // construction/destruction
 //-------------------------------------------------
 //  device_palette_interface - constructor
 //-------------------------------------------------
 public device_palette_interface(machine_config mconfig, device_t device)
     : base(device, "palette")
 {
     m_palette       = null;
     m_pens          = null;
     m_format        = bitmap_format.BITMAP_FORMAT_RGB32;
     m_shadow_table  = null;
     m_shadow_group  = 0;
     m_hilight_group = 0;
     m_white_pen     = 0;
     m_black_pen     = 0;
 }
Пример #2
0
        rectangle m_cliprect;   // a clipping rectangle covering the full bitmap


        // construction/destruction -- subclasses only to ensure type correctness

        //bitmap_t(const bitmap_t &) = delete;
        //bitmap_t(bitmap_t &&that);

        /**
         * @fn  bitmap_t::bitmap_t(bitmap_format format, int bpp, int width, int height, int xslop, int yslop)
         *
         * @brief   -------------------------------------------------
         *            bitmap_t - basic constructor
         *          -------------------------------------------------.
         *
         * @param   format  Describes the format to use.
         * @param   bpp     The bits per pixel.
         * @param   width   The width.
         * @param   height  The height.
         * @param   xslop   The xslop.
         * @param   yslop   The yslop.
         */
        public bitmap_t(bitmap_format format, uint8_t bpp, int width = 0, int height = 0, int xslop = 0, int yslop = 0)
        {
            m_alloc      = null;
            m_allocbytes = 0;
            m_format     = format;
            m_bpp        = (byte)bpp;
            m_palette    = null;


            assert(valid_format());

            // allocate intializes all other fields
            allocate(width, height, xslop, yslop);
        }
Пример #3
0
        /**
         * @fn  bitmap_t::bitmap_t(bitmap_format format, uint8_t bpp, void *base, int width, int height, int rowpixels)
         *
         * @brief   Constructor.
         *
         * @param   format          Describes the format to use.
         * @param   bpp             The bits per pixel.
         * @param [in,out]  base    If non-null, the base.
         * @param   width           The width.
         * @param   height          The height.
         * @param   rowpixels       The rowpixels.
         */
        public bitmap_t(bitmap_format format, uint8_t bpp, PointerU8 base_, int width, int height, int rowpixels)  //bitmap_t::bitmap_t(bitmap_format format, uint8_t bpp, void *base, int width, int height, int rowpixels)
        {
            m_alloc      = null;
            m_allocbytes = 0;
            m_base       = base_;
            m_rowpixels  = rowpixels;
            m_width      = width;
            m_height     = height;
            m_format     = format;
            m_bpp        = bpp;
            m_palette    = null;
            m_cliprect   = new rectangle(0, width - 1, 0, height - 1);


            assert(valid_format());
        }
Пример #4
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));
        }
Пример #5
0
        }                                                                                                                                                                                       //bitmap_specific(bitmap_format format, PixelType *base, int width, int height, int rowpixels) : bitmap_t(format, PIXEL_BITS, base, width, height, rowpixels) { }

        protected bitmap_specific(bitmap_format format, bitmap_specific <PixelType, PixelType_OPS, PixelTypePointer> source, rectangle subrect) : base(format, (uint8_t)PIXEL_BITS, source, subrect)
        {
        }                                                                                                                                                                                                //bitmap_specific(bitmap_format format, bitmap_specific<PixelType> &source, const rectangle &subrect) : bitmap_t(format, PIXEL_BITS, source, subrect) { }
Пример #6
0
        }                                                                                                                                                                                  //bitmap_specific(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, PIXEL_BITS, width, height, xslop, yslop) { }

        protected bitmap_specific(bitmap_format format, PixelTypePointer base_, int width, int height, int rowpixels) : base(format, (uint8_t)PIXEL_BITS, base_, width, height, rowpixels)
        {
        }                                                                                                                                                                                       //bitmap_specific(bitmap_format format, PixelType *base, int width, int height, int rowpixels) : bitmap_t(format, PIXEL_BITS, base, width, height, rowpixels) { }
Пример #7
0
        static readonly int PIXEL_BITS = 8 * sizeof_(typeof(PixelType));  //static constexpr int PixelBits = 8 * sizeof(PixelType);


        // construction/destruction -- subclasses only
        //bitmap_specific(bitmap_specific<PixelType> &&) = default;
        protected bitmap_specific(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : base(format, (uint8_t)PIXEL_BITS, width, height, xslop, yslop)
        {
        }                                                                                                                                                                                  //bitmap_specific(bitmap_format format, int width = 0, int height = 0, int xslop = 0, int yslop = 0) : bitmap_t(format, PIXEL_BITS, width, height, xslop, yslop) { }
Пример #8
0
 //void set_pen_contrast(pen_t pen, double bright) { m_palette->entry_set_contrast(pen, bright); }
 public void set_format(bitmap_format format)
 {
     m_format = format;
 }