FreeRDP
planar.c File Reference
#include <freerdp/config.h>
#include <winpr/crt.h>
#include <winpr/wtypes.h>
#include <winpr/assert.h>
#include <winpr/print.h>
#include <freerdp/primitives.h>
#include <freerdp/log.h>
#include <freerdp/codec/bitmap.h>
#include <freerdp/codec/planar.h>

Macros

#define TAG   FREERDP_TAG("codec")
 
#define PLANAR_ALIGN(val, align)    ((val) % (align) == 0) ? (val) : ((val) + (align) - (val) % (align))
 

Functions

static INLINE UINT32 planar_invert_format (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT planar, BOOL alpha, UINT32 DstFormat)
 
static INLINE BOOL freerdp_bitmap_planar_compress_plane_rle (const BYTE *WINPR_RESTRICT plane, UINT32 width, UINT32 height, BYTE *outPlane, UINT32 *WINPR_RESTRICT dstSize)
 
static INLINE BYTEfreerdp_bitmap_planar_delta_encode_plane (const BYTE *WINPR_RESTRICT inPlane, UINT32 width, UINT32 height, BYTE *WINPR_RESTRICT outPlane)
 
static INLINE INT32 planar_skip_plane_rle (const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight)
 
static INLINE INT32 planar_decompress_plane_rle_only (const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, BYTE *WINPR_RESTRICT pDstData, UINT32 nWidth, UINT32 nHeight)
 
static INLINE INT32 planar_decompress_plane_rle (const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, BYTE *WINPR_RESTRICT pDstData, INT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 nChannel, BOOL vFlip)
 
static INLINE INT32 planar_set_plane (BYTE bValue, BYTE *pDstData, INT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, UINT32 nChannel, BOOL vFlip)
 
static INLINE BOOL writeLine (BYTE **WINPR_RESTRICT ppRgba, UINT32 DstFormat, UINT32 width, const BYTE **WINPR_RESTRICT ppR, const BYTE **WINPR_RESTRICT ppG, const BYTE **WINPR_RESTRICT ppB, const BYTE **WINPR_RESTRICT ppA)
 
static INLINE BOOL planar_decompress_planes_raw (const BYTE *WINPR_RESTRICT pSrcData[4], BYTE *WINPR_RESTRICT pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, BOOL vFlip, UINT32 totalHeight)
 
static BOOL planar_subsample_expand (const BYTE *WINPR_RESTRICT plane, size_t planeLength, UINT32 nWidth, UINT32 nHeight, UINT32 nPlaneWidth, UINT32 nPlaneHeight, BYTE *WINPR_RESTRICT deltaPlane)
 
BOOL planar_decompress (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT planar, const BYTE *WINPR_RESTRICT pSrcData, UINT32 SrcSize, UINT32 nSrcWidth, UINT32 nSrcHeight, BYTE *WINPR_RESTRICT pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nDstWidth, UINT32 nDstHeight, BOOL vFlip)
 
static INLINE BOOL freerdp_split_color_planes (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT planar, const BYTE *WINPR_RESTRICT data, UINT32 format, UINT32 width, UINT32 height, UINT32 scanline, BYTE *WINPR_RESTRICT planes[4])
 
static INLINE UINT32 freerdp_bitmap_planar_write_rle_bytes (const BYTE *WINPR_RESTRICT pInBuffer, UINT32 cRawBytes, UINT32 nRunLength, BYTE *WINPR_RESTRICT pOutBuffer, UINT32 outBufferSize)
 
static INLINE UINT32 freerdp_bitmap_planar_encode_rle_bytes (const BYTE *WINPR_RESTRICT pInBuffer, UINT32 inBufferSize, BYTE *WINPR_RESTRICT pOutBuffer, UINT32 outBufferSize)
 
BOOL freerdp_bitmap_planar_compress_plane_rle (const BYTE *WINPR_RESTRICT inPlane, UINT32 width, UINT32 height, BYTE *WINPR_RESTRICT outPlane, UINT32 *WINPR_RESTRICT dstSize)
 
static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle (BYTE *WINPR_RESTRICT inPlanes[4], UINT32 width, UINT32 height, BYTE *WINPR_RESTRICT outPlanes, UINT32 *WINPR_RESTRICT dstSizes, BOOL skipAlpha)
 
static INLINE BOOL freerdp_bitmap_planar_delta_encode_planes (BYTE *WINPR_RESTRICT inPlanes[4], UINT32 width, UINT32 height, BYTE *WINPR_RESTRICT outPlanes[4])
 
BYTEfreerdp_bitmap_compress_planar (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT context, const BYTE *WINPR_RESTRICT data, UINT32 format, UINT32 width, UINT32 height, UINT32 scanline, BYTE *WINPR_RESTRICT dstData, UINT32 *WINPR_RESTRICT pDstSize)
 
BOOL freerdp_bitmap_planar_context_reset (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT context, UINT32 width, UINT32 height)
 
BITMAP_PLANAR_CONTEXT * freerdp_bitmap_planar_context_new (DWORD flags, UINT32 maxWidth, UINT32 maxHeight)
 
void freerdp_bitmap_planar_context_free (BITMAP_PLANAR_CONTEXT *context)
 
void freerdp_planar_switch_bgr (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT planar, BOOL bgr)
 
void freerdp_planar_topdown_image (BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT planar, BOOL topdown)
 

Macro Definition Documentation

◆ PLANAR_ALIGN

#define PLANAR_ALIGN (   val,
  align 
)     ((val) % (align) == 0) ? (val) : ((val) + (align) - (val) % (align))

◆ TAG

#define TAG   FREERDP_TAG("codec")

FreeRDP: A Remote Desktop Protocol Implementation RDP6 Planar Codec

Copyright 2013 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

◆ freerdp_bitmap_compress_planar()

BYTE* freerdp_bitmap_compress_planar ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  context,
const BYTE *WINPR_RESTRICT  data,
UINT32  format,
UINT32  width,
UINT32  height,
UINT32  scanline,
BYTE *WINPR_RESTRICT  dstData,
UINT32 *WINPR_RESTRICT  pDstSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_compress_plane_rle() [1/2]

BOOL freerdp_bitmap_planar_compress_plane_rle ( const BYTE *WINPR_RESTRICT  inPlane,
UINT32  width,
UINT32  height,
BYTE *WINPR_RESTRICT  outPlane,
UINT32 *WINPR_RESTRICT  dstSize 
)
Here is the call graph for this function:

◆ freerdp_bitmap_planar_compress_plane_rle() [2/2]

static INLINE BOOL freerdp_bitmap_planar_compress_plane_rle ( const BYTE *WINPR_RESTRICT  plane,
UINT32  width,
UINT32  height,
BYTE outPlane,
UINT32 *WINPR_RESTRICT  dstSize 
)
static
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_compress_planes_rle()

static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle ( BYTE *WINPR_RESTRICT  inPlanes[4],
UINT32  width,
UINT32  height,
BYTE *WINPR_RESTRICT  outPlanes,
UINT32 *WINPR_RESTRICT  dstSizes,
BOOL  skipAlpha 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_context_free()

void freerdp_bitmap_planar_context_free ( BITMAP_PLANAR_CONTEXT *  context)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_context_new()

BITMAP_PLANAR_CONTEXT* freerdp_bitmap_planar_context_new ( DWORD  flags,
UINT32  maxWidth,
UINT32  maxHeight 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_context_reset()

BOOL freerdp_bitmap_planar_context_reset ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  context,
UINT32  width,
UINT32  height 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_delta_encode_plane()

BYTE * freerdp_bitmap_planar_delta_encode_plane ( const BYTE *WINPR_RESTRICT  inPlane,
UINT32  width,
UINT32  height,
BYTE *WINPR_RESTRICT  outPlane 
)
static
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_delta_encode_planes()

static INLINE BOOL freerdp_bitmap_planar_delta_encode_planes ( BYTE *WINPR_RESTRICT  inPlanes[4],
UINT32  width,
UINT32  height,
BYTE *WINPR_RESTRICT  outPlanes[4] 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_encode_rle_bytes()

static INLINE UINT32 freerdp_bitmap_planar_encode_rle_bytes ( const BYTE *WINPR_RESTRICT  pInBuffer,
UINT32  inBufferSize,
BYTE *WINPR_RESTRICT  pOutBuffer,
UINT32  outBufferSize 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_write_rle_bytes()

static INLINE UINT32 freerdp_bitmap_planar_write_rle_bytes ( const BYTE *WINPR_RESTRICT  pInBuffer,
UINT32  cRawBytes,
UINT32  nRunLength,
BYTE *WINPR_RESTRICT  pOutBuffer,
UINT32  outBufferSize 
)
static
Here is the caller graph for this function:

◆ freerdp_planar_switch_bgr()

void freerdp_planar_switch_bgr ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  planar,
BOOL  bgr 
)
Here is the caller graph for this function:

◆ freerdp_planar_topdown_image()

void freerdp_planar_topdown_image ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  planar,
BOOL  topdown 
)
Here is the caller graph for this function:

◆ freerdp_split_color_planes()

static INLINE BOOL freerdp_split_color_planes ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  planar,
const BYTE *WINPR_RESTRICT  data,
UINT32  format,
UINT32  width,
UINT32  height,
UINT32  scanline,
BYTE *WINPR_RESTRICT  planes[4] 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ planar_decompress()

BOOL planar_decompress ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  planar,
const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
UINT32  nSrcWidth,
UINT32  nSrcHeight,
BYTE *WINPR_RESTRICT  pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nDstWidth,
UINT32  nDstHeight,
BOOL  vFlip 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ planar_decompress_plane_rle()

static INLINE INT32 planar_decompress_plane_rle ( const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
BYTE *WINPR_RESTRICT  pDstData,
INT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
UINT32  nChannel,
BOOL  vFlip 
)
static
Here is the caller graph for this function:

◆ planar_decompress_plane_rle_only()

static INLINE INT32 planar_decompress_plane_rle_only ( const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
BYTE *WINPR_RESTRICT  pDstData,
UINT32  nWidth,
UINT32  nHeight 
)
static
Here is the caller graph for this function:

◆ planar_decompress_planes_raw()

static INLINE BOOL planar_decompress_planes_raw ( const BYTE *WINPR_RESTRICT  pSrcData[4],
BYTE *WINPR_RESTRICT  pDstData,
UINT32  DstFormat,
UINT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
BOOL  vFlip,
UINT32  totalHeight 
)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ planar_invert_format()

static INLINE UINT32 planar_invert_format ( BITMAP_PLANAR_CONTEXT *WINPR_RESTRICT  planar,
BOOL  alpha,
UINT32  DstFormat 
)
static
Here is the caller graph for this function:

◆ planar_set_plane()

static INLINE INT32 planar_set_plane ( BYTE  bValue,
BYTE pDstData,
INT32  nDstStep,
UINT32  nXDst,
UINT32  nYDst,
UINT32  nWidth,
UINT32  nHeight,
UINT32  nChannel,
BOOL  vFlip 
)
static
Here is the caller graph for this function:

◆ planar_skip_plane_rle()

static INLINE INT32 planar_skip_plane_rle ( const BYTE *WINPR_RESTRICT  pSrcData,
UINT32  SrcSize,
UINT32  nWidth,
UINT32  nHeight 
)
static
Here is the caller graph for this function:

◆ planar_subsample_expand()

static BOOL planar_subsample_expand ( const BYTE *WINPR_RESTRICT  plane,
size_t  planeLength,
UINT32  nWidth,
UINT32  nHeight,
UINT32  nPlaneWidth,
UINT32  nPlaneHeight,
BYTE *WINPR_RESTRICT  deltaPlane 
)
static
Here is the caller graph for this function:

◆ writeLine()

static INLINE BOOL writeLine ( BYTE **WINPR_RESTRICT  ppRgba,
UINT32  DstFormat,
UINT32  width,
const BYTE **WINPR_RESTRICT  ppR,
const BYTE **WINPR_RESTRICT  ppG,
const BYTE **WINPR_RESTRICT  ppB,
const BYTE **WINPR_RESTRICT  ppA 
)
static
Here is the call graph for this function:
Here is the caller graph for this function: