FreeRDP
color.h File Reference
#include <freerdp/api.h>
#include <winpr/wlog.h>
#include <freerdp/log.h>
This graph shows which files directly or indirectly include this file:

Data Structures

struct  gdiPalette
 

Macros

#define CTAG   FREERDP_TAG("codec.color")
 
#define FREERDP_PIXEL_FORMAT_TYPE_A   0
 
#define FREERDP_PIXEL_FORMAT_TYPE_ARGB   1
 
#define FREERDP_PIXEL_FORMAT_TYPE_ABGR   2
 
#define FREERDP_PIXEL_FORMAT_TYPE_RGBA   3
 
#define FREERDP_PIXEL_FORMAT_TYPE_BGRA   4
 
#define FREERDP_PIXEL_FORMAT_IS_ABGR(_format)   (FREERDP_PIXEL_FORMAT_TYPE(_format) == FREERDP_PIXEL_FORMAT_TYPE_ABGR)
 
#define FREERDP_FLIP_NONE   0
 
#define FREERDP_FLIP_VERTICAL   1
 
#define FREERDP_FLIP_HORIZONTAL   2
 
#define FREERDP_PIXEL_FORMAT(_bpp, _type, _a, _r, _g, _b)   ((_bpp << 24) | (_type << 16) | (_a << 12) | (_r << 8) | (_g << 4) | (_b))
 
#define FREERDP_PIXEL_FORMAT_TYPE(_format)   (((_format) >> 16) & 0x07)
 
#define PIXEL_FORMAT_ARGB32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 8, 8, 8, 8)
 
#define PIXEL_FORMAT_XRGB32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8)
 
#define PIXEL_FORMAT_ABGR32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 8, 8, 8, 8)
 
#define PIXEL_FORMAT_XBGR32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8)
 
#define PIXEL_FORMAT_BGRA32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 8, 8, 8, 8)
 
#define PIXEL_FORMAT_BGRX32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 0, 8, 8, 8)
 
#define PIXEL_FORMAT_RGBA32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 8, 8, 8, 8)
 
#define PIXEL_FORMAT_RGBX32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 0, 8, 8, 8)
 
#define PIXEL_FORMAT_RGB24   FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8)
 
#define PIXEL_FORMAT_BGR24   FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8)
 
#define PIXEL_FORMAT_RGB16   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 6, 5)
 
#define PIXEL_FORMAT_BGR16   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 6, 5)
 
#define PIXEL_FORMAT_ARGB15   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 1, 5, 5, 5)
 
#define PIXEL_FORMAT_RGB15   FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 5, 5)
 
#define PIXEL_FORMAT_ABGR15   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 1, 5, 5, 5)
 
#define PIXEL_FORMAT_BGR15   FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 5, 5)
 
#define PIXEL_FORMAT_RGB8   FREERDP_PIXEL_FORMAT(8, FREERDP_PIXEL_FORMAT_TYPE_A, 8, 0, 0, 0)
 
#define PIXEL_FORMAT_A4   FREERDP_PIXEL_FORMAT(4, FREERDP_PIXEL_FORMAT_TYPE_A, 4, 0, 0, 0)
 
#define PIXEL_FORMAT_MONO   FREERDP_PIXEL_FORMAT(1, FREERDP_PIXEL_FORMAT_TYPE_A, 1, 0, 0, 0)
 
#define GetColorFormatName   FreeRDPGetColorFormatName
 
#define GetColor   FreeRDPGetColor
 
#define ConvertColor   FreeRDPConvertColor
 

Functions

static INLINE DWORD AreColorFormatsEqualNoAlpha (DWORD first, DWORD second)
 
static const char * FreeRDPGetColorFormatName (UINT32 format)
 
static INLINE void SplitColor (UINT32 color, UINT32 format, BYTE *_r, BYTE *_g, BYTE *_b, BYTE *_a, const gdiPalette *palette)
 
static INLINE UINT32 FreeRDPGetColor (UINT32 format, BYTE r, BYTE g, BYTE b, BYTE a)
 
