microvg  7.0.0
microvg
LLVG_GRADIENT_impl_stub.c
Go to the documentation of this file.
1 /*
2  * C
3  *
4  * Copyright 2022-2024 MicroEJ Corp. All rights reserved.
5  * Use of this source code is governed by a BSD-style license that can be found with this software.
6  */
7 
19 #include "vg_configuration.h"
20 
21 #if defined(VG_FEATURE_GRADIENT) && defined(VG_FEATURE_GRADIENT_FIRST_COLOR) && \
22  (VG_FEATURE_GRADIENT == VG_FEATURE_GRADIENT_FIRST_COLOR)
23 
24 // -----------------------------------------------------------------------------
25 // Includes
26 // -----------------------------------------------------------------------------
27 
28 #include <LLVG_GRADIENT_impl.h>
29 
30 #include "bsp_util.h"
31 
32 // -----------------------------------------------------------------------------
33 // LLVG_GRADIENT_impl.h functions [optional]: weak functions
34 // -----------------------------------------------------------------------------
35 
36 // See the header file for the function documentation
37 BSP_DECLARE_WEAK_FCNT jint LLVG_GRADIENT_IMPL_initializeGradient(jint *gradient, jint length, const jint *colors,
38  jint count, jfloat *positions, jfloat xStart,
39  jfloat yStart, jfloat xEnd, jfloat yEnd) {
40  (void)count;
41  (void)positions;
42  (void)xStart;
43  (void)yStart;
44  (void)xEnd;
45  (void)yEnd;
46 
47  jint ret;
48 
49  if (length < 1) {
50  // the given array is too small
51  ret = 1; // return the expected minimal size
52  } else {
53  // just store the first color
54  gradient[0] = colors[0];
55  ret = LLVG_SUCCESS;
56  }
57 
58  return ret;
59 }
60 
61 // -----------------------------------------------------------------------------
62 // EOF
63 // -----------------------------------------------------------------------------
64 
65 #endif // VG_FEATURE_GRADIENT
MicroEJ MicroVG library low level API: enable some features according to the hardware capacities.