add inline annotations to some methods where i probably forgot before
these don't really affect performance in any meaningful way, according to the benchmarks i just added. lol
This commit is contained in:
parent
a0ec2f4826
commit
3b159a61b8
|
@ -40,6 +40,7 @@ impl IndexedBitmap {
|
||||||
|
|
||||||
/// Draws a line from x1,y1 to x2,y2 by blending the drawn pixels using the given blend map,
|
/// Draws a line from x1,y1 to x2,y2 by blending the drawn pixels using the given blend map,
|
||||||
/// or the color specified if the blend map does not include this color.
|
/// or the color specified if the blend map does not include this color.
|
||||||
|
#[inline]
|
||||||
pub fn blended_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
pub fn blended_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
||||||
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
||||||
self.line_custom(
|
self.line_custom(
|
||||||
|
@ -56,6 +57,7 @@ impl IndexedBitmap {
|
||||||
|
|
||||||
/// Draws a horizontal line from x1,y to x2,y by blending the drawn pixels using the given
|
/// Draws a horizontal line from x1,y to x2,y by blending the drawn pixels using the given
|
||||||
/// blend map, or the color specified if the blend map does not include this color.
|
/// blend map, or the color specified if the blend map does not include this color.
|
||||||
|
#[inline]
|
||||||
pub fn blended_horiz_line(&mut self, x1: i32, x2: i32, y: i32, color: u8, blend_map: &BlendMap) {
|
pub fn blended_horiz_line(&mut self, x1: i32, x2: i32, y: i32, color: u8, blend_map: &BlendMap) {
|
||||||
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
||||||
self.horiz_line_custom(
|
self.horiz_line_custom(
|
||||||
|
@ -71,6 +73,7 @@ impl IndexedBitmap {
|
||||||
|
|
||||||
/// Draws a vertical line from x,y1 to x,y2 by blending the drawn pixels using the given blend
|
/// Draws a vertical line from x,y1 to x,y2 by blending the drawn pixels using the given blend
|
||||||
/// map, or the color specified if the blend map does not include this color.
|
/// map, or the color specified if the blend map does not include this color.
|
||||||
|
#[inline]
|
||||||
pub fn blended_vert_line(&mut self, x: i32, y1: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
pub fn blended_vert_line(&mut self, x: i32, y1: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
||||||
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
||||||
self.vert_line_custom(
|
self.vert_line_custom(
|
||||||
|
@ -88,6 +91,7 @@ impl IndexedBitmap {
|
||||||
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively.
|
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively.
|
||||||
/// The box is drawn by blending the drawn pixels using the given blend map, or the color
|
/// The box is drawn by blending the drawn pixels using the given blend map, or the color
|
||||||
/// specified if the blend map does not include this color.
|
/// specified if the blend map does not include this color.
|
||||||
|
#[inline]
|
||||||
pub fn blended_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
pub fn blended_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
||||||
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
||||||
self.rect_custom(
|
self.rect_custom(
|
||||||
|
@ -106,6 +110,7 @@ impl IndexedBitmap {
|
||||||
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively. The
|
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively. The
|
||||||
/// filled box is draw by blending the drawn pixels using the given blend map, or the color
|
/// filled box is draw by blending the drawn pixels using the given blend map, or the color
|
||||||
/// specified if the blend map does not include this color.
|
/// specified if the blend map does not include this color.
|
||||||
|
#[inline]
|
||||||
pub fn blended_filled_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
pub fn blended_filled_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u8, blend_map: &BlendMap) {
|
||||||
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
if let Some(blend_mapping) = blend_map.get_mapping(color) {
|
||||||
self.filled_rect_custom(
|
self.filled_rect_custom(
|
||||||
|
|
|
@ -25,6 +25,7 @@ impl RgbaBitmap {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Draws a line from x1,y1 to x2,y2 by blending the drawn pixels using the given blend function.
|
/// Draws a line from x1,y1 to x2,y2 by blending the drawn pixels using the given blend function.
|
||||||
|
#[inline]
|
||||||
pub fn blended_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
|
pub fn blended_line(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
|
||||||
self.line_custom(
|
self.line_custom(
|
||||||
x1, //
|
x1, //
|
||||||
|
@ -37,6 +38,7 @@ impl RgbaBitmap {
|
||||||
|
|
||||||
/// Draws a horizontal line from x1,y to x2,y by blending the drawn pixels using the given
|
/// Draws a horizontal line from x1,y to x2,y by blending the drawn pixels using the given
|
||||||
/// blend function.
|
/// blend function.
|
||||||
|
#[inline]
|
||||||
pub fn blended_horiz_line(&mut self, x1: i32, x2: i32, y: i32, color: u32, blend: BlendFunction) {
|
pub fn blended_horiz_line(&mut self, x1: i32, x2: i32, y: i32, color: u32, blend: BlendFunction) {
|
||||||
self.horiz_line_custom(
|
self.horiz_line_custom(
|
||||||
x1, //
|
x1, //
|
||||||
|
@ -48,6 +50,7 @@ impl RgbaBitmap {
|
||||||
|
|
||||||
/// Draws a vertical line from x,y1 to x,y2 by blending the drawn pixels using the given blend
|
/// Draws a vertical line from x,y1 to x,y2 by blending the drawn pixels using the given blend
|
||||||
/// function.
|
/// function.
|
||||||
|
#[inline]
|
||||||
pub fn blended_vert_line(&mut self, x: i32, y1: i32, y2: i32, color: u32, blend: BlendFunction) {
|
pub fn blended_vert_line(&mut self, x: i32, y1: i32, y2: i32, color: u32, blend: BlendFunction) {
|
||||||
self.vert_line_custom(
|
self.vert_line_custom(
|
||||||
x, //
|
x, //
|
||||||
|
@ -60,6 +63,7 @@ impl RgbaBitmap {
|
||||||
/// Draws an empty box (rectangle) using the points x1,y1 and x2,y2 to form the box to be
|
/// Draws an empty box (rectangle) using the points x1,y1 and x2,y2 to form the box to be
|
||||||
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively.
|
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively.
|
||||||
/// The box is drawn by blending the drawn pixels using the given blend function.
|
/// The box is drawn by blending the drawn pixels using the given blend function.
|
||||||
|
#[inline]
|
||||||
pub fn blended_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
|
pub fn blended_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
|
||||||
self.rect_custom(
|
self.rect_custom(
|
||||||
x1, //
|
x1, //
|
||||||
|
@ -73,6 +77,7 @@ impl RgbaBitmap {
|
||||||
/// Draws a filled box (rectangle) using the points x1,y1 and x2,y2 to form the box to be
|
/// Draws a filled box (rectangle) using the points x1,y1 and x2,y2 to form the box to be
|
||||||
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively. The
|
/// drawn, assuming they are specifying the top-left and bottom-right corners respectively. The
|
||||||
/// filled box is draw by blending the drawn pixels using the given blend function.
|
/// filled box is draw by blending the drawn pixels using the given blend function.
|
||||||
|
#[inline]
|
||||||
pub fn blended_filled_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
|
pub fn blended_filled_rect(&mut self, x1: i32, y1: i32, x2: i32, y2: i32, color: u32, blend: BlendFunction) {
|
||||||
self.filled_rect_custom(
|
self.filled_rect_custom(
|
||||||
x1, //
|
x1, //
|
||||||
|
|
Loading…
Reference in a new issue