Exemplo n.º 1
0
void Image_removeAlpha(Image *self)
{
	if (Image_isRGBA8(self))
	{
		UArray_leave_thenRemove_(self->byteArray, 3, 1);
		self->componentCount = 3;
	}
}
Exemplo n.º 2
0
IO_METHOD(IoSeq, leaveThenRemove)
{
	/*doc MutableSequence IoSeq_leaveThenRemove(aNumberToLeave, aNumberToRemove)
	Leaves aNumberToLeave items then removes aNumberToRemove items.  Returns self.
	*/

	size_t itemsToLeave = IoMessage_locals_sizetArgAt_(m, locals, 0);
	size_t itemsToRemove = IoMessage_locals_sizetArgAt_(m, locals, 1);

	IO_ASSERT_NOT_SYMBOL(self);

	IOASSERT(itemsToLeave > 0 || itemsToRemove > 0, "either aNumberToLeave or aNumberToRemove must be > 0");
	
	UArray_leave_thenRemove_(DATA(self), itemsToLeave, itemsToRemove);

	return self;
}