static INLINE UINT32 GetBitsPerPixel (UINT32 format)
 
static INLINE BOOL ColorHasAlpha (UINT32 format)
 
static INLINE UINT32 ReadColor (const BYTE *src, UINT32 format)
 
static INLINE BOOL WriteColor (BYTE *dst, UINT32 format, UINT32 color)
 
static INLINE UINT32 FreeRDPConvertColor (UINT32 color, UINT32 srcFormat, UINT32 dstFormat, const gdiPalette *palette)
 
static INLINE UINT32 GetBytesPerPixel (UINT32 format)
 
FREERDP_API BYTEfreerdp_glyph_convert (UINT32 width, UINT32 height, const BYTE *data)
 
FREERDP_API BOOL freerdp_image_copy_from_monochrome (BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE *pSrcData, UINT32 backColor, UINT32 foreColor, const gdiPalette *palette)
 
FREERDP_API BOOL freerdp_image_copy_from_pointer_data (BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE *xorMask, UINT32 xorMaskLength, const BYTE *andMask, UINT32 andMaskLength, UINT32 xorBpp, const gdiPalette *palette)
 
FREERDP_API BOOL freerdp_image_copy (BYTE *pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, const BYTE *pSrcData, DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, const gdiPalette *palette, UINT32 flags)
 
FREERDP_API BOOL freerdp_image_fill (BYTE *pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 color)
 

Macro Definition Documentation

#define ConvertColor   FreeRDPConvertColor
#define CTAG   FREERDP_TAG("codec.color")

FreeRDP: A Remote Desktop Protocol Implementation Color Conversion Routines

Copyright 2010 Marc-Andre Moreau marca.nosp@m.ndre.nosp@m..more.nosp@m.au@g.nosp@m.mail..nosp@m.com Copyright 2016 Armin Novak armin.nosp@m..nov.nosp@m.ak@th.nosp@m.inca.nosp@m.st.co.nosp@m.m Copyright 2016 Thincast Technologies GmbH

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

#define FREERDP_FLIP_HORIZONTAL   2
#define FREERDP_FLIP_NONE   0
#define FREERDP_FLIP_VERTICAL   1
#define FREERDP_PIXEL_FORMAT (   _bpp,
  _type,
  _a,
  _r,
  _g,
  _b 
)    ((_bpp << 24) | (_type << 16) | (_a << 12) | (_r << 8) | (_g << 4) | (_b))
#define FREERDP_PIXEL_FORMAT_IS_ABGR (   _format)    (FREERDP_PIXEL_FORMAT_TYPE(_format) == FREERDP_PIXEL_FORMAT_TYPE_ABGR)
#define FREERDP_PIXEL_FORMAT_TYPE (   _format)    (((_format) >> 16) & 0x07)
#define FREERDP_PIXEL_FORMAT_TYPE_A   0
#define FREERDP_PIXEL_FORMAT_TYPE_ABGR   2
#define FREERDP_PIXEL_FORMAT_TYPE_ARGB   1
#define FREERDP_PIXEL_FORMAT_TYPE_BGRA   4
#define FREERDP_PIXEL_FORMAT_TYPE_RGBA   3
#define GetColor   FreeRDPGetColor
#define GetColorFormatName   FreeRDPGetColorFormatName
#define PIXEL_FORMAT_A4   FREERDP_PIXEL_FORMAT(4, FREERDP_PIXEL_FORMAT_TYPE_A, 4, 0, 0, 0)
#define PIXEL_FORMAT_ABGR15   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 1, 5, 5, 5)
#define PIXEL_FORMAT_ABGR32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 8, 8, 8, 8)
#define PIXEL_FORMAT_ARGB15   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 1, 5, 5, 5)
#define PIXEL_FORMAT_ARGB32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 8, 8, 8, 8)
#define PIXEL_FORMAT_BGR15   FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 5, 5)
#define PIXEL_FORMAT_BGR16   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 5, 6, 5)
#define PIXEL_FORMAT_BGR24   FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8)
#define PIXEL_FORMAT_BGRA32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 8, 8, 8, 8)
#define PIXEL_FORMAT_BGRX32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_BGRA, 0, 8, 8, 8)
#define PIXEL_FORMAT_MONO   FREERDP_PIXEL_FORMAT(1, FREERDP_PIXEL_FORMAT_TYPE_A, 1, 0, 0, 0)
#define PIXEL_FORMAT_RGB15   FREERDP_PIXEL_FORMAT(15, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 5, 5)
#define PIXEL_FORMAT_RGB16   FREERDP_PIXEL_FORMAT(16, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 5, 6, 5)
#define PIXEL_FORMAT_RGB24   FREERDP_PIXEL_FORMAT(24, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8)
#define PIXEL_FORMAT_RGB8   FREERDP_PIXEL_FORMAT(8, FREERDP_PIXEL_FORMAT_TYPE_A, 8, 0, 0, 0)
#define PIXEL_FORMAT_RGBA32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 8, 8, 8, 8)
#define PIXEL_FORMAT_RGBX32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_RGBA, 0, 8, 8, 8)
#define PIXEL_FORMAT_XBGR32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ABGR, 0, 8, 8, 8)
#define PIXEL_FORMAT_XRGB32   FREERDP_PIXEL_FORMAT(32, FREERDP_PIXEL_FORMAT_TYPE_ARGB, 0, 8, 8, 8)

