FreeRDP
color.c File Reference
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <winpr/crt.h>
#include <freerdp/log.h>
#include <freerdp/freerdp.h>
#include <freerdp/primitives.h>

Macros

#define TAG   FREERDP_TAG("color")
 

Functions

BYTEfreerdp_glyph_convert (UINT32 width, UINT32 height, const BYTE *data)
 
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)
 
static INLINE UINT32 freerdp_image_inverted_pointer_color (UINT32 x, UINT32 y, UINT32 format)
 
static void fill_gdi_palette_for_icon (const BYTE *colorTable, UINT16 cbColorTable, gdiPalette *palette)
 
static INLINE UINT32 div_ceil (UINT32 a, UINT32 b)
 
static INLINE UINT32 round_up (UINT32 a, UINT32 b)
 
BOOL freerdp_image_copy_from_icon_data (BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT16 nWidth, UINT16 nHeight, const BYTE *bitsColor, UINT16 cbBitsColor, const BYTE *bitsMask, UINT16 cbBitsMask, const BYTE *colorTable, UINT16 cbColorTable, UINT32 bpp)
 
static BOOL freerdp_image_copy_from_pointer_data_1bpp (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)
 
static BOOL freerdp_image_copy_from_pointer_data_xbpp (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)
 
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)
 
static INLINE BOOL overlapping (const BYTE *pDstData, UINT32 nXDst, UINT32 nYDst, UINT32 nDstStep, UINT32 dstBytesPerPixel, const BYTE *pSrcData, UINT32 nXSrc, UINT32 nYSrc, UINT32 nSrcStep, UINT32 srcBytesPerPixel, UINT32 nWidth, UINT32 nHeight)
 
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)
 
BOOL freerdp_image_fill (BYTE *pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 color)
 
BOOL freerdp_image_scale (BYTE *pDstData, DWORD DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, const BYTE *pSrcData, DWORD SrcFormat, UINT32 nSrcStep, UINT32 nXSrc, UINT32 nYSrc, UINT32 nSrcWidth, UINT32 nSrcHeight)
 

Macro Definition Documentation

◆ TAG

#define TAG   FREERDP_TAG("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.

Function Documentation

◆ div_ceil()

static INLINE UINT32 div_ceil ( UINT32  a,
UINT32  b 
)
static
Here is the caller graph for this function:

◆ fill_gdi_palette_for_icon()

static void fill_gdi_palette_for_icon ( const BYTE colorTable,
UINT16  cbColorTable,
gdiPalette *  palette 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_glyph_convert()

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_image_copy()

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_image_copy_from_icon_data()

BOOL freerdp_image_copy_from_icon_data ( BYTE pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT16  nWidth,
UINT16  nHeight,
const BYTE bitsColor,
UINT16  cbBitsColor,
const BYTE bitsMask,
UINT16  cbBitsMask,
const BYTE colorTable,
UINT16  cbColorTable,
UINT32  bpp 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_image_copy_from_monochrome()

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_image_copy_from_pointer_data()

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_image_copy_from_pointer_data_1bpp()

static BOOL freerdp_image_copy_from_pointer_data_1bpp ( 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 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_image_copy_from_pointer_data_xbpp()

static BOOL freerdp_image_copy_from_pointer_data_xbpp ( 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 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_image_fill()

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:

◆ freerdp_image_inverted_pointer_color()

static INLINE UINT32 freerdp_image_inverted_pointer_color ( UINT32  x,
UINT32  y,
UINT32  format 
)
static

Inverted pointer colors (where individual pixels can change their color to accommodate the background behind them) only seem to be supported on Windows. Using a static replacement color for these pixels (e.g. black) might result in invisible pointers depending on the background. This function returns either black or white, depending on the pixel's position.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_image_scale()

BOOL freerdp_image_scale ( BYTE pDstData,
DWORD  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstWidth,
UINT32  nDstHeight,
const BYTE pSrcData,
DWORD  SrcFormat,
UINT32  nSrcStep,
UINT32  nXSrc,
UINT32  nYSrc,
UINT32  nSrcWidth,
UINT32  nSrcHeight 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ overlapping()

static INLINE BOOL overlapping ( const BYTE pDstData,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstStep,
UINT32  dstBytesPerPixel,
const BYTE pSrcData,
UINT32  nXSrc,
UINT32  nYSrc,
UINT32  nSrcStep,
UINT32  srcBytesPerPixel,
UINT32  nWidth,
UINT32  nHeight 
)
static
Here is the caller graph for this function:

◆ round_up()

static INLINE UINT32 round_up ( UINT32  a,
UINT32  b 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: