Esempio n. 1
0
NakedMemory Dib24To32(int width, int height, NakedMemory& old)
{
    auto orowbytes = round_4(width * 3);
    if (orowbytes * height != old.GetSize())
    {
        LOGERROR("Dib size not correct!");
        return NakedMemory();
    }
    
    auto nrowbytes = width * 4;
    NakedMemory newd(nrowbytes * height);
    auto nrows = (uint8_t*)newd.Get();
    auto orows = (uint8_t*)old.Get();
    for (int i = 0;i < height;i++)
    {
        auto pn = nrows;
        auto po = orows;
        for (int j = 0;j < width;j++)
        {
            pn[0] = po[0];
            pn[1] = po[1];
            pn[2] = po[2];
            pn[4] = 0;
            pn += 4;
            po += 3;
        }
        nrows += nrowbytes;
        orows += orowbytes;
    }
    return std::move(newd);
}
Esempio n. 2
0
NakedMemory Dib32To24(int width, int height, NakedMemory& old, NakedMemory& alpha)
{
    if (width * 4 * height != old.GetSize())
    {
        LOGERROR("Dib size not correct!");
        return NakedMemory();
    }
    
    auto nrowbytes = round_4(width * 3);
    auto arowbytes = round_4(width);
    auto orowbytes = width * 4;
    NakedMemory newd(nrowbytes * height);
    NakedMemory newa(arowbytes * height);
    auto nrows = (uint8_t*)newd.Get();
    auto orows = (uint8_t*)old.Get();
    auto arows = (uint8_t*)newa.Get();
    for (int i = 0;i < height;i++)
    {
        auto pn = nrows;
        auto po = orows;
        auto pa = arows;
        for (int j = 0;j < width;j++)
        {
            pn[0] = po[0];
            pn[1] = po[1];
            pn[2] = po[2];
            *pa++ = po[3];
            pn += 3;
            po += 4;
        }
        nrows += nrowbytes;
        orows += orowbytes;
        arows += arowbytes;
    }
    alpha = std::move(newa);
    return std::move(newd);
}
Esempio n. 3
0
PCommitable AttributesDimension::copy() const
{
	checkNotCheckedOut();
	PAttributesDimension newd(new AttributesDimension(*this));
	return newd;
}
Esempio n. 4
0
PCommitable CubeDimension::copy() const
{
	checkNotCheckedOut();
	PCubeDimension newd(new CubeDimension(*this));
	return newd;
}
Esempio n. 5
0
PCommitable EngineCpuMT::copy() const
{
	checkNotCheckedOut();
	PEngineBase newd(new EngineCpuMT(*this));
	return newd;
}
Esempio n. 6
0
PCommitable NormalDimension::copy() const
{
	checkNotCheckedOut();
	PNormalDimension newd(new NormalDimension(*this));
	return newd;
}
Esempio n. 7
0
PCommitable RightsDimension::copy() const
{
	checkNotCheckedOut();
	PRightsDimension newd(new RightsDimension(*this));
	return newd;
}
Esempio n. 8
0
PCommitable ConfigDatabase::copy() const
{
	checkNotCheckedOut();
	PConfigDatabase newd(new ConfigDatabase(*this));
	return newd;
}
Esempio n. 9
0
PCommitable UserInfoDatabase::copy() const
{
	checkNotCheckedOut();
	PUserInfoDatabase newd(new UserInfoDatabase(*this));
	return newd;
}
Esempio n. 10
0
PCommitable SubsetViewDimension::copy() const
{
	checkNotCheckedOut();
	PSubsetViewDimension newd(new SubsetViewDimension(*this));
	return newd;
}