|
Packit |
1fb8d4 |
/**
|
|
Packit |
1fb8d4 |
* FreeRDP: A Remote Desktop Protocol Implementation
|
|
Packit |
1fb8d4 |
* NSCodec Codec
|
|
Packit |
1fb8d4 |
*
|
|
Packit |
1fb8d4 |
* Copyright 2011 Samsung, Author Jiten Pathy
|
|
Packit |
1fb8d4 |
* Copyright 2012 Vic Lee
|
|
Packit |
1fb8d4 |
* Copyright 2016 Armin Novak <armin.novak@thincast.com>
|
|
Packit |
1fb8d4 |
* Copyright 2016 Thincast Technologies GmbH
|
|
Packit |
1fb8d4 |
*
|
|
Packit |
1fb8d4 |
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
Packit |
1fb8d4 |
* you may not use this file except in compliance with the License.
|
|
Packit |
1fb8d4 |
* You may obtain a copy of the License at
|
|
Packit |
1fb8d4 |
*
|
|
Packit |
1fb8d4 |
* http://www.apache.org/licenses/LICENSE-2.0
|
|
Packit |
1fb8d4 |
*
|
|
Packit |
1fb8d4 |
* Unless required by applicable law or agreed to in writing, software
|
|
Packit |
1fb8d4 |
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
Packit |
1fb8d4 |
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
Packit |
1fb8d4 |
* See the License for the specific language governing permissions and
|
|
Packit |
1fb8d4 |
* limitations under the License.
|
|
Packit |
1fb8d4 |
*/
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#ifndef FREERDP_CODEC_NSCODEC_H
|
|
Packit |
1fb8d4 |
#define FREERDP_CODEC_NSCODEC_H
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#include <freerdp/api.h>
|
|
Packit |
1fb8d4 |
#include <freerdp/types.h>
|
|
Packit |
1fb8d4 |
#include <freerdp/constants.h>
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#include <winpr/stream.h>
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#ifdef __cplusplus
|
|
Packit |
1fb8d4 |
extern "C" {
|
|
Packit |
1fb8d4 |
#endif
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
struct _NSC_MESSAGE
|
|
Packit |
1fb8d4 |
{
|
|
Packit |
1fb8d4 |
UINT32 x;
|
|
Packit |
1fb8d4 |
UINT32 y;
|
|
Packit |
1fb8d4 |
UINT32 width;
|
|
Packit |
1fb8d4 |
UINT32 height;
|
|
Packit |
1fb8d4 |
const BYTE* data;
|
|
Packit |
1fb8d4 |
UINT32 scanline;
|
|
Packit |
1fb8d4 |
BYTE* PlaneBuffer;
|
|
Packit |
1fb8d4 |
UINT32 MaxPlaneSize;
|
|
Packit |
1fb8d4 |
BYTE* PlaneBuffers[5];
|
|
Packit |
1fb8d4 |
UINT32 OrgByteCount[4];
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
UINT32 LumaPlaneByteCount;
|
|
Packit |
1fb8d4 |
UINT32 OrangeChromaPlaneByteCount;
|
|
Packit |
1fb8d4 |
UINT32 GreenChromaPlaneByteCount;
|
|
Packit |
1fb8d4 |
UINT32 AlphaPlaneByteCount;
|
|
Packit |
1fb8d4 |
UINT32 ColorLossLevel;
|
|
Packit |
1fb8d4 |
UINT32 ChromaSubsamplingLevel;
|
|
Packit |
1fb8d4 |
};
|
|
Packit |
1fb8d4 |
typedef struct _NSC_MESSAGE NSC_MESSAGE;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
typedef struct _NSC_CONTEXT_PRIV NSC_CONTEXT_PRIV;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
typedef struct _NSC_CONTEXT NSC_CONTEXT;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
struct _NSC_CONTEXT
|
|
Packit |
1fb8d4 |
{
|
|
Packit |
1fb8d4 |
UINT32 OrgByteCount[4];
|
|
Packit |
1fb8d4 |
UINT32 format;
|
|
Packit |
1fb8d4 |
UINT16 width;
|
|
Packit |
1fb8d4 |
UINT16 height;
|
|
Packit |
1fb8d4 |
BYTE* BitmapData;
|
|
Packit |
1fb8d4 |
UINT32 BitmapDataLength;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
BYTE* Planes;
|
|
Packit |
1fb8d4 |
UINT32 PlaneByteCount[4];
|
|
Packit |
1fb8d4 |
UINT32 ColorLossLevel;
|
|
Packit |
1fb8d4 |
UINT32 ChromaSubsamplingLevel;
|
|
Packit |
1fb8d4 |
BOOL DynamicColorFidelity;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
/* color palette allocated by the application */
|
|
Packit |
1fb8d4 |
const BYTE* palette;
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
BOOL (*decode)(NSC_CONTEXT* context);
|
|
Packit |
1fb8d4 |
BOOL (*encode)(NSC_CONTEXT* context, const BYTE* BitmapData,
|
|
Packit |
1fb8d4 |
UINT32 rowstride);
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
NSC_CONTEXT_PRIV* priv;
|
|
Packit |
1fb8d4 |
};
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
FREERDP_API BOOL nsc_context_set_pixel_format(NSC_CONTEXT* context,
|
|
Packit |
1fb8d4 |
UINT32 pixel_format);
|
|
Packit |
1fb8d4 |
FREERDP_API BOOL nsc_process_message(NSC_CONTEXT* context, UINT16 bpp,
|
|
Packit |
1fb8d4 |
UINT32 width, UINT32 height,
|
|
Packit |
1fb8d4 |
const BYTE* data, UINT32 length,
|
|
Packit |
1fb8d4 |
BYTE* pDstData, UINT32 DstFormat,
|
|
Packit |
1fb8d4 |
UINT32 nDstStride, UINT32 nXDst, UINT32 nYDst,
|
|
Packit |
1fb8d4 |
UINT32 nWidth, UINT32 nHeight, UINT32 flip);
|
|
Packit |
1fb8d4 |
FREERDP_API BOOL nsc_compose_message(NSC_CONTEXT* context, wStream* s,
|
|
Packit |
1fb8d4 |
const BYTE* bmpdata,
|
|
Packit |
1fb8d4 |
UINT32 width, UINT32 height, UINT32 rowstride);
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
FREERDP_API NSC_MESSAGE* nsc_encode_messages(NSC_CONTEXT* context,
|
|
Packit |
1fb8d4 |
const BYTE* data,
|
|
Packit |
1fb8d4 |
UINT32 x, UINT32 y,
|
|
Packit |
1fb8d4 |
UINT32 width, UINT32 height, UINT32 scanline,
|
|
Packit |
1fb8d4 |
UINT32* numMessages, UINT32 maxDataSize);
|
|
Packit |
1fb8d4 |
FREERDP_API BOOL nsc_write_message(NSC_CONTEXT* context, wStream* s,
|
|
Packit |
1fb8d4 |
NSC_MESSAGE* message);
|
|
Packit |
1fb8d4 |
FREERDP_API void nsc_message_free(NSC_CONTEXT* context, NSC_MESSAGE* message);
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
FREERDP_API BOOL nsc_context_reset(NSC_CONTEXT* context, UINT32 width,
|
|
Packit |
1fb8d4 |
UINT32 height);
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
FREERDP_API NSC_CONTEXT* nsc_context_new(void);
|
|
Packit |
1fb8d4 |
FREERDP_API void nsc_context_free(NSC_CONTEXT* context);
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#ifdef __cplusplus
|
|
Packit |
1fb8d4 |
}
|
|
Packit |
1fb8d4 |
#endif
|
|
Packit |
1fb8d4 |
|
|
Packit |
1fb8d4 |
#endif /* FREERDP_CODEC_NSCODEC_H */
|