//-----------------------------------------------------------------------------
//  (c) 2002 by Basler Vision Technologies
//  Section:  Vision Components
//  Project:  BVC
//  $Header: /cvs/genicam/genicam/library/CPP/include/GenApi/Basler/BvcDib/DibSectn.h,v 1.2 2006/02/22 11:48:55 rueder Exp $
//-----------------------------------------------------------------------------
/**
  \file
 *
  \brief   Interface for the DIBSections functions
 *
 * <type long description here>
 */
//-----------------------------------------------------------------------------


#pragma once


//! Creates a DIBSection based on the criteria passed in as parameters.
HBITMAP DSCreateDIBSection( LONG dwX, LONG dwY, WORD wBits, BOOL Monochrome );

//! Creates a DIBSection based on the contents of a BMP file.
BOOL DSLoadDIBSectionFromBMPFile( LPCTSTR szFileName, HBITMAP *phBitmap, HPALETTE *phPalette );

//! Stores the DIBSection in a BMP file.
BOOL DSStoreDIBSectionInBMPFile( LPCTSTR szFileName, HBITMAP hBitmap );

//! Draws a DIBSection on a target DC.
BOOL DSDrawDIBSectionOnDC( HDC hDC, HBITMAP hBitmap, LPRECT pRect );

//! Creates a palette to be used to display the DIBSection on a palettized display device.
HPALETTE DSCreatePaletteForDIBSection( HBITMAP hBitmap );

//! Allocates and returns a pointer to a BITMAPINFO for the DIBSection.
LPBITMAPINFO DSGetBITMAPINFOForDIBSection( HBITMAP hBitmap );

//! Calculates and returns the size, in bytes, of the color table for the DIB described by the BITMAPINFO.
DWORD DSColorTableSize( LPBITMAPINFO pbmi );

//! Calculates and returns the size, in bytes, of the entire CF_DIB bitmap described by the BITMAPINFO 
//! - including header, color table, and image bits.
DWORD DSTotalBytesSize( LPBITMAPINFO pbmi );

//! Calculates and returns the size, in bytes, of the image bits for the DIB described by the BITMAPINFO.
DWORD DSImageBitsSize( LPBITMAPINFO pbmi );

//! Returns a pointer to the DIBSection's image bits.
LPBYTE DSGetPointerToDIBSectionImageBits( HBITMAP hBitmap );

//! This function will build a palette with a spectrum of colors.  
HPALETTE DSCreateSpectrumPalette( void );
