MCPcopy Create free account
hub / github.com/christophhart/HISE / loadPathFromData

Method loadPathFromData

hi_scripting/scripting/api/ScriptingApiObjects.cpp:6183–6211  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6181}
6182
6183void ApiHelpers::loadPathFromData(Path& p, var data)
6184{
6185
6186 if (data.isString())
6187 {
6188 juce::MemoryBlock mb;
6189 mb.fromBase64Encoding(data.toString());
6190 p.clear();
6191 p.loadPathFromData(mb.getData(), mb.getSize());
6192 }
6193 else if (data.isArray())
6194 {
6195 p.clear();
6196 Array<unsigned char> pathData;
6197 Array<var> *varData = data.getArray();
6198 const int numElements = varData->size();
6199
6200 pathData.ensureStorageAllocated(numElements);
6201
6202 for (int i = 0; i < numElements; i++)
6203 pathData.add(static_cast<unsigned char>((int)varData->getUnchecked(i)));
6204
6205 p.loadPathFromData(pathData.getRawDataPointer(), numElements);
6206 }
6207 else if (auto sp = dynamic_cast<ScriptingObjects::PathObject*>(data.getObject()))
6208 {
6209 p = sp->getPath();
6210 }
6211}
6212
6213juce::PathStrokeType ApiHelpers::createPathStrokeType(var strokeType)
6214{

Callers 15

GlobalHiseLookAndFeelMethod · 0.45
paintCableMethod · 0.45
createSettingsPathMethod · 0.45
drawComboBoxMethod · 0.45
drawListItemMethod · 0.45
createPathMethod · 0.45
createPathMethod · 0.45
createPathMethod · 0.45
TouchOverlayMethod · 0.45

Calls 15

fromBase64EncodingMethod · 0.80
isStringMethod · 0.45
toStringMethod · 0.45
clearMethod · 0.45
getDataMethod · 0.45
getSizeMethod · 0.45
isArrayMethod · 0.45
getArrayMethod · 0.45
sizeMethod · 0.45
addMethod · 0.45
getUncheckedMethod · 0.45

Tested by

no test coverage detected