commitBufferRW(drect);
}
+void ModifiablePixelBuffer::fillRect(const PixelFormat& pf, const Rect &dest,
+ Pixel pix)
+{
+ fillRect(dest, format.pixelFromPixel(pf, pix));
+}
+
+void ModifiablePixelBuffer::imageRect(const PixelFormat& pf, const Rect &dest,
+ const void* pixels, int stride)
+{
+ rdr::U8* dstBuffer;
+ int dstStride;
+
+ if (stride == 0)
+ stride = dest.width();
+
+ dstBuffer = getBufferRW(dest, &dstStride);
+ format.bufferFromBuffer(dstBuffer, pf, (const rdr::U8*)pixels,
+ dest.width(), dest.height(),
+ dstStride, stride);
+ commitBufferRW(dest);
+}
+
// -=- Simple pixel buffer with a continuous block of memory
FullFramePixelBuffer::FullFramePixelBuffer(const PixelFormat& pf, int w, int h,
// pixel is the Pixel value to be used where mask_ is set
void maskRect(const Rect& r, Pixel pixel, const void* mask_);
+ // Render in a specific format
+ // Does the exact same thing as the above methods, but the given
+ // pixel values are defined by the given PixelFormat.
+ void fillRect(const PixelFormat& pf, const Rect &dest, Pixel pix);
+ void imageRect(const PixelFormat& pf, const Rect &dest,
+ const void* pixels, int stride=0);
+
protected:
ModifiablePixelBuffer();
};