Skip to content

Commit

Permalink
put out type definition
Browse files Browse the repository at this point in the history
  • Loading branch information
logica0419 committed Dec 10, 2023
1 parent 2185fc8 commit 8b1431d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions service/imaging/processor_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,13 @@ func (p *defaultProcessor) Fit(src io.ReadSeeker, width, height int) (image.Imag
return orig, nil
}

// GIFのリサイズ時、フレーム合成GoRoutineと拡縮用GoRoutineの間でやり取りするデータ
type frameData struct {
tempCanvas *image.NRGBA
srcBounds image.Rectangle
srcPalette color.Palette
}

func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*bytes.Reader, error) {
srcImage, err := gif.DecodeAll(src)
if err != nil {
Expand Down Expand Up @@ -117,12 +124,6 @@ func (p *defaultProcessor) FitAnimationGIF(src io.Reader, width, height int) (*b
BackgroundIndex: srcImage.BackgroundIndex,
}

// フレーム合成GoRoutineと拡縮用GoRoutineの間でやり取りするデータ
type frameData struct {
tempCanvas *image.NRGBA
srcBounds image.Rectangle
srcPalette color.Palette
}
frameDataChannels := make([]chan frameData, len(srcImage.Image))
for i := range frameDataChannels {
frameDataChannels[i] = make(chan frameData)
Expand Down

0 comments on commit 8b1431d

Please sign in to comment.