Function Documentation

static INLINE DWORD AreColorFormatsEqualNoAlpha ( DWORD  first,
DWORD  second 
)
static

Here is the caller graph for this function:

static INLINE BOOL ColorHasAlpha ( UINT32  format)
static

Here is the caller graph for this function:

FREERDP_API BYTE* freerdp_glyph_convert ( UINT32  width,
UINT32  height,
const BYTE data 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_image_copy ( BYTE pDstData,
DWORD  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
const BYTE pSrcData,
DWORD  SrcFormat,
UINT32  nSrcStep,
UINT32  nXSrc,
UINT32  nYSrc,
const gdiPalette *  palette,
UINT32  flags 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_image_copy_from_monochrome ( BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
const BYTE pSrcData,
UINT32  backColor,
UINT32  foreColor,
const gdiPalette *  palette 
)

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_image_copy_from_pointer_data ( BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
const BYTE xorMask,
UINT32  xorMaskLength,
const BYTE andMask,
UINT32  andMaskLength,
UINT32  xorBpp,
const gdiPalette *  palette 
)

Drawing Monochrome Pointers: http://msdn.microsoft.com/en-us/library/windows/hardware/ff556143/

Drawing Color Pointers: http://msdn.microsoft.com/en-us/library/windows/hardware/ff556138/

Here is the call graph for this function:

Here is the caller graph for this function:

FREERDP_API BOOL freerdp_image_fill ( BYTE pDstData,
DWORD  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
UINT32  color 
)

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE UINT32 FreeRDPConvertColor ( UINT32  color,
UINT32  srcFormat,
UINT32  dstFormat,
const gdiPalette *  palette 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE UINT32 FreeRDPGetColor ( UINT32  format,
BYTE  r,
BYTE  g,
BYTE  b,
BYTE  a 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static const char* FreeRDPGetColorFormatName ( UINT32  format)
static

Here is the caller graph for this function:

static INLINE UINT32 GetBitsPerPixel ( UINT32  format)
static

Here is the caller graph for this function:

static INLINE UINT32 GetBytesPerPixel ( UINT32  format)
static

Here is the call graph for this function:

static INLINE UINT32 ReadColor ( const BYTE src,
UINT32  format 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE void SplitColor ( UINT32  color,
UINT32  format,
BYTE _r,
BYTE _g,
BYTE _b,
BYTE _a,
const gdiPalette *  palette 
)
static

Here is the call graph for this function:

Here is the caller graph for this function:

static INLINE BOOL WriteColor ( BYTE dst,
UINT32  format,
UINT32  color 
)
static

Here is the call graph for this function:

Here is the caller graph for this function: