Lines Matching refs:width
28 : width(0), height(0), dirty(false), surface(NULL), format(GL_NONE)
244 // Store the pixel rectangle designated by xoffset,yoffset,width,height with pixels stored as format/type at input
246 void Texture::loadImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type,
249 GLsizei inputPitch = ComputePitch(width, format, type, unpackAlignment);
257 loadAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
260 loadLuminanceImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, description->Format == D3DFMT_L8);
263 loadLuminanceAlphaImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output, description->Format == D3DFMT_A8L8);
266 loadRGBUByteImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
269 loadRGBAUByteImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
272 loadBGRAImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
281 loadRGB565ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
290 loadRGBA4444ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
299 loadRGBA5551ImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
309 loadAlphaFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
312 loadLuminanceFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
315 loadLuminanceAlphaFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
318 loadRGBFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
321 loadRGBAFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
331 loadAlphaHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
334 loadLuminanceHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
337 loadLuminanceAlphaHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
340 loadRGBHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
343 loadRGBAHalfFloatImageData(xoffset, yoffset, width, height, inputPitch, input, outputPitch, output);
352 void Texture::loadAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
362 for (int x = 0; x < width; x++)
372 void Texture::loadAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
382 for (int x = 0; x < width; x++)
392 void Texture::loadAlphaHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
402 for (int x = 0; x < width; x++)
412 void Texture::loadLuminanceImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
426 for (int x = 0; x < width; x++)
436 memcpy(dest, source, width);
441 void Texture::loadLuminanceFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
451 for (int x = 0; x < width; x++)
461 void Texture::loadLuminanceHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
471 for (int x = 0; x < width; x++)
481 void Texture::loadLuminanceAlphaImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
495 for (int x = 0; x < width; x++)
505 memcpy(dest, source, width * 2);
510 void Texture::loadLuminanceAlphaFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
520 for (int x = 0; x < width; x++)
530 width, GLsizei height,
540 for (int x = 0; x < width; x++)
550 void Texture::loadRGBUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
560 for (int x = 0; x < width; x++)
570 void Texture::loadRGB565ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
580 for (int x = 0; x < width; x++)
591 void Texture::loadRGBFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
601 for (int x = 0; x < width; x++)
611 void Texture::loadRGBHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
621 for (int x = 0; x < width; x++)
631 void Texture::loadRGBAUByteImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
641 for (int x = 0; x < width; x++)
651 void Texture::loadRGBA4444ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
661 for (int x = 0; x < width; x++)
672 void Texture::loadRGBA5551ImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
682 for (int x = 0; x < width; x++)
693 void Texture::loadRGBAFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
703 memcpy(dest, source, width * 16);
707 void Texture::loadRGBAHalfFloatImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
717 memcpy(dest, source, width * 8);
721 void Texture::loadBGRAImageData(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height,
731 memcpy(dest, source, width*4);
735 void Texture::createSurface(GLsizei width, GLsizei height, GLenum format, GLenum type, Image *img)
740 if (width != 0 && height != 0)
743 GLsizei requestWidth = width;
745 if (IsCompressed(format) && (width % 4 != 0 || height % 4 != 0))
778 img->width = width;
783 void Texture::setImage(GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img)
785 createSurface(width, height, format, type, img);
799 loadImageData(0, 0, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits, &description);
809 void Texture::setCompressedImage(GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img)
811 createSurface(width, height, format, GL_UNSIGNED_BYTE, img);
832 bool Texture::subImage(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels, Image *img)
834 if (width + xoffset > img->width || height + yoffset > img->height)
842 createSurface(img->width, img->height, format, type, img);
857 loadImageData(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, locked.Pitch, locked.pBits, &description);
867 bool Texture::subImageCompressed(GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels, Image *img)
869 if (width + xoffset > img->width || height + yoffset > img->height)
883 createSurface(img->width, img->height, format, GL_UNSIGNED_BYTE, img);
890 updateRegion.right = xoffset + width;
901 GLsizei inputPitch = ComputeCompressedPitch(width, format);
917 void Texture::copyNonRenderable(Image *image, GLenum internalFormat, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, IDirect3DSurface9 *renderTarget)
924 HRESULT result = device->CreateOffscreenPlainSurface(description.Width, description.Height, description.Format, D3DPOOL_SYSTEMMEM, &surface, NULL);
942 RECT sourceRect = {x, y, x + width, y + height};
955 createSurface(width, height, internalFormat, mType, image);
967 RECT destRect = {xoffset, yoffset, xoffset + width, yoffset + height};
992 for(int x = 0; x < width; x++)
1004 for(int x = 0; x < width; x++)
1024 for(int x = 0; x < width; x++)
1044 for(int x = 0; x < width; x++)
1057 for(int x = 0; x < width; x++)
1155 GLint Texture::creationLevels(GLsizei width, GLsizei height, GLint maxlevel) const
1157 if (isPow2(width) && isPow2(height))
1211 // Call this when a particular level of the texture must be defined with a specific format, width and height.
1214 // a new height and width for the texture by working backwards from the given width and height.
1215 bool Texture2D::redefineTexture(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum type)
1217 bool widthOkay = (mWidth >> level == width);
1222 || (heightOkay && mWidth >> level == 0 && width == 1));
1232 internalFormat, width, height);
1254 mWidth = width << level;
1263 void Texture2D::setImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1265 redefineTexture(level, internalFormat, width, height, type);
1267 Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[level]);
1270 void Texture2D::setCompressedImage(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
1272 redefineTexture(level, internalFormat, width, height, GL_UNSIGNED_BYTE);
1274 Texture::setCompressedImage(width, height, internalFormat, imageSize, pixels, &mImageArray[level]);
1277 void Texture2D::commitRect(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
1295 sourceRect.right = xoffset + width;
1312 void Texture2D::subImage(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1314 if (Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, &mImageArray[level]))
1316 commitRect(level, xoffset, yoffset, width, height);
1320 void Texture2D::subImageCompressed(GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
1322 if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[level]))
1324 commitRect(level, xoffset, yoffset, width, height);
1328 void Texture2D::copyImage(GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source)
1338 bool redefined = redefineTexture(level, internalFormat, width, height, mType);
1342 copyNonRenderable(&mImageArray[level], internalFormat, 0, 0, x, y, width, height, renderTarget);
1356 if (width != 0 && height != 0 && level < levelCount())
1360 sourceRect.right = x + width;
1372 mImageArray[level].width = width;
1377 void Texture2D::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source)
1379 if (xoffset + width > mImageArray[level].width || yoffset + height > mImageArray[level].height)
1392 bool redefined = redefineTexture(0, mImageArray[0].format, mImageArray[0].width, mImageArray[0].height, mType);
1396 copyNonRenderable(&mImageArray[level], getFormat(), xoffset, yoffset, x, y, width, height, renderTarget);
1414 sourceRect.right = x + width;
1430 GLsizei width = mImageArray[0].width;
1433 if (width <= 0 || height <= 0)
1465 if ((getWrapS() != GL_CLAMP_TO_EDGE && !isPow2(width))
1473 if (!isPow2(width) || !isPow2(height))
1478 int q = log2(std::max(width, height));
1487 if (mImageArray[level].width != std::max(1, width >> level))
1647 if (!isPow2(mImageArray[0].width) || !isPow2(mImageArray[0].height))
1665 mImageArray[i].width = std::max(mImageArray[0].width >> i, 1);
1698 createSurface(mImageArray[i].width, mImageArray[i].height, mImageArray[i].format, mType, &mImageArray[i]);
1777 void TextureCubeMap::setImagePosX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1779 setImage(0, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1782 void TextureCubeMap::setImageNegX(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1784 setImage(1, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1787 void TextureCubeMap::setImagePosY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1789 setImage(2, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1792 void TextureCubeMap::setImageNegY(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1794 setImage(3, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1797 void TextureCubeMap::setImagePosZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1799 setImage(4, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1802 void TextureCubeMap::setImageNegZ(GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1804 setImage(5, level, internalFormat, width, height, format, type, unpackAlignment, pixels);
1807 void TextureCubeMap::setCompressedImage(GLenum face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei imageSize, const void *pixels)
1809 redefineTexture(level, internalFormat, width);
1811 Texture::setCompressedImage(width, height, internalFormat, imageSize, pixels, &mImageArray[faceIndex(face)][level]);
1814 void TextureCubeMap::commitRect(GLenum faceTarget, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height)
1832 sourceRect.right = xoffset + width;
1849 void TextureCubeMap::subImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
1851 if (Texture::subImage(xoffset, yoffset, width, height, format, type, unpackAlignment, pixels, &mImageArray[faceIndex(target)][level]))
1853 commitRect(target, level, xoffset, yoffset, width, height);
1857 void TextureCubeMap::subImageCompressed(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *pixels)
1859 if (Texture::subImageCompressed(xoffset, yoffset, width, height, format, imageSize, pixels, &mImageArray[faceIndex(target)][level]))
1861 commitRect(target, level, xoffset, yoffset, width, height);
1868 int size = mImageArray[0][0].width;
1894 if (mImageArray[face][0].width != size || mImageArray[face][0].height != size)
1927 if (mImageArray[face][level].width != std::max(1, size >> level))
1932 ASSERT(mImageArray[face][level].height == mImageArray[face][level].width);
2074 void TextureCubeMap::setImage(int face, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint unpackAlignment, const void *pixels)
2076 redefineTexture(level, internalFormat, width);
2078 Texture::setImage(width, height, format, type, unpackAlignment, pixels, &mImageArray[face][level]);
2109 // Call this when a particular level of the texture must be defined with a specific format, width and height.
2113 bool TextureCubeMap::redefineTexture(GLint level, GLenum internalFormat, GLsizei width)
2116 bool sizeOkay = (mImageArray[0][0].width >> level == width);
2123 mImageArray[0][0].format, mImageArray[0][0].width,
2124 internalFormat, width);
2148 mWidth = width << level;
2149 mImageArray[0][0].width = width << level;
2150 mHeight = width << level;
2151 mImageArray[0][0].height = width << level;
2159 void TextureCubeMap::copyImage(GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source)
2170 bool redefined = redefineTexture(level, internalFormat, width);
2174 copyNonRenderable(&mImageArray[faceindex][level], internalFormat, 0, 0, x, y, width, height, renderTarget);
2188 ASSERT(width == height);
2190 if (width > 0 && level < levelCount())
2194 sourceRect.right = x + width;
2205 mImageArray[faceindex][level].width = width;
2241 void TextureCubeMap::copySubImage(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height, RenderbufferStorage *source)
2243 GLsizei size = mImageArray[faceIndex(target)][level].width;
2245 if (xoffset + width > size || yoffset + height > size)
2259 bool redefined = redefineTexture(0, mImageArray[0][0].format, mImageArray[0][0].width);
2263 copyNonRenderable(&mImageArray[faceindex][level], getFormat(), 0, 0, x, y, width, height, renderTarget);
2281 sourceRect.right = x + width;
2295 if (mImageArray[0][0].width == 0)
2302 if (mImageArray[f][0].width != mImageArray[0][0].width
2314 if (!isPow2(mImageArray[0][0].width) || !isCubeComplete())
2320 unsigned int q = log2(mImageArray[0][0].width);
2334 mImageArray[f][i].width = std::max(mImageArray[f][0].width >> i, 1);
2335 mImageArray[f][i].height = mImageArray[f][i].width;
2369 createSurface(mImageArray[f][i].width, mImageArray[f][i].height, mImageArray[f][i].format, mType, &mImageArray[f][i]);