MHEG5  18.9.0
MHEG5 Documentation
asn1_createBitmap.c
Go to the documentation of this file.
1 /*******************************************************************************
2  * Copyright © 2014 The DTVKit Open Software Foundation Ltd (www.dtvkit.org)
3  * Copyright © 2004 Ocean Blue Software Ltd
4  * Copyright © 2000 Koninklijke Philips Electronics N.V
5  *
6  * This file is part of a DTVKit Software Component
7  * You are permitted to copy, modify or distribute this file subject to the terms
8  * of the DTVKit 1.0 Licence which can be found in licence.txt or at www.dtvkit.org
9  *
10  * THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
11  * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES
12  * OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
13  *
14  * If you or your organisation is not a member of DTVKit then you have access
15  * to this source code outside of the terms of the licence agreement
16  * and you are expected to delete this and any associated files immediately.
17  * Further information on DTVKit, membership and terms can be found at www.dtvkit.org
18  *******************************************************************************/
27 /*---includes for this file--------------------------------------------------*/
28 #include <stdio.h>
29 #include "vpa1_sys.h"
30 #include "vpa1_tgs.h"
31 #include "fpa1_syn.h"
32 #include "asn1_sys.h"
33 
34 
35 #include "glue_debug.h"
36 #include "mh5base.h"
37 #include "mh5bitmap.h"
38 #include "asn1_createExtras.h"
39 #include "asn1_createVisible.h"
40 #include "asn1_createBitmap.h"
41 
42 /*---constant definitions for this file--------------------------------------*/
43 
44 
45 /*---local typedef structs for this file-------------------------------------*/
46 
47 /*---local (static) variable declarations for this file----------------------*/
48 TRACER(int asn_bitmap_count = 0; )
49 
50 /*---local function definitions----------------------------------------------*/
51 
52 /*---global function definitions---------------------------------------------*/
53 
62 {
63  MHEG5Bitmap *bitmap;
64  fpa1_syntaxList *currItem;
65 
66  DPL5((">> asn1_decodeBitmap(%X)\n", listPtr));
67  assert( listPtr );
68  TRACER(asn_bitmap_count++);
69 
70  bitmap = (MHEG5Bitmap *)MHEG5getMem( sizeof(MHEG5Bitmap));
71  if (bitmap != NULL)
72  {
73  memset(bitmap, 0, sizeof(MHEG5Bitmap));
75 
76  /* Defaults */
77  /*
78  bitmap->tiling = MHEG5FALSE;
79  bitmap->originalTransparency = 0;
80  */
81 
82  /* searches current set of tags for local tags */
83  currItem = listPtr->children;
84  while (currItem != NULL)
85  {
86  /* most objects will have more than one local tag */
87  switch (currItem->tag)
88  {
89  case TILING:
90  if (currItem->data.boolData != 0)
91  {
92  bitmap->tiling = MHEG5TRUE;
93  }
94  break;
95  case OTRANS:
96  bitmap->originalTransparency = currItem->data.intData;
97  break;
98 
99  default:
100  break;
101  }
102  currItem = currItem->next;
103  }
104  /* decode inherited tags */
105  if (asn1_decodeVisible(listPtr, &bitmap->visible) != ASN_NO_ERROR)
106  {
107  #if (DPLEVEL >= 2)
108  DPL2(("WARNING:[ASN.1] asn1_decodeBitmap() Fails\n"));
109  #endif /* DPLEVEL >= 2 */
110  MHEG5freeMem( bitmap );
111  bitmap = NULL;
112  }
113  }
114  else
115  {
116  TRACE(TERROR, ("Alloc asn1_decodeBitmap() Fails\n"))
117  }
118 
119  DPL5(("<< asn1_decodeBitmap() %X\n", bitmap));
120 
121  return (MHEG5Ingredient *)bitmap;
122 }
123 
MHEG5Int originalTransparency
Definition: mh5bitmap.h:60
Basis MHEG5 data types.
Functions to create a MHEG5Bitmap from a MHEG5 script (in the form of a list of fpa1_syntaxList struc...
Miscellaneous functions for decoding ASN.1 types.
Debug tracing.
Contains functions/structure used to do MHEG-5 ASN.1 syntax parsing.
#define MHEG5getMem
Definition: glue_memory.h:93
MHEG5Final clazz
Definition: mh5root.h:55
Typedefs, macros used by all of parser. These may be duplicated elsewhere.
struct fpa1_syntaxItem * children
Definition: fpa1_syn.h:53
#define ASN_NO_ERROR
Definition: asn1_sys.h:36
MHEG5Bool tiling
Definition: mh5bitmap.h:59
syntaxItemData data
Definition: fpa1_syn.h:57
#define DPL5(x)
Definition: glue_debug.h:167
typedefs etc for the whole object creation section.
Contains macros for MHEG-5 ASN.1 tags and structures.
#define MHEG5freeMem
Definition: glue_memory.h:94
#define OTRANS
Definition: vpa1_tgs.h:129
MHEG5Bool boolData
Definition: fpa1_syn.h:44
#define DPL2(x)
Definition: glue_debug.h:185
asnErr asn1_decodeVisible(fpa1_syntaxList *listPtr, MHEG5Visible *visible)
Decodes Visible class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
Module Description: Implement the MHEG5 Bitmap Class. 32 Bitmap Class Defines the behaviour of a two-...
#define MHEG5TRUE
Definition: mh5base.h:49
#define TRACER(x)
Definition: glue_debug.h:123
#define TILING
Definition: vpa1_tgs.h:128
Functions to create a MHEG5Visible from a MHEG5 script (in the form of a list of fpa1_syntaxList stru...
MHEG5Ingredient ingredient
Definition: mh5visible.h:49
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52
MHEG5Int intData
Definition: fpa1_syn.h:45
MHEG5Visible visible
Definition: mh5bitmap.h:45
MHEG5Ingredient * asn1_createBitmap(fpa1_syntaxList *listPtr)
Decodes Bitmap class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
#define TRACE(t, x)
Definition: glue_debug.h:118