U8* getMutablePtrDiscard(S64 ofs = 0) { discard(); return getMutablePtr(ofs); }
void setChannels (const Vec2i& pos, const F32* values) { setChannels(getMutablePtr(pos), values, getFormat(), 0, getFormat().getNumChannels()); }
void setChannel (const Vec2i& pos, int idx, F32 value) { setChannels(getMutablePtr(pos), &value, getFormat(), idx, 1); }
void setChannels (const Vec2i& pos, const F32* values, int first, int num) { setChannels(getMutablePtr(pos), values, getFormat(), first, num); }
void set (const Image& src) { blit(getFormat(), getMutablePtr(), getStride(), src.getFormat(), src.getPtr(), src.getStride(), Vec2i(min(getSize().x, src.getSize().x), min(getSize().y, src.getSize().y))); }
void set (const Vec2i& dstPos, const Image& src, const Vec2i& srcPos, const Vec2i& size) { FW_ASSERT(contains(dstPos, size) && src.contains(srcPos, size)); blit(getFormat(), getMutablePtr(dstPos), getStride(), src.getFormat(), src.getPtr(srcPos), src.getStride(), size); }
void write (const ImageFormat& format, const void* ptr, S64 stride) { blit(getFormat(), getMutablePtr(), getStride(), format, (const U8*)ptr, stride, getSize()); }
void write (const ImageFormat& format, const void* ptr, S64 stride, const Vec2i& pos, const Vec2i& size) { FW_ASSERT(contains(pos, size)); blit(getFormat(), getMutablePtr(pos), getStride(), format, (const U8*)ptr, stride, size); }