Ejemplo n.º 1
0
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]);
}
Ejemplo n.º 2
0
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;
    }
}
Ejemplo n.º 3
0
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);
}
Ejemplo n.º 4
0
Archivo: test.c Proyecto: laMudri/univ
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);
}
Ejemplo n.º 5
0
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;
}
Ejemplo n.º 6
0
	IntrusiveReference<Enumerator<T> > randomShuffle()
	{
		Array<T> data = toArray();
		std::random_shuffle(data.begin(), data.end());
		return fromArray(data);
	}
Ejemplo n.º 7
0
Matrix<rows, cols, T>::Matrix(const T* array)
{
    fromArray(array);
}
Ejemplo n.º 8
0
Matrix<rows, cols, T>::Matrix(const Matrix& rhs)
{
    fromArray(rhs.myMatrix);
}
Ejemplo n.º 9
0
shared_ptr<Image3unorm8> Image3unorm8::fromImage4(const shared_ptr<Image4>& im) {
    return fromArray(im->getCArray(), im->width(), im->height(), static_cast<WrapMode>(im->wrapMode()));
}
Ejemplo n.º 10
0
shared_ptr<Image3unorm8> Image3unorm8::fromImage1unorm8(const shared_ptr<class Image1unorm8>& im) {
    return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode());
}
Ejemplo n.º 11
0
Image1uint8::Ref Image1uint8::fromImage3uint8(const ReferenceCountedPointer<class Image3uint8>& im) {
    return fromArray(im->getCArray(), im->width(), im->height(), im->wrapMode());
}