PageRenderTime 23ms CodeModel.GetById 10ms app.highlight 11ms RepoModel.GetById 1ms app.codeStats 0ms

/binding/win32/gdipluscolormatrix.d

http://github.com/wilkie/djehuty
D | 100 lines | 43 code | 16 blank | 41 comment | 0 complexity | 0a25a9e5b5dcd7c2a8c704be2ec40b8f MD5 | raw file
  1/*
  2 * gdipluscolormatrix.d
  3 *
  4 * This module implements GdiPlusColorMatrix.h for D. The original copyright
  5 * info is given below.
  6 *
  7 * Author: Dave Wilkinson
  8 * Originated: November 25th, 2009
  9 *
 10 */
 11
 12module binding.win32.gdipluscolormatrix;
 13
 14import binding.win32.windef;
 15import binding.win32.winbase;
 16import binding.win32.winnt;
 17import binding.win32.guiddef;
 18import binding.win32.gdipluscolor;
 19import binding.win32.gdiplusimaging;
 20import binding.win32.gdiplustypes;
 21import binding.win32.gdiplusenums;
 22import binding.win32.gdipluspixelformats;
 23
 24/**************************************************************************\
 25*
 26* Copyright (c) 1998-2001, Microsoft Corp.  All Rights Reserved.
 27*
 28* Module Name:
 29*
 30*   GdiplusColorMatrix.h
 31*
 32* Abstract:
 33*
 34*  GDI+ Color Matrix object, used with Graphics.DrawImage
 35*
 36\**************************************************************************/
 37
 38extern(System):
 39
 40//----------------------------------------------------------------------------
 41// Color channel look up table (LUT)
 42//----------------------------------------------------------------------------
 43
 44alias BYTE[256] ColorChannelLUT;
 45
 46//----------------------------------------------------------------------------
 47// Per-channel Histogram for 8bpp images.
 48//----------------------------------------------------------------------------
 49
 50enum HistogramFormat {
 51    HistogramFormatARGB,
 52    HistogramFormatPARGB,
 53    HistogramFormatRGB,
 54    HistogramFormatGray,
 55    HistogramFormatB,
 56    HistogramFormatG,
 57    HistogramFormatR,
 58    HistogramFormatA
 59}
 60
 61//----------------------------------------------------------------------------
 62// Color matrix
 63//----------------------------------------------------------------------------
 64
 65struct ColorMatrix {
 66    REAL m[5][5] = [[1,0,0,0,0], [0,1,0,0,0], [0,0,1,0,0], [0,0,0,1,0], [0,0,0,0,1]];
 67}
 68
 69//----------------------------------------------------------------------------
 70// Color Matrix flags
 71//----------------------------------------------------------------------------
 72
 73enum ColorMatrixFlags {
 74    ColorMatrixFlagsDefault   = 0,
 75    ColorMatrixFlagsSkipGrays = 1,
 76    ColorMatrixFlagsAltGray   = 2
 77}
 78
 79//----------------------------------------------------------------------------
 80// Color Adjust Type
 81//----------------------------------------------------------------------------
 82
 83enum ColorAdjustType {
 84    ColorAdjustTypeDefault,
 85    ColorAdjustTypeBitmap,
 86    ColorAdjustTypeBrush,
 87    ColorAdjustTypePen,
 88    ColorAdjustTypeText,
 89    ColorAdjustTypeCount,
 90    ColorAdjustTypeAny      // Reserved
 91}
 92
 93//----------------------------------------------------------------------------
 94// Color Map
 95//----------------------------------------------------------------------------
 96
 97struct ColorMap {
 98    Color oldColor;
 99    Color newColor;
100}