home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.1 (Developer) [x86] / NeXT Step 3.1 Intel dev.cdr.dmg / NextDeveloper / Headers / bsd / dev / i386 / displayDefs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-04-30  |  3.5 KB  |  99 lines

  1. /*     Copyright (c) 1992 NeXT Computer, Inc.  All rights reserved. 
  2.  *
  3.  * displayDefs.h - Defs of various structs/data used by the display system.
  4.  *
  5.  *
  6.  * HISTORY
  7.  * 01 Sep 92    Joe Pasqua
  8.  *      Created. 
  9.  */
  10.  
  11. //
  12. // Bits per pixel values.
  13. //
  14. typedef enum {
  15.     IO_2BitsPerPixel,    //  2 bpp grayscale
  16.     IO_8BitsPerPixel,    //  8 bpp grayscale
  17.     IO_12BitsPerPixel,    // 16 bpp, 12 used (4 bits/component)
  18.     IO_15BitsPerPixel,    // 16 bpp, 15 used (5 bits/component)
  19.     IO_32BitsPerPixel,    // 32 bpp, 24 used (8 bits/component)
  20.     IO_VGA        // VGA framebuffer
  21.             // (VGA is special, and may not be
  22.             // linearly mapped or packed pixel format.)
  23. } IOBitsPerPixel;
  24.  
  25. // Definitions of Color Space Type and Values
  26. typedef unsigned short IOColorSpace;
  27. #define IO_DISPLAY_ONEISBLACKCOLORSPACE    0
  28. #define IO_DISPLAY_ONEISWHITECOLORSPACE    1
  29. #define IO_DISPLAY_RGBCOLORSPACE    2
  30. #define IO_DISPLAY_CMYKCOLORSPACE    3
  31.  
  32. //
  33. // Structure describing the layout of the display.
  34. //
  35. typedef struct
  36. {
  37.     int        width;        // Width in pixels
  38.     int        height;        // Height in pixels
  39.     int        totalWidth;    // Width in pixels including undisplayed pixels
  40.     int        rowBytes;    // # bytes to get from one scanline to next
  41.     int        refreshRate;    // Monitor refresh setting
  42.  
  43.     // Pointer to origin of screen. This pointer is deliberately 
  44.     // untyped to force actual screen writes to be dependent on
  45.     // bits_per_pixel.
  46.     void    *frameBuffer;    
  47.     
  48.     // VRAM configuration, indicated by memory space occupied by one pixel.
  49.     IOBitsPerPixel    bitsPerPixel;
  50.     IOColorSpace    colorSpace;
  51.     
  52.     // Flags used to indicate special requirements or conditions to DPS
  53.     unsigned int    flags;
  54.     
  55.     // Driver specific parameters
  56.     void *parameters;
  57. } IODisplayInfo;
  58.  
  59.  
  60. //
  61. // Definition of values for the IODisplayInfo flags field
  62. //
  63.  
  64. // Bit 1 determines whether the display requires gamma corrected 444->555
  65. // conversion in software.
  66. #define IO_DISPLAY_NEEDS_SOFTWARE_GAMMA_CORRECTION    0x00000002
  67.  
  68. // Bits 2 and 3 specify cache behavior
  69. #define IO_DISPLAY_CACHE_WRITETHROUGH        0x00000000     // default
  70. #define IO_DISPLAY_CACHE_COPYBACK        0x00000004
  71. #define IO_DISPLAY_CACHE_OFF            0x00000008
  72. #define IO_DISPLAY_CACHE_MASK            0x0000000C
  73.  
  74. // Bit 4 indicates if the a hardware gamma correction transfer table
  75. // (CLUT)exists and can be changed by an IODISPLAY_SET_TRANSFER_TABLE call.
  76. #define IO_DISPLAY_HAS_TRANSFER_TABLE        0x00000010
  77.  
  78. // Parameter to be supported by Display subclasses in their implementation
  79. // of setIntValues:forParameter:count: method, if the driver supports
  80. // setting a hardware gamma correction transfer table.
  81. //
  82. // The transfer table has a maximum size of 256 ints, and may be smaller.
  83. // 32 or 24 bit color, and 8 bit monochrome displays use the full 256 entries.
  84. // 15 bit color displays use 32 entries. 12 bit color displays use 16 entries.
  85. // 2 bit monochrome displays use 4 entries.  Each integer in the table holds
  86. // a packed RGBM value.  Monochrome displays use the low byte.  Color displays
  87. // should use the high 3 bytes, with Red in the most significant byte.
  88. #define IODISPLAY_SET_TRANSFER_TABLE        "IO_Display_Set_Transfer_Table"
  89. #define IODISPLAY_SET_TRANSFER_TABLE_2BPP_SIZE    4
  90. #define IODISPLAY_SET_TRANSFER_TABLE_8BPP_SIZE    256
  91. #define IODISPLAY_SET_TRANSFER_TABLE_12BPP_SIZE    16
  92. #define IODISPLAY_SET_TRANSFER_TABLE_15BPP_SIZE    32
  93. #define IODISPLAY_SET_TRANSFER_TABLE_24BPP_SIZE    256
  94. #define IODISPLAY_SET_TRANSFER_TABLE_32BPP_SIZE    256
  95. #define IODISPLAY_SET_TRANSFER_TABLE_MAXSIZE    256
  96.  
  97. #define IODISPLAY_GET_PORT    "IO_Display_GetPort"
  98. #define IODISPLAY_GET_PORT_SIZE    1
  99.