Loading...
Searching...
No Matches
image_framing.h
Go to the documentation of this file.
77 static Channels difference(Channels first, Channels second) { return _mm_sub_ps(first, second); }
105 const auto packed = static_cast<std::uint32_t>(_mm_cvtsi128_si32(_mm_packus_epi16(words, words)));
126 static Channels difference(Channels first, Channels second) { return vsubq_f32(first, second); }
173 static Channels load(const float* values) { return {values[0], values[1], values[2], values[3]}; }
320 width_ != width || height_ != height || inset_ != inset || rotationBound_ != rotationBoundDegrees) {
Produce a bounded crop/resample view over a source BGRA image.
Definition image_framing.h:62
static Channels load(const float *values)
Load four floating-point channel values in BGRA order.
Definition image_framing.h:173
static Channels sum(Channels first, Channels second)
Accumulate channel values without mixing color and alpha.
Definition image_framing.h:150
View apply(const unsigned char *bgra, int sourceWidth, int sourceHeight, int stride, int width, int height, int inset=0, double rotationDegrees=0, double rotationBoundDegrees=0)
Frame BGRA pixels into a crop, resampled image, or rotated image.
Definition image_framing.h:277
static Channels product(Channels first, Channels second)
Multiply each channel by its corresponding weight.
Definition image_framing.h:166
static void writeRow(unsigned char *destination, int width, SamplePixel &&sample)
Write one sampled row to the byte raster.
Definition image_framing.h:195
std::vector< unsigned char > buffer_
Definition image_framing.h:70
static Channels splat(float value)
Broadcast a scalar to all four portable BGRA lanes.
Definition image_framing.h:145
static Channels difference(Channels first, Channels second)
Form independent channel deltas for interpolation.
Definition image_framing.h:158
static Channels channels(const unsigned char *pixel)
Widen a packed BGRA pixel for floating-point interpolation.
Definition image_framing.h:184
static void samples(std::vector< Sample > &result, int count, int sourceSize, double offset, double scale)
Precompute bilinear indices and fractions along one output axis.
Definition image_framing.h:212
std::vector< float > horizontal_[2]
Definition image_framing.h:71
static Crop crop(int sourceWidth, int sourceHeight, int width, int height, int inset=0, double rotationBoundDegrees=0)
Fit an output aspect ratio inside source bounds and rotation margin.
Definition image_framing.h:239
static void store(float *target, Channels values)
Store channels in the order expected by byte conversion.
Definition image_framing.h:177
static bool bounds(const struct coverage_state *state, const struct coverage_candidate *candidate, struct coverage_bounds *box)
Reject unusable polygons before converting coordinates or scanning cells.
Definition coverage_scheduler.c:120
Definition camera_optics.h:32
void validateJpegSize(int width, int height)
Validate encoded-image dimensions before allocating pixel buffers.
Definition image_framing.h:49
Source-space crop and uniform scale needed for an output frame.
Definition image_framing.h:225