home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / ODFDev / ODF / OS / FWGraphx / SLWinDIB.h < prev   
Encoding:
Text File  |  1996-09-17  |  2.5 KB  |  123 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                SLWinDIB.h
  4. //    Release Version:    $ ODF 2 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef SLWINDIB_H
  11. #define SLWINDIB_H
  12.  
  13. #ifndef FWSTDDEF_H
  14. #include "FWStdDef.h"
  15. #endif
  16.  
  17. #ifdef FW_BUILD_WIN
  18.  
  19. #ifndef SLCOLOR_H
  20. #include "SLColor.h"
  21. #endif
  22.  
  23. #ifndef SLSTRMRW_H
  24. #include "SLStrmRW.h"
  25. #endif
  26.  
  27. //========================================================================================
  28. // DIB utilities
  29. //========================================================================================
  30.  
  31. FW_EXTERN_C_BEGIN
  32.  
  33. // ----- Attributes
  34.  
  35. FW_WinPixelBufferPtr
  36. SL_API        FW_DIBGetPixelBuffer(FW_WinDIB dib);
  37.  
  38. unsigned short
  39. SL_API        FW_PrivDIBAcquireColorTable(FW_WinDIB dib, FW_SColor** colors);
  40.  
  41. void
  42. SL_API        FW_DIBReleaseColorTable(FW_SColor* colors);
  43.  
  44. // ----- Conversion
  45.  
  46. HBITMAP
  47. SL_API        FW_PrivDIBConvertToBitmap(FW_WinDIB dib, HPALETTE hPal);
  48.  
  49. FW_WinDIB
  50. SL_API        FW_PrivDIBConvertFromBitmap(HBITMAP bitmapHandle, short bitDepth, HPALETTE hPal);
  51.     
  52. // ----- Palette
  53.  
  54. unsigned long
  55. SL_API        FW_DIBGetPaletteSize(FW_WinDIB dib);
  56.  
  57. HPALETTE
  58. SL_API        FW_PrivDIBGetPalette(Environment* ev, FW_WinDIB dib);
  59.  
  60. // ----- Creation
  61.  
  62. FW_WinDIB
  63. SL_API        FW_PrivDIBCreate(
  64.                 short bitDepth, short width, short height,
  65.                 short nbColors, const FW_SColor* colorTable,
  66.                 const void* pixels);
  67.  
  68. FW_WinDIB
  69. SL_API        FW_PrivDIBCreateCopy(FW_WinDIB dib);
  70.     
  71. // ----- Persistence
  72.  
  73. FW_WinDIB
  74. SL_API        FW_PrivDIBLoadFromStream(
  75.     Environment*                ev,
  76.     FW_HReadableStream            stream,
  77.     FW_Boolean                     bFileHeader);
  78.  
  79. void
  80. SL_API        FW_PrivDIBSaveToStream(
  81.     Environment*                ev,
  82.     FW_HWritableStream             stream,
  83.     FW_WinDIB                     dib,
  84.     FW_Boolean                     bFileHeader);
  85.  
  86. // ----- Memory
  87.  
  88. void
  89. SL_API        FW_DIBFree(FW_WinDIB dib);
  90.  
  91. //========================================================================================
  92. // Device Dependent Bitmap utilities
  93. //========================================================================================
  94.  
  95. // ----- Color info
  96.  
  97. short
  98. SL_API        FW_DDBGetColorDepth(HBITMAP hBitmap);
  99.  
  100. // ----- Image copying options
  101.  
  102. enum
  103. {
  104.     FW_kCropImage,
  105.     FW_kScaleImage
  106. };
  107.  
  108. void
  109. SL_API        FW_DDBCopyImage(
  110.                 HBITMAP     hBmpDst,
  111.                 HPALETTE     hPalDst,
  112.                 const RECT*    rectDst,
  113.                 HBITMAP     hBmpSrc,
  114.                 HPALETTE    hPalSrc,
  115.                 const RECT*    rectSrc,
  116.                 short options);
  117.  
  118. FW_EXTERN_C_END
  119.  
  120. #endif // FW_BUILD_WIN
  121.  
  122. #endif // SLWINDIB_H
  123.