CCV::CCV(Texture* t) { this->m_numColors = t->m_numCCVColors; this->m_numPix = t->m_width * t->m_height; //set the CCVs m_CCV_r = fromArray(t->m_CCV); m_CCV_g = fromArray(&t->m_CCV[m_numColors * 2]); m_CCV_b = fromArray(&t->m_CCV[m_numColors * 2 * 2]); }
Image4uint8::Ref Image4uint8::fromGImage(const GImage& im, WrapMode wrap) { switch (im.channels()) { case 1: return fromArray(im.pixel1(), im.width(), im.height(), wrap); case 3: return fromArray(im.pixel3(), im.width(), im.height(), wrap); case 4: return fromArray(im.pixel4(), im.width(), im.height(), wrap); default: debugAssertM(false, "Input GImage must have 1, 3, or 4 channels."); return NULL; } }
Matrix<rows, cols, T>& Matrix<rows, cols, T>::operator=(const Matrix<rows, cols, T> &rhs) { if (&rhs == this) return(*this); fromArray(rhs.myMatrix); return(*this); }
void main() { int items[] = {4,-2,5,92,-5,-2,8}; tree *heap = heapify(items, sizeof(items) / sizeof(items[0])); printTree(heap); printf("\n"); xorCell *c = fromArray(items, sizeof(items) / sizeof(items[0])); xorCell *d = insert(6, NULL, c); printXorList(d); }
bool TcJSONObject::fromString(QString jsonText) { clear(); std::wstring ws = jsonText.toStdWString(); const wchar_t *ptr = ws.c_str(); ptr = skip(ptr); switch (*ptr) { case L'{': ptr = fromObject("", ptr); break; case L'[': ptr = fromArray(ptr); break; } ptr = skip(ptr); if (!ptr) { clear(); } return ptr != NULL; }
IntrusiveReference<Enumerator<T> > randomShuffle() { Array<T> data = toArray(); std::random_shuffle(data.begin(), data.end()); return fromArray(data); }
Matrix<rows, cols, T>::Matrix(const T* array) { fromArray(array); }
Matrix<rows, cols, T>::Matrix(const Matrix& rhs) { fromArray(rhs.myMatrix); }
shared_ptr<Image3unorm8> Image3unorm8::fromImage4(const shared_ptr<Image4>& im) { return fromArray(im->getCArray(), im->width(), im->height(), static_cast<WrapMode>(im->wrapMode())); }
shared_ptr<Image3unorm8> Image3unorm8::fromImage1unorm8(const shared_ptr<class Image1unorm8>& im) { return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); }
Image1uint8::Ref Image1uint8::fromImage3uint8(const ReferenceCountedPointer<class Image3uint8>& im) { return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode()); }