157 USER_DATA_OBJECT = 41
165 def __lt__(self, other):
166 if self.__class__
is other.__class__:
167 return self.
value < other.value
168 return NotImplemented
170 def __gt__(self, other):
171 if self.__class__
is other.__class__:
172 return self.
value > other.value
173 return NotImplemented
175 def __eq__(self, other):
176 if self.__class__
is other.__class__:
177 return self.
value == other.value
178 return NotImplemented
180 def get_vx_enum_name(type) :
181 if type == Type.NULL :
183 elif type == Type.RAW_IMAGE :
184 return "TIVX_TYPE_" + type.name
186 return "VX_TYPE_" + type.name
188 def get_vx_name(type) :
189 if type == Type.RAW_IMAGE :
190 return "tivx_" + type.name.lower()
192 return "vx_" + type.name.lower()
194 def is_scalar_type(type) :
195 if type > Type.INVALID
and type < Type.REFERENCE :
197 if type == Type.SCALAR :
201 def is_array_type(type) :
202 if type > Type.INVALID
and type < Type.REFERENCE :
204 if type == Type.RECTANGLE :
206 if type == Type.KEYPOINT :
208 if type == Type.COORDINATES2D :
210 if type == Type.COORDINATES3D :
214 def get_obj_desc_name(type):
215 if Type.is_scalar_type(type) :
217 return "tivx_obj_desc_" + type.name.lower() +
"_t" 219 def get_scalar_obj_desc_data_name(type) :
220 if Type.is_scalar_type(type) :
221 if type
is Type.CHAR :
223 if type
is Type.INT8 :
225 if type
is Type.UINT8 :
227 if type
is Type.INT16:
229 if type
is Type.UINT16:
231 if type
is Type.INT32:
233 if type
is Type.UINT32:
235 if type
is Type.INT64:
237 if type
is Type.UINT64:
239 if type
is Type.FLOAT32:
241 if type
is Type.FLOAT64:
243 if type
is Type.ENUM :
245 if type
is Type.SIZE :
247 if type
is Type.DF_IMAGE:
249 if type
is Type.BOOL :
305 def get_vx_enum_name(df_format) :
306 if df_format == DfImage.P12
or df_format == DfImage.NV12_P12
or df_format == DfImage.RGB565
or df_format == DfImage.BGRX :
307 return "TIVX_DF_IMAGE_" + df_format.name
309 return "VX_DF_IMAGE_" + df_format.name
311 def get_vx_name(df_format) :
312 if df_format == DfImage.P12
or df_format == DfImage.NV12_P12
or df_format == DfImage.RGB565
or df_format == DfImage.BGRX :
313 return "tivx_df_image_e" 315 return "vx_df_image_e" 317 def get_df_enum_from_string(full_df_name) :
318 index = full_df_name.find(
"VX_DF_IMAGE_")
320 newstr = full_df_name.replace(
"VX_DF_IMAGE_",
"")
321 if newstr
in DfImage.__members__ :
322 return DfImage[newstr]
324 newstr = full_df_name.replace(
"TIVX_DF_IMAGE_",
"")
325 if newstr
in DfImage.__members__ :
326 return DfImage[newstr]
327 return DfImage.INVALID
329 def get_num_planes(df_format) :
330 if df_format == DfImage.NV12
or df_format == DfImage.NV21
or df_format == DfImage.NV12_P12 :
332 if df_format == DfImage.IYUV
or df_format == DfImage.YUV4 :
369 def get_vx_enum_name(type) :
370 if type == Channel.C0 :
371 return "VX_CHANNEL_0" 372 if type == Channel.C1 :
373 return "VX_CHANNEL_1" 374 if type == Channel.C2 :
375 return "VX_CHANNEL_2" 376 if type == Channel.C3 :
377 return "VX_CHANNEL_3" 378 return "VX_CHANNEL_" + type.name
380 def get_vx_name(type) :
381 return "vx_channel_e" 398 def get_vx_enum_name(type) :
399 if type.name ==
"IPU2" :
400 return "TIVX_CPU_ID_IPU2_0" 402 return "TIVX_CPU_ID_" + type.name
464 def get_vx_enum_name(type) :
465 return "TIVX_TARGET_" + type.name
467 def get_target_folder_name(type) :
468 if target == Target.DSP1 :
470 if target == Target.DSP2 :
472 if target == Target.EVE1 :
474 if target == Target.EVE2 :
476 if target == Target.EVE3 :
478 if target == Target.EVE4 :
480 if target == Target.A15_0 :
482 if target == Target.MCU2_0 :
484 if target == Target.MCU2_1 :
486 if target == Target.IPU2 :
488 if target == Target.VPAC_NF :
490 if target == Target.VPAC_LDC1 :
492 if target == Target.VPAC_LDC2 :
494 if target == Target.VPAC_MSC1 :
496 if target == Target.VPAC_MSC2 :
498 if target == Target.DMPAC_SDE :
500 if target == Target.DMPAC_DOF :
502 if target == Target.VPAC_VISS1 :
504 if target == Target.DSP_C7_1 :
506 if target == Target.MPU_0 :
510 def is_j6_target(target) :
511 if target == Target.DSP1 :
513 if target == Target.DSP2 :
515 if target == Target.EVE1 :
517 if target == Target.EVE2 :
519 if target == Target.EVE3 :
521 if target == Target.EVE4 :
523 if target == Target.A15_0 :
525 if target == Target.MCU2_0 :
527 if target == Target.MCU2_1 :
529 if target == Target.IPU2 :
534 def get_cpu(target) :
535 if target == Target.DSP1 :
537 if target == Target.DSP2 :
539 if target == Target.EVE1 :
541 if target == Target.EVE2 :
543 if target == Target.EVE3 :
545 if target == Target.EVE4 :
547 if target == Target.A15_0 :
549 if target == Target.MCU2_0 :
551 if target == Target.MCU2_1 :
553 if target == Target.IPU2 :
555 if target == Target.VPAC_NF :
557 if target == Target.VPAC_LDC1 :
559 if target == Target.VPAC_LDC2 :
561 if target == Target.VPAC_MSC1 :
563 if target == Target.VPAC_MSC2 :
565 if target == Target.DMPAC_SDE :
567 if target == Target.DMPAC_DOF :
569 if target == Target.VPAC_VISS1 :
571 if target == Target.DSP_C7_1 :
573 if target == Target.MPU_0 :
592 def get_vx_enum_name(type) :
593 return "VX_CONVERT_POLICY_" + type.name
595 def get_vx_name(type) :
596 return "vx_convert_policy_e" 613 def get_vx_enum_name(type) :
614 return "VX_ROUND_POLICY_" + type.name
616 def get_vx_name(type) :
617 return "vx_round_policy_e" 636 def get_vx_enum_name(type) :
637 return "VX_NONLINEAR_FILTER_" + type.name
639 def get_vx_name(type) :
640 return "vx_non_linear_filter_e" 661 def get_vx_enum_name(type) :
662 return "VX_PATTERN_" + type.name
664 def get_vx_name(type) :
665 return "vx_pattern_e" 684 def get_vx_enum_name(type) :
685 return "VX_INTERPOLATION_" + type.name
687 def get_vx_name(type) :
688 return "vx_interpolation_type_e" 705 def get_vx_enum_name(type) :
706 return "vx_" + type.name.lower() +
"_e" 708 def get_vx_name(type) :
726 def get_vx_enum_name(type) :
727 return "VX_NORM_" + type.name
729 def get_vx_name(type) :
749 def get_vx_enum_name(type) :
750 return "VX_" + type.name
752 def get_vx_name(type) :
753 return "vx_direction_e" 755 def get_access_type(type) :
756 if type == Direction.INPUT:
757 return "VX_READ_ONLY" 758 if type == Direction.OUTPUT:
759 return "VX_WRITE_ONLY" 760 if type == Direction.BIDIRECTIONAL:
761 return "VX_READ_WRITE" 764 def get_doxygen_name(type) :
765 if type == Direction.INPUT:
767 if type == Direction.OUTPUT:
769 if type == Direction.BIDIRECTIONAL:
789 def get_vx_enum_name(type) :
790 return "VX_PARAMETER_STATE_" + type.name
792 def get_vx_name(type) :
793 return "vx_parameter_state_e" 810 def get_vx_enum_name(type) :
811 return "VX_SCALE_PYRAMID_" + type.name
828 def get_vx_enum_name(type) :
829 return "VX_THRESHOLD_TYPE_" + type.name
831 def get_vx_name(type) :
832 return "vx_threshold_type_e" 852 def get_vx_enum_name(type) :
853 return "VX_TERM_CRITERIA_" + type.name
855 def get_vx_name(type) :
856 return "vx_termination_criteria_e" Image channel (OpenVX equivalent = vx_channel_e)
Parameter state (OpenVX equivalent = vx_parameter_state_e)
Interpolation type (OpenVX equivalent = vx_interpolation_type_e)
Target on which to execute a node (TIOVX equivalent = TIVX_TARGET_xxxx)
Image data format (OpenVX equivalent = vx_df_image_e)
Termination Criteria (OpenVX equivalent = vx_termination_criteria_e)
Threshold Type (OpenVX equivalent = vx_threshold_type_e)
Boolean type (OpenVX equivalent = vx_bool)
Pyramid Scale (OpenVX equivalent = VX_SCALE_PYRAMID_xxx)
Normalization type (OpenVX equivalent = vx_norm_type_e)
Non linear filter type (OpenVX equivalent = vx_non_linear_filter_e)
Object/Data type (OpenVX equivalent = vx_type_e)
Conversion Policy (OpenVX equivalent = vx_convert_policy_e)
Parameter direction (OpenVX equivalent = vx_direction_e)
Round Policy (OpenVX equivalent = vx_round_policy_e)
Matrix Patterns (OpenVX equivalent = vx_pattern_e)