MHEG5  18.9.0
MHEG5 Documentation
asn1_createLineart.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 #include "mh5base.h"
35 #include "mh5lineart.h"
36 #include "asn1_createExtras.h"
37 #include "asn1_createVisible.h"
38 #include "asn1_createLineart.h"
39 #include "tmcolor.h"
40 
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 
49 /*---local function definitions----------------------------------------------*/
50 
51 /*---global function definitions---------------------------------------------*/
52 
65 {
66  MHEG5Lineart *lineart;
67  asnErr errVal = 0;
68  fpa1_syntaxList *currItem;
69 
70  DPL5((">> asn1_decodeLineart(%X)\n", listPtr));
71 
72  assert( listPtr );
73 
74  lineart = (MHEG5Lineart *)MHEG5getMem( size );
75  if (lineart)
76  {
77  /* defaults */
78  memset(lineart, 0, size);
79  lineart->visible.ingredient.root.clazz = clazz;
80  lineart->borderedBoundingBox = MHEG5TRUE;
81  lineart->originalLineWidth = 1;
82  lineart->originalLineStyle = 1; /* solid */
85 
86  /* searches current set of tags for local tags */
87  currItem = listPtr->children;
88  while (currItem != NULL)
89  {
90  /* most objects will have more than one local tag */
91  switch (currItem->tag)
92  {
93  case BBBOX:
94  lineart->borderedBoundingBox = (currItem->data.boolData == 0) ? MHEG5FALSE : MHEG5TRUE;
95  break;
96  case OLWIDTH:
97  lineart->originalLineWidth = currItem->data.intData;
98  break;
99  case OLSTYLE:
100  lineart->originalLineStyle = currItem->data.intData;
101  break;
102  case ORLCOLOUR:
103  errVal |= asn1_decodeColour(currItem, &lineart->originalRefLineColour);
104  break;
105  case ORFCOLOUR:
106  errVal |= asn1_decodeColour(currItem, &lineart->originalRefFillColour);
107  break;
108  default:
109  break;
110  }
111  currItem = currItem->next;
112  }
113  /* decode inherited tags */
114  errVal |= asn1_decodeVisible(listPtr, &lineart->visible);
115  if (errVal != ASN_NO_ERROR)
116  {
117  #if (DPLEVEL >= 2)
118  DPL2(("WARNING:[ASN.1] asn1_decodeLineart() Fails\n"));
119  #endif /* DPLEVEL >= 2 */
120  MHEG5freeMem( lineart );
121  lineart = NULL;
122  }
123  }
124 
125  DPL5(("<< asn1_decodeLineart() %X\n", lineart));
126  return (MHEG5Ingredient *)lineart;
127 }
128 
asnErr asn1_decodeColour(fpa1_syntaxList *listPtr, MHEG5Colour *colour)
Decodes Colour class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
Basis MHEG5 data types.
#define TRANSPARENTCOLOR
Definition: tmcolor.h:37
#define MHEG5colourInit
Definition: mh5base.h:61
MHEG5Ingredient * asn1_createLineart(fpa1_syntaxList *listPtr, MHEG5Final clazz, U32BIT size)
Decodes Lineart class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
MHEG5Int originalLineStyle
Definition: mh5lineart.h:56
MHEG5Int originalLineWidth
Definition: mh5lineart.h:55
Miscellaneous functions for decoding ASN.1 types.
Functions to create a MHEG5Lineart from a MHEG5 script (in the form of a list of fpa1_syntaxList stru...
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
Implement the MHEG5 LineArt Class. Defines functionality associated with vectorial representation of ...
#define ASN_NO_ERROR
Definition: asn1_sys.h:36
syntaxItemData data
Definition: fpa1_syn.h:57
MHEG5Final
Definition: mh5base.h:190
#define DPL5(x)
Definition: glue_debug.h:167
typedefs etc for the whole object creation section.
#define BBBOX
Definition: vpa1_tgs.h:130
OSDColor OSDgetColour(const char *colour, int len)
Converts an MHEG5 colour value to an OSDColor type.
Definition: tmcolor.c:53
#define ORLCOLOUR
Definition: vpa1_tgs.h:133
Contains macros for MHEG-5 ASN.1 tags and structures.
#define BLACKCOLOR
Definition: tmcolor.h:38
#define MHEG5freeMem
Definition: glue_memory.h:94
MHEG5Bool boolData
Definition: fpa1_syn.h:44
MHEG5Bool borderedBoundingBox
Definition: mh5lineart.h:54
MHEG5Colour originalRefLineColour
Definition: mh5lineart.h:57
#define OLSTYLE
Definition: vpa1_tgs.h:132
#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...
#define MHEG5TRUE
Definition: mh5base.h:49
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
int asnErr
Definition: asn1_sys.h:41
MHEG5Colour originalRefFillColour
Definition: mh5lineart.h:58
MHEG5Visible visible
Definition: mh5lineart.h:51
Definition of colour type for MHEG5 - settings and conversions.
struct fpa1_syntaxItem * next
Definition: fpa1_syn.h:52
#define ORFCOLOUR
Definition: vpa1_tgs.h:134
#define OLWIDTH
Definition: vpa1_tgs.h:131
MHEG5Int intData
Definition: fpa1_syn.h:45
#define MHEG5FALSE
Definition: mh5base.h:48
uint32_t U32BIT
Definition: techtype.h:86