Skip to content

Commit

Permalink
linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gbendy committed Jul 15, 2023
1 parent d0f8095 commit dc71ca8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 24 deletions.
11 changes: 6 additions & 5 deletions src/filter/kaleid0sc0pe/ikaleid0sc0pe.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef IKALEID0SC0PE_H
#define IKALEID0SC0PE_H 1
#ifndef SRC_FILTER_KALEID0SC0PE_IKALEID0SC0PE_H_
#define SRC_FILTER_KALEID0SC0PE_IKALEID0SC0PE_H_ 1

#include <cstdint>
#include <memory>
Expand All @@ -44,7 +44,8 @@ class default_delete<libkaleid0sc0pe::IKaleid0sc0pe>
public:
void operator()(libkaleid0sc0pe::IKaleid0sc0pe* p);
};
}

} // namespace std

namespace libkaleid0sc0pe {

Expand Down Expand Up @@ -302,6 +303,6 @@ class IKaleid0sc0pe {

};

}
} // namespace libkaleid0sc0pe

#endif
#endif // SRC_FILTER_KALEID0SC0PE_IKALEID0SC0PE_H_
20 changes: 10 additions & 10 deletions src/filter/kaleid0sc0pe/kaleid0sc0pe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ void default_delete<libkaleid0sc0pe::IKaleid0sc0pe>::operator()(libkaleid0sc0pe:
delete p;
}

}
} // namespace std

namespace libkaleid0sc0pe {

Expand Down Expand Up @@ -360,24 +360,24 @@ Kaleid0sc0pe::Reflect_info Kaleid0sc0pe::calculate_reflect_info(std::uint32_t x,
{
Reflect_info info;

to_screen(info.screen_x, info.screen_y, x, y);
to_screen(&(info.screen_x), &(info.screen_y), x, y);

info.angle = std::atan2(info.screen_y, info.screen_x) - m_start_angle;
info.reference_angle = std::fabs(info.angle) + m_segment_width / 2;
info.segment_number = std::uint32_t(info.reference_angle / m_segment_width);

return info;
}
void Kaleid0sc0pe::to_screen(float& x, float& y, std::uint32_t sx, std::uint32_t sy)
void Kaleid0sc0pe::to_screen(float *x, float *y, std::uint32_t sx, std::uint32_t sy)
{
x = sx - m_origin_native_x;
y = (sy - m_origin_native_y) * m_aspect;
*x = sx - m_origin_native_x;
*y = (sy - m_origin_native_y) * m_aspect;
}

void Kaleid0sc0pe::from_screen(float& x, float& y)
void Kaleid0sc0pe::from_screen(float *x, float *y)
{
x += m_origin_native_x;
y = y / m_aspect + m_origin_native_y;
*x = *x + m_origin_native_x;
*y = *y / m_aspect + m_origin_native_y;
}
#endif

Expand Down Expand Up @@ -497,7 +497,7 @@ void Kaleid0sc0pe::process_block(Block *block)
float source_x = info.screen_x * cos_angle - info.screen_y * sin_angle;
float source_y = info.screen_y * cos_angle + info.screen_x * sin_angle;

from_screen(source_x, source_y);
from_screen(&source_x, &source_y);

if (m_edge_reflect) {
if (source_x < 0) {
Expand Down Expand Up @@ -756,4 +756,4 @@ std::int32_t Kaleid0sc0pe::visualise(void* out_frame)
return 0;
}

}
} // namespace libkaleid0sc0pe
17 changes: 8 additions & 9 deletions src/filter/kaleid0sc0pe/kaleid0sc0pe.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
* Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
*/
#ifndef KALEID0SC0PE_H
#define KALEID0SC0PE_H 1
#ifndef SRC_FILTER_KALEID0SC0PE_KALEID0SC0PE_H_
#define SRC_FILTER_KALEID0SC0PE_KALEID0SC0PE_H_ 1

#include "ikaleid0sc0pe.h"

Expand Down Expand Up @@ -164,16 +164,16 @@ class Kaleid0sc0pe: public IKaleid0sc0pe {
Reflect_info calculate_reflect_info(std::uint32_t x, std::uint32_t y);

/// Converts coordinates to screen space
/// @param x x coordinate
/// @param y y coordinate
/// @param x recieves x coordinate
/// @param y recieves y coordinate
/// @param sx source x coordinate
/// @param sy source y coordinate
void to_screen(float& x, float& y, std::uint32_t sx, std::uint32_t sy);
void to_screen(float *x, float *y, std::uint32_t sx, std::uint32_t sy);

/// Converts coordinates from screen space in place
/// @param x x coordinate
/// @param y y coordinate
void from_screen(float& x, float& y);
void from_screen(float *x, float *y);
#endif
/// A block of data to process
struct Block {
Expand Down Expand Up @@ -274,7 +274,6 @@ class Kaleid0sc0pe: public IKaleid0sc0pe {
#endif
};

}

#endif
} // namespace libkaleid0sc0pe

#endif // SRC_FILTER_KALEID0SC0PE_KALEID0SC0PE_H_

0 comments on commit dc71ca8

Please sign in to comment.