w_step = (float)(image.
GetWidth()) / (
float)(width);
47 floath_step = (float)(image.
GetHeight()) / (
float)(height);
50<< width <<
"x"<< height);
53 for(
size_t i= 0;
i< height; ++
i) {
54 inti_start = (
int)h_offs;
55 inti_end = (
int)(h_offs + h_step);
58 for(
size_tj = 0; j < width; ++j) {
61 intj_start = (
int)w_offs;
62 intj_end = (
int)(w_offs + w_step);
72vals[0] = vals[1] = vals[2] = vals[3] = 0;
73 for(
intfrom_i = i_start; from_i < i_end; ++from_i) {
74 for(
intfrom_j = j_start; from_j < j_end; ++from_j) {
76image(from_i, from_j);
77 for(
size_tk = 0; k < image.
GetDepth(); ++k) {
78vals[k] += from_pixel[k];
84 for(
size_tk = 0; k < new_image->
GetDepth(); ++k) {
85to[k] = (
unsignedchar)((vals[k] /
count) & 0xff);
97 for(
intfrom_i = i_start; from_i < i_end; ++from_i) {
98 for(
intfrom_j = j_start; from_j < j_end; ++from_j) {
100image(from_i, from_j);
102 size_tlum = ( 6969 * from_pixel[0] +
10323434 * from_pixel[1] +
1042365 * from_pixel[2])/32768;
107 for(
size_tk = 0; k < image.
GetDepth(); ++k) {
108to[k] = from_pixel[k];
123 for(
intfrom_i = i_start; from_i < i_end; ++from_i) {
124 for(
intfrom_j = j_start; from_j < j_end; ++from_j) {
126image(from_i, from_j);
128 size_tlum = ( 6969 * from_pixel[0] +
12923434 * from_pixel[1] +
1302365 * from_pixel[2])/32768;
133 for(
size_tk = 0; k < image.
GetDepth(); ++k) {
134to[k] = from_pixel[k];
161 unsigned char* start_ptr = image.
SetData() + scanline_size *
i;
162 unsigned char* end_ptr = image.
SetData() + scanline_size * (
i+ 1);
167 for( ; end_ptr > start_ptr; end_ptr -=
depth, start_ptr +=
depth) {
169 std::swap(*(start_ptr + 1), *(end_ptr + 1));
170 std::swap(*(start_ptr + 2), *(end_ptr + 2));
175 for( ; end_ptr > start_ptr; end_ptr -=
depth, start_ptr +=
depth) {
177 std::swap(*(start_ptr + 1), *(end_ptr + 1));
178 std::swap(*(start_ptr + 2), *(end_ptr + 2));
179 std::swap(*(start_ptr + 3), *(end_ptr + 3));
197 unsigned char*
buf=
new unsigned char[scanline_size];
199 for( ; end > start; --end, ++start) {
200 unsigned char* start_ptr = image.
SetData() + scanline_size * start;
201 unsigned char* end_ptr = image.
SetData() + scanline_size * end;
204memcpy(
buf, start_ptr, scanline_size);
205memcpy(start_ptr, end_ptr, scanline_size);
206memcpy(end_ptr,
buf, scanline_size);
static void FlipX(CImage &image)
static CImage * Scale(const CImage &image, size_t width, size_t height, EScale scale=eScale_Average)
static void FlipY(CImage &image)
size_t GetDepth(void) const
size_t GetWidth(void) const
const unsigned char * TConstPixel
size_t GetHeight(void) const
unsigned char * SetData(void)
static unsigned char depth[2 *(256+1+29)+1]
void swap(NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair1, NCBI_NS_NCBI::pair_base_member< T1, T2 > &pair2)
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
TObjectType * Release(void)
Release a reference to the object and return a pointer to the object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
unsigned int
A callback function used to compare two keys in a database.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4