Example #1
0
   //
   // Type_Array::getSizeWords
   //
   Core::FastU Type_Array::getSizeWords() const
   {
      auto wordBytes = Target::GetWordBytes();

      if(wordBytes == 1)
         return getSizeBytes();

      return (getSizeBytes() + wordBytes - 1) / wordBytes;
   }
Example #2
0
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;
}
Example #3
0
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;
}