MHEG5  15.3.0
source/decoder/inc/decoder.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
00003  * Copyright © 2008 Ocean Blue Software Ltd
00004  *
00005  * This file is part of a DTVKit Software Component
00006  * You are permitted to copy, modify or distribute this file subject to the terms
00007  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
00008  *
00009  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
00010  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
00011  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
00012  *
00013  * If you or your organisation is not a member of DTVKit then you have access
00014  * to this source code outside of the terms of the licence agreement
00015  * and you are expected to delete this and any associated files immediately.
00016  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
00017  *******************************************************************************/
00025 #ifndef _DECODER_H
00026 #define _DECODER_H
00027 
00028 #include "techtype.h"
00029 
00030 #define HAS_TRANSPARENCY  0x00
00031 #define COMPLETELY_OPAQUE 0x01
00032 
00033 #define PIX_BYTES_PLT    1
00034 #define PIX_BYTES_RGB    3
00035 #define PIX_BYTES_ARGB   4
00036 
00037 #define SD_METRIC_RESOLUTION        2835
00038 #define HD_720_METRIC_RESOLUTION    3543
00039 #define HD_1080_METRIC_RESOLUTION   5315
00040 
00041 /* Structure: 'S_IMAGE'
00042  * Only
00043  * 'width' and 'height' are in pixels of the bitmap.
00044  * 'y_resolution' is in pixels per meter (on y axis). It is expected that bitmap resolution
00045  * could be - 0 or 2835, 3543, 5315. These correspond to bitmaps adapted to screen resolutions:
00046  * 720x576 (in case of 0 or 2835),  1280x720 (in case of 3543) and 1920x1080 (in case of 5315)
00047  *
00048  * 'pix_bytes' is the number of bytes per pixel - 1, 3 or 4.
00049  *    For value of 1 (palette data), the buffer should use the palette given by MHEG5_Open
00050  *    For value of 3 (RGB colour data), 'opaque' should always be set to COMPLETELY_OPAQUE.
00051  *    For value of 4 (ARGB colour data), 'opaque' could be set to COMPLETELY_OPAQUE, if all data is so.
00052  *
00053  * Values for 'opaque' indicate whether entire buffer has opaque colours
00054  * This can helps later with speed of pixel blending
00055  */
00056 typedef struct s_image
00057 {
00058    U16BIT width;
00059    U16BIT height;
00060    U16BIT y_resolution;
00061    U8BIT pix_bytes;
00062    U8BIT opaque;
00063    U8BIT *col_buff;
00064 } S_IMAGE;
00065 
00066 
00067 /*-------------------------------------------------------------------------------*
00068  *       Functions optionally provided by Receiver Platform                      *
00069  *        - when not using PNG/JPG libraries from Ocean Blue                     *
00070  *-------------------------------------------------------------------------------*/
00071 
00079 S_IMAGE* DEC_DecodePng( U8BIT *data, U32BIT size );
00080 
00081 
00087 void DEC_FreePng( S_IMAGE *image );
00088 
00089 
00097 S_IMAGE* DEC_DecodeJpg( U8BIT *data, U32BIT size );
00098 
00099 
00105 void DEC_FreeJpg( S_IMAGE *image );
00106 
00107 
00130 void* DEC_OSDCreateBmpSurf( U32BIT s_width, U32BIT s_height,
00131    U32BIT i_width, U32BIT i_height,
00132    S_IMAGE *image, U32BIT *pitch );
00133 
00134 #endif /* _DECODER_H  */
 All Data Structures Files Functions Variables Typedefs Defines