Beispiel #1
0
void Image1unorm8::copyArray(const Color4* src, int w, int h) {
    resize(w, h);
    int N = w * h;

    Color1unorm8* dst = getCArray();
    for (int i = 0; i < N; ++i) {
        dst[i] = Color1unorm8(Color1(src[i].rgb().average()));
    }
}
Beispiel #2
0
void Image1::copyArray(const Color3* src, int w, int h) {
    resize(w, h);
    int N = w * h;

    Color1* dst = getCArray();
    for (int i = 0; i < N; ++i) {
        dst[i] = Color1(src[i].average());
    }
}
Beispiel #3
0
void Image3::copyArray(const Color1uint8* src, int w, int h) {
    resize(w, h);
    int N = w * h;

    Color3* dst = getCArray();
    for (int i = 0; i < N; ++i) {
        dst[i].r = dst[i].g = dst[i].b = Color1(src[i]).value;
    }
}
Beispiel #4
0
void Image1::copyArray(const Color3uint8* src, int w, int h) {
    resize(w, h);

    int N = w * h;
    Color1* dst = data.getCArray();
    // Convert int8 -> float
    for (int i = 0; i < N; ++i) {
        dst[i] = Color1(Color3(src[i]).average());
    }
}
Beispiel #5
0
void Image4::copyArray(const Color1unorm8* src, int w, int h) {
    resize(w, h);
    int N = w * h;

    Color4* dst = getCArray();
    for (int i = 0; i < N; ++i) {
        dst[i].r = dst[i].g = dst[i].b = Color1(src[i]).value;
        dst[i].a = 1.0f;
    }
}
Beispiel #6
0
void Image1::copyArray(const Color4* src, int w, int h) {
    resize(w, h);

    int N = w * h;
    Color1* dst = data.getCArray();
    
    // Strip alpha
    for (int i = 0; i < N; ++i) {
        dst[i] = Color1(src[i].rgb().average());
    }
}
Beispiel #7
0
void StatsRenderer::DrawText(const RECT &rc, const CString &strText)
{
  D3DXCOLOR Color1( 1.0f, 0.2f, 0.2f, 1.0f );
  D3DXCOLOR Color0( 0.0f, 0.0f, 0.0f, 1.0f );
  RECT Rect1 = rc;
  RECT Rect2 = rc;

  OffsetRect(&Rect2 , 1, 1);
  m_pFont->DrawText( m_pSprite, strText, -1, &Rect2, DT_NOCLIP, Color0);
  m_pFont->DrawText( m_pSprite, strText, -1, &Rect1, DT_NOCLIP, Color1);
}
Beispiel #8
0
Image1::Ref Image1::fromImage1uint8(const ReferenceCountedPointer<Image1uint8>& im) {
    Ref out = createEmpty(static_cast<WrapMode>(im->wrapMode()));
    out->resize(im->width(), im->height());

    int N = im->width() * im->height();
    const Color1uint8* src = reinterpret_cast<Color1uint8*>(im->getCArray());
    for (int i = 0; i < N; ++i) {
        out->data[i] = Color1(src[i]);
    }

    return out;
}
Beispiel #9
0
TPoro::TPoro(int x,int y,double vol,char* col)
{
	this->x=x;
	this->y=y;
	volumen=vol;
	//color=col;
	if(col!=NULL)
	{
		this->color=new char[strlen(col)+1];
		Color1(col);

	}else
	{
		this->color=NULL;
	}
}
Beispiel #10
0
Image1::Image1(int w, int h, WrapMode wrap) : Map2D<Color1, Color1>(w, h, wrap) {
    setAll(Color1(0.0f));
}
Beispiel #11
0
void TPoro::Color(char* col)
{
	Color1(col);
}