clover: Add a pixel_size() method to the image class.

Tested-by: Tom Stellard <thomas.stellard@amd.com>
This commit is contained in:
Francisco Jerez 2013-10-18 16:25:36 -07:00
parent 6230f77232
commit adefa84d66
2 changed files with 7 additions and 0 deletions

View file

@ -22,6 +22,7 @@
#include "core/memory.hpp"
#include "core/resource.hpp"
#include "util/u_format.h"
using namespace clover;
@ -165,6 +166,11 @@ image::depth() const {
return _depth;
}
size_t
image::pixel_size() const {
return util_format_get_blocksize(translate_format(_format));
}
size_t
image::row_pitch() const {
return _row_pitch;

View file

@ -120,6 +120,7 @@ namespace clover {
size_t width() const;
size_t height() const;
size_t depth() const;
size_t pixel_size() const;
size_t row_pitch() const;
size_t slice_pitch() const;