MHEG-5  19.3.0
MHEG-5 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 
64 MHEG5Ingredient* asn1_createLineart(fpa1_syntaxList *listPtr, MHEG5Final clazz, U32BIT size )
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 */
83  MHEG5colourInit(&lineart->originalRefLineColour, OSDgetColour(BLACKCOLOR));
84  MHEG5colourInit(&lineart->originalRefFillColour, OSDgetColour(TRANSPARENTCOLOR));
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.
MHEG5Ingredient * asn1_createLineart(fpa1_syntaxList *listPtr, MHEG5Final clazz, U32BIT size)
Decodes Lineart class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
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.
Typedefs, macros used by all of parser. These may be duplicated elsewhere.
Implement the MHEG5 LineArt Class. Defines functionality associated with vectorial representation of ...
typedefs etc for the whole object creation section.
OSDColor OSDgetColour(const char *colour, int len)
Converts an MHEG5 colour value to an OSDColor type.
Definition: tmcolor.c:53
Contains macros for MHEG-5 ASN.1 tags and structures.
asnErr asn1_decodeVisible(fpa1_syntaxList *listPtr, MHEG5Visible *visible)
Decodes Visible class. Refer to MHEG5 Specification (ISO/IEC 13522-2:1996), Appendix A...
Functions to create a MHEG5Visible from a MHEG5 script (in the form of a list of fpa1_syntaxList stru...
Definition of colour type for MHEG5 - settings and conversions.