Ignore:
Timestamp:
Dec 12, 2003, 3:49:41 PM (19 years ago)
Author:
Sam Hocevar
Message:
  • src/bitmap.c: + Added antialiasing support. + Dithering, antialiasing and background mode can now be selected at

runtime.

  • src/caca.c src/caca.h: + Renamed caca_dithering into caca_feature and extended the type to

express background colour and antialiasing mode.

  • examples/demo.c: + Fixed a bug that disabled the sprite demo. + Draw solid flares.
  • examples/view.c: + Select antialiasing and background mode at runtime.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/src/caca.h

    r247 r249  
    8585
    8686/**
    87  * The dithering modes to be used with caca_set_dithering().
    88  */
    89 enum caca_dithering
    90 {
    91     CACA_DITHERING_NONE = 0,
    92     CACA_DITHERING_ORDERED2 = 1,
    93     CACA_DITHERING_ORDERED4 = 2,
    94     CACA_DITHERING_ORDERED8 = 3,
    95     CACA_DITHERING_RANDOM = 4
    96 };
    97 
    98 const char *caca_get_dithering_name(enum caca_dithering);
     87 * The internal libcaca features.
     88 */
     89enum caca_feature
     90{
     91    /* Properties of background characters */
     92    CACA_BACKGROUND       = 0x10,
     93    CACA_BACKGROUND_BLACK = 0x11,
     94    CACA_BACKGROUND_SOLID = 0x12,
     95#define CACA_BACKGROUND_MIN 0x11
     96#define CACA_BACKGROUND_MAX 0x12
     97
     98    /* Antialiasing features */
     99    CACA_ANTIALIASING           = 0x20,
     100    CACA_ANTIALIASING_NONE      = 0x21,
     101    CACA_ANTIALIASING_PREFILTER = 0x22,
     102#define CACA_ANTIALIASING_MIN     0x21
     103#define CACA_ANTIALIASING_MAX     0x22
     104
     105    /* Dithering methods */
     106    CACA_DITHERING          = 0x30,
     107    CACA_DITHERING_NONE     = 0x31,
     108    CACA_DITHERING_ORDERED2 = 0x32,
     109    CACA_DITHERING_ORDERED4 = 0x33,
     110    CACA_DITHERING_ORDERED8 = 0x34,
     111    CACA_DITHERING_RANDOM   = 0x35,
     112#define CACA_DITHERING_MIN    0x31
     113#define CACA_DITHERING_MAX    0x35
     114
     115    /* Unknown feature */
     116    CACA_UNKNOWN_FEATURE = 0xffff
     117};
     118
     119const char *caca_get_feature_name(enum caca_feature);
    99120
    100121/* Backwards compatibility */
     122#define caca_dithering caca_feature
     123#define caca_set_dithering caca_set_feature
     124#define caca_get_dithering_name caca_get_feature_name
    101125#define CACA_DITHER_NONE    CACA_DITHERING_NONE
    102126#define CACA_DITHER_ORDERED CACA_DITHERING_ORDERED8
     
    146170int caca_init(void);
    147171void caca_set_delay(unsigned int);
    148 void caca_set_dithering(enum caca_dithering);
     172enum caca_feature caca_get_feature(enum caca_feature);
     173void caca_set_feature(enum caca_feature);
    149174unsigned int caca_get_rendertime(void);
    150175unsigned int caca_get_width(void);
Note: See TracChangeset for help on using the changeset viewer.