// // Type_Array::getSizeWords // Core::FastU Type_Array::getSizeWords() const { auto wordBytes = Target::GetWordBytes(); if(wordBytes == 1) return getSizeBytes(); return (getSizeBytes() + wordBytes - 1) / wordBytes; }
bool StImagePlane::initZero(StImagePlane::ImgFormat thePixelFormat, const size_t theSizeX, const size_t theSizeY, const size_t theSizeRowBytes, const int theValue) { if(!initTrash(thePixelFormat, theSizeX, theSizeY, theSizeRowBytes)) { return false; } stMemSet(myDataPtr, theValue, getSizeBytes()); return true; }
bool StImagePlane::initTrash(StImagePlane::ImgFormat thePixelFormat, const size_t theSizeX, const size_t theSizeY, const size_t theSizeRowBytes) { nullify(thePixelFormat); if((theSizeX == 0) || (theSizeY == 0)) { return false; } mySizeX = theSizeX; mySizeY = theSizeY; mySizeRowBytes = mySizeX * mySizeBPP; if(theSizeRowBytes > mySizeRowBytes) { // use argument only if it greater mySizeRowBytes = theSizeRowBytes; } myDataPtr = stMemAllocAligned<GLubyte*>(getSizeBytes()); myIsOwnPointer = true; return myDataPtr != NULL; }