示例#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()));
    }
}
示例#2
0
文件: Image1.cpp 项目: Cryptoh/server
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());
    }
}
示例#3
0
文件: Image3.cpp 项目: Cryptoh/server
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;
    }
}
示例#4
0
文件: Image1.cpp 项目: Cryptoh/server
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());
    }
}
示例#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;
    }
}
示例#6
0
文件: Image1.cpp 项目: Cryptoh/server
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());
    }
}
示例#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);
}
示例#8
0
文件: Image1.cpp 项目: Cryptoh/server
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;
}
示例#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;
	}
}
示例#10
0
文件: Image1.cpp 项目: Cryptoh/server
Image1::Image1(int w, int h, WrapMode wrap) : Map2D<Color1, Color1>(w, h, wrap) {
    setAll(Color1(0.0f));
}
示例#11
0
void TPoro::Color(char* col)
{
	Color1(col);
}