Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/fleximg/core/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
//

#ifdef ARDUINO
#define FLEXIMG_DEBUG_LOG(fmt, ...) \
do { \
printf(fmt "\n", ##__VA_ARGS__); \
fflush(stdout); \
vTaskDelay(1); \
#define FLEXIMG_DEBUG_LOG(fmt, ...) \
do { \
printf(fmt "\n", __VA_ARGS__); \
fflush(stdout); \
vTaskDelay(1); \
} while (0)
#else
#define FLEXIMG_DEBUG_LOG(fmt, ...) \
do { \
printf(fmt "\n", ##__VA_ARGS__); \
fflush(stdout); \
#define FLEXIMG_DEBUG_LOG(fmt, ...) \
do { \
printf(fmt "\n", __VA_ARGS__); \
fflush(stdout); \
} while (0)
#endif

#ifdef FLEXIMG_DEBUG
#define FLEXIMG_DEBUG_WARN(fmt, ...) FLEXIMG_DEBUG_LOG(fmt, ##__VA_ARGS__)
#define FLEXIMG_DEBUG_WARN(fmt, ...) FLEXIMG_DEBUG_LOG(fmt, __VA_ARGS__)
#else
#define FLEXIMG_DEBUG_WARN(fmt, ...) ((void)0)
#endif
Expand Down
8 changes: 4 additions & 4 deletions src/fleximg/image/image_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ class ImageBuffer {
const uint8_t *srcRow = static_cast<const uint8_t *>(view_.data) + (view_.y + y) * view_.stride +
view_.x * view_.bytesPerPixel();
uint8_t *dstRow = static_cast<uint8_t *>(converted.view_.data) + y * converted.view_.stride;
resolved(dstRow, srcRow, view_.width);
resolved(dstRow, srcRow, static_cast<size_t>(view_.width));
}
}
}
Expand Down Expand Up @@ -582,7 +582,7 @@ inline bool ImageBuffer::blendFrom(const ImageBuffer &src)
auto blendFunc = srcFmt->blendUnderStraight;
if (blendFunc) {
// 直接ブレンド(RGBA8_Straight等、blendUnderStraight実装済みフォーマット)
blendFunc(dstPtr, srcPtr, remaining, srcAux);
blendFunc(dstPtr, srcPtr, static_cast<size_t>(remaining), srcAux);
} else {
// フォールバック: チャンク単位でRGBA8_Straightに変換してからブレンド
auto converter = resolveConverter(srcFmt, PixelFormatIDs::RGBA8_Straight, srcAux);
Expand All @@ -600,9 +600,9 @@ inline bool ImageBuffer::blendFrom(const ImageBuffer &src)

do {
int_fast16_t chunk = std::min(remaining, CHUNK_SIZE);
converter(tempBuf, srcChunkPtr, chunk);
converter(tempBuf, srcChunkPtr, static_cast<size_t>(chunk));
void *dstChunkPtr = dstRow + static_cast<size_t>(cursor - dstStartX) * dstPixelBytes;
straightBlend(dstChunkPtr, tempBuf, chunk, nullptr);
straightBlend(dstChunkPtr, tempBuf, static_cast<size_t>(chunk), nullptr);
srcChunkPtr += srcBytesPerChunk;
cursor += chunk;
remaining -= chunk;
Expand Down
2 changes: 1 addition & 1 deletion src/fleximg/image/pixel_format.h
Original file line number Diff line number Diff line change
Expand Up @@ -481,7 +481,7 @@ inline void convertFormat(const void *src, PixelFormatID srcFormat, void *dst, P
(void)dstAux; // 現在の全呼び出し箇所で未使用
auto converter = resolveConverter(srcFormat, dstFormat, srcAux);
if (converter) {
converter(dst, src, pixelCount);
converter(dst, src, static_cast<size_t>(pixelCount));
}
}

Expand Down
6 changes: 3 additions & 3 deletions src/fleximg/image/pixel_format/rgba8_straight.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ handle_dstA_255: {
d += 16;
dstA = d[3];
} while (--plimit);
auto pindex = (d - d_start);
auto pindex = static_cast<size_t>(d - d_start);
if (d != d_start) {
pixelCount -= pindex >> 2;
if (pixelCount <= 0) return;
Expand Down Expand Up @@ -203,7 +203,7 @@ handle_dstA_0: {
dstA = d[3];
s += 16;
} while (--plimit);
auto pindex = (s - s_start);
auto pindex = static_cast<size_t>(s - s_start);
if (pindex) {
pixelCount -= pindex >> 2;
if (pixelCount <= 0) return;
Expand Down Expand Up @@ -239,7 +239,7 @@ handle_srcA_0: {
s += 16;
srcA = s[3];
} while (--plimit);
auto pindex = (s - s_start);
auto pindex = static_cast<size_t>(s - s_start);
if (pindex) {
pixelCount -= pindex >> 2;
if (pixelCount <= 0) return;
Expand Down
2 changes: 1 addition & 1 deletion src/fleximg/image/viewport.h
Original file line number Diff line number Diff line change
Expand Up @@ -473,7 +473,7 @@ void copyRowDDABilinear(void *dst, const ViewPort &src, int_fast16_t count, int_

// フォーマット変換(必要な場合、in-place)
if (converter) {
converter(quadBuffer, quadPtr, chunk * 4);
converter(quadBuffer, quadPtr, static_cast<size_t>(chunk) * 4);
}
uint32_t *quadRGBA = quadBuffer;

Expand Down
2 changes: 1 addition & 1 deletion src/fleximg/nodes/distributor_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DistributorNode : public Node, public AffineCapability {
public:
explicit DistributorNode(int outputCount = 1)
{
initPorts(1, outputCount); // 入力1、出力N
initPorts(1, static_cast<int_fast16_t>(outputCount)); // 入力1、出力N
}

// ========================================
Expand Down
2 changes: 1 addition & 1 deletion src/fleximg/nodes/matte_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ RenderResponse &MatteNode::onPullProcess(const RenderRequest &request)
(bgViewPort.y + srcY) * bgViewPort.stride +
(bgViewPort.x + srcStartX) * srcBytesPerPixel;
uint8_t *dstRow = static_cast<uint8_t *>(outView.data) + y * outView.stride + copyStartX * 4;
converter(dstRow, srcRow, copyWidth);
converter(dstRow, srcRow, static_cast<size_t>(copyWidth));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/fleximg/nodes/sink_node.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ void SinkNode::onPushProcess(RenderResponse &input, const RenderRequest &request
for (int_fast32_t y = 0; y < copyH; ++y) {
const void *srcRow = inputView.pixelAt(srcX, srcY + static_cast<int>(y));
void *dstRow = target_.pixelAt(dstX, dstY + static_cast<int>(y));
converter(dstRow, srcRow, static_cast<int>(copyW));
converter(dstRow, srcRow, static_cast<size_t>(copyW));
}
}
}
Expand Down
Loading