Skip to content

Commit

Permalink
core:image: rename flip_vertical(ly) -> vertical_flip
Browse files Browse the repository at this point in the history
  • Loading branch information
DerTee committed Feb 11, 2025
1 parent f239eac commit d40e436
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions core/image/bmp/bmp.odin
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
}

// is flipped XOR user wants to flip
if (int(info.height < 0) ~ int(.flip_vertical in options)) == 1 {
image.flip_vertically(img)
if (int(info.height < 0) ~ int(.vertical_flip in options)) == 1 {
image.vertical_flip(img)
}
return
}
Expand Down
4 changes: 2 additions & 2 deletions core/image/common.odin
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ Option :: enum {
alpha_drop_if_present, // Unimplemented for QOI. Returns error.
alpha_premultiply, // Unimplemented for QOI. Returns error.
blend_background, // Ignored for non-PNG formats
flip_vertical,
vertical_flip, // flip image vertically on load

// Unimplemented
do_not_expand_grayscale,
Expand Down Expand Up @@ -1441,7 +1441,7 @@ expand_grayscale :: proc(img: ^Image, allocator := context.allocator) -> (ok: bo
return true
}

flip_vertically :: proc(img: ^Image) {
vertical_flip :: proc(img: ^Image) {
pixels := img.pixels.buf[:]
bpp := img.depth/8 * img.channels
bytes_per_line := img.width * bpp
Expand Down
4 changes: 2 additions & 2 deletions core/image/netpbm/netpbm.odin
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ load_from_bytes :: proc(data: []byte, options := Options{}, allocator := context
}
img.metadata = info

if .flip_vertical in options {
image.flip_vertically(img)
if .vertical_flip in options {
image.vertical_flip(img)
}
return img, nil
}
Expand Down
4 changes: 2 additions & 2 deletions core/image/png/png.odin
Original file line number Diff line number Diff line change
Expand Up @@ -1182,8 +1182,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
panic("We should never see bit depths other than 8, 16 and 'Paletted' here.")
}

if .flip_vertical in options {
image.flip_vertically(img)
if .vertical_flip in options {
image.vertical_flip(img)
}
return img, nil
}
Expand Down
4 changes: 2 additions & 2 deletions core/image/qoi/qoi.odin
Original file line number Diff line number Diff line change
Expand Up @@ -323,8 +323,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
return img, .Post_Processing_Error
}

if .flip_vertical in options {
image.flip_vertically(img)
if .vertical_flip in options {
image.vertical_flip(img)
}

return
Expand Down
4 changes: 2 additions & 2 deletions core/image/tga/tga.odin
Original file line number Diff line number Diff line change
Expand Up @@ -371,8 +371,8 @@ load_from_context :: proc(ctx: ^$C, options := Options{}, allocator := context.a
}
line += 1 if origin_is_top else -1
}
if .flip_vertical in options {
image.flip_vertically(img)
if .vertical_flip in options {
image.vertical_flip(img)
}
return img, nil
}
Expand Down

0 comments on commit d40e436

Please # to comment.