FreeRDP
planar.c File Reference
#include <winpr/crt.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 *planar, BOOL alpha, UINT32 DstFormat)
 
static INLINE BOOL freerdp_bitmap_planar_compress_plane_rle (const BYTE *plane, UINT32 width, UINT32 height, BYTE *outPlane, UINT32 *dstSize)
 
static INLINE BYTEfreerdp_bitmap_planar_delta_encode_plane (const BYTE *inPlane, UINT32 width, UINT32 height, BYTE *outPlane)
 
static INLINE INT32 planar_skip_plane_rle (const BYTE *pSrcData, UINT32 SrcSize, UINT32 nWidth, UINT32 nHeight)
 
static INLINE INT32 planar_decompress_plane_rle_only (const BYTE *pSrcData, UINT32 SrcSize, BYTE *pDstData, UINT32 nWidth, UINT32 nHeight)
 
static INLINE INT32 planar_decompress_plane_rle (const BYTE *pSrcData, UINT32 SrcSize, BYTE *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 **ppRgba, UINT32 DstFormat, UINT32 width, const BYTE **ppR, const BYTE **ppG, const BYTE **ppB, const BYTE **ppA)
 
static INLINE BOOL planar_decompress_planes_raw (const BYTE *pSrcData[4], BYTE *pDstData, UINT32 DstFormat, UINT32 nDstStep, UINT32 nXDst, UINT32 nYDst, UINT32 nWidth, UINT32 nHeight, BOOL vFlip, UINT32 totalHeight)
 
static BOOL planar_subsample_expand (const BYTE *plane, size_t planeLength, UINT32 nWidth, UINT32 nHeight, UINT32 nPlaneWidth, UINT32 nPlaneHeight, BYTE *deltaPlane)
 
BOOL planar_decompress (BITMAP_PLANAR_CONTEXT *planar, const BYTE *pSrcData, UINT32 SrcSize, UINT32 nSrcWidth, UINT32 nSrcHeight, BYTE *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 *planar, const BYTE *data, UINT32 format, UINT32 width, UINT32 height, UINT32 scanline, BYTE *planes[4])
 
static INLINE UINT32 freerdp_bitmap_planar_write_rle_bytes (const BYTE *pInBuffer, UINT32 cRawBytes, UINT32 nRunLength, BYTE *pOutBuffer, UINT32 outBufferSize)
 
static INLINE UINT32 freerdp_bitmap_planar_encode_rle_bytes (const BYTE *pInBuffer, UINT32 inBufferSize, BYTE *pOutBuffer, UINT32 outBufferSize)
 
static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle (BYTE *inPlanes[4], UINT32 width, UINT32 height, BYTE *outPlanes, UINT32 *dstSizes, BOOL skipAlpha)
 
static INLINE BOOL freerdp_bitmap_planar_delta_encode_planes (BYTE *inPlanes[4], UINT32 width, UINT32 height, BYTE *outPlanes[4])
 
BYTEfreerdp_bitmap_compress_planar (BITMAP_PLANAR_CONTEXT *context, const BYTE *data, UINT32 format, UINT32 width, UINT32 height, UINT32 scanline, BYTE *dstData, UINT32 *pDstSize)
 
BOOL freerdp_bitmap_planar_context_reset (BITMAP_PLANAR_CONTEXT *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 *planar, BOOL bgr)
 
void freerdp_planar_topdown_image (BITMAP_PLANAR_CONTEXT *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 *  context,
const BYTE data,
UINT32  format,
UINT32  width,
UINT32  height,
UINT32  scanline,
BYTE dstData,
UINT32 *  pDstSize 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_compress_plane_rle()

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

◆ freerdp_bitmap_planar_compress_planes_rle()

static INLINE BOOL freerdp_bitmap_planar_compress_planes_rle ( BYTE inPlanes[4],
UINT32  width,
UINT32  height,
BYTE outPlanes,
UINT32 *  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 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 *  context,
UINT32  width,
UINT32  height 
)
Here is the caller graph for this function:

◆ freerdp_bitmap_planar_delta_encode_plane()

BYTE * freerdp_bitmap_planar_delta_encode_plane ( const BYTE inPlane,
UINT32  width,
UINT32  height,
BYTE 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 inPlanes[4],
UINT32  width,
UINT32  height,
BYTE 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 pInBuffer,
UINT32  inBufferSize,
BYTE 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 pInBuffer,
UINT32  cRawBytes,
UINT32  nRunLength,
BYTE pOutBuffer,
UINT32  outBufferSize 
)
static
Here is the caller graph for this function:

◆ freerdp_planar_switch_bgr()

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

◆ freerdp_planar_topdown_image()

void freerdp_planar_topdown_image ( BITMAP_PLANAR_CONTEXT *  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 *  planar,
const BYTE data,
UINT32  format,
UINT32  width,
UINT32  height,
UINT32  scanline,
BYTE 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 *  planar,
const BYTE pSrcData,
UINT32  SrcSize,
UINT32  nSrcWidth,
UINT32  nSrcHeight,
BYTE 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 pSrcData,
UINT32  SrcSize,
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_decompress_plane_rle_only()

static INLINE INT32 planar_decompress_plane_rle_only ( const BYTE pSrcData,
UINT32  SrcSize,
BYTE 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 pSrcData[4],
BYTE 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 *  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 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 plane,
size_t  planeLength,
UINT32  nWidth,
UINT32  nHeight,
UINT32  nPlaneWidth,
UINT32  nPlaneHeight,
BYTE deltaPlane 
)
static
Here is the caller graph for this function:

◆ writeLine()

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