![]() |
Maria GDK 5.0.0.738
Documentation of native code in develop branch
|
Typedefs | |
typedef unsigned int | RGBA |
template<typename From , typename To > | |
using | enable_if_safe_cast_t = typename enable_if_safe_cast< From, To >::type |
typedef AngularFilterClass< float > | AngularFilterf |
typedef AngularFilterClass< double > | AngularFilter |
using | CatmullRomf = CatmullRom< float > |
using | CatmullRomd = CatmullRom< double > |
typedef FilterClass< float > | Filterf |
typedef FilterClass< double > | Filter |
typedef LinearFilterClass< float > | LinearFilterf |
typedef LinearFilterClass< double > | LinearFilter |
using | Matrix4x4d = Matrix4x4< double > |
using | Matrix4x4f = Matrix4x4< float > |
typedef OrientedBoundingBox2< float > | OrientedBoundingBox2f |
typedef OrientedBoundingBox2< double > | OrientedBoundingBox2d |
typedef PidControlClass< float > | PidControlf |
typedef PidControlClass< double > | PidControl |
typedef Polygon< Vector2f > | Polygon2f |
typedef Polygon< Vector2d > | Polygon2d |
typedef Polygon< Vector3f > | Polygon3f |
typedef Polygon< Vector3d > | Polygon3d |
typedef std::vector< Vector3d > | PointVector |
typedef std::shared_ptr< std::vector< Vector3d > > | SharedPointVector |
using | Quaterniond = Quaternion< double > |
using | Quaternionf = Quaternion< float > |
typedef Transform2< float > | Transform2f |
typedef Transform2< double > | Transform2d |
using | Vector2d = Vector2< double > |
using | Vector2f = Vector2< float > |
using | Vector3f = Vector3< float > |
using | Vector3d = Vector3< double > |
using | Vector4f = Vector4< float > |
using | Vector4d = Vector4< double > |
Enumerations | |
enum | LogLevel { LOG_DEBUG = 0 , LOG_INFO , LOG_WARNING , LOG_ERROR , LOG_FATAL } |
enum class | ResampMethod { NEAREST = 0 , BOX_NEAREST , FILTER , LINEAR , QUADRATIC , CUBIC , LANCZOS , MITCHELL , MAX_COUNT } |
enum class | FontStyle { Regular , Bold , Italic , BoldItalic } |
enum | RenderMask { OpaqueMask = 0x0001 , TransparentMask = 0x0002 } |
enum class | StencilMode { NONE , WRITE_STENCIL , WRITE_STENCIL_COLOR , TEST_EQ , TEST_NEQ } |
enum class | TextHAlignment { Left , Center , Right } |
enum class | TextVAlignment { Bottom , Center , Top } |
Functions | |
bool | getBinaryDir (std::string &dir) |
bool | getInstallationDir (std::string &dir) |
bool | getApplicationDataDir (std::string &dir) |
bool | getUserDataDir (std::string &dir) |
void | initApplication () |
void | initApplication (const std::vector< std::string > &args) |
void | initApplication (const std::vector< std::string > &args, STK::CommandLineParser &parser) |
LogStream | logDebug (const std::string &module="") |
LogStream | logInfo (const std::string &module="") |
LogStream | logWarning (const std::string &module="") |
LogStream | logError (const std::string &module="") |
LogStream & | endl (LogStream &ls) |
RGBA | toRGBA (int r, int g, int b, int a=255) |
RGBA | fromARGB (RGBA val) |
RGBA | floatToRGBA (float r, float g, float b, float a=1.0) |
RGBA | toARGB (int r, int g, int b, int a=255) |
RGBA | floatToARGB (float r, float g, float b, float a=1.0) |
RGBA | multiplyAlpha (RGBA rgba, float a) |
void | RGBAToFloat (RGBA rgba, float &r, float &g, float &b, float &a) |
char | toLower (const char c) |
char | toUpper (const char c) |
void | splitString (const std::string &str, char delim, std::vector< std::string > &strlist) |
std::string | joinString (const std::vector< std::string > &strList, const std::string &delim) |
void | toLowerCaseInline (std::string &str) |
void | toUpperCaseInline (std::string &str) |
std::string | toLowerCase (const std::string &str) |
std::string | toUpperCase (const std::string &str) |
bool | strEndsWith (const std::string &str, const std::string &suffix, bool caseSensitive=false) |
bool | strBeginsWith (const std::string &str, const std::string &prefix, bool caseSensitive=false) |
std::string | replaceAll (const std::string &str, const std::string &from, const std::string &to) |
std::wstring | s2ws (const std::string &str) |
std::string | ws2s (const std::wstring &wstr) |
std::u32string | utf8ToUtf32 (std::string const &utf8) |
void | unreachable () |
std::FILE * | fopen (std::string_view filename, std::string_view mode) |
std::string | createUUID () |
bool | compressDXTC (const Image &src, Image &dst, Image::Format fmt) |
bool | decompressDXTC (const Image &src, Image &dst, Image::Format=Image::RGBA_32) |
bool | decompressDXT1 (const Image &src, Image &dst, Image::Format=Image::RGBA_32) |
bool | decompressDXT3 (const Image &src, Image &dst, Image::Format=Image::RGBA_32) |
bool | decompressDXT5 (const Image &src, Image &dst, Image::Format=Image::RGBA_32) |
void | calcNormalVector (const STK::Image &img, int x, int y, double dx, double dy, double &nx, double &ny, double &nz) |
int | singles2halfp (void *target, void *source, int numel) |
int | doubles2halfp (void *target, void *source, int numel) |
int | halfp2singles (void *target, void *source, int numel) |
int | halfp2doubles (void *target, void *source, int numel) |
int | ilog2 (int n) |
Calculate the base two logarithm of an integer. | |
int | nearestPow2 (int val) |
Calculate the nearest power of 2 of the given integer. | |
bool | convHull2D (const std::vector< STK::Vector3d > &pts, std::vector< STK::Vector3d > &out_pts) |
Calculate the 2D convex hull of a point set. | |
template<class Type > | |
bool | distanceLinePoint (const STK::Vector3< Type > &p1, const STK::Vector3< Type > &p2, const STK::Vector3< Type > &p, Type &d) |
template<class T > | |
STK::Vector2< T > | centroid (const std::vector< STK::Vector2< T > > &pts) |
double | normalizeAngleDegrees (double angle) |
Normalize the given angle to the interval 0 - 360. | |
template<class T > | |
T | getMinXValue (const std::vector< STK::Vector2< T > > &pts) |
template<class T > | |
double | getMaxXValue (const std::vector< STK::Vector2< T > > &pts) |
template<class T > | |
double | getMinYValue (const std::vector< STK::Vector2< T > > &pts) |
template<class T > | |
double | getMaxYValue (const std::vector< STK::Vector2< T > > &pts) |
template<class Type > | |
bool | rayTriangleIntersection (const STK::Vector3< Type > &rayOrigin, const STK::Vector3< Type > &rayVector, const STK::Vector3< Type > &vertex0, const STK::Vector3< Type > &vertex1, const STK::Vector3< Type > &vertex2, STK::Vector3< Type > &outIntersectionPoint) |
template<class Type > | |
bool | raySphereIntersection (const STK::Vector3< Type > &rayOrigin, const STK::Vector3< Type > &rayVector, const STK::Vector3< Type > &sphCenter, Type sphRadius, Type &t) |
template<class Type > | |
bool | rayPlaneIntersection (const STK::Vector3< Type > &planePoint, const STK::Vector3< Type > &planeNormal, const STK::Vector3< Type > &linePoint, const STK::Vector3< Type > &lineDirection, STK::Vector3< Type > &intersection) |
template<class Type > | |
Type | closestDistanceBetweenLines (const STK::Vector3< Type > &L1P0, const STK::Vector3< Type > &L1Dir, const STK::Vector3< Type > &L2P0, const STK::Vector3< Type > &L2Dir, STK::Vector3< Type > &L1P, STK::Vector3< Type > &L2P) |
template<class Type > | |
bool | convHull2D (const std::vector< STK::Vector3< Type > > &pts, std::vector< STK::Vector3< Type > > &hull) |
template<typename Type > | |
std::optional< STK::Vector2< Type > > | segmentIntersection (const STK::Vector2< Type > &S1Start, const STK::Vector2< Type > &S1End, const STK::Vector2< Type > &S2Start, const STK::Vector2< Type > &S2End) |
Find the intersection point between two segments in 2d. Algorithm from: https://stackoverflow.com/a/565282. | |
double | calcEccentricAnomalyFromAngle (const double angle, const double a, const double b, const double tolerance=0.000001) |
std::vector< STK::SharedPointVector > | polyClip (STK::SharedPointVector poly, double xMin, double yMin, double xMax, double yMax, double eps) |
std::vector< STK::SharedPointVector > | calcPolyGridIntersection (const std::vector< STK::Vector3d > &poly, double xMin, double yMin, double xMax, double yMax, int rows, int cols, bool clip=false, bool closed=false) |
istream & | operator>> (istream &input, Tab1 &tab) |
ostream & | operator<< (ostream &output, Tab1 &tab) |
std::istream & | operator>> (std::istream &input, Tab2 &tab) |
std::ostream & | operator<< (std::ostream &output, Tab2 &tab) |
istream & | operator>> (istream &input, Tab3 &tab) |
btVector3 | toBtVector (const STK::Vector3< btScalar > &v) |
STK::Vector3< btScalar > | fromBtVector (const btVector3 &v) |
btMatrix3x3 | toBtMatrix (const Matrix4x4f &m) |
void | deleteCollisionShape (btCollisionShape *shape) |
btTransform | interpolateTransform (const btTransform &t0, const btTransform &t1, btScalar s) |
bool | checkGLError (const char *prefix=nullptr) |
bool | checkFBOStatus () |
void | dumpGLState () |
bool | isMipmapFilter (GLenum filter) |
void | convertToIndexedTriangles (const std::vector< unsigned int > &idx, GLenum mode, int group, std::vector< IndexTriangle > &idx_triangles) |
std::shared_ptr< STK::PolylineRender2D > | clipPolylineRender2D (const STK::PolylineRender2D &pl, const std::vector< STK::Vector2f > &clip_poly, int precision=5) |
bool | sortByDepthAndBatch (const std::shared_ptr< RenderItem2D > &i1, const std::shared_ptr< RenderItem2D > &i2) |
STK::Matrix4x4f | createPickMatrix (const STK::Viewport &vp, float x, float y, float hitW, float hitH) |
Create a projection matrix for hit testing around the given (x,y) point in screen coordinates. | |
STK::Vector3f | unproject (const STK::Vector3f &in, const STK::Matrix4x4f &modelView, const STK::Matrix4x4f &projection, const STK::Vector4f &viewport) |
void | buildSphere (float radius, int slices, int stacks, STK::VertexBuffer *vtx_buffer, std::vector< GLushort > &idx) |
void | buildCylinderSector (float radius, float height, float sector_angle, int slices, bool reverse, STK::VertexBuffer *vtx_buffer, std::vector< GLushort > &top_idx, std::vector< GLushort > &bot_idx, std::vector< GLushort > &mid_idx) |
void | buildCylinder (float radius, float height, int slices, bool reverse, STK::VertexBuffer *vtx_buffer, std::vector< GLushort > &top_idx, std::vector< GLushort > &bot_idx, std::vector< GLushort > &mid_idx) |
std::vector< STK::Vector2f > | generateRoundedRectangle (const STK::Vector2f &bl, const STK::Vector2f &br, const STK::Vector2f &tr, const STK::Vector2f &tl, float corner_radius_x, float corner_radius_y, int num_corner_pts=10) |
Variables | |
std::string | bin_dir = "" |
Binary directory, where the .exe or entry .dll/.so file is placed. | |
std::string | root_dir = "" |
Root installation directory. Data and binary directories should be subdirectories of this. | |
std::string | app_data_dir = "" |
Installation wide data directory. | |
std::string | user_data_dir = "" |
Per-user data directory. | |
bool | is_initialized = false |
Check if application has been initialized. | |
ILogger * | defaultLog = nullptr |
template<typename From , typename To > | |
constexpr bool | safe_type_cast_v = safe_type_cast<From, To>::value |
constexpr double | rad_to_deg = 180.0/M_PI |
Conversion factor from radians to degrees. | |
constexpr float | rad_to_deg_f = static_cast<float>(180.0f / M_PI) |
constexpr double | deg_to_rad = M_PI/180.0 |
Conversion factor from degrees to radians. | |
constexpr float | deg_to_rad_f = static_cast<float>(M_PI / 180.0f) |
constexpr double | pi = M_PI |
constexpr double | twopi = 2*M_PI |
constexpr double | halfpi = 0.5*M_PI |
constexpr float | pi_f = static_cast<float>(M_PI) |
constexpr float | twopi_f = 2.0f * pi_f |
constexpr float | halfpi_f = 0.5f * pi_f |
file M3DBoundingVolume.h
brief
file stkFileInfo.h
brief
file stkProgressHandler.h
brief
The angular filter wraps around at 2PI, is otherwise a normal first order lowpass filter. It's well suited to filter yaw angles, for example.
Simple digital first-order low-pass filter.
The filter clamps the maximum rate of change.
file stkUniformPoissonDiscSampler.h
brief
file M3DB3DMParser.h
brief
file stkMarkerObject.h
brief
file stkMeshUtils.h
brief
file stkScreen.h
brief
file stkStkVertexBuffer2D.h
brief
file stkVertexBufferManager.h
brief
|
strong |
ScaleImage - Image scaling algorithms. This image transform class is used to scale an image up or down by a an arbitrary factor in each direction. You can select from a range of different algorithms with various tradeoffs between image quality and execution speed.
We will now give a brief overview of the scaling algorithms, all the linear and higher-order filters (from Triangle and onwards) are applied in a similar manner in which the filter is first applied on the rows and then on the columns of the transformed rows. All these filters are symmetrical, i.e the
Most of these filters are based on code by Dale Schumacher from the book Graphics Gems III.
This is the simplest (and fastest) algorithm, but unfortunately also the one that gives poorest results, especially for downscaling. It simply uses the nearest pixel value in the input image as pixel value in the output image.
This is also a simple an quite fast method, which also gives relatively good results, albeit with some blurring. The output pixel value is simply taken as an unweighted average of the input pixel values.
This method uses a linear interpolation of the input values
This method uses quadratic interpolation of the input value.
This filter uses a cubic B-spline function:
This method uses a trigonometric filter:
This filter is the most complex of them. Suffice it to say that it gives very good results, and take a lot of time. See source code for details.
|
inline |
Build an indexed geometry cylinder. This method will build a cylinder with three index arrays, top and bottom which are GL_TRIANGLE_FAN, and middle which is GL_TRIANGLE_STRIP.
void STK::buildCylinderSector | ( | float | radius, |
float | height, | ||
float | sector_angle, | ||
int | slices, | ||
bool | reverse, | ||
STK::VertexBuffer * | vtx_buffer, | ||
std::vector< GLushort > & | top_idx, | ||
std::vector< GLushort > & | bot_idx, | ||
std::vector< GLushort > & | mid_idx | ||
) |
Build an indexed geometry cylinder sector. This method will build a cylinder with three index arrays, top and bottom which are GL_TRIANGLE_FAN, and middle which is GL_TRIANGLE_STRIP. The sector angle is how many degrees of the sector we should cover.
void STK::buildSphere | ( | float | radius, |
int | slices, | ||
int | stacks, | ||
STK::VertexBuffer * | vtx_buffer, | ||
std::vector< GLushort > & | idx | ||
) |
Build an indexed geometry sphere mesh. This method builds a sphere mesh as one continous triangle strip.
void STK::calcNormalVector | ( | const STK::Image & | img, |
int | x, | ||
int | y, | ||
double | dx, | ||
double | dy, | ||
double & | nx, | ||
double & | ny, | ||
double & | nz | ||
) |
Calculate normal vector for image pixel This method will calculate the normal vector for an image at pixel (x, y). The pixel size is (dx, dy).
STK::Vector2< T > STK::centroid | ( | const std::vector< STK::Vector2< T > > & | pts | ) |
Calculate centroid (average position) of the point list.
|
inline |
GLUtils - Short description. Detailed description.
Type STK::closestDistanceBetweenLines | ( | const STK::Vector3< Type > & | L1P0, |
const STK::Vector3< Type > & | L1Dir, | ||
const STK::Vector3< Type > & | L2P0, | ||
const STK::Vector3< Type > & | L2Dir, | ||
STK::Vector3< Type > & | L1P, | ||
STK::Vector3< Type > & | L2P | ||
) |
Calculate closest points on two lines. This method will calculate the two points that are closest to each other on the two lines defined by L1P0 along L1Dir vector and L2P0 along L2Dir vector. The output points are L1P on the L1 line and L2P on the L2 line. The distance between these points (shortest distance between the lines) is returned in the return value.
Algorithm from http://geomalgorithms.com/a07-_distance.html
void STK::convertToIndexedTriangles | ( | const std::vector< unsigned int > & | idx, |
GLenum | mode, | ||
int | group, | ||
std::vector< IndexTriangle > & | idx_triangles | ||
) |
Convert the input index array to indexed triangles. The input data can be either GL_TRIANGLES, GL_TRIANGLE_STRIP or GL_TRIANGLE_FAN The group parameter can be used to organize triangles according to some ID.
|
inline |
Create a projection matrix for hit testing around the given (x,y) point in screen coordinates.
SceneUtils - Utility functions related to scene graph and scene rendering
bool STK::distanceLinePoint | ( | const STK::Vector3< Type > & | p1, |
const STK::Vector3< Type > & | p2, | ||
const STK::Vector3< Type > & | p, | ||
Type & | d | ||
) |
Calculate shortest distance between the point p and the line segment from p1 to p2. The function returns true if the projected point falls between the end points of the segment, false otherwise.
void STK::initApplication | ( | ) |
Initialize application This method parses the command line and sets any recognized options
|
inline |
Calculate intersection between a ray and a plane. The plane is defined by a point and a normal vector, the ray by a point and a direction vector. Both direction and normal vectors must be normalized.
|
inline |
Calculate intersection between a ray and a sphere, if any. Returns true if an intersection was found, false if not. The t parameter indicates where on the ray the intersection was found. The actual point can then be calculated as
intersectionPoint = rayOrigin + t*rayVector
Note that the ray is considered directional and you can only get intersections on one side of the origin point (along the direction vector).
|
inline |
Calculate intersection between a ray and a triangle, if any. Returns true if an intersection was found, false if not. The intersection point is returned in the outIntersectionPoint argument.
Note that the ray is considered infinite and you can get intersections on both sides of the origin point.
std::optional< STK::Vector2< Type > > STK::segmentIntersection | ( | const STK::Vector2< Type > & | S1Start, |
const STK::Vector2< Type > & | S1End, | ||
const STK::Vector2< Type > & | S2Start, | ||
const STK::Vector2< Type > & | S2End | ||
) |
Find the intersection point between two segments in 2d. Algorithm from: https://stackoverflow.com/a/565282.
In the case of collinear points, we return the point closest to the S1Start point.
Type | The precision level |
S1Start | The start point for the first segment |
S1End | the endpoint for the first segment |
S2Start | The start point for the second segment |
S2End | The endpoint for the second segement |