2011-01-06 00:02:22 +03:00
|
|
|
/*
|
|
|
|
* Copyright 2010 Ole Loots <ole@monochrom.net>
|
|
|
|
*
|
|
|
|
* This file is part of NetSurf, http://www.netsurf-browser.org/
|
|
|
|
*
|
|
|
|
* NetSurf is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; version 2 of the License.
|
|
|
|
*
|
|
|
|
* NetSurf is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef _GEM_PLOTTER_API_H_
|
|
|
|
#define _GEM_PLOTTER_API_H_
|
2011-01-31 00:48:22 +03:00
|
|
|
#include <stdlib.h>
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <math.h>
|
|
|
|
#include <assert.h>
|
|
|
|
#include <string.h>
|
2011-01-06 00:02:22 +03:00
|
|
|
#include <windom.h>
|
|
|
|
|
2011-03-01 22:29:40 +03:00
|
|
|
#include "desktop/plotters.h"
|
2011-01-31 00:48:22 +03:00
|
|
|
#include "desktop/plot_style.h"
|
|
|
|
#include "image/bitmap.h"
|
|
|
|
#include "atari/bitmap.h"
|
|
|
|
#include "atari/osspec.h"
|
|
|
|
#include "atari/gui.h"
|
|
|
|
#include "atari/font.h"
|
2012-03-22 13:34:34 +04:00
|
|
|
#include "desktop/options.h"
|
2011-01-31 00:48:22 +03:00
|
|
|
#include "atari/findfile.h"
|
|
|
|
#include "utils/utf8.h"
|
|
|
|
#include "utils/log.h"
|
2011-01-06 00:02:22 +03:00
|
|
|
|
|
|
|
#ifndef ceilf
|
2011-03-21 01:28:53 +03:00
|
|
|
#warning "ceilf emulation"
|
2011-01-06 00:02:22 +03:00
|
|
|
#define ceilf(x) (float)ceil((double)x)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef TEST_PLOTTER
|
|
|
|
#define verbose_log 1
|
|
|
|
#define LOG(x) do { if (verbose_log) (printf(__FILE__ " %s %i: ", __PRETTY_FUNCTION__, __LINE__), printf x, fputc('\n', stdout)); } while (0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define MAX_FRAMEBUFS 0x010
|
2012-03-13 01:20:18 +04:00
|
|
|
#define C2P (1<<0) /* C2P convert buffer 1 to buffer 2 */
|
2011-01-06 00:02:22 +03:00
|
|
|
/* TODO: implement offscreen buffer switch */
|
2011-04-11 01:47:59 +04:00
|
|
|
|
2012-03-13 01:20:18 +04:00
|
|
|
/* Plotter Option Flags: */
|
|
|
|
#define PLOT_FLAG_DITHER 0x04 /* true if the plotter shall dither images */
|
|
|
|
#define PLOT_FLAG_TRANS 0x08 /* true if the plotter supports transparent operations */
|
|
|
|
|
|
|
|
/* Plotter "feature" flags */
|
|
|
|
#define PLOT_FLAG_HAS_DITHER 0x0400
|
|
|
|
#define PLOT_FLAG_HAS_ALPHA 0x0800
|
|
|
|
#define PLOT_FLAG_OFFSCREEN 0x1000 /* offsreen plotter should set this flag */
|
|
|
|
|
|
|
|
/* Plotter "internal" flags */
|
|
|
|
#define PLOT_FLAG_LOCKED 0x08000 /* plotter should set this flag during screen updates */
|
2012-01-04 03:02:38 +04:00
|
|
|
|
|
|
|
/* Font Plotter flags: */
|
|
|
|
#define FONTPLOT_FLAG_MONOGLYPH 0x01
|
2011-01-06 00:02:22 +03:00
|
|
|
|
2011-04-11 01:47:59 +04:00
|
|
|
/* Flags for init_mfdb function: */
|
2011-11-30 01:19:26 +04:00
|
|
|
#define MFDB_FLAG_STAND 0x01
|
2011-03-21 01:28:53 +03:00
|
|
|
#define MFDB_FLAG_ZEROMEM 0x02
|
|
|
|
#define MFDB_FLAG_NOALLOC 0x04
|
|
|
|
|
2011-01-06 00:02:22 +03:00
|
|
|
/* Error codes: */
|
2011-04-11 01:47:59 +04:00
|
|
|
#define ERR_BUFFERSIZE_EXCEEDS_SCREEN 1 /* The buffer allocated is larger than the screen */
|
2011-12-04 16:53:03 +04:00
|
|
|
#define ERR_NO_MEM 2 /* Not enough memory for requested operation */
|
|
|
|
#define ERR_PLOTTER_NOT_AVAILABLE 3 /* invalid plotter driver name passed */
|
2011-01-06 00:02:22 +03:00
|
|
|
|
2011-04-11 01:47:59 +04:00
|
|
|
/* Grapics & Font Plotter "Objects": */
|
2011-01-06 00:02:22 +03:00
|
|
|
typedef struct s_font_plotter * FONT_PLOTTER;
|
|
|
|
typedef struct s_gem_plotter * GEM_PLOTTER;
|
|
|
|
typedef struct s_font_plotter * GEM_FONT_PLOTTER; /* for public use ... */
|
2011-01-31 00:48:22 +03:00
|
|
|
|
|
|
|
|
|
|
|
/* declaration of font plotter member functions: (_fpmf_ prefix) */
|
|
|
|
typedef int (*_fpmf_str_width)( FONT_PLOTTER self, const plot_font_style_t *fstyle,
|
|
|
|
const char * str, size_t length, int * width);
|
|
|
|
typedef int (*_fpmf_str_split)( FONT_PLOTTER self, const plot_font_style_t *fstyle,
|
|
|
|
const char *string, size_t length,
|
|
|
|
int x, size_t *char_offset, int *actual_x);
|
|
|
|
typedef int (*_fpmf_pixel_pos)( FONT_PLOTTER self, const plot_font_style_t *fstyle,
|
|
|
|
const char *string, size_t length,
|
|
|
|
int x, size_t *char_offset, int *actual_x);
|
2011-11-30 01:19:26 +04:00
|
|
|
typedef int (*_fpmf_text)( FONT_PLOTTER self, int x, int y, const char *text,
|
2011-01-31 00:48:22 +03:00
|
|
|
size_t length, const plot_font_style_t *fstyle);
|
2012-01-04 03:02:38 +04:00
|
|
|
|
|
|
|
typedef void (*_fpmf_draw_glyph)(FONT_PLOTTER self, GRECT * loc, uint8_t * pixdata,
|
|
|
|
int pitch, uint32_t colour);
|
2011-01-31 00:48:22 +03:00
|
|
|
typedef int (*_fpmf_dtor)( FONT_PLOTTER self );
|
2012-01-04 03:02:38 +04:00
|
|
|
|
2011-01-31 00:48:22 +03:00
|
|
|
|
2011-04-11 01:47:59 +04:00
|
|
|
/* prototype of the font plotter "object" */
|
2011-01-06 00:02:22 +03:00
|
|
|
struct s_font_plotter
|
|
|
|
{
|
|
|
|
char * name;
|
|
|
|
int flags;
|
|
|
|
int vdi_handle;
|
|
|
|
void * priv_data;
|
|
|
|
GEM_PLOTTER plotter;
|
2011-01-31 00:48:22 +03:00
|
|
|
|
|
|
|
_fpmf_str_width str_width;
|
|
|
|
_fpmf_str_split str_split;
|
|
|
|
_fpmf_pixel_pos pixel_pos;
|
2012-01-04 03:02:38 +04:00
|
|
|
_fpmf_text text;
|
|
|
|
_fpmf_draw_glyph draw_glyph;
|
2011-01-31 00:48:22 +03:00
|
|
|
_fpmf_dtor dtor;
|
2011-01-06 00:02:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-03-01 22:29:40 +03:00
|
|
|
struct rect;
|
2011-01-06 00:02:22 +03:00
|
|
|
|
|
|
|
struct s_vdi_sysinfo {
|
2011-04-11 01:47:59 +04:00
|
|
|
short vdi_handle; /* vdi handle */
|
|
|
|
short scr_w; /* resolution horz. */
|
|
|
|
short scr_h; /* resolution vert. */
|
|
|
|
short scr_bpp; /* bits per pixel */
|
|
|
|
int colors; /* 0=hiclor, 2=mono */
|
|
|
|
unsigned long hicolors; /* if colors = 0 */
|
|
|
|
short pixelsize; /* bytes per pixel */
|
|
|
|
unsigned short pitch; /* row pitch */
|
|
|
|
unsigned short vdiformat; /* pixel format */
|
|
|
|
unsigned short clut; /* type of clut support */
|
|
|
|
void * screen; /* pointer to screen, or NULL */
|
|
|
|
unsigned long screensize;/* size of screen (in bytes) */
|
|
|
|
unsigned long mask_r; /* color masks */
|
2011-01-06 00:02:22 +03:00
|
|
|
unsigned long mask_g;
|
|
|
|
unsigned long mask_b;
|
|
|
|
unsigned long mask_a;
|
2011-04-11 01:47:59 +04:00
|
|
|
short maxintin; /* maximum pxy items */
|
|
|
|
short maxpolycoords; /* max coords for p_line etc. */
|
|
|
|
unsigned long EdDiVersion;/* EdDi Version or 0 */
|
|
|
|
bool rasterscale; /* raster scaling support */
|
2011-01-06 00:02:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-01-31 00:48:22 +03:00
|
|
|
/* declaration of plotter member functions ( _pmf_ prefix )*/
|
|
|
|
typedef int (*_pmf_resize)(GEM_PLOTTER self, int w, int h);
|
|
|
|
typedef int (*_pmf_move)(GEM_PLOTTER self, short x, short y );
|
|
|
|
typedef void * (*_pmf_create_framebuffer)(GEM_PLOTTER self);
|
2011-11-30 01:19:26 +04:00
|
|
|
typedef void * (*_pmf_switch_to_framebuffer)(GEM_PLOTTER self);
|
|
|
|
typedef int (*_pmf_lock)(GEM_PLOTTER self);
|
2011-01-31 00:48:22 +03:00
|
|
|
typedef int (*_pmf_unlock)(GEM_PLOTTER self);
|
|
|
|
typedef int (*_pmf_put_pixel)(GEM_PLOTTER self, int x, int y, int color );
|
|
|
|
typedef int (*_pmf_copy_rect)(GEM_PLOTTER self, GRECT src, GRECT dst );
|
2012-03-15 02:06:07 +04:00
|
|
|
typedef int (*_pmf_set_clip)(GEM_PLOTTER self, const struct rect * clip );
|
|
|
|
typedef int (*_pmf_get_clip)(GEM_PLOTTER self, struct rect * clip_out );
|
2011-01-31 00:48:22 +03:00
|
|
|
typedef int (*_pmf_arc)(GEM_PLOTTER self, int x, int y, int radius, int angle1, int angle2, const plot_style_t * pstyle);
|
|
|
|
typedef int (*_pmf_disc)(GEM_PLOTTER self, int x, int y, int radius, const plot_style_t * pstyle);
|
|
|
|
typedef int (*_pmf_line)(GEM_PLOTTER self, int x0, int y0, int x1, int y1, const plot_style_t * pstyle);
|
|
|
|
typedef int (*_pmf_rectangle)(GEM_PLOTTER self, int x0, int y0, int x1, int y1, const plot_style_t * pstyle);
|
|
|
|
typedef int (*_pmf_polygon)(GEM_PLOTTER self, const int *p, unsigned int n, const plot_style_t * pstyle);
|
|
|
|
typedef int (*_pmf_path)(GEM_PLOTTER self, const float *p, unsigned int n, int fill, float width, int c, const float transform[6]);
|
|
|
|
typedef int (*_pmf_bitmap_resize) ( GEM_PLOTTER self, struct bitmap * bm, int nw, int nh );
|
2011-12-31 19:21:49 +04:00
|
|
|
typedef int (*_pmf_bitmap_convert)( GEM_PLOTTER self, struct bitmap * img, int x, int y,
|
|
|
|
GRECT * clip, uint32_t bg, uint32_t flags, MFDB *out );
|
2011-01-31 00:48:22 +03:00
|
|
|
typedef int (*_pmf_bitmap)(GEM_PLOTTER self, struct bitmap * bmp, int x, int y,
|
|
|
|
unsigned long bg, unsigned long flags );
|
2012-01-02 18:29:16 +04:00
|
|
|
typedef int (*_pmf_plot_mfdb)(GEM_PLOTTER self, GRECT * loc, MFDB * mfdb, unsigned char fgcolor, uint32_t flags);
|
2011-01-31 00:48:22 +03:00
|
|
|
typedef int (*_pmf_text)(GEM_PLOTTER self, int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle);
|
|
|
|
typedef int (*_pmf_dtor)(GEM_PLOTTER self);
|
|
|
|
|
|
|
|
|
2011-04-11 01:47:59 +04:00
|
|
|
/* this is the prototype of an plotter "object" */
|
2011-01-06 00:02:22 +03:00
|
|
|
struct s_gem_plotter
|
|
|
|
{
|
|
|
|
char * name; /* name that identifies the Plotter */
|
|
|
|
unsigned long flags;
|
|
|
|
int vdi_handle;
|
|
|
|
struct s_vdi_sysinfo * scr;
|
|
|
|
void * priv_data;
|
2011-08-05 05:10:36 +04:00
|
|
|
/* bit depth of framebuffers: */
|
2011-11-30 01:19:26 +04:00
|
|
|
int bpp_virt;
|
2011-01-06 00:02:22 +03:00
|
|
|
|
|
|
|
FONT_PLOTTER font_plotter;
|
2011-08-05 05:10:36 +04:00
|
|
|
/* set new dimensions (realloc memory): */
|
2011-01-31 00:48:22 +03:00
|
|
|
_pmf_resize resize;
|
2011-08-05 05:10:36 +04:00
|
|
|
/* set drawing origin: */
|
2011-01-31 00:48:22 +03:00
|
|
|
_pmf_move move;
|
|
|
|
_pmf_lock lock;
|
|
|
|
_pmf_unlock unlock;
|
|
|
|
_pmf_create_framebuffer create_framebuffer;
|
|
|
|
_pmf_switch_to_framebuffer switch_to_framebuffer;
|
|
|
|
_pmf_put_pixel put_pixel;
|
|
|
|
_pmf_copy_rect copy_rect;
|
2012-03-15 02:06:07 +04:00
|
|
|
_pmf_set_clip set_clip;
|
|
|
|
_pmf_get_clip get_clip;
|
2011-01-31 00:48:22 +03:00
|
|
|
_pmf_arc arc;
|
|
|
|
_pmf_disc disc;
|
|
|
|
_pmf_line line;
|
|
|
|
_pmf_rectangle rectangle;
|
|
|
|
_pmf_polygon polygon;
|
|
|
|
_pmf_path path;
|
2011-08-05 05:10:36 +04:00
|
|
|
/* scale an netsurf bitmap: */
|
2011-12-31 19:21:49 +04:00
|
|
|
_pmf_bitmap_resize bitmap_resize;
|
|
|
|
/* convert an ABGR (netsurf) bitmap to screen format, ready for vro_cpyfm */
|
|
|
|
_pmf_bitmap_convert bitmap_convert;
|
2011-08-05 05:10:36 +04:00
|
|
|
/* plot an netsurf bitmap into the buffer / screen: */
|
2011-01-31 00:48:22 +03:00
|
|
|
_pmf_bitmap bitmap;
|
2011-08-05 05:10:36 +04:00
|
|
|
/* plot an mfdb into the buffer / screen: */
|
2011-03-21 01:28:53 +03:00
|
|
|
_pmf_plot_mfdb plot_mfdb;
|
2011-01-31 00:48:22 +03:00
|
|
|
_pmf_text text;
|
|
|
|
_pmf_dtor dtor;
|
2011-01-06 00:02:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2011-04-11 01:47:59 +04:00
|
|
|
/* these 2 structs hold info about an specific driver. */
|
|
|
|
/* a table in plotter.c defines all the available plotters */
|
2011-01-06 00:02:22 +03:00
|
|
|
struct s_driver_table_entry
|
2012-03-15 02:06:07 +04:00
|
|
|
{
|
|
|
|
|
|
|
|
/* name (unique) */
|
|
|
|
char * name;
|
|
|
|
|
|
|
|
/* pointer to ctor of the plotter */
|
|
|
|
int (*ctor)( GEM_PLOTTER self, GRECT * log_isze );
|
|
|
|
|
|
|
|
/* a bitmask containing info about supported operations */
|
|
|
|
int flags;
|
|
|
|
|
|
|
|
/* the maximum supported screen depth of the plotter */
|
|
|
|
int max_bpp;
|
2011-01-06 00:02:22 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
struct s_font_driver_table_entry
|
|
|
|
{
|
2012-03-15 02:06:07 +04:00
|
|
|
const char * name;
|
2011-01-06 00:02:22 +03:00
|
|
|
int (*ctor)( FONT_PLOTTER self );
|
|
|
|
int flags;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct s_driver_table_entry * PLOTTER_INFO;
|
|
|
|
typedef struct s_font_driver_table_entry * FONT_PLOTTER_INFO;
|
|
|
|
|
|
|
|
/* get s_driver_table_entry from driver table */
|
|
|
|
struct s_driver_table_entry * get_screen_driver_entry(char * name);
|
|
|
|
|
|
|
|
/* get s_font_driver_table_entry from driver table */
|
|
|
|
struct s_font_driver_table_entry * get_font_driver_entry(char * name);
|
|
|
|
|
|
|
|
/* fill screen / sys info */
|
|
|
|
struct s_vdi_sysinfo * read_vdi_sysinfo(short vdih, struct s_vdi_sysinfo * info );
|
|
|
|
|
|
|
|
/*
|
|
|
|
Create an new plotter object
|
|
|
|
Error Values:
|
|
|
|
-1 no mem
|
|
|
|
-2 error configuring plotter
|
|
|
|
-3 Plotter not available
|
|
|
|
*/
|
|
|
|
GEM_PLOTTER new_plotter(int vdihandle, char * name,
|
|
|
|
GRECT *, int virt_bpp, unsigned long flags, FONT_PLOTTER font_renderer,
|
|
|
|
int * error);
|
|
|
|
|
|
|
|
/*
|
|
|
|
Create an new font plotter object
|
|
|
|
Error Values:
|
|
|
|
-1 no mem
|
|
|
|
-2 error configuring font plotter
|
|
|
|
-3 Font Plotter not available
|
|
|
|
*/
|
|
|
|
FONT_PLOTTER new_font_plotter(int vdihandle, char * name, unsigned long flags, int * error );
|
|
|
|
|
|
|
|
/* free the plotter resources */
|
|
|
|
int delete_plotter( GEM_PLOTTER p );
|
|
|
|
int delete_font_plotter( FONT_PLOTTER p );
|
|
|
|
|
|
|
|
|
|
|
|
/* calculate size of intermediate buffer */
|
|
|
|
int calc_chunked_buffer_size(int x, int y, int stride, int bpp);
|
|
|
|
|
|
|
|
/* calculates the pixel offset from x,y pos */
|
|
|
|
int get_pixel_offset( int x, int y, int stride, int bpp );
|
|
|
|
|
|
|
|
/* translate an error number */
|
|
|
|
const char* plotter_err_str(int i) ;
|
|
|
|
|
|
|
|
void dump_font_drivers(void);
|
|
|
|
void dump_plot_drivers(void);
|
|
|
|
void dump_vdi_info(short);
|
2011-12-31 19:21:49 +04:00
|
|
|
|
2012-01-07 02:10:10 +04:00
|
|
|
/* convert an vdi color to bgra */
|
|
|
|
void vdi1000_to_rgb( unsigned short * in, unsigned char * out );
|
2011-01-06 00:02:22 +03:00
|
|
|
|
2012-01-07 02:10:10 +04:00
|
|
|
/* convert an bgra color to vdi1000 color */
|
2011-01-06 00:02:22 +03:00
|
|
|
void rgb_to_vdi1000( unsigned char * in, unsigned short * out );
|
|
|
|
|
|
|
|
/* convert an rgb color to an index into the web palette */
|
|
|
|
short rgb_to_666_index(unsigned char r, unsigned char g, unsigned char b);
|
|
|
|
|
2011-03-14 00:46:59 +03:00
|
|
|
/*
|
2011-11-30 01:19:26 +04:00
|
|
|
setup an MFDB struct and allocate memory for it when it is needed.
|
2011-03-14 00:46:59 +03:00
|
|
|
If bpp == 0, this function assumes that the MFDB shall point to the screen
|
2011-11-30 01:19:26 +04:00
|
|
|
and will not allocate any memory (mfdb.fd_addr == 0).
|
|
|
|
The function will return 0 when the memory allocation fails
|
2011-03-21 01:28:53 +03:00
|
|
|
( out of memory), otherwise it returns the size of the mfdb.fd_addr
|
2011-11-30 01:19:26 +04:00
|
|
|
as number of bytes.
|
2011-03-14 00:46:59 +03:00
|
|
|
*/
|
2011-03-21 01:28:53 +03:00
|
|
|
int init_mfdb(int bpp, int w, int h, uint32_t flags, MFDB * out );
|
2011-03-14 00:46:59 +03:00
|
|
|
|
|
|
|
/* shared / static methods follows */
|
|
|
|
|
|
|
|
/*
|
2011-11-30 01:19:26 +04:00
|
|
|
Get clipping for current framebuffer
|
2011-03-14 00:46:59 +03:00
|
|
|
*/
|
2011-03-01 22:29:40 +03:00
|
|
|
int plotter_get_clip( GEM_PLOTTER self, struct rect * out );
|
2011-03-14 00:46:59 +03:00
|
|
|
|
2011-03-21 01:28:53 +03:00
|
|
|
/*
|
|
|
|
Get clipping for current framebuffer as GRECT
|
|
|
|
*/
|
|
|
|
void plotter_get_clip_grect( GEM_PLOTTER self, GRECT * out );
|
|
|
|
|
2011-04-11 01:47:59 +04:00
|
|
|
|
2011-01-06 00:02:22 +03:00
|
|
|
#define PLOTTER_IS_LOCKED(plotter) ( plotter->private_flags & PLOTTER_FLAG_LOCKED )
|
|
|
|
|
|
|
|
|
2012-03-15 02:06:07 +04:00
|
|
|
/*
|
|
|
|
calculates MFDB compatible rowstride (in number of bits)
|
|
|
|
*/
|
|
|
|
#define MFDB_STRIDE( w ) (((w & 15) != 0) ? (w | 15)+1 : w)
|
2011-01-06 00:02:22 +03:00
|
|
|
|
2012-03-15 02:06:07 +04:00
|
|
|
/*
|
|
|
|
Calculate size of an mfdb,
|
|
|
|
|
|
|
|
params:
|
|
|
|
|
|
|
|
bpp: Bits per pixel,
|
|
|
|
stride: Word aligned rowstride (width) as returned by MFDB_STRIDE,
|
|
|
|
h: Height in pixels
|
|
|
|
*/
|
|
|
|
#define MFDB_SIZE( bpp, stride, h ) ( ((stride >> 3) * h) * bpp )
|
|
|
|
|
|
|
|
#ifdef WITH_8BPP_SUPPORT
|
2011-04-11 01:47:59 +04:00
|
|
|
/* some Well known indexes into the VDI palette */
|
|
|
|
/* common indexes into the VDI palette */
|
|
|
|
/* (only used when running with 256 colors or less ) */
|
2011-11-30 01:19:26 +04:00
|
|
|
#define OFFSET_WEB_PAL 16
|
2012-03-15 02:06:07 +04:00
|
|
|
#define OFFSET_CUST_PAL 232
|
|
|
|
#define RGB_TO_VDI(c) rgb_to_666_index( (c&0xFF),(c&0xFF00)>>8,(c&0xFF0000)>>16)+OFFSET_WEB_PAL
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* the name of this macro is crap - it should be named bgr_to_rgba ... or so */
|
|
|
|
#define ABGR_TO_RGB(c) ( ((c&0xFF)<<16) | (c&0xFF00) | ((c&0xFF0000)>>16) ) << 8
|
|
|
|
/* this index into the palette is used by the TC renderer to set current draw color: */
|
|
|
|
#define OFFSET_CUSTOM_COLOR 255
|
2011-04-11 01:47:59 +04:00
|
|
|
|
2011-01-06 00:02:22 +03:00
|
|
|
|
|
|
|
#endif